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

View File

@ -6,6 +6,8 @@ import java.util.Arrays;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.nbclass.activity.model.OssFile;
import org.apache.commons.lang3.StringUtils;
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)
client:
reactive:
endpoints: 39.108.110.167:9200
# endpoints: 39.108.110.167:9200
endpoints: 127.0.0.1:9200
connection-timeout: 5000
socket-timeout: 5000

View File

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

View File

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

View File

@ -1,73 +1,73 @@
<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">
<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 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 class="qq-upload-drop-area-selector qq-upload-drop-area" qq-hide-dropzone>
<span class="qq-upload-drop-area-text-selector"></span>
</div>
<div id="upload-button" class="buttons">
<div class="qq-upload-button-selector qq-upload-button">
<div>选择文件</div>
</div>
<button type="button" id="trigger-upload" class="btn btn-primary">
<i class="icon-upload icon-white"></i> 上传
</button>
</div>
<span class="qq-drop-processing-selector qq-drop-processing">
<span>Processing dropped files...</span>
<span class="qq-drop-processing-spinner-selector qq-drop-processing-spinner"></span>
</span>
<ul id="ul" class="qq-upload-list-selector qq-upload-list" aria-live="polite" aria-relevant="additions removals">
<li>
<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>
<span class="qq-upload-spinner-selector qq-upload-spinner"></span>
<!--- <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-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">
<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-retry-selector qq-upload-retry">重试</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>
<input type="hidden" id="attachment" name="attachment" th:value="${attachment}" style="display: none;">
<div style="height: 20px; line-height: 20px;">
<a class="a_viewfile" href="javascript:;" target="_blank" title="点击下载" style="height: 34px; line-height: 34px;"></a>
</div>
</li>
</ul>
<!--<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-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>-->
<!-- <div class="qq-upload-drop-area-selector qq-upload-drop-area" qq-hide-dropzone>-->
<!-- <span class="qq-upload-drop-area-text-selector"></span>-->
<!-- </div>-->
<!-- <div id="upload-button" class="buttons">-->
<!-- <div class="qq-upload-button-selector qq-upload-button">-->
<!-- <div>选择文件</div>-->
<!-- </div>-->
<!-- <button type="button" id="trigger-upload" class="btn btn-primary">-->
<!-- <i class="icon-upload icon-white"></i> 上传-->
<!-- </button>-->
<!-- </div>-->
<!-- <span class="qq-drop-processing-selector qq-drop-processing">-->
<!-- <span>Processing dropped files...</span>-->
<!-- <span class="qq-drop-processing-spinner-selector qq-drop-processing-spinner"></span>-->
<!-- </span>-->
<!-- <ul id="ul" class="qq-upload-list-selector qq-upload-list" aria-live="polite" aria-relevant="additions removals">-->
<!-- <li>-->
<!-- <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>-->
<!-- <span class="qq-upload-spinner-selector qq-upload-spinner"></span>-->
<!-- &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-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">-->
<!-- <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-retry-selector qq-upload-retry">重试</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>-->
<!-- <input type="hidden" id="attachment" name="attachment" th:value="${attachment}" style="display: none;">-->
<!-- <div style="height: 20px; line-height: 20px;">-->
<!-- <a class="a_viewfile" href="javascript:;" target="_blank" title="点击下载" style="height: 34px; line-height: 34px;"></a>-->
<!-- </div>-->
<!-- </li>-->
<!-- </ul>-->
<dialog class="qq-alert-dialog-selector">
<div class="qq-dialog-message-selector"></div>
<div class="qq-dialog-buttons">
<button type="button" class="qq-cancel-button-selector">关闭</button>
</div>
</dialog>
<!-- <dialog class="qq-alert-dialog-selector">-->
<!-- <div class="qq-dialog-message-selector"></div>-->
<!-- <div class="qq-dialog-buttons">-->
<!-- <button type="button" class="qq-cancel-button-selector">关闭</button>-->
<!-- </div>-->
<!-- </dialog>-->
<dialog class="qq-confirm-dialog-selector">
<div class="qq-dialog-message-selector"></div>
<div class="qq-dialog-buttons">
<button type="button" class="qq-cancel-button-selector">No</button>
<button type="button" class="qq-ok-button-selector">Yes</button>
</div>
</dialog>
<!-- <dialog class="qq-confirm-dialog-selector">-->
<!-- <div class="qq-dialog-message-selector"></div>-->
<!-- <div class="qq-dialog-buttons">-->
<!-- <button type="button" class="qq-cancel-button-selector">No</button>-->
<!-- <button type="button" class="qq-ok-button-selector">Yes</button>-->
<!-- </div>-->
<!-- </dialog>-->
<dialog class="qq-prompt-dialog-selector">
<div class="qq-dialog-message-selector"></div>
<input type="text">
<div class="qq-dialog-buttons">
<button type="button" class="qq-cancel-button-selector">Cancel</button>
<button type="button" class="qq-ok-button-selector">Ok</button>
</div>
</dialog>
</div>
</script>
<!-- <dialog class="qq-prompt-dialog-selector">-->
<!-- <div class="qq-dialog-message-selector"></div>-->
<!-- <input type="text">-->
<!-- <div class="qq-dialog-buttons">-->
<!-- <button type="button" class="qq-cancel-button-selector">Cancel</button>-->
<!-- <button type="button" class="qq-ok-button-selector">Ok</button>-->
<!-- </div>-->
<!-- </dialog>-->
<!-- </div>-->
<!--</script>-->
<style>
@ -194,22 +194,25 @@
</div>
</div>
<!--<div class="form-group">
<div class="form-group">
<label class="col-sm-2 control-label">附件:</label>
<div class="col-sm-2">
<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="hidden" id="attachment" name="attachment" th:value="${attachment}" style="display: none;">
<div style="height: 20px; line-height: 20px;">
<a class="a_viewfile" href="javascript:;" target="_blank" title="点击下载" style="height: 34px; line-height: 34px;"></a>
<div id="dfile" style="height: 20px; line-height: 20px;">
<!-- <a class="a_viewfile" href="javascript:void(0);" target="_blank" title="点击下载" style="height: 34px; line-height: 34px;"></a>-->
</div>
</div>
</div>-->
<div class="form-group">
<label class="col-sm-2 control-label">附件:</label>
<div id="fine-uploader-manual-trigger"></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">
<label class="col-sm-2 control-label"><font color="red">*</font> 封面图:</label>
<div class="col-sm-2">
@ -288,7 +291,7 @@ var caseType = [[${caseType}]];
afterBlur: function(){this.sync();}, // 失去焦点时将上传内容同步到textarea中
afterCreate: function(){
console.log("xxx")
console.log($( ".ke-dialog-content" ))
console.log($( ".ke-dialog-content" ));
$( ".ke-dialog-simple" ).tooltip( "disable" );
$( ".ke-dialog" ).tooltip( "disable" );
$( ".ke-dialog" ).tooltip({
@ -401,10 +404,16 @@ var caseType = [[${caseType}]];
dataType: "json",
success: function (data) {
if (data.ret==0) {
$.each(data.data,function (n,value) {
console.log(value);
for(var i = 0; i < value.length;i++){
$('#listicon').parent().find('input[type="file"]').val(''); // 清空值
$('#listicon').val(data.data.url);
$("#img_listicon").attr('src', data.data.url);
$('#listicon').val(value[i].url);
console.log(value[i].url);
$("#img_listicon").attr('src', value[i].url);
$('#img_listicon').show();
}
});
}else{
layer.msg(data.msg);
}
@ -422,19 +431,35 @@ var caseType = [[${caseType}]];
dataType: "json",
success: function (data) {
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) {
for(var i = 0 ; i < value.length;i++){
var ori_name = value[i].ori_name;
console.log(ori_name)
console.log(ori_name.length)
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(value[i]));
$(".a_viewfile").attr('href', value[i].url);
$(".a_viewfile").text(ori_name);
$('.a_viewfile').show();
// $('#attachment').parent().find('input[type="file"]').val(''); // 清空值
//$('#attachment').val(JSON.stringify(value[i]));
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{
@ -444,64 +469,64 @@ var caseType = [[${caseType}]];
});
}
$('#fine-uploader-manual-trigger').fineUploader({
element: document.getElementById("fine-uploader-manual-trigger"),
template: 'qq-template-manual-trigger',
request: {
endpoint: '[[@{/console/tool/oss/uploadFile}]]?category=attachment&caseType=[[${caseType}]]',
inputName:"file"
},
thumbnails: {
placeholders: {
waitingPath: '/cases/img/waiting-generic.png',
notAvailablePath: '/cases/img/not_available-generic.png'
}
},
validation: {
allowedExtensions: ['jpeg', 'jpg', 'txt'],
itemLimit: 5,
sizeLimit: 5242880 // 5mb
},
autoUpload: false,
callbacks: {
onError: function (id, name, reason, maybeXhrOrXdr) { //上传失败
// $('#fine-uploader-manual-trigger').fineUploader({
// element: document.getElementById("fine-uploader-manual-trigger"),
// template: 'qq-template-manual-trigger',
// request: {
// endpoint: '[[@{/console/tool/oss/uploadFile}]]?category=attachment&caseType=[[${caseType}]]',
// inputName:"file"
// },
// thumbnails: {
// placeholders: {
// waitingPath: '/cases/img/waiting-generic.png',
// notAvailablePath: '/cases/img/not_available-generic.png'
// }
// },
// validation: {
// allowedExtensions: ['jpeg', 'jpg', 'txt'],
// itemLimit: 5,
// sizeLimit: 5242880 // 5mb
// },
// autoUpload: false,
// callbacks: {
// 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())
// }
// }
// },
// });
},
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() {
$('#fine-uploader-manual-trigger').fineUploader('uploadStoredFiles');
});
$("#upload-button").click(function (){
$(".ui-tooltip").remove()
});
// $('#trigger-upload').click(function() {
// $('#fine-uploader-manual-trigger').fineUploader('uploadStoredFiles');
// });
//
// $("#upload-button").click(function (){
// $(".ui-tooltip").remove()
// });
// 上传视频
function uploadVideoFile(obj) {
@ -570,57 +595,121 @@ 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(){
// 加载附件内容
// if($('#dataid').val() > 0){
// var attachment = '[[${attachment}]]';
// console.log(attachment)
// if(attachment != null && attachment != undefined){
// attachment=attachment.replace(new RegExp('&quot;','g'),'"');
// attachment = attachment.substring(1,attachment.length);
// attachment = attachment.substring(0,attachment.length-1);
// attachment = "["+attachment+"]";
// console.log(attachment)
// if(attachment!=null && $.trim(attachment)!=''){
// var jsondata = JSON.parse(attachment);
// console.log(jsondata)
// $.each(jsondata, function (i, value) {
// var liNode=document.createElement("li");
// liNode.setAttribute("class","qq-file-id-" + i+5 + " qq-file-id=" + i+5 + "");
// 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){
var attachment = '[[${attachment}]]';
console.log(attachment)
if(attachment != null && attachment != undefined){
attachment=attachment.replace(new RegExp('&quot;','g'),'"');
attachment = attachment.substring(1,attachment.length);
attachment = attachment.substring(0,attachment.length-1);
attachment = "["+attachment+"]";
console.log(attachment)
if(attachment!=null && $.trim(attachment)!=''){
var jsondata = JSON.parse(attachment);
console.log(jsondata)
$.each(jsondata, function (i, value) {
var liNode=document.createElement("li");
liNode.setAttribute("class","qq-file-id-" + i+5 + " qq-file-id=" + i+5 + "");
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("");
});
});
attachment();
}
@ -695,7 +784,7 @@ var caseType = [[${caseType}]];
$('.selectpicker').selectpicker('render');
}
}
},100)
},100);
// 加载图集的table
@ -708,7 +797,6 @@ var caseType = [[${caseType}]];
initKEdit('#desct'); // 初始化编辑器
getDropDownBox();
if($("#result").val() > 0){
$("#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(){
uploadIconFile(this.files);

View File

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