This commit is contained in:
gaojiuqi 2022-03-28 21:41:29 +08:00
parent 9efcd8c89e
commit d1c70c3eb5
8 changed files with 381 additions and 248 deletions

View File

@ -304,12 +304,12 @@ 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("[", "");
s = s.replace("]", ""); // s = s.replace("]", "");
entity.setAttachment(s); // entity.setAttachment(s);
} // }
String desc = null; String desc = null;
if(entity.getId()!=null && entity.getId()>0){ if(entity.getId()!=null && entity.getId()>0){
service.update(entity); service.update(entity);

View File

@ -6,6 +6,8 @@ import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.nbclass.activity.model.OssFile; import com.nbclass.activity.model.OssFile;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;

View File

@ -0,0 +1,25 @@
package com.nbclass.util;
import javax.servlet.Servlet;
import java.io.FileReader;
import java.util.Properties;
import java.util.Scanner;
public class Tomcat {
public static void main(String[] args) throws Exception {
System.out.println("Tomcat服务器正在启动....");
System.out.println("请输入路径:");
Scanner scanner = new Scanner(System.in);
String next = scanner.next();
FileReader reader = new FileReader("web");
Properties properties = new Properties();
properties.load(reader);
properties.clone();
Class<?> aClass = Class.forName(next);
Object o = aClass.newInstance();
Servlet servlet = (Servlet) o;
servlet.service(null,null);
}
}

View File

@ -34,7 +34,8 @@ spring:
enabled: true # 开启 Elasticsearch仓库(默认值:true) enabled: true # 开启 Elasticsearch仓库(默认值:true)
client: client:
reactive: reactive:
endpoints: 39.108.110.167:9200 # endpoints: 39.108.110.167:9200
endpoints: 127.0.0.1:9200
connection-timeout: 5000 connection-timeout: 5000
socket-timeout: 5000 socket-timeout: 5000

View File

@ -492,8 +492,6 @@
</if> </if>
WHERE WHERE
item.dictid = 26 item.dictid = 26
GROUP BY
item.id,c.id
<if test="type!=null and type==2"> <if test="type!=null and type==2">
AND DATE_FORMAT( c.online_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ), '%Y%m' ) AND DATE_FORMAT( c.online_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ), '%Y%m' )
</if> </if>
@ -503,27 +501,43 @@
<if test="type!=null and type==4"> <if test="type!=null and type==4">
AND YEAR(c.online_time)=YEAR(NOW()) AND YEAR(c.online_time)=YEAR(NOW())
</if> </if>
GROUP BY
item.id,c.id
</select> </select>
<select id="getCensusLine" resultType="java.lang.Integer"> <select id="getCensusLine" resultType="java.lang.Integer">
select select
/*v.month,*/ /*v.month,*/
ifnull(b.count,0) count from ( ifnull(b.count,0) count from (
SELECT DATE_FORMAT(CURDATE(), '%Y-%m') AS `month`
UNION SELECT DATE_FORMAT((CURDATE() - INTERVAL 1 MONTH), '%Y-%m') AS `month` SELECT
UNION SELECT DATE_FORMAT((CURDATE() - INTERVAL 2 MONTH), '%Y-%m') AS `month` CONCAT( YEAR ( CURDATE()), '-', '01' ) `month` UNION
UNION SELECT DATE_FORMAT((CURDATE() - INTERVAL 3 MONTH), '%Y-%m') AS `month` SELECT
UNION SELECT DATE_FORMAT((CURDATE() - INTERVAL 4 MONTH), '%Y-%m') AS `month` CONCAT( YEAR ( CURDATE()), '-', '02' ) `month` UNION
UNION SELECT DATE_FORMAT((CURDATE() - INTERVAL 5 MONTH), '%Y-%m') AS `month` SELECT
UNION SELECT DATE_FORMAT((CURDATE() - INTERVAL 6 MONTH), '%Y-%m') AS `month` CONCAT( YEAR ( CURDATE()), '-', '03' ) `month` UNION
UNION SELECT DATE_FORMAT((CURDATE() - INTERVAL 7 MONTH), '%Y-%m') AS `month` SELECT
UNION SELECT DATE_FORMAT((CURDATE() - INTERVAL 8 MONTH), '%Y-%m') AS `month` CONCAT( YEAR ( CURDATE()), '-', '04' ) `month` UNION
UNION SELECT DATE_FORMAT((CURDATE() - INTERVAL 9 MONTH), '%Y-%m') AS `month` SELECT
UNION SELECT DATE_FORMAT((CURDATE() - INTERVAL 10 MONTH), '%Y-%m') AS `month` CONCAT( YEAR ( CURDATE()), '-', '05' ) `month` UNION
UNION SELECT DATE_FORMAT((CURDATE() - INTERVAL 11 MONTH), '%Y-%m') AS `month` SELECT
ORDER BY month CONCAT( YEAR ( CURDATE()), '-', '06' ) `month` UNION
SELECT
CONCAT( YEAR ( CURDATE()), '-', '07' ) `month` UNION
SELECT
CONCAT( YEAR ( CURDATE()), '-', '08' ) `month` UNION
SELECT
CONCAT( YEAR ( CURDATE()), '-', '09' ) `month` UNION
SELECT
CONCAT( YEAR ( CURDATE()), '-', '10' ) `month` UNION
SELECT
CONCAT( YEAR ( CURDATE()), '-', '11' ) `month` UNION
SELECT
CONCAT( YEAR ( CURDATE()), '-', '12' ) `month`
ORDER BY
MONTH
) v ) v
left join left join
(select (select
left(online_time,7) as 'month',count(*) as count left(online_time,7) as 'month',count(*) as count
from content as a from content as a
@ -541,29 +555,29 @@
FROM FROM
( (
SELECT SELECT
DATE_FORMAT( date( date_add( now(), INTERVAL - 1 YEAR )), '%Y-%m' ) AS `month` UNION CONCAT( YEAR ( CURDATE())-1, '-', '01' ) `month` UNION
SELECT SELECT
DATE_FORMAT(( date( date_add( now(), INTERVAL - 1 YEAR )) - INTERVAL 1 MONTH ), '%Y-%m' ) AS `month` UNION CONCAT( YEAR ( CURDATE())-1, '-', '02' ) `month` UNION
SELECT SELECT
DATE_FORMAT(( date( date_add( now(), INTERVAL - 1 YEAR )) - INTERVAL 2 MONTH ), '%Y-%m' ) AS `month` UNION CONCAT( YEAR ( CURDATE())-1, '-', '03' ) `month` UNION
SELECT SELECT
DATE_FORMAT(( date( date_add( now(), INTERVAL - 1 YEAR )) - INTERVAL 3 MONTH ), '%Y-%m' ) AS `month` UNION CONCAT( YEAR ( CURDATE())-1, '-', '04' ) `month` UNION
SELECT SELECT
DATE_FORMAT(( date( date_add( now(), INTERVAL - 1 YEAR )) - INTERVAL 4 MONTH ), '%Y-%m' ) AS `month` UNION CONCAT( YEAR ( CURDATE())-1, '-', '05' ) `month` UNION
SELECT SELECT
DATE_FORMAT(( date( date_add( now(), INTERVAL - 1 YEAR )) - INTERVAL 5 MONTH ), '%Y-%m' ) AS `month` UNION CONCAT( YEAR ( CURDATE())-1, '-', '06' ) `month` UNION
SELECT SELECT
DATE_FORMAT(( date( date_add( now(), INTERVAL - 1 YEAR )) - INTERVAL 6 MONTH ), '%Y-%m' ) AS `month` UNION CONCAT( YEAR ( CURDATE())-1, '-', '07' ) `month` UNION
SELECT SELECT
DATE_FORMAT(( date( date_add( now(), INTERVAL - 1 YEAR )) - INTERVAL 7 MONTH ), '%Y-%m' ) AS `month` UNION CONCAT( YEAR ( CURDATE())-1, '-', '08' ) `month` UNION
SELECT SELECT
DATE_FORMAT(( date( date_add( now(), INTERVAL - 1 YEAR )) - INTERVAL 8 MONTH ), '%Y-%m' ) AS `month` UNION CONCAT( YEAR ( CURDATE())-1, '-', '09' ) `month` UNION
SELECT SELECT
DATE_FORMAT(( date( date_add( now(), INTERVAL - 1 YEAR )) - INTERVAL 9 MONTH ), '%Y-%m' ) AS `month` UNION CONCAT( YEAR ( CURDATE())-1, '-', '10' ) `month` UNION
SELECT SELECT
DATE_FORMAT(( date( date_add( now(), INTERVAL - 1 YEAR )) - INTERVAL 10 MONTH ), '%Y-%m' ) AS `month` UNION CONCAT( YEAR ( CURDATE())-1, '-', '11' ) `month` UNION
SELECT SELECT
DATE_FORMAT(( date( date_add( now(), INTERVAL - 1 YEAR )) - INTERVAL 11 MONTH ), '%Y-%m' ) AS `month` CONCAT( YEAR ( CURDATE())-1, '-', '12' ) `month`
ORDER BY ORDER BY
MONTH MONTH
) v ) v

View File

@ -162,7 +162,7 @@
function getCensus4(){ function getCensus4(){
var count = []; var count = [];
//初始化下拉框 //初始化下拉框
$.getJSON("/cases/console/content/getCensus?type=3",function (data){ $.getJSON("/cases/console/content/getCensus?type=4",function (data){
console.log(data) console.log(data)
// 基于准备好的dom初始化echarts实例 // 基于准备好的dom初始化echarts实例
var myChart = echarts.init(document.getElementById('main4')); var myChart = echarts.init(document.getElementById('main4'));
@ -269,28 +269,13 @@
type: 'line', type: 'line',
data: data.data.list2, data: data.data.list2,
markPoint: { markPoint: {
data: [{ name: '周最低', value: -2, xAxis: 1, yAxis: -1.5 }] data: [
{ type: 'max', name: 'Max' },
{ type: 'min', name: 'Min' }
]
}, },
markLine: { markLine: {
data: [ data: [{ type: 'average', name: 'Avg' }]
{ type: 'average', name: 'Avg' },
[
{
symbol: 'none',
x: '90%',
yAxis: 'max'
},
{
symbol: 'circle',
label: {
position: 'start',
formatter: 'Max'
},
type: 'max',
name: '最高点'
}
]
]
} }
} }
] ]

View File

@ -1,73 +1,73 @@
<link rel="stylesheet" th:href="@{/css/cases/content.css}" xmlns:th="http://www.w3.org/1999/xhtml"/> <link rel="stylesheet" th:href="@{/css/cases/content.css}" xmlns:th="http://www.w3.org/1999/xhtml"/>
<script type="text/template" id="qq-template-manual-trigger"> <!--<script type="text/template" id="qq-template-manual-trigger">-->
<div class="qq-uploader-selector qq-uploader" qq-drop-area-text="Drop files here"> <!-- <div class="qq-uploader-selector qq-uploader" qq-drop-area-text="Drop files here">-->
<div class="qq-total-progress-bar-container-selector qq-total-progress-bar-container"> <!-- <div class="qq-total-progress-bar-container-selector qq-total-progress-bar-container">-->
<div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-total-progress-bar-selector qq-progress-bar qq-total-progress-bar"></div> <!-- <div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-total-progress-bar-selector qq-progress-bar qq-total-progress-bar"></div>-->
</div> <!-- </div>-->
<div class="qq-upload-drop-area-selector qq-upload-drop-area" qq-hide-dropzone> <!-- <div class="qq-upload-drop-area-selector qq-upload-drop-area" qq-hide-dropzone>-->
<span class="qq-upload-drop-area-text-selector"></span> <!-- <span class="qq-upload-drop-area-text-selector"></span>-->
</div> <!-- </div>-->
<div id="upload-button" class="buttons"> <!-- <div id="upload-button" class="buttons">-->
<div class="qq-upload-button-selector qq-upload-button"> <!-- <div class="qq-upload-button-selector qq-upload-button">-->
<div>选择文件</div> <!-- <div>选择文件</div>-->
</div> <!-- </div>-->
<button type="button" id="trigger-upload" class="btn btn-primary"> <!-- <button type="button" id="trigger-upload" class="btn btn-primary">-->
<i class="icon-upload icon-white"></i> 上传 <!-- <i class="icon-upload icon-white"></i> 上传-->
</button> <!-- </button>-->
</div> <!-- </div>-->
<span class="qq-drop-processing-selector qq-drop-processing"> <!-- <span class="qq-drop-processing-selector qq-drop-processing">-->
<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 id="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--> <!-- &lt;!&ndash;- <img class="qq-thumbnail-selector" qq-max-size="100" qq-server-scale&ndash;&gt;-->
<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">-->
<span class="qq-upload-size-selector qq-upload-size"></span> <!-- <span class="qq-upload-size-selector qq-upload-size"></span>-->
<button type="button" class="qq-btn qq-upload-cancel-selector qq-upload-cancel">删除</button> <!-- <button type="button" class="qq-btn qq-upload-cancel-selector qq-upload-cancel">删除</button>-->
<button type="button" class="qq-btn qq-upload-retry-selector qq-upload-retry">重试</button> <!-- <button type="button" class="qq-btn qq-upload-retry-selector qq-upload-retry">重试</button>-->
<button type="button" class="qq-btn qq-upload-delete-selector qq-upload-delete">Delete</button> <!-- <button type="button" class="qq-btn qq-upload-delete-selector qq-upload-delete">Delete</button>-->
<span role="status" class="qq-upload-status-text-selector qq-upload-status-text"></span> <!-- <span role="status" class="qq-upload-status-text-selector qq-upload-status-text"></span>-->
<input type="hidden" id="attachment" name="attachment" th:value="${attachment}" style="display: none;"> <!-- <input type="hidden" id="attachment" name="attachment" th:value="${attachment}" style="display: none;">-->
<div style="height: 20px; line-height: 20px;"> <!-- <div style="height: 20px; line-height: 20px;">-->
<a class="a_viewfile" href="javascript:;" target="_blank" title="点击下载" style="height: 34px; line-height: 34px;"></a> <!-- <a class="a_viewfile" href="javascript:;" target="_blank" title="点击下载" style="height: 34px; line-height: 34px;"></a>-->
</div> <!-- </div>-->
</li> <!-- </li>-->
</ul> <!-- </ul>-->
<dialog class="qq-alert-dialog-selector"> <!-- <dialog class="qq-alert-dialog-selector">-->
<div class="qq-dialog-message-selector"></div> <!-- <div class="qq-dialog-message-selector"></div>-->
<div class="qq-dialog-buttons"> <!-- <div class="qq-dialog-buttons">-->
<button type="button" class="qq-cancel-button-selector">关闭</button> <!-- <button type="button" class="qq-cancel-button-selector">关闭</button>-->
</div> <!-- </div>-->
</dialog> <!-- </dialog>-->
<dialog class="qq-confirm-dialog-selector"> <!-- <dialog class="qq-confirm-dialog-selector">-->
<div class="qq-dialog-message-selector"></div> <!-- <div class="qq-dialog-message-selector"></div>-->
<div class="qq-dialog-buttons"> <!-- <div class="qq-dialog-buttons">-->
<button type="button" class="qq-cancel-button-selector">No</button> <!-- <button type="button" class="qq-cancel-button-selector">No</button>-->
<button type="button" class="qq-ok-button-selector">Yes</button> <!-- <button type="button" class="qq-ok-button-selector">Yes</button>-->
</div> <!-- </div>-->
</dialog> <!-- </dialog>-->
<dialog class="qq-prompt-dialog-selector"> <!-- <dialog class="qq-prompt-dialog-selector">-->
<div class="qq-dialog-message-selector"></div> <!-- <div class="qq-dialog-message-selector"></div>-->
<input type="text"> <!-- <input type="text">-->
<div class="qq-dialog-buttons"> <!-- <div class="qq-dialog-buttons">-->
<button type="button" class="qq-cancel-button-selector">Cancel</button> <!-- <button type="button" class="qq-cancel-button-selector">Cancel</button>-->
<button type="button" class="qq-ok-button-selector">Ok</button> <!-- <button type="button" class="qq-ok-button-selector">Ok</button>-->
</div> <!-- </div>-->
</dialog> <!-- </dialog>-->
</div> <!-- </div>-->
</script> <!--</script>-->
<style> <style>
@ -194,22 +194,25 @@
</div> </div>
</div> </div>
<!--<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">附件:</label> <label class="col-sm-2 control-label">附件:</label>
<div class="col-sm-2"> <div class="col-sm-2">
<label class="btn btn-info" for="attachment_file" style="color:white;vertical-align:top;">上传</label> <label class="btn btn-info" for="attachment_file" style="color:white;vertical-align:top;">上传</label>
<input type="file" id="attachment_file" name="file" multiple style="display: none;"> <input type="file" id="attachment_file" name="file" multiple style="display: none;">
<input type="hidden" id="attachment" name="attachment" th:value="${attachment}" style="display: none;"> <input type="hidden" id="attachment" name="attachment" th:value="${attachment}" style="display: none;">
<div style="height: 20px; line-height: 20px;"> <div id="dfile" style="height: 20px; line-height: 20px;">
<a class="a_viewfile" href="javascript:;" target="_blank" title="点击下载" style="height: 34px; line-height: 34px;"></a> <!-- <a class="a_viewfile" href="javascript:void(0);" target="_blank" title="点击下载" style="height: 34px; line-height: 34px;"></a>-->
</div> </div>
</div> </div>
</div>-->
<div class="form-group">
<label class="col-sm-2 control-label">附件:</label>
<div id="fine-uploader-manual-trigger"></div>
</div> </div>
<div id="divbr">
</div>
<!-- <div class="form-group">-->
<!-- <label class="col-sm-2 control-label">附件:</label>-->
<!-- <div id="fine-uploader-manual-trigger"></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>
<div class="col-sm-2"> <div class="col-sm-2">
@ -288,7 +291,7 @@ var caseType = [[${caseType}]];
afterBlur: function(){this.sync();}, // 失去焦点时将上传内容同步到textarea中 afterBlur: function(){this.sync();}, // 失去焦点时将上传内容同步到textarea中
afterCreate: function(){ afterCreate: function(){
console.log("xxx") console.log("xxx")
console.log($( ".ke-dialog-content" )) console.log($( ".ke-dialog-content" ));
$( ".ke-dialog-simple" ).tooltip( "disable" ); $( ".ke-dialog-simple" ).tooltip( "disable" );
$( ".ke-dialog" ).tooltip( "disable" ); $( ".ke-dialog" ).tooltip( "disable" );
$( ".ke-dialog" ).tooltip({ $( ".ke-dialog" ).tooltip({
@ -401,10 +404,16 @@ var caseType = [[${caseType}]];
dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
if (data.ret==0) { if (data.ret==0) {
$('#listicon').parent().find('input[type="file"]').val(''); // 清空值 $.each(data.data,function (n,value) {
$('#listicon').val(data.data.url); console.log(value);
$("#img_listicon").attr('src', data.data.url); for(var i = 0; i < value.length;i++){
$('#img_listicon').show(); $('#listicon').parent().find('input[type="file"]').val(''); // 清空值
$('#listicon').val(value[i].url);
console.log(value[i].url);
$("#img_listicon").attr('src', value[i].url);
$('#img_listicon').show();
}
});
}else{ }else{
layer.msg(data.msg); layer.msg(data.msg);
} }
@ -422,19 +431,35 @@ var caseType = [[${caseType}]];
dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
if (data.ret==0) { if (data.ret==0) {
console.log(data.data) console.log(JSON.stringify(data.data.list));
$('#attachment').parent().find('input[type="file"]').val(''); // 清空值
$('#attachment').val(JSON.stringify(data.data.list));
$.each(data.data,function (n,value) { $.each(data.data,function (n,value) {
for(var i = 0 ; i < value.length;i++){ for(var i = 0 ; i < value.length;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').val(JSON.stringify(value[i])); // $('#attachment').parent().find('input[type="file"]').val(''); // 清空值
$(".a_viewfile").attr('href', value[i].url); //$('#attachment').val(JSON.stringify(value[i]));
$(".a_viewfile").text(ori_name);
$('.a_viewfile').show(); var obj = document.createElement("a");
var br = document.createElement("br");
var br2 = document.createElement("br");
obj.href = value[i].url;
obj.text = ori_name;
obj.title = "点击下载";
obj.style = "height: 34px; line-height: 34px; overflow:auto;";
var dfile = document.getElementById("dfile");
dfile.appendChild(obj);
dfile.appendChild(br);
document.getElementById("divbr").appendChild(br2);
document.getElementById("divbr").appendChild(br2);
// $(".a_viewfile").attr('href', value[i].url);
// $(".a_viewfile").text(ori_name);
// $('.a_viewfile').show();
} }
}); });
}else{ }else{
@ -444,64 +469,64 @@ var caseType = [[${caseType}]];
}); });
} }
$('#fine-uploader-manual-trigger').fineUploader({ // $('#fine-uploader-manual-trigger').fineUploader({
element: document.getElementById("fine-uploader-manual-trigger"), // element: document.getElementById("fine-uploader-manual-trigger"),
template: 'qq-template-manual-trigger', // template: 'qq-template-manual-trigger',
request: { // request: {
endpoint: '[[@{/console/tool/oss/uploadFile}]]?category=attachment&caseType=[[${caseType}]]', // endpoint: '[[@{/console/tool/oss/uploadFile}]]?category=attachment&caseType=[[${caseType}]]',
inputName:"file" // inputName:"file"
}, // },
thumbnails: { // thumbnails: {
placeholders: { // placeholders: {
waitingPath: '/cases/img/waiting-generic.png', // waitingPath: '/cases/img/waiting-generic.png',
notAvailablePath: '/cases/img/not_available-generic.png' // notAvailablePath: '/cases/img/not_available-generic.png'
} // }
}, // },
validation: { // validation: {
allowedExtensions: ['jpeg', 'jpg', 'txt'], // allowedExtensions: ['jpeg', 'jpg', 'txt'],
itemLimit: 5, // itemLimit: 5,
sizeLimit: 5242880 // 5mb // sizeLimit: 5242880 // 5mb
}, // },
autoUpload: false, // autoUpload: false,
callbacks: { // callbacks: {
onError: function (id, name, reason, maybeXhrOrXdr) { //上传失败 // onError: function (id, name, reason, maybeXhrOrXdr) { //上传失败
//
// },
// onComplete: function (id, fileName, responseJSON) {
// //上传完成后
// alert("上传成功");
// console.log("responseJSON ",responseJSON)
// if (responseJSON.ret === 0) {
// console.log(responseJSON.data)
// $.each(responseJSON.data,function (n,value) {
// for(var i = 0 ; i < value.length;i++){
// filelist.push(value[i]);
// var ori_name = value[i].ori_name;
// console.log(ori_name)
// 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);
//
// $('#attachment').parent().find('input[type="file"]').val(''); // 清空值
// $(".a_viewfile").attr('href', value[i].url);
// $(".a_viewfile").text(ori_name);
// $('.a_viewfile').show();
// }
// });
// $('#attachment').val(JSON.stringify(filelist));
// console.log(filelist)
// console.log($("#attachment").val())
// }
// }
// },
// });
}, // $('#trigger-upload').click(function() {
onComplete: function (id, fileName, responseJSON) { // $('#fine-uploader-manual-trigger').fineUploader('uploadStoredFiles');
//上传完成后 // });
alert("上传成功"); //
console.log("responseJSON ",responseJSON) // $("#upload-button").click(function (){
if (responseJSON.ret === 0) { // $(".ui-tooltip").remove()
console.log(responseJSON.data) // });
$.each(responseJSON.data,function (n,value) {
for(var i = 0 ; i < value.length;i++){
filelist.push(value[i]);
var ori_name = value[i].ori_name;
console.log(ori_name)
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);
$('#attachment').parent().find('input[type="file"]').val(''); // 清空值
$(".a_viewfile").attr('href', value[i].url);
$(".a_viewfile").text(ori_name);
$('.a_viewfile').show();
}
});
$('#attachment').val(JSON.stringify(filelist));
console.log(filelist)
console.log($("#attachment").val())
}
}
},
});
$('#trigger-upload').click(function() {
$('#fine-uploader-manual-trigger').fineUploader('uploadStoredFiles');
});
$("#upload-button").click(function (){
$(".ui-tooltip").remove()
});
// 上传视频 // 上传视频
function uploadVideoFile(obj) { function uploadVideoFile(obj) {
@ -570,58 +595,122 @@ var caseType = [[${caseType}]];
}); });
} }
function attachment() {
var attachment = '[[${attachment}]]';
console.log(attachment);
if(attachment != null && attachment != undefined){
attachment=attachment.replace(new RegExp('&quot;','g'),'"').replace(/^\"|\"$/g,'');
console.log(attachment);
console.log(attachment.length)
if(attachment!=null && $.trim(attachment)!=''){
//var jsondata = JSON.parse(attachment);
console.log(attachment);
// $('#attachment').parent().find('input[type="file"]').val(''); // 清空值
// $('#attachment').val(attachment);
// $(".a_viewfile").attr('href', jsondata.url);
// $(".a_viewfile").text(jsondata.ori_name);
// $('.a_viewfile').show();
var atta = eval('(' + attachment + ')');
console.log(atta);
$('#attachment').parent().find('input[type="file"]').val(''); // 清空值
$('#attachment').val(attachment);
for(var i in atta){
var ori_name = atta[i].ori_name;
console.log(ori_name);
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);
//$('#attachment').parent().find('input[type="file"]').val(''); // 清空值
//$('#attachment').val(JSON.stringify(atta[i]));
var obj = document.createElement("a");
var br = document.createElement("br");
var br2 = document.createElement("br");
obj.href = atta[i].url;
obj.text = ori_name;
obj.title = "点击下载";
obj.style = "height: 34px; line-height: 34px; overflow:auto;";
var dfile = document.getElementById("dfile");
dfile.appendChild(obj);
var del = document.createElement("span");
del.id = "span"+i;
del.className = "span22";
del.style = "cursor:pointer;color:#3c8dbc";
del.innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x";
dfile.appendChild(del);
dfile.appendChild(br);
var divbr = document.getElementById("divbr");
divbr.appendChild(br2);
divbr.appendChild(br2);
// $(".a_viewfile").attr('href', value[i].url);
// $(".a_viewfile").text(ori_name);
// $('.a_viewfile').show();
}
}
}
}
function initLoad(){ function initLoad(){
// 加载附件内容 // 加载附件内容
if($('#dataid').val() > 0){ // if($('#dataid').val() > 0){
var attachment = '[[${attachment}]]'; // var attachment = '[[${attachment}]]';
console.log(attachment) // console.log(attachment)
if(attachment != null && attachment != undefined){ // if(attachment != null && attachment != undefined){
attachment=attachment.replace(new RegExp('&quot;','g'),'"'); // attachment=attachment.replace(new RegExp('&quot;','g'),'"');
attachment = attachment.substring(1,attachment.length); // attachment = attachment.substring(1,attachment.length);
attachment = attachment.substring(0,attachment.length-1); // attachment = attachment.substring(0,attachment.length-1);
attachment = "["+attachment+"]"; // attachment = "["+attachment+"]";
console.log(attachment) // console.log(attachment)
if(attachment!=null && $.trim(attachment)!=''){ // if(attachment!=null && $.trim(attachment)!=''){
var jsondata = JSON.parse(attachment); // var jsondata = JSON.parse(attachment);
console.log(jsondata) // console.log(jsondata)
$.each(jsondata, function (i, value) { // $.each(jsondata, function (i, value) {
var liNode=document.createElement("li"); // var liNode=document.createElement("li");
liNode.setAttribute("class","qq-file-id-" + i+5 + " qq-file-id=" + i+5 + ""); // liNode.setAttribute("class","qq-file-id-" + i+5 + " qq-file-id=" + i+5 + "");
liNode.innerHTML = // liNode.innerHTML =
" <div class=\"qq-progress-bar-container-selector qq-hide\">\n" + // " <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 role=\"progressbar\" aria-valuenow=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" class=\"qq-progress-bar-selector qq-progress-bar\"></div>\n" +
" </div>\n" + // " </div>\n" +
" <span class=\"qq-upload-spinner-selector qq-upload-spinner qq-hide\"></span>\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" + // " <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" + // "<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" + // " <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" + // " <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" + // " <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" + // " <input type=\"hidden\" id=\"attachment" + i + "\" name=\"attachment\" value='' style=\"display: none;\">\n" +
" <div style=\"height: 20px; line-height: 20px;\">\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" + // " <a class=\"a_viewfile" + i + "\" href=\"javascript:;\" target=\"_blank\" title=\"点击下载\" style=\"height: 34px; line-height: 34px;\"></a>\n" +
" </div>\n" ; // " </div>\n" ;
//$(".qq-upload-list-selector qq-upload-list").appendChild(liNode); // //$(".qq-upload-list-selector qq-upload-list").appendChild(liNode);
document.getElementById("ul").appendChild(liNode); // document.getElementById("ul").appendChild(liNode);
$("#attachment"+i+"").parent().find('input[type="file"]').val(''); // 清空值 // $("#attachment"+i+"").parent().find('input[type="file"]').val(''); // 清空值
$("#attachment"+i+"").val(JSON.stringify(value)); // $("#attachment"+i+"").val(JSON.stringify(value));
$(".a_viewfile"+i+"").attr('href', value.url); // $(".a_viewfile"+i+"").attr('href', value.url);
$(".a_viewfile"+i+"").text(value.ori_name); // $(".a_viewfile"+i+"").text(value.ori_name);
$('.a_viewfile'+i+"").show(); // $('.a_viewfile'+i+"").show();
}); // });
} // }
} // }
$("#deleteFile2").on("click",function (){ // $("#deleteFile2").on("click",function (){
var value = "qq-file-id-" +$(this).attr("name"); // var value = "qq-file-id-" +$(this).attr("name");
var msg = "确定删除该文件?"; // var msg = "确定删除该文件?";
Core.confirm(msg, function () { // Core.confirm(msg, function () {
alert(value) // alert(value)
$("."+value+"").remove(); // $("."+value+"").remove();
$("#attachment"+i+"").val(""); // $("#attachment"+i+"").val("");
}); // });
}); // });
} // }
if($('#dataid').val() > 0){
attachment();
}
// 加载标签插件数据 // 加载标签插件数据
@ -695,7 +784,7 @@ var caseType = [[${caseType}]];
$('.selectpicker').selectpicker('render'); $('.selectpicker').selectpicker('render');
} }
} }
},100) },100);
// 加载图集的table // 加载图集的table
@ -708,7 +797,6 @@ var caseType = [[${caseType}]];
initKEdit('#desct'); // 初始化编辑器 initKEdit('#desct'); // 初始化编辑器
getDropDownBox(); getDropDownBox();
if($("#result").val() > 0){ if($("#result").val() > 0){
$("#btn_save").hide(); $("#btn_save").hide();
} }
@ -727,6 +815,21 @@ var caseType = [[${caseType}]];
} }
}); });
//附件删除
$(".span22").click(function () {
var attachment = $("#attachment").val();
attachment = eval('(' + attachment + ')');
for(var i in attachment){
if(attachment[i].url == this.previousSibling){
attachment.splice(i,1);
$("#attachment").val(JSON.stringify(attachment));
}
}
this.previousSibling.parentNode.removeChild(this.previousSibling);
this.parentNode.removeChild(this);
});
// 选择图片自动上传 // 选择图片自动上传
$("#newsForm").on("change","#listicon_file",function(){ $("#newsForm").on("change","#listicon_file",function(){
uploadIconFile(this.files); uploadIconFile(this.files);

View File

@ -0,0 +1,3 @@
/aaaa=com.nbclass.util.UserListServlet
/bbbb=com.nbclass.util.UserLoginServlet
/cccc=com.nbclass.util.BankServlet