....
This commit is contained in:
parent
f3876737d7
commit
78eb1b9d6c
4
pom.xml
4
pom.xml
@ -54,10 +54,10 @@
|
|||||||
-->
|
-->
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- 引入log4j2依赖 -->
|
<!-- 引入log4j2依赖 -->
|
||||||
<!--<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-log4j2</artifactId>
|
<artifactId>spring-boot-starter-log4j2</artifactId>
|
||||||
</dependency>-->
|
</dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core-->
|
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
|
|||||||
@ -33,6 +33,7 @@ public class JWTInterceptor implements HandlerInterceptor {
|
|||||||
//获取token的过期时间
|
//获取token的过期时间
|
||||||
long expiration = claims.getExpiration().getTime();
|
long expiration = claims.getExpiration().getTime();
|
||||||
if(expiration < issuedAt){
|
if(expiration < issuedAt){
|
||||||
|
log.error("token已过期!");
|
||||||
throw new ParameterException("token已过期!");
|
throw new ParameterException("token已过期!");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import com.nbclass.exception.ParameterException;
|
|||||||
import com.nbclass.system.service.UserService;
|
import com.nbclass.system.service.UserService;
|
||||||
import com.nbclass.util.JWTUtils;
|
import com.nbclass.util.JWTUtils;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.StringEscapeUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.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;
|
||||||
@ -305,6 +306,8 @@ public class ContentController extends BaseController {
|
|||||||
}
|
}
|
||||||
if(entity.getAttachment()!=null){
|
if(entity.getAttachment()!=null){
|
||||||
String s = JSON.toJSONString(entity.getAttachment());
|
String s = JSON.toJSONString(entity.getAttachment());
|
||||||
|
s = s.replace("[", "");
|
||||||
|
s = s.replace("]", "");
|
||||||
entity.setAttachment(s);
|
entity.setAttachment(s);
|
||||||
}
|
}
|
||||||
String desc = null;
|
String desc = null;
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.nbclass.activity.model.WeiXiUser;
|
import com.nbclass.activity.model.WeiXiUser;
|
||||||
import com.nbclass.activity.service.WxService;
|
import com.nbclass.activity.service.WxService;
|
||||||
|
import com.nbclass.activity.service.WxUserService;
|
||||||
import com.nbclass.exception.ParameterException;
|
import com.nbclass.exception.ParameterException;
|
||||||
|
|
||||||
import com.nbclass.util.HttpUtils;
|
import com.nbclass.util.HttpUtils;
|
||||||
@ -39,7 +40,8 @@ public class WxController {
|
|||||||
/**
|
/**
|
||||||
* wx的AppID
|
* wx的AppID
|
||||||
*/
|
*/
|
||||||
private static final String appId = "wx35766a64d73d08a9";
|
//private static final String appId = "wx35766a64d73d08a9";
|
||||||
|
private static final String appId = "wx013ea7738ce6991f";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wx的AppSecret
|
* wx的AppSecret
|
||||||
@ -59,6 +61,9 @@ public class WxController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private WxService wxService;
|
private WxService wxService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private WxUserService wxUserService;
|
||||||
|
|
||||||
@RequestMapping("/loginPage")
|
@RequestMapping("/loginPage")
|
||||||
public String loginPage(){
|
public String loginPage(){
|
||||||
return "loginPage";
|
return "loginPage";
|
||||||
@ -131,6 +136,7 @@ public class WxController {
|
|||||||
WeiXiUser weiXiUser = jsonUser.toJavaObject(WeiXiUser.class);
|
WeiXiUser weiXiUser = jsonUser.toJavaObject(WeiXiUser.class);
|
||||||
//添加用户信息到数据库
|
//添加用户信息到数据库
|
||||||
wxService.saveWxUser(weiXiUser);
|
wxService.saveWxUser(weiXiUser);
|
||||||
|
|
||||||
}
|
}
|
||||||
//数据库获取用户信息
|
//数据库获取用户信息
|
||||||
WeiXiUser weiXiUser = wxService.getWxUser(openid);
|
WeiXiUser weiXiUser = wxService.getWxUser(openid);
|
||||||
@ -148,7 +154,7 @@ public class WxController {
|
|||||||
map.put("token",token);
|
map.put("token",token);
|
||||||
map.put("nickname",weiXiUser.getNickname());
|
map.put("nickname",weiXiUser.getNickname());
|
||||||
map.put("headimgurl",weiXiUser.getHeadimgurl());*/
|
map.put("headimgurl",weiXiUser.getHeadimgurl());*/
|
||||||
response.sendRedirect("http://test.szxgl.cn/cases/?token="+token+"&nickname="+weiXiUser.getNickname()+"&headimgurl"+weiXiUser.getHeadimgurl());
|
response.sendRedirect("http://test.szxgl.cn/cases/?token="+token+"&nickname="+weiXiUser.getNickname()+"&headimgurl="+weiXiUser.getHeadimgurl()+"&status="+weiXiUser.getStatus());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
12
src/main/java/com/nbclass/activity/model/OssFile.java
Normal file
12
src/main/java/com/nbclass/activity/model/OssFile.java
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package com.nbclass.activity.model;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OssFile {
|
||||||
|
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
private String ori_name;
|
||||||
|
|
||||||
|
}
|
||||||
@ -91,5 +91,9 @@ public class WeiXiUser implements Serializable {
|
|||||||
|
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型(0、外部人员 1、公司内部人员)
|
||||||
|
*/
|
||||||
|
private int status;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,4 +33,6 @@ public interface WxUserService{
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String getNickname(String username);
|
String getNickname(String username);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -448,7 +448,7 @@ public class ContentServiceImpl implements ContentService {
|
|||||||
//查询案例id
|
//查询案例id
|
||||||
Long contentId = mapper.getContentId(check.getApplicationId());
|
Long contentId = mapper.getContentId(check.getApplicationId());
|
||||||
//更新案例状态
|
//更新案例状态
|
||||||
mapper.updateContentRelease(contentId,2,1);
|
mapper.updateContentRelease(contentId,2,2);
|
||||||
//更新es的状态
|
//更新es的状态
|
||||||
Content entity=mapper.findById(contentId);
|
Content entity=mapper.findById(contentId);
|
||||||
entity.setVisibility(1);
|
entity.setVisibility(1);
|
||||||
|
|||||||
@ -278,7 +278,7 @@ public class ElasticSearchServiceImpl implements ElasticSearchService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
|
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
|
||||||
boolQueryBuilder.must(QueryBuilders.termQuery("visibility", 1));
|
boolQueryBuilder.must(QueryBuilders.termQuery("release", 2));
|
||||||
/*if(StringUtils.isNotBlank(type)) { // 案例类型
|
/*if(StringUtils.isNotBlank(type)) { // 案例类型
|
||||||
boolQueryBuilder.must(QueryBuilders.termQuery("type", type));
|
boolQueryBuilder.must(QueryBuilders.termQuery("type", type));
|
||||||
if (StringUtils.isNoneBlank(keyWord)){
|
if (StringUtils.isNoneBlank(keyWord)){
|
||||||
|
|||||||
BIN
src/main/resources/static/img/login.jpeg
Normal file
BIN
src/main/resources/static/img/login.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 72 KiB |
BIN
src/main/resources/static/img/not_available-generic.png
Normal file
BIN
src/main/resources/static/img/not_available-generic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
BIN
src/main/resources/static/img/waiting-generic.png
Normal file
BIN
src/main/resources/static/img/waiting-generic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
8
src/main/resources/static/libs/bootstrap-select/defaults-zh_CN.min.js
vendored
Normal file
8
src/main/resources/static/libs/bootstrap-select/defaults-zh_CN.min.js
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/*!
|
||||||
|
* Bootstrap-select v1.13.14 (https://developer.snapappointments.com/bootstrap-select)
|
||||||
|
*
|
||||||
|
* Copyright 2012-2020 SnapAppointments, LLC
|
||||||
|
* Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
|
!function(e,t){void 0===e&&void 0!==window&&(e=window),"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,function(e){e.fn.selectpicker.defaults={noneSelectedText:"\u6ca1\u6709\u9009\u4e2d\u4efb\u4f55\u9879",noneResultsText:"\u6ca1\u6709\u627e\u5230\u5339\u914d\u9879",countSelectedText:"\u9009\u4e2d{1}\u4e2d\u7684{0}\u9879",maxOptionsText:["\u8d85\u51fa\u9650\u5236 (\u6700\u591a\u9009\u62e9{n}\u9879)","\u7ec4\u9009\u62e9\u8d85\u51fa\u9650\u5236(\u6700\u591a\u9009\u62e9{n}\u7ec4)"],multipleSeparator:", ",selectAllText:"\u5168\u9009",deselectAllText:"\u53d6\u6d88\u5168\u9009"}});
|
||||||
BIN
src/main/resources/static/libs/fineuploader/edit.gif
Normal file
BIN
src/main/resources/static/libs/fineuploader/edit.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 150 B |
1
src/main/resources/static/libs/fineuploader/fine-uploader-new.min.css
vendored
Normal file
1
src/main/resources/static/libs/fineuploader/fine-uploader-new.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
7
src/main/resources/static/libs/fineuploader/jquery.fine-uploader.min.js
vendored
Normal file
7
src/main/resources/static/libs/fineuploader/jquery.fine-uploader.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
src/main/resources/static/libs/fineuploader/loading.gif
Normal file
BIN
src/main/resources/static/libs/fineuploader/loading.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
7
src/main/resources/static/libs/jquery.ui/jquery-ui.min.css
vendored
Normal file
7
src/main/resources/static/libs/jquery.ui/jquery-ui.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
13
src/main/resources/static/libs/jquery.ui/jquery-ui.min.js
vendored
Normal file
13
src/main/resources/static/libs/jquery.ui/jquery-ui.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
src/main/resources/static/libs/select2/select2.min.css
vendored
Normal file
1
src/main/resources/static/libs/select2/select2.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
2
src/main/resources/static/libs/select2/select2.min.js
vendored
Normal file
2
src/main/resources/static/libs/select2/select2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
src/main/resources/static/libs/select2/zh-CN.js
vendored
Normal file
1
src/main/resources/static/libs/select2/zh-CN.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
!function(){var n;jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd&&(n=jQuery.fn.select2.amd),n.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(n){return"请删除"+(n.input.length-n.maximum)+"个字符"},inputTooShort:function(n){return"请再输入至少"+(n.minimum-n.input.length)+"个字符"},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(n){return"最多只能选择"+n.maximum+"个项目"},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"},removeAllItems:function(){return"删除所有项目"}}}),n.define,n.require}();
|
||||||
@ -7,10 +7,12 @@
|
|||||||
<body>
|
<body>
|
||||||
<br/><br/><br/>
|
<br/><br/><br/>
|
||||||
<!-- 为ECharts准备一个具备大小(宽高)的Dom -->
|
<!-- 为ECharts准备一个具备大小(宽高)的Dom -->
|
||||||
<div id="main" class="jax-box jax-box-table" style="width: 1500px;height:800px;background-color: white"></div><br/><br/><br/>
|
<!--<div id="main" class="jax-box jax-box-table" style="width: 1500px;height:800px;background-color: white"></div><br/><br/><br/>-->
|
||||||
<div id="main2" class="jax-box jax-box-table" style="width: 1500px;height:800px;background-color: white"></div><br/><br/><br/>
|
<div id="main2" class="jax-box jax-box-table" style="width: 1500px;height:800px;background-color: white"></div><br/><br/><br/>
|
||||||
<div id="main3" class="jax-box jax-box-table" style="width: 1500px;height:800px;background-color: white"></div><br/><br/><br/>
|
<!--<div id="main3" class="jax-box jax-box-table" style="width: 1500px;height:800px;background-color: white"></div><br/><br/><br/>-->
|
||||||
<div id="main4" class="jax-box jax-box-table" style="width: 1500px;height:800px;background-color: white"></div>
|
<div id="main5" class="jax-box jax-box-table" style="width: 1500px;height:800px;background-color: white"></div>
|
||||||
|
<div id="main4" class="jax-box jax-box-table" style="width: 1500px;height:800px;background-color: white"></div></div><br/><br/><br/>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function getCensus(){
|
function getCensus(){
|
||||||
var count = [];
|
var count = [];
|
||||||
@ -194,11 +196,104 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getCensus5(){
|
||||||
|
var count = [];
|
||||||
|
//初始化下拉框
|
||||||
|
$.getJSON("/cases/console/content/getCensus?type=1",function (data){
|
||||||
|
console.log(data)
|
||||||
|
// 基于准备好的dom,初始化echarts实例
|
||||||
|
var myChart = echarts.init(document.getElementById('main5'));
|
||||||
|
// 指定图表的配置项和数据
|
||||||
|
option = {
|
||||||
|
title: {
|
||||||
|
text: '每月案例上传总数环比趋势'+data.data.count
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis'
|
||||||
|
},
|
||||||
|
legend: {},
|
||||||
|
toolbox: {
|
||||||
|
show: true,
|
||||||
|
feature: {
|
||||||
|
dataView: { readOnly: false },
|
||||||
|
magicType: { type: ['line', 'bar'] },
|
||||||
|
restore: {},
|
||||||
|
saveAsImage: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
boundaryGap: false,
|
||||||
|
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
||||||
|
axisLabel: { interval: 0, rotate: 30 }
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
axisLabel: {
|
||||||
|
formatter: '{value} °C'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: '今年',
|
||||||
|
type: 'line',
|
||||||
|
data: [10, 11, 13, 11, 12, 12, 9],
|
||||||
|
markPoint: {
|
||||||
|
data: [
|
||||||
|
{ type: 'max', name: 'Max' },
|
||||||
|
{ type: 'min', name: 'Min' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
markLine: {
|
||||||
|
data: [{ type: 'average', name: 'Avg' }]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '去年',
|
||||||
|
type: 'line',
|
||||||
|
data: [1, -2, 2, 5, 3, 2, 0],
|
||||||
|
markPoint: {
|
||||||
|
data: [{ name: '周最低', value: -2, xAxis: 1, yAxis: -1.5 }]
|
||||||
|
},
|
||||||
|
markLine: {
|
||||||
|
data: [
|
||||||
|
{ type: 'average', name: 'Avg' },
|
||||||
|
[
|
||||||
|
{
|
||||||
|
symbol: 'none',
|
||||||
|
x: '90%',
|
||||||
|
yAxis: 'max'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
symbol: 'circle',
|
||||||
|
label: {
|
||||||
|
position: 'start',
|
||||||
|
formatter: 'Max'
|
||||||
|
},
|
||||||
|
type: 'max',
|
||||||
|
name: '最高点'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
// 使用刚指定的配置项和数据显示图表。
|
||||||
|
myChart.setOption(option);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$(function (){
|
$(function (){
|
||||||
getCensus();
|
|
||||||
getCensus2();
|
getCensus2();
|
||||||
getCensus3();
|
|
||||||
getCensus4();
|
getCensus4();
|
||||||
|
getCensus5();
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -21,13 +21,13 @@
|
|||||||
<span>Processing dropped files...</span>
|
<span>Processing dropped files...</span>
|
||||||
<span class="qq-drop-processing-spinner-selector qq-drop-processing-spinner"></span>
|
<span class="qq-drop-processing-spinner-selector qq-drop-processing-spinner"></span>
|
||||||
</span>
|
</span>
|
||||||
<ul class="qq-upload-list-selector qq-upload-list" aria-live="polite" aria-relevant="additions removals">
|
<ul id="ul" class="qq-upload-list-selector qq-upload-list" aria-live="polite" aria-relevant="additions removals">
|
||||||
<li>
|
<li>
|
||||||
<div class="qq-progress-bar-container-selector">
|
<div class="qq-progress-bar-container-selector">
|
||||||
<div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-progress-bar-selector qq-progress-bar"></div>
|
<div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-progress-bar-selector qq-progress-bar"></div>
|
||||||
</div>
|
</div>
|
||||||
<span class="qq-upload-spinner-selector qq-upload-spinner"></span>
|
<span class="qq-upload-spinner-selector qq-upload-spinner"></span>
|
||||||
<!-- <img class="qq-thumbnail-selector" qq-max-size="100" qq-server-scale>-->
|
<!--- <img class="qq-thumbnail-selector" qq-max-size="100" qq-server-scale-->
|
||||||
<span class="qq-upload-file-selector qq-upload-file"></span>
|
<span class="qq-upload-file-selector qq-upload-file"></span>
|
||||||
<span class="qq-edit-filename-icon-selector qq-edit-filename-icon" aria-label="Edit filename"></span>
|
<span class="qq-edit-filename-icon-selector qq-edit-filename-icon" aria-label="Edit filename"></span>
|
||||||
<input class="qq-edit-filename-selector qq-edit-filename" tabindex="0" type="text">
|
<input class="qq-edit-filename-selector qq-edit-filename" tabindex="0" type="text">
|
||||||
@ -112,6 +112,9 @@
|
|||||||
<div class="col-sm-2">
|
<div class="col-sm-2">
|
||||||
<select id="applicationStatus" class="selectpicker" disabled="disabled">
|
<select id="applicationStatus" class="selectpicker" disabled="disabled">
|
||||||
<option value="">请选择</option>
|
<option value="">请选择</option>
|
||||||
|
<option value="1">未发布</option>
|
||||||
|
<option value="2">已发布</option>
|
||||||
|
<option value="4">已下线</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<label class="col-sm-2 control-label custom1">关联部门:</label>
|
<label class="col-sm-2 control-label custom1">关联部门:</label>
|
||||||
@ -160,6 +163,16 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-2 control-label">可见性:</label>
|
||||||
|
<div class="col-sm-2">
|
||||||
|
<select id="visibility" name="visibility" class="selectpicker">
|
||||||
|
<option value="">请选择</option>
|
||||||
|
<option value="1">可见</option>
|
||||||
|
<option value="2">不可见</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label"><font color="red">*</font> 标签:</label>
|
<label class="col-sm-2 control-label"><font color="red">*</font> 标签:</label>
|
||||||
@ -259,6 +272,7 @@ var caseType = [[${caseType}]];
|
|||||||
<script charset="utf-8" type="text/javascript" th:src="@{/js/cases/content.js}"></script>
|
<script charset="utf-8" type="text/javascript" th:src="@{/js/cases/content.js}"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var editor;
|
var editor;
|
||||||
|
var filelist =[];
|
||||||
function initKEdit(desct){
|
function initKEdit(desct){
|
||||||
editor = KindEditor.create(desct,{
|
editor = KindEditor.create(desct,{
|
||||||
filterMode: false, // 取消过滤video等
|
filterMode: false, // 取消过滤video等
|
||||||
@ -451,27 +465,31 @@ var caseType = [[${caseType}]];
|
|||||||
autoUpload: false,
|
autoUpload: false,
|
||||||
callbacks: {
|
callbacks: {
|
||||||
onError: function (id, name, reason, maybeXhrOrXdr) { //上传失败
|
onError: function (id, name, reason, maybeXhrOrXdr) { //上传失败
|
||||||
alert("上传异常");
|
|
||||||
},
|
},
|
||||||
onComplete: function (id, fileName, responseJSON) { //上传完成后
|
onComplete: function (id, fileName, responseJSON) {
|
||||||
|
//上传完成后
|
||||||
alert("上传成功");
|
alert("上传成功");
|
||||||
console.log("responseJSON ",responseJSON)
|
console.log("responseJSON ",responseJSON)
|
||||||
if (responseJSON.ret === 0) {
|
if (responseJSON.ret === 0) {
|
||||||
console.log(responseJSON.data)
|
console.log(responseJSON.data)
|
||||||
$.each(responseJSON.data,function (n,value) {
|
$.each(responseJSON.data,function (n,value) {
|
||||||
for(var i = 0 ; i < value.length;i++){
|
for(var i = 0 ; i < value.length;i++){
|
||||||
|
filelist.push(value[i]);
|
||||||
var ori_name = value[i].ori_name;
|
var ori_name = value[i].ori_name;
|
||||||
console.log(ori_name)
|
console.log(ori_name)
|
||||||
console.log(ori_name.length)
|
console.log(ori_name.length)
|
||||||
if(ori_name.length>10)ori_name=ori_name.substring(0, 8)+"..."+ori_name.substring(ori_name.length-4, ori_name.length);
|
if(ori_name.length>10)ori_name=ori_name.substring(0, 8)+"..."+ori_name.substring(ori_name.length-4, ori_name.length);
|
||||||
|
|
||||||
$('#attachment').parent().find('input[type="file"]').val(''); // 清空值
|
$('#attachment').parent().find('input[type="file"]').val(''); // 清空值
|
||||||
$('#attachment').val(JSON.stringify(value));
|
|
||||||
$(".a_viewfile").attr('href', value[i].url);
|
$(".a_viewfile").attr('href', value[i].url);
|
||||||
$(".a_viewfile").text(ori_name);
|
$(".a_viewfile").text(ori_name);
|
||||||
$('.a_viewfile').show();
|
$('.a_viewfile').show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$('#attachment').val(JSON.stringify(filelist));
|
||||||
|
console.log(filelist)
|
||||||
|
console.log($("#attachment").val())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -560,17 +578,52 @@ var caseType = [[${caseType}]];
|
|||||||
console.log(attachment)
|
console.log(attachment)
|
||||||
if(attachment != null && attachment != undefined){
|
if(attachment != null && attachment != undefined){
|
||||||
attachment=attachment.replace(new RegExp('"','g'),'"');
|
attachment=attachment.replace(new RegExp('"','g'),'"');
|
||||||
|
attachment = attachment.substring(1,attachment.length);
|
||||||
|
attachment = attachment.substring(0,attachment.length-1);
|
||||||
|
attachment = "["+attachment+"]";
|
||||||
|
console.log(attachment)
|
||||||
if(attachment!=null && $.trim(attachment)!=''){
|
if(attachment!=null && $.trim(attachment)!=''){
|
||||||
var jsondata = JSON.parse(attachment);
|
var jsondata = JSON.parse(attachment);
|
||||||
$('#trigger-upload').parent().find('input[type="file"]').val(''); // 清空值
|
console.log(jsondata)
|
||||||
$('#trigger-upload').val(attachment);
|
$.each(jsondata, function (i, value) {
|
||||||
$(".a_viewfile").attr('href', jsondata.url);
|
var liNode=document.createElement("li");
|
||||||
$(".a_viewfile").text(jsondata.ori_name);
|
liNode.setAttribute("class","qq-file-id-" + i+5 + " qq-file-id=" + i+5 + "");
|
||||||
$('.a_viewfile').show();
|
liNode.innerHTML =
|
||||||
|
" <div class=\"qq-progress-bar-container-selector qq-hide\">\n" +
|
||||||
|
" <div role=\"progressbar\" aria-valuenow=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" class=\"qq-progress-bar-selector qq-progress-bar\"></div>\n" +
|
||||||
|
" </div>\n" +
|
||||||
|
" <span class=\"qq-upload-spinner-selector qq-upload-spinner qq-hide\"></span>\n" +
|
||||||
|
" <span class=\"qq-upload-file-selector qq-upload-file qq-editable\" title=\"" + value.ori_name + "\">" + value.ori_name + "</span>\n" +
|
||||||
|
"<input class=\"qq-edit-filename-selector qq-edit-filename\" tabindex=\"0\" type=\"text\">\n" +
|
||||||
|
" <span class=\"qq-upload-size-selector qq-upload-size qq-hide\"></span>\n" +
|
||||||
|
" <button id='deleteFile2' name='" + i+5 + "' type=\"button\" class=\"qq-btn\">删除</button>\n" +
|
||||||
|
" <span role=\"status\" class=\"qq-upload-status-text-selector qq-upload-status-text\"></span>\n" +
|
||||||
|
" <input type=\"hidden\" id=\"attachment" + i + "\" name=\"attachment\" value='' style=\"display: none;\">\n" +
|
||||||
|
" <div style=\"height: 20px; line-height: 20px;\">\n" +
|
||||||
|
" <a class=\"a_viewfile" + i + "\" href=\"javascript:;\" target=\"_blank\" title=\"点击下载\" style=\"height: 34px; line-height: 34px;\"></a>\n" +
|
||||||
|
" </div>\n" ;
|
||||||
|
//$(".qq-upload-list-selector qq-upload-list").appendChild(liNode);
|
||||||
|
document.getElementById("ul").appendChild(liNode);
|
||||||
|
$("#attachment"+i+"").parent().find('input[type="file"]').val(''); // 清空值
|
||||||
|
$("#attachment"+i+"").val(JSON.stringify(value));
|
||||||
|
$(".a_viewfile"+i+"").attr('href', value.url);
|
||||||
|
$(".a_viewfile"+i+"").text(value.ori_name);
|
||||||
|
$('.a_viewfile'+i+"").show();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$("#deleteFile2").on("click",function (){
|
||||||
|
var value = "qq-file-id-" +$(this).attr("name");
|
||||||
|
var msg = "确定删除该文件?";
|
||||||
|
Core.confirm(msg, function () {
|
||||||
|
alert(value)
|
||||||
|
$("."+value+"").remove();
|
||||||
|
$("#attachment"+i+"").val("");
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 加载标签插件数据
|
// 加载标签插件数据
|
||||||
if($('#dataid').val() > 0){
|
if($('#dataid').val() > 0){
|
||||||
var tags = '[[${tags}]]';
|
var tags = '[[${tags}]]';
|
||||||
@ -617,15 +670,25 @@ var caseType = [[${caseType}]];
|
|||||||
|
|
||||||
var release = '[[${release}]]';
|
var release = '[[${release}]]';
|
||||||
if(release != null && release != undefined){
|
if(release != null && release != undefined){
|
||||||
console.log(release)
|
|
||||||
if(release === '1' ){
|
if(release === '1' ){
|
||||||
$("#applicationStatus").append("<option value='"+release+"'>未发布</option>\n").attr("selected",true);
|
$("#applicationStatus").find("option[value='"+release+"']").attr("selected",true);
|
||||||
}else if(release === '2' ){
|
}else if(release === '2' ){
|
||||||
$("#applicationStatus").append("<option value='"+release+"'>已发布</option>\n").attr("selected",true);
|
$("#applicationStatus").find("option[value='"+release+"']").attr("selected",true);
|
||||||
}else if(release === '4' ){
|
}else if(release === '4' ){
|
||||||
$("#applicationStatus").append("<option value='"+release+"'>已下线</option>\n").attr("selected",true);
|
$("#applicationStatus").find("option[value='"+release+"']").attr("selected",true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var visibility = '[[${visibility}]]';
|
||||||
|
if(visibility != null && visibility != undefined){
|
||||||
|
console.log(visibility)
|
||||||
|
if(visibility === '1' ){
|
||||||
|
$("#visibility").find("option[value='"+visibility+"']").attr("selected",true);
|
||||||
|
}else if(visibility === '2' ){
|
||||||
|
$("#visibility").find("option[value='"+visibility+"']").attr("selected",true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//使用refresh方法更新UI以匹配新状态
|
//使用refresh方法更新UI以匹配新状态
|
||||||
$('.selectpicker').selectpicker('refresh');
|
$('.selectpicker').selectpicker('refresh');
|
||||||
//render方法强制重新渲染引导程序
|
//render方法强制重新渲染引导程序
|
||||||
@ -750,6 +813,8 @@ var caseType = [[${caseType}]];
|
|||||||
alert('标签不能为空!');
|
alert('标签不能为空!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// editor.sync(); // 同步editor数据
|
// editor.sync(); // 同步editor数据
|
||||||
if(caseType == 'design' || caseType == 'video' || caseType == 'h5'){
|
if(caseType == 'design' || caseType == 'video' || caseType == 'h5'){
|
||||||
$('#imgList').val(getImgJsonList()); // 同步多图json数据
|
$('#imgList').val(getImgJsonList()); // 同步多图json数据
|
||||||
|
|||||||
@ -1,39 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>百度</title>
|
|
||||||
<link rel="stylesheet" type="text/css" href="http://www.java1234.com/jquery-easyui-1.3.3/themes/default/easyui.css">
|
|
||||||
<link rel="stylesheet" type="text/css" href="http://www.java1234.com/jquery-easyui-1.3.3/themes/icon.css">
|
|
||||||
<link rel="stylesheet" type="text/css" href="http://www.java1234.com/jquery-easyui-1.3.3/demo/demo.css">
|
|
||||||
<script type="text/javascript" src="http://www.java1234.com/jquery-easyui-1.3.3/jquery.min.js"></script>
|
|
||||||
<script type="text/javascript" src="http://www.java1234.com/jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
|
|
||||||
<script type="text/javascript" src="http://www.java1234.com/jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h2>下拉框多选</h2>
|
|
||||||
<div class="demo-info" style="margin-bottom:10px">
|
|
||||||
<div class="demo-tip icon-tip"></div>
|
|
||||||
<div>点击下拉框选择多个项.</div>
|
|
||||||
</div>
|
|
||||||
<label class="col-sm-2 control-label">关联部门:</label>
|
|
||||||
<input class="easyui-combobox"
|
|
||||||
name="language"
|
|
||||||
data-options="
|
|
||||||
valueField:'label',
|
|
||||||
textField:'value',
|
|
||||||
multiple:true,
|
|
||||||
panelHeight:'auto',
|
|
||||||
data: [{
|
|
||||||
label: 'java',
|
|
||||||
value: 'Java'
|
|
||||||
},{
|
|
||||||
label: 'perl',
|
|
||||||
value: 'Perl'
|
|
||||||
},{
|
|
||||||
label: 'ruby',
|
|
||||||
value: 'Ruby'
|
|
||||||
}]
|
|
||||||
">
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Loading…
Reference in New Issue
Block a user