Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
tjmdp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
other-project
tjmdp
Commits
40077fd1
Commit
40077fd1
authored
May 07, 2019
by
liuchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
621b2551
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
526 additions
and
13 deletions
+526
-13
CertificateController.java
...in/java/com/qiankun/controller/CertificateController.java
+45
-6
Certificate.java
src/main/java/com/qiankun/entity/Certificate.java
+10
-0
main.jsp
src/main/webapp/WEB-INF/decorators/main.jsp
+5
-5
list.jsp
src/main/webapp/WEB-INF/pages/certificate/list.jsp
+138
-0
save.jsp
src/main/webapp/WEB-INF/pages/certificate/save.jsp
+133
-0
jquery.imageLabel.min.css
...resources/assets/css/imageLabel/jquery.imageLabel.min.css
+2
-2
certificate.js
src/main/webapp/resources/js/certificate/certificate.js
+193
-0
No files found.
src/main/java/com/qiankun/controller/CertificateController.java
View file @
40077fd1
package
com
.
qiankun
.
controller
;
package
com
.
qiankun
.
controller
;
import
java.io.File
;
import
java.io.File
;
import
java.util.Date
;
import
java.util.ResourceBundle
;
import
java.util.ResourceBundle
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.servlet.ModelAndView
;
import
org.springframework.web.servlet.ModelAndView
;
import
com.qiankun.controller.base.BaseController
;
import
com.qiankun.controller.base.BaseController
;
...
@@ -41,17 +46,51 @@ public class CertificateController extends BaseController<Object>{
...
@@ -41,17 +46,51 @@ public class CertificateController extends BaseController<Object>{
if
(
StringUtils
.
isNotBlank
(
id
))
{
if
(
StringUtils
.
isNotBlank
(
id
))
{
certificate
=
certificateService
.
findById
(
id
);
certificate
=
certificateService
.
findById
(
id
);
}
}
view
.
setViewName
(
"
activity/saveactivity
"
);
view
.
setViewName
(
"
certificate/save
"
);
view
.
getModel
().
put
(
"certificate"
,
certificate
);
view
.
getModel
().
put
(
"certificate"
,
certificate
);
return
view
;
return
view
;
}
}
@RequestMapping
(
value
=
"/api/certificate/save"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
"/api/certificate/save"
)
public
ModelAndView
save
(
@RequestParam
(
value
=
"file"
,
required
=
false
)
MultipartFile
file
,
Certificate
certificate
,
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
Exception
{
public
void
save
(
String
id
,
String
name
,
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
Exception
{
Certificate
certificate
=
new
Certificate
();
ModelAndView
view
=
new
ModelAndView
();
if
(
StringUtils
.
isEmpty
(
certificate
.
getId
()))
{
view
.
getModel
().
put
(
"status"
,
1
);
}
else
{
String
id
=
certificate
.
getId
();
String
name
=
certificate
.
getName
();
String
position
=
certificate
.
getPosition
();
String
uploadImage
=
certificate
.
getUploadImage
();
Boolean
status
=
certificate
.
getStatus
();
certificate
=
certificateService
.
findById
(
id
);
certificateService
.
save
(
certificate
);
certificate
.
setName
(
name
);
certificate
.
setPosition
(
position
);
certificate
.
setUploadImage
(
uploadImage
);
certificate
.
setStatus
(
status
);
view
.
getModel
().
put
(
"status"
,
2
);
}
if
(
file
!=
null
)
{
String
fileFullName
=
file
.
getOriginalFilename
();
String
[]
originalFileName
=
fileFullName
.
split
(
"\\."
);
String
fileName
=
System
.
currentTimeMillis
()
+
"."
+
originalFileName
[
originalFileName
.
length
-
1
];
String
rootPath
=
rb
.
getString
(
"file_path"
);
if
(
StringUtils
.
isNotBlank
(
certificate
.
getUploadImage
()))
{
File
oldFile
=
new
File
(
rootPath
+
certificate
.
getUploadImage
());
if
(
oldFile
.
isFile
())
FileUtils
.
forceDelete
(
oldFile
);
}
File
destFile
=
new
File
(
rootPath
+
certificateImagePath
,
fileName
);
FileUtils
.
writeByteArrayToFile
(
destFile
,
file
.
getBytes
());
certificate
.
setUploadImage
(
certificateImagePath
+
File
.
separator
+
fileName
);
}
Certificate
entity
=
certificateService
.
save
(
certificate
);
view
.
getModel
().
put
(
"entity"
,
entity
);
return
view
;
}
}
@RequestMapping
(
"/api/certificate/del"
)
@RequestMapping
(
"/api/certificate/del"
)
...
...
src/main/java/com/qiankun/entity/Certificate.java
View file @
40077fd1
...
@@ -29,6 +29,8 @@ public class Certificate {
...
@@ -29,6 +29,8 @@ public class Certificate {
private
String
uploadImage
;
//证书照片路径
private
String
uploadImage
;
//证书照片路径
private
Boolean
status
=
false
;
//true 启用 false 停用
public
String
getId
()
{
public
String
getId
()
{
return
id
;
return
id
;
...
@@ -63,6 +65,14 @@ public class Certificate {
...
@@ -63,6 +65,14 @@ public class Certificate {
this
.
position
=
position
;
this
.
position
=
position
;
}
}
public
Boolean
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Boolean
status
)
{
this
.
status
=
status
;
}
...
...
src/main/webapp/WEB-INF/decorators/main.jsp
View file @
40077fd1
...
@@ -226,14 +226,14 @@
...
@@ -226,14 +226,14 @@
</li>
</li>
<li>
<li>
<a
href=
"
#
"
class=
"dropdown-toggle"
>
<a
href=
"
<webpath:path/>/certificate/list
"
class=
"dropdown-toggle"
>
<i
class=
"icon-book"
></i>
<i
class=
"icon-book"
></i>
<span
class=
"menu-text"
>
电子证书
</span>
<span
class=
"menu-text"
>
证书管理
</span>
<
b
class=
"arrow icon-angle-down"
></b
>
<
!-- <b class="arrow icon-angle-down"></b> --
>
</a>
</a>
<ul
class=
"submenu"
>
<
!-- <
ul class="submenu">
<li>
<li>
<a href="tables.html">
<a href="tables.html">
<i class="icon-double-angle-right"></i>
<i class="icon-double-angle-right"></i>
...
@@ -247,7 +247,7 @@
...
@@ -247,7 +247,7 @@
证书管理
证书管理
</a>
</a>
</li>
</li>
</ul>
</ul>
-->
</li>
</li>
<li>
<li>
...
...
src/main/webapp/WEB-INF/pages/certificate/list.jsp
0 → 100644
View file @
40077fd1
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="webpath" uri="/WEB-INF/tlds/path.tld"%>
<%@ taglib prefix="webpage" uri="/WEB-INF/tlds/pageview.tld"%>
<head>
</head>
<div class="main-content">
<div class="breadcrumbs" id="breadcrumbs">
<ul class="breadcrumb">
<li>
<i class="icon-home home-icon"></i>
<a href="#">首页</a>
</li>
<li class="active">证书管理</li>
</ul><!-- .breadcrumb -->
</div>
<div class="page-content">
<div class="row">
<div class="col-xs-12">
<div class="widget-toolbox">
<div class="btn-group">
<button class="btn btn-sm btn-success" onclick="window.location.href='<webpath:path/>/certificate/add'">
<i class="icon-plus-sign-alt bigger-110"></i>
新增
</button>
<!-- button class="btn btn-sm btn-success">
<i class="icon-ban-circle bigger-110"></i>
禁用
</button-->
</div>
<div class="pull-right">
</div>
</div>
<div class="pull-left"></div>
<table id="table-data" class="table table-bordered ">
<thead>
<tr class="">
<!-- <th class="center">
<label>
<input type="checkbox" class="ace">
<span class="lbl"></span>
</label>
</th> -->
<th width="">证书照片</th>
<th width="15%">证书名称</th>
<th width="8%">位置坐标</th>
<th width="8%" class="">状态</th>
<th width="100">操作</th>
</tr>
</thead>
<tbody>
<c:forEach var="list" items="${list}">
<tr class="tr-highlight">
<!-- <td class="center" width=10>
<label>
<input type="checkbox" class="ace">
<span class="lbl"></span>
</label>
</td> -->
<td title=""><img id="uploadImage" src="<webpath:path/>/wx/rainbowplan/loadResource?imageName=${list.uploadImage}" height="100"/></td>
<td title="">${list.name}</td>
<td title="">${list.position}</td>
<td title="">${list.status}</td>
<td>
<div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
<button class="btn btn-xs btn-info" onclick="window.location.href='<webpath:path/>/certificate/add?id=${list.id}'">
<i class="icon-edit"></i>
</button>
<c:if test="${!list.status}">
<button class="btn btn-xs btn-danger " onclick="certificate.remove('${list.id}')">
<i class="icon-trash"></i>
</button>
</c:if>
</div>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script src="<webpath:path/>/resources/js/certificate/certificate.js" type="text/javascript"></script>
\ No newline at end of file
src/main/webapp/WEB-INF/pages/certificate/save.jsp
0 → 100644
View file @
40077fd1
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="webpath" uri="/WEB-INF/tlds/path.tld"%>
<%@ taglib prefix="webpage" uri="/WEB-INF/tlds/pageview.tld"%>
<head>
</head>
<div class="main-content">
<div class="breadcrumbs" id="breadcrumbs">
<ul class="breadcrumb">
<li>
<i class="icon-home home-icon"></i>
<a href="#">首页</a>
</li>
<li class="active">证书管理</li>
<li class="active">保存</li>
</ul><!-- .breadcrumb -->
</div>
<div class="page-content">
<div class="row">
<div class="col-xs-12">
<form action="#" id="certificateForm" name="certificateForm" method="post" onsubmit="return false" class="form-horizontal" role="form">
<input type="hidden" id="id" name="id" value="${certificate.id}"/>
<input type="hidden" id="uploadImage" name="uploadImage" value="${certificate.uploadImage}"/>
<div class="row">
<div class="col-xs-5">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font> 证书名称 </label>
<div class="col-sm-9">
<input type="text" id="name" name="name" class="col-xs-10 col-sm-10" value="${certificate.name}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> 状态 </label>
<div class="col-sm-9">
<select name="status" id="status" class="col-xs-10 col-sm-10">
<option value="true" <c:if test="${certificate.status==true}">selected</c:if>>启用</option>
<option value="false" <c:if test="${certificate.status==false}">selected</c:if>>停用</option>
</select>
</div>
</div>
<c:if test="${certificate.id!=null}">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> <font color="red">*</font> 位置坐标 </label>
<div class="col-sm-9">
<textarea rows="4" class="col-xs-10 col-sm-10" id="position" name="position">${certificate.position}</textarea>
</div>
</div>
</c:if>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-1">图片</label>
<div class="col-sm-9">
<input type="file" id="input_file" name="file" >
</div>
</div>
<div class="col-md-offset-3 col-md-9">
<button class="btn btn-sm btn-success" type="submit">
<i class="icon-save bigger-110"></i>
保存
</button>
<a class="btn btn-sm btn-success" href="javascript:history.go(-1)">
<i class="icon-reply bigger-110"></i>
返回
</a>
</div>
</div>
<div class="col-xs-7">
<c:if test="${certificate.uploadImage!=null}">
<a href="javascript:;" onclick="certificate.editpic()"><img id="pic" src="<webpath:path/>/wx/rainbowplan/loadResource?imageName=${certificate.uploadImage}" width="300"/></a><br></c:if>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<script src="<webpath:path/>/resources/js/certificate/certificate.js" type="text/javascript"></script>
\ No newline at end of file
src/main/webapp/resources/assets/css/imageLabel/jquery.imageLabel.min.css
View file @
40077fd1
.imageLabel-box
{
font-size
:
14px
;
visibility
:
hidden
;
opacity
:
0
;
position
:
fixed
;
width
:
100%
;
height
:
100%
;
left
:
0
;
top
:
0
;
background-color
:
#363636
;
z-index
:
100
;
transition
:
all
.4s
;
-webkit-user-select
:
none
;
-moz-user-select
:
none
;
-ms-user-select
:
none
;
user-select
:
none
}
.imageLabel-box.imageLabel-box-active
{
visibility
:
visible
;
opacity
:
1
;
transform
:
scale
(
1
)}
.imageLabel-box
*
{
-webkit-tap-highlight-color
:
rgba
(
255
,
0
,
0
,
0
);
outline
:
none
;
box-sizing
:
border-box
;
list-style
:
none
;
margin
:
0
;
padding
:
0
}
.imageLabel-box
button
{
-webkit-user-select
:
none
}
.imageLabel-box
input
[
type
=
number
]
{
-moz-appearance
:
textfield
}
.imageLabel-box
input
::-webkit-inner-spin-button
,
.imageLabel-box
input
::-webkit-outer-spin-button
{
-webkit-appearance
:
none
!important
;
margin
:
0
}
.imageLabel-box
button
,
.imageLabel-box
input
[
type
=
number
],
.imageLabel-box
input
[
type
=
password
],
.imageLabel-box
input
[
type
=
tel
],
.imageLabel-box
input
[
type
=
text
]
{
-webkit-appearance
:
none
}
.imageLabel-box
input
::-webkit-search-cancel-button
{
display
:
none
}
.imageLabel-box
.imageLabel
{
width
:
100%
;
height
:
100%
;
display
:
-ms-flexbox
;
display
:
flex
;
-ms-flex-direction
:
column
;
flex-direction
:
column
}
.imageLabel-box
.imageLabel
.imageLabel-box
{
width
:
100%
;
height
:
100%
}
.imageLabel-box
.imageLabel-buttons
{
padding
:
10px
;
text-align
:
center
}
.imageLabel-box
.imageLabel-buttons
div
{
padding
:
5px
10px
;
margin
:
0
10px
;
background-color
:
#4b5060
}
.imageLabel-box
.imageLabel-buttons
div
.imageLabel-closes
{
background-color
:
#959595
}
.imageLabel-box
.imageLabel-img-boxs
{
-ms-flex-pack
:
center
;
-ms-flex-align
:
center
;
-ms-flex
:
1
;
flex
:
1
}
.imageLabel-box
.imageLabel-img-boxs
,
.imageLabel-box
.imageLabel-img-boxs
.imageLabel-img-body
{
width
:
100%
;
height
:
100%
;
justify-content
:
center
;
align-items
:
center
;
display
:
-ms-flexbox
;
display
:
flex
}
.imageLabel-box
.imageLabel-img-boxs
.imageLabel-img-body
{
position
:
relative
;
overflow
:
hidden
;
-ms-flex-pack
:
center
;
-ms-flex-align
:
center
}
.imageLabel-box
.imageLabel-drap-menu
{
background-color
:
#fff
;
width
:
100px
;
position
:
fixed
;
z-index
:
9999
;
display
:
none
;
box-shadow
:
0
16px
24px
2px
rgba
(
0
,
0
,
0
,
.06
),
0
6px
30px
5px
rgba
(
0
,
0
,
0
,
.12
),
0
8px
10px
-7px
rgba
(
0
,
0
,
0
,
.2
)}
.imageLabel-box
.imageLabel-drap-menu
.btns
{
padding
:
5px
10px
;
text-align
:
center
}
.imageLabel-box
.imageLabel-drap-menu
.btns
:hover
{
background-color
:
rgba
(
0
,
0
,
0
,
.1
)}
.imageLabel-box
.imageLabel-drap-menu
.btns
:active
{
opacity
:
.9
}
.imageLabel-img
{
visibility
:
hidden
;
opacity
:
0
;
transition
:
all
.3s
}
.imageLabel-img.imageLabel-img-active
{
visibility
:
visible
;
opacity
:
1
}
.imageLabel-content
{
cursor
:
crosshair
;
width
:
100%
;
height
:
100%
;
left
:
0
;
top
:
0
;
position
:
absolute
}
.imageLabel-imgdrop
{
cursor
:
move
;
position
:
absolute
;
min-width
:
7px
;
min-height
:
7px
;
background-color
:
rgba
(
0
,
0
,
0
,
.3
);
border
:
1px
dashed
#959595
;
z-index
:
10
;
display
:
-ms-flexbox
;
display
:
flex
;
-ms-flex-pack
:
center
;
justify-content
:
center
;
-ms-flex-align
:
center
;
align-items
:
center
}
.imageLabel-imgdrop
span
{
color
:
#fff
}
.imageLabel-imgdrop
em
.imageLable-em
{
display
:
none
;
z-index
:
-1
;
position
:
absolute
;
background-color
:
rgba
(
0
,
0
,
0
,
.2
)}
.imageLabel-imgdrop
em
.imageLable-em
:first-of-type
{
bottom
:
100%
;
left
:
50%
;
width
:
10000px
;
margin-bottom
:
1px
;
height
:
10000px
;
margin-left
:
-5000px
}
.imageLabel-imgdrop
em
.imageLable-em
:nth-of-type
(
2
)
{
left
:
100%
;
margin-left
:
1px
;
top
:
-1px
;
width
:
10000px
;
bottom
:
-1px
}
.imageLabel-imgdrop
em
.imageLable-em
:nth-of-type
(
3
)
{
top
:
100%
;
left
:
50%
;
width
:
10000px
;
margin-top
:
1px
;
height
:
10000px
;
margin-left
:
-5000px
}
.imageLabel-imgdrop
em
.imageLable-em
:nth-of-type
(
4
)
{
right
:
100%
;
top
:
-1px
;
width
:
10000px
;
margin-right
:
1px
;
bottom
:
-1px
}
.imageLabel-imgdrop
i
{
width
:
9px
;
height
:
9px
;
border-radius
:
50%
;
border
:
1px
solid
#fff
;
background-color
:
#959595
;
position
:
absolute
;
cursor
:
default
!important
}
.imageLabel-imgdrop
i
:first-of-type
{
left
:
-5px
;
top
:
-5px
;
cursor
:
nw-resize
}
.imageLabel-imgdrop
i
:nth-of-type
(
2
)
{
right
:
-5px
;
top
:
-5px
;
cursor
:
ne-resize
}
.imageLabel-imgdrop
i
:nth-of-type
(
3
)
{
right
:
-5px
;
bottom
:
-5px
;
cursor
:
se-resize
}
.imageLabel-imgdrop
i
:nth-of-type
(
4
)
{
left
:
-5px
;
bottom
:
-5px
;
cursor
:
sw-resize
}
.imageLabel-imgdrop
i
:nth-of-type
(
5
)
{
left
:
50%
;
top
:
-5px
;
margin-left
:
-5px
;
cursor
:
col-resize
}
.imageLabel-imgdrop
i
:nth-of-type
(
6
)
{
right
:
-5px
;
top
:
50%
;
margin-top
:
-5px
;
cursor
:
ew-resize
}
.imageLabel-imgdrop
i
:nth-of-type
(
7
)
{
left
:
50%
;
bottom
:
-5px
;
margin-left
:
-5px
;
cursor
:
col-resize
}
.imageLabel-imgdrop
i
:nth-of-type
(
8
)
{
left
:
-5px
;
top
:
50%
;
margin-top
:
-5px
;
cursor
:
ew-resize
}
.imageLabel-imgdrop.imageLabel-drop-edit
,
.imageLabel-imgdrop.imageLabel-drop-now
{
display
:
block
!important
;
background-color
:
transparent
!important
}
.imageLabel-imgdrop.imageLabel-drop-edit
.imageLabel-imgdrop-font
,
.imageLabel-imgdrop.imageLabel-drop-now
.imageLabel-imgdrop-font
{
opacity
:
0
}
.imageLabel-imgdrop.imageLabel-drop-edit
em
.imageLable-em
,
.imageLabel-imgdrop.imageLabel-drop-now
em
.imageLable-em
{
display
:
block
}
.imageLabel-imgdrop
em
.imageLable-em
{
pointer-events
:
none
}
.imageLabel-imgdrop.imageLabel-drop-edit
{
border
:
2px
solid
transparent
;
-o-border-image
:
url(../images/border.gif)
1
1
round
;
border-image
:
url(../images/border.gif)
1
1
round
}
.imageLabel-imgdrop.imageLabel-drop-has
{
background-color
:
rgba
(
255
,
0
,
0
,
.3
)
!important
}
.imageLabel-imgdrop.imageLabel-drop-has
.imageLabel-imgdrop-font
{
opacity
:
1
}
.imageLabel-imgdrop.imageLabel-drop-move
{
background-color
:
transparent
!important
}
.imageLabel-imgdrop.imageLabel-drop-move
.imageLabel-imgdrop-font
{
opacity
:
0
}
.imageLabel-imgdrop
.imageLabel-imgdrop-font
{
pointer-events
:
none
;
overflow
:
hidden
;
padding
:
2px
;
position
:
absolute
}
.imageLabel-imgdrop
.imageLabel-imgdrop-font
,
.imageLabel-input
{
width
:
100%
;
height
:
100%
;
left
:
0
;
top
:
0
;
display
:
-ms-flexbox
;
display
:
flex
;
-ms-flex-pack
:
center
;
justify-content
:
center
;
-ms-flex-align
:
center
;
align-items
:
center
}
.imageLabel-input
{
position
:
fixed
;
-webkit-user-select
:
none
;
-moz-user-select
:
none
;
-ms-user-select
:
none
;
user-select
:
none
;
visibility
:
hidden
;
transition
:
all
.4s
;
opacity
:
0
;
z-index
:
999999
}
.imageLabel-input
.imageLabel-input-box
{
transform
:
scale
(
0
);
transition
:
all
.4s
}
.imageLabel-input.imageLabel-active
{
opacity
:
1
;
visibility
:
visible
}
.imageLabel-input.imageLabel-active
.imageLabel-input-box
{
transform
:
scale
(
1
)}
.imageLabel-btn
{
padding
:
6px
10px
;
background-color
:
#333
;
color
:
#fff
;
-webkit-user-select
:
none
;
-moz-user-select
:
none
;
-ms-user-select
:
none
;
user-select
:
none
;
border-radius
:
3px
;
cursor
:
pointer
;
text-align
:
center
;
display
:
inline-block
;
box-shadow
:
0
4px
5px
0
rgba
(
0
,
0
,
0
,
.06
),
0
1px
10px
0
rgba
(
0
,
0
,
0
,
.12
),
0
2px
4px
-1px
rgba
(
0
,
0
,
0
,
.3
)}
.imageLabel-btn
:active
{
opacity
:
.8
}
.imageLabel-loading-body
{
width
:
100%
;
height
:
100%
;
position
:
absolute
;
left
:
0
;
top
:
0
;
display
:
-ms-flexbox
;
display
:
flex
;
-ms-flex-pack
:
center
;
justify-content
:
center
;
-ms-flex-align
:
center
;
align-items
:
center
}
.imageLabel-loading
{
width
:
50px
;
height
:
50px
;
border-radius
:
50%
;
border
:
2px
solid
#fff
;
border-right-color
:
hsla
(
0
,
0%
,
100%
,
.2
);
animation
:
imageLabelLoading
1s
infinite
linear
}
@keyframes
imageLabelLoading
{
form
{
transform
:
rotate
(
0deg
)}
to
{
transform
:
rotate
(
1turn
)}}
.imageLabel-box
{
font-size
:
14px
;
visibility
:
hidden
;
opacity
:
0
;
position
:
fixed
;
width
:
100%
;
height
:
100%
;
left
:
0
;
top
:
0
;
background-color
:
#363636
;
z-index
:
1000
;
transition
:
all
.4s
;
-webkit-user-select
:
none
;
-moz-user-select
:
none
;
-ms-user-select
:
none
;
user-select
:
none
}
.imageLabel-box.imageLabel-box-active
{
visibility
:
visible
;
opacity
:
1
;
transform
:
scale
(
1
)}
.imageLabel-box
*
{
-webkit-tap-highlight-color
:
rgba
(
255
,
0
,
0
,
0
);
outline
:
none
;
box-sizing
:
border-box
;
list-style
:
none
;
margin
:
0
;
padding
:
0
}
.imageLabel-box
button
{
-webkit-user-select
:
none
}
.imageLabel-box
input
[
type
=
number
]
{
-moz-appearance
:
textfield
}
.imageLabel-box
input
::-webkit-inner-spin-button
,
.imageLabel-box
input
::-webkit-outer-spin-button
{
-webkit-appearance
:
none
!important
;
margin
:
0
}
.imageLabel-box
button
,
.imageLabel-box
input
[
type
=
number
],
.imageLabel-box
input
[
type
=
password
],
.imageLabel-box
input
[
type
=
tel
],
.imageLabel-box
input
[
type
=
text
]
{
-webkit-appearance
:
none
}
.imageLabel-box
input
::-webkit-search-cancel-button
{
display
:
none
}
.imageLabel-box
.imageLabel
{
width
:
100%
;
height
:
100%
;
display
:
-ms-flexbox
;
display
:
flex
;
-ms-flex-direction
:
column
;
flex-direction
:
column
}
.imageLabel-box
.imageLabel
.imageLabel-box
{
width
:
100%
;
height
:
100%
}
.imageLabel-box
.imageLabel-buttons
{
padding
:
10px
;
text-align
:
center
}
.imageLabel-box
.imageLabel-buttons
div
{
padding
:
5px
10px
;
margin
:
0
10px
;
background-color
:
#4b5060
}
.imageLabel-box
.imageLabel-buttons
div
.imageLabel-closes
{
background-color
:
#959595
}
.imageLabel-box
.imageLabel-img-boxs
{
-ms-flex-pack
:
center
;
-ms-flex-align
:
center
;
-ms-flex
:
1
;
flex
:
1
}
.imageLabel-box
.imageLabel-img-boxs
,
.imageLabel-box
.imageLabel-img-boxs
.imageLabel-img-body
{
width
:
100%
;
height
:
100%
;
justify-content
:
center
;
align-items
:
center
;
display
:
-ms-flexbox
;
display
:
flex
}
.imageLabel-box
.imageLabel-img-boxs
.imageLabel-img-body
{
position
:
relative
;
overflow
:
hidden
;
-ms-flex-pack
:
center
;
-ms-flex-align
:
center
}
.imageLabel-box
.imageLabel-drap-menu
{
background-color
:
#fff
;
width
:
100px
;
position
:
fixed
;
z-index
:
9999
;
display
:
none
;
box-shadow
:
0
16px
24px
2px
rgba
(
0
,
0
,
0
,
.06
),
0
6px
30px
5px
rgba
(
0
,
0
,
0
,
.12
),
0
8px
10px
-7px
rgba
(
0
,
0
,
0
,
.2
)}
.imageLabel-box
.imageLabel-drap-menu
.btns
{
padding
:
5px
10px
;
text-align
:
center
}
.imageLabel-box
.imageLabel-drap-menu
.btns
:hover
{
background-color
:
rgba
(
0
,
0
,
0
,
.1
)}
.imageLabel-box
.imageLabel-drap-menu
.btns
:active
{
opacity
:
.9
}
.imageLabel-img
{
visibility
:
hidden
;
opacity
:
0
;
transition
:
all
.3s
}
.imageLabel-img.imageLabel-img-active
{
visibility
:
visible
;
opacity
:
1
}
.imageLabel-content
{
cursor
:
crosshair
;
width
:
100%
;
height
:
100%
;
left
:
0
;
top
:
0
;
position
:
absolute
}
.imageLabel-imgdrop
{
cursor
:
move
;
position
:
absolute
;
min-width
:
7px
;
min-height
:
7px
;
background-color
:
rgba
(
0
,
0
,
0
,
.3
);
border
:
1px
dashed
#959595
;
z-index
:
10
;
display
:
-ms-flexbox
;
display
:
flex
;
-ms-flex-pack
:
center
;
justify-content
:
center
;
-ms-flex-align
:
center
;
align-items
:
center
}
.imageLabel-imgdrop
span
{
color
:
#fff
}
.imageLabel-imgdrop
em
.imageLable-em
{
display
:
none
;
z-index
:
-1
;
position
:
absolute
;
background-color
:
rgba
(
0
,
0
,
0
,
.2
)}
.imageLabel-imgdrop
em
.imageLable-em
:first-of-type
{
bottom
:
100%
;
left
:
50%
;
width
:
10000px
;
margin-bottom
:
1px
;
height
:
10000px
;
margin-left
:
-5000px
}
.imageLabel-imgdrop
em
.imageLable-em
:nth-of-type
(
2
)
{
left
:
100%
;
margin-left
:
1px
;
top
:
-1px
;
width
:
10000px
;
bottom
:
-1px
}
.imageLabel-imgdrop
em
.imageLable-em
:nth-of-type
(
3
)
{
top
:
100%
;
left
:
50%
;
width
:
10000px
;
margin-top
:
1px
;
height
:
10000px
;
margin-left
:
-5000px
}
.imageLabel-imgdrop
em
.imageLable-em
:nth-of-type
(
4
)
{
right
:
100%
;
top
:
-1px
;
width
:
10000px
;
margin-right
:
1px
;
bottom
:
-1px
}
.imageLabel-imgdrop
i
{
width
:
9px
;
height
:
9px
;
border-radius
:
50%
;
border
:
1px
solid
#fff
;
background-color
:
#959595
;
position
:
absolute
;
cursor
:
default
!important
}
.imageLabel-imgdrop
i
:first-of-type
{
left
:
-5px
;
top
:
-5px
;
cursor
:
nw-resize
}
.imageLabel-imgdrop
i
:nth-of-type
(
2
)
{
right
:
-5px
;
top
:
-5px
;
cursor
:
ne-resize
}
.imageLabel-imgdrop
i
:nth-of-type
(
3
)
{
right
:
-5px
;
bottom
:
-5px
;
cursor
:
se-resize
}
.imageLabel-imgdrop
i
:nth-of-type
(
4
)
{
left
:
-5px
;
bottom
:
-5px
;
cursor
:
sw-resize
}
.imageLabel-imgdrop
i
:nth-of-type
(
5
)
{
left
:
50%
;
top
:
-5px
;
margin-left
:
-5px
;
cursor
:
col-resize
}
.imageLabel-imgdrop
i
:nth-of-type
(
6
)
{
right
:
-5px
;
top
:
50%
;
margin-top
:
-5px
;
cursor
:
ew-resize
}
.imageLabel-imgdrop
i
:nth-of-type
(
7
)
{
left
:
50%
;
bottom
:
-5px
;
margin-left
:
-5px
;
cursor
:
col-resize
}
.imageLabel-imgdrop
i
:nth-of-type
(
8
)
{
left
:
-5px
;
top
:
50%
;
margin-top
:
-5px
;
cursor
:
ew-resize
}
.imageLabel-imgdrop.imageLabel-drop-edit
,
.imageLabel-imgdrop.imageLabel-drop-now
{
display
:
block
!important
;
background-color
:
transparent
!important
}
.imageLabel-imgdrop.imageLabel-drop-edit
.imageLabel-imgdrop-font
,
.imageLabel-imgdrop.imageLabel-drop-now
.imageLabel-imgdrop-font
{
opacity
:
0
}
.imageLabel-imgdrop.imageLabel-drop-edit
em
.imageLable-em
,
.imageLabel-imgdrop.imageLabel-drop-now
em
.imageLable-em
{
display
:
block
}
.imageLabel-imgdrop
em
.imageLable-em
{
pointer-events
:
none
}
.imageLabel-imgdrop.imageLabel-drop-edit
{
border
:
2px
solid
transparent
;
-o-border-image
:
url(../images/border.gif)
1
1
round
;
border-image
:
url(../images/border.gif)
1
1
round
}
.imageLabel-imgdrop.imageLabel-drop-has
{
background-color
:
rgba
(
255
,
0
,
0
,
.3
)
!important
}
.imageLabel-imgdrop.imageLabel-drop-has
.imageLabel-imgdrop-font
{
opacity
:
1
}
.imageLabel-imgdrop.imageLabel-drop-move
{
background-color
:
transparent
!important
}
.imageLabel-imgdrop.imageLabel-drop-move
.imageLabel-imgdrop-font
{
opacity
:
0
}
.imageLabel-imgdrop
.imageLabel-imgdrop-font
{
pointer-events
:
none
;
overflow
:
hidden
;
padding
:
2px
;
position
:
absolute
}
.imageLabel-imgdrop
.imageLabel-imgdrop-font
,
.imageLabel-input
{
width
:
100%
;
height
:
100%
;
left
:
0
;
top
:
0
;
display
:
-ms-flexbox
;
display
:
flex
;
-ms-flex-pack
:
center
;
justify-content
:
center
;
-ms-flex-align
:
center
;
align-items
:
center
}
.imageLabel-input
{
position
:
fixed
;
-webkit-user-select
:
none
;
-moz-user-select
:
none
;
-ms-user-select
:
none
;
user-select
:
none
;
visibility
:
hidden
;
transition
:
all
.4s
;
opacity
:
0
;
z-index
:
999999
}
.imageLabel-input
.imageLabel-input-box
{
transform
:
scale
(
0
);
transition
:
all
.4s
}
.imageLabel-input.imageLabel-active
{
opacity
:
1
;
visibility
:
visible
}
.imageLabel-input.imageLabel-active
.imageLabel-input-box
{
transform
:
scale
(
1
)}
.imageLabel-btn
{
padding
:
6px
10px
;
background-color
:
#333
;
color
:
#fff
;
-webkit-user-select
:
none
;
-moz-user-select
:
none
;
-ms-user-select
:
none
;
user-select
:
none
;
border-radius
:
3px
;
cursor
:
pointer
;
text-align
:
center
;
display
:
inline-block
;
box-shadow
:
0
4px
5px
0
rgba
(
0
,
0
,
0
,
.06
),
0
1px
10px
0
rgba
(
0
,
0
,
0
,
.12
),
0
2px
4px
-1px
rgba
(
0
,
0
,
0
,
.3
)}
.imageLabel-btn
:active
{
opacity
:
.8
}
.imageLabel-loading-body
{
width
:
100%
;
height
:
100%
;
position
:
absolute
;
left
:
0
;
top
:
0
;
display
:
-ms-flexbox
;
display
:
flex
;
-ms-flex-pack
:
center
;
justify-content
:
center
;
-ms-flex-align
:
center
;
align-items
:
center
}
.imageLabel-loading
{
width
:
50px
;
height
:
50px
;
border-radius
:
50%
;
border
:
2px
solid
#fff
;
border-right-color
:
hsla
(
0
,
0%
,
100%
,
.2
);
animation
:
imageLabelLoading
1s
infinite
linear
}
@keyframes
imageLabelLoading
{
form
{
transform
:
rotate
(
0deg
)}
to
{
transform
:
rotate
(
1turn
)}}
\ No newline at end of file
\ No newline at end of file
src/main/webapp/resources/js/certificate/certificate.js
0 → 100644
View file @
40077fd1
var
isSubmit
=
true
;
$
(
document
).
ready
(
function
(){
if
(
$
(
'#certificateForm'
).
length
>
0
){
$
(
'#certificateForm'
).
validate
({
rules
:
{
"name"
:
{
required
:
true
}
},
messages
:{
"name"
:
{
required
:
"不能为空"
}
},
submitHandler
:
function
(
form
){
certificate
.
save
(
form
);
}
});
}
})
var
certificate
=
{
remove
:
function
(
id
){
bootbox
.
confirm
({
buttons
:
{
cancel
:
{
label
:
'取消'
,
className
:
'btn-default'
},
confirm
:
{
label
:
'确认'
,
className
:
'btn-myStyle'
}
},
message
:
'请确认是否删除?'
,
callback
:
function
(
result
)
{
if
(
result
)
{
$
.
ajax
({
type
:
'GET'
,
url
:
webPath
+
'/api/certificate/del?id='
+
id
,
dataType
:
'json'
,
success
:
function
(
data
){
window
.
location
.
reload
();
}
})
}
else
{
}
}
});
},
save
:
function
(
form
){
if
(
isSubmit
){
isSubmit
=
false
;
var
formData
=
new
FormData
();
formData
.
append
(
'file'
,
$
(
'#input_file'
)[
0
].
files
[
0
]);
formData
.
append
(
'id'
,
$
(
'#id'
).
val
());
formData
.
append
(
'name'
,
$
(
'#name'
).
val
());
formData
.
append
(
'status'
,
$
(
'#status'
).
val
());
formData
.
append
(
'uploadImage'
,
$
(
'#uploadImage'
).
val
());
if
(
typeof
(
$
(
'#position'
).
val
())
!=
"undefined"
){
formData
.
append
(
'position'
,
$
(
'#position'
).
val
());
}
$
.
ajax
({
url
:
webPath
+
'/api/certificate/save'
,
type
:
'POST'
,
cache
:
false
,
data
:
formData
,
processData
:
false
,
contentType
:
false
,
dataType
:
"json"
,
beforeSend
:
function
(){
},
success
:
function
(
data
){
var
status
=
data
.
status
;
var
entity
=
data
.
certificate
;
if
(
status
==
1
){
//成功
bootbox
.
dialog
({
message
:
"上传证书成功"
,
buttons
:{
"success"
:{
"label"
:
"下一步"
,
"className"
:
"btn-sm btn-primary"
,
"callback"
:
function
()
{
window
.
location
.
href
=
webPath
+
'/certificate/add?id='
+
entity
.
id
;
}
}
}
});
}
else
if
(
status
==
2
){
isSubmit
=
true
;
bootbox
.
dialog
({
message
:
"修改成功"
,
buttons
:{
"success"
:{
"label"
:
"确定"
,
"className"
:
"btn-sm btn-primary"
,
"callback"
:
function
()
{
window
.
location
.
reload
();
}
}
}
});
}
}
});
}
},
editpic
:
function
()
{
var
jsonstr
=
[];
if
(
$
(
"#position"
).
val
()
!=
""
){
jsonstr
=
JSON
.
parse
(
$
(
"#position"
).
val
());
}
window
.
c
=
imageLabel
({
img
:
$
(
"#pic"
).
attr
(
"src"
),
editPop
:
true
,
data
:
jsonstr
,
close
:
function
(
t
)
{
return
true
;
},
clickArea
:
function
()
{},
edit
:
function
(
t
)
{},
startArea
:
function
()
{},
confirm
:
function
(
t
)
{
//alert(JSON.stringify(t))
if
(
t
!=
null
){
$
(
"#position"
).
val
(
JSON
.
stringify
(
t
));
}
//return t.length && alert(JSON.stringify(t)), true
return
true
;
}
})
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment