Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
石磊
/
cihai
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9f9c81bf
authored
Jan 16, 2018
by
侯昆
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
图片识别整合
1 parent
a7a252c4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
119 additions
and
25 deletions
serverside/cihai-pc/pom.xml
serverside/cihai-pc/src/main/webapp/WEB-INF/jsp/home/index.jsp
serverside/cihai-pc/src/main/webapp/WEB-INF/jsp/include/header_search.jsp
serverside/cihai-pc/pom.xml
View file @
9f9c81b
...
@@ -43,21 +43,6 @@
...
@@ -43,21 +43,6 @@
<!--表现层-->
<!--表现层-->
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
jstl
</artifactId>
<scope>
${jetty.scope}
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jetty
</artifactId>
<artifactId>
spring-boot-starter-jetty
</artifactId>
<scope>
${jetty.scope}
</scope>
<scope>
${jetty.scope}
</scope>
</dependency>
</dependency>
...
@@ -66,6 +51,11 @@
...
@@ -66,6 +51,11 @@
<artifactId>
apache-jsp
</artifactId>
<artifactId>
apache-jsp
</artifactId>
<scope>
${jetty.scope}
</scope>
<scope>
${jetty.scope}
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
jstl
</artifactId>
<scope>
${jetty.scope}
</scope>
</dependency>
<!--表现层-->
<!--表现层-->
<!--工具-->
<!--工具-->
...
...
serverside/cihai-pc/src/main/webapp/WEB-INF/jsp/home/index.jsp
View file @
9f9c81b
<%@ page import="org.apache.commons.lang3.StringUtils" %>
<%@ page import="org.apache.commons.lang3.time.DateFormatUtils" %>
<%@ page import="org.apache.commons.lang3.time.DateFormatUtils" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.util.Date" %>
<%@ page import="org.apache.commons.lang3.StringUtils" %>
<%@ page import="java.util.stream.Collectors" %>
<%@ page import="java.util.stream.Collectors" %>
<jsp:useBean id="oneDayCharacter" scope="request" type="com.dookay.cihai.core.word.dto.OneCharacterDTO"/>
<jsp:useBean id="oneDayCharacter" scope="request" type="com.dookay.cihai.core.word.dto.OneCharacterDTO"/>
<jsp:useBean id="recommendStatement" scope="request" type="com.dookay.cihai.core.word.dto.RecommendStatementDTO"/>
<jsp:useBean id="recommendStatement" scope="request" type="com.dookay.cihai.core.word.dto.RecommendStatementDTO"/>
...
@@ -58,8 +58,11 @@
...
@@ -58,8 +58,11 @@
<div class="search-main-input-inner clearfix">
<div class="search-main-input-inner clearfix">
<div class="form-group input-group-lg">
<div class="form-group input-group-lg">
<input class="form-control j_search_content" name="keyword" type="text">
<input class="form-control j_search_content" name="keyword" type="text">
<%--<button class="btn navbar-search-camera j_image_serch" type="button">--%>
<button class="btn navbar-search-camera" type="button">
<%--<div class="icon icon-camera"></div>--%>
<div class="icon icon-camera">
<input name="image" type="file" class="j_search_image" style="opacity: 0" accept=".png, .jpg, .jpeg">
</div>
<%--</button>--%>
<%--</button>--%>
<%--<button class="btn navbar-search-microphone" type="button">--%>
<%--<button class="btn navbar-search-microphone" type="button">--%>
<%--<div class="icon icon-microphone"></div>--%>
<%--<div class="icon icon-microphone"></div>--%>
...
@@ -163,15 +166,65 @@
...
@@ -163,15 +166,65 @@
<jsp:include page="/WEB-INF/jsp/include/footer.jsp"/>
<jsp:include page="/WEB-INF/jsp/include/footer.jsp"/>
<script>
<script>
$(function () {
$(function () {
$('.j_search_form').ajaxSubmitForm({
$('.j_search_form').ajaxSubmitForm({
before: function () {
var index = layer.load(2, 10000);
},
success: function ($form, data) {
success: function ($form, data) {
if
(data.code ==="OK")
{
if
(data.code === "OK")
{
location.href = '/word/' + data.data.wordId;
location.href = '/word/' + data.data.wordId;
}
}
else{
else
{
$.tip(data.message);
$.tip(data.message);
}
}
layer.close(index);
},
},
});
$('.j_search_image').change(function () {
var $this = $(this);
var $form = $this.closest('form');
if ($this.val() == null) {
return;
}
var index = layer.load(2, 10000);
$.ajax({
url: '/image/search',
type: 'POST',
data: new FormData($form[0]),
cache: false,
contentType: false,
processData: false,
xhr: function () {
var myXhr = $.ajaxSettings.xhr();
if (myXhr.upload) {
// For handling the progress of the upload
myXhr.upload.addEventListener('progress', function (e) {
if (e.lengthComputable) {
$('progress').attr({
value: e.loaded,
max: e.total,
});
});
}
}, false);
}
return myXhr;
},
success: function (data) {
if (data.code === "OK") {
location.href = '/word/' + data.data.wordId;
}
else {
$.tip(data.message);
}
layer.close(index);
},
error: function () {
layer.close(index);
},
});
});
})
})
</script>
</script>
serverside/cihai-pc/src/main/webapp/WEB-INF/jsp/include/header_search.jsp
View file @
9f9c81b
...
@@ -21,15 +21,64 @@
...
@@ -21,15 +21,64 @@
<script>
<script>
$
(
function
()
{
$
(
function
()
{
backEndApp
.
init
();
backEndApp
.
init
();
$
(
'.j_search_form'
).
ajaxSubmitForm
({
$
(
'.j_search_form'
).
ajaxSubmitForm
({
before
:
function
()
{
var
index
=
layer
.
load
(
2
,
10000
);
},
success
:
function
(
$form
,
data
)
{
success
:
function
(
$form
,
data
)
{
if
(
data
.
code
===
"OK"
){
if
(
data
.
code
===
"OK"
)
{
location
.
href
=
'/word/'
+
data
.
data
.
wordId
;
}
else
{
$
.
tip
(
data
.
message
);
}
layer
.
close
(
index
);
},
});
$
(
'.j_search_image'
).
change
(
function
()
{
var
$this
=
$
(
this
);
var
$form
=
$this
.
closest
(
'form'
);
if
(
$this
.
val
()
==
null
)
{
return
;
}
var
index
=
layer
.
load
(
2
,
10000
);
$
.
ajax
({
url
:
'/image/search'
,
type
:
'POST'
,
data
:
new
FormData
(
$form
[
0
]),
cache
:
false
,
contentType
:
false
,
processData
:
false
,
xhr
:
function
()
{
var
myXhr
=
$
.
ajaxSettings
.
xhr
();
if
(
myXhr
.
upload
)
{
// For handling the progress of the upload
myXhr
.
upload
.
addEventListener
(
'progress'
,
function
(
e
)
{
if
(
e
.
lengthComputable
)
{
$
(
'progress'
).
attr
({
value
:
e
.
loaded
,
max
:
e
.
total
,
});
}
},
false
);
}
return
myXhr
;
},
success
:
function
(
data
)
{
if
(
data
.
code
===
"OK"
)
{
location
.
href
=
'/word/'
+
data
.
data
.
wordId
;
location
.
href
=
'/word/'
+
data
.
data
.
wordId
;
}
}
else
{
else
{
$
.
tip
(
data
.
message
);
$
.
tip
(
data
.
message
);
}
}
layer
.
close
(
index
);
},
},
error
:
function
()
{
layer
.
close
(
index
);
},
});
});
});
})
})
</script>
</script>
...
@@ -46,9 +95,11 @@
...
@@ -46,9 +95,11 @@
<form
class=
"navbar-form clearfix j_search_form"
method=
"GET"
action=
"/home/search"
>
<form
class=
"navbar-form clearfix j_search_form"
method=
"GET"
action=
"/home/search"
>
<div
class=
"form-group input-group-lg"
>
<div
class=
"form-group input-group-lg"
>
<input
class=
"form-control"
type=
"text"
placeholder=
"之云"
name=
"keyword"
>
<input
class=
"form-control"
type=
"text"
placeholder=
"之云"
name=
"keyword"
>
<
%--
<button
class=
"btn navbar-search-camera"
type=
"button"
>
--%>
<button
class=
"btn navbar-search-camera"
type=
"button"
>
<
%--
<div
class=
"icon icon-camera"
></div>
--%>
<div
class=
"icon icon-camera"
>
<
%--
</button>
--%>
<input
name=
"image"
type=
"file"
class=
"j_search_image"
style=
"opacity: 0"
accept=
".png, .jpg, .jpeg"
>
</div>
</button>
<
%--
<button
class=
"btn navbar-search-microphone"
type=
"button"
>
--%>
<
%--
<button
class=
"btn navbar-search-microphone"
type=
"button"
>
--%>
<
%--
<div
class=
"icon icon-microphone"
></div>
--%>
<
%--
<div
class=
"icon icon-microphone"
></div>
--%>
<
%--
</button>
--%>
<
%--
</button>
--%>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment