From 85e1feb42045e13314d2c45f7718d04b56c27f51 Mon Sep 17 00:00:00 2001 From: duxp Date: Wed, 20 Sep 2023 11:21:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/base/affairs/affairs.html | 42 ++-- .../resources/templates/base/affairs/day.html | 42 ++-- .../templates/base/affairs/partystyle.html | 42 ++-- .../templates/base/affairs/viewFiles.html | 196 +++++++++++++++--- .../templates/base/affairs/warn.html | 79 +++---- .../templates/base/affairs/year.html | 42 ++-- 6 files changed, 254 insertions(+), 189 deletions(-) diff --git a/cyx-admin/src/main/resources/templates/base/affairs/affairs.html b/cyx-admin/src/main/resources/templates/base/affairs/affairs.html index 64faa86..2520f16 100644 --- a/cyx-admin/src/main/resources/templates/base/affairs/affairs.html +++ b/cyx-admin/src/main/resources/templates/base/affairs/affairs.html @@ -230,58 +230,42 @@ formatter: function(value, row, index) { var actions = []; if (row.status === '1'){ - actions.push('上传附件 '); + actions.push('上传附件 '); }else if (row.status === '2'){ actions.push('待审核 '); + actions.push('上传附件 '); }else if(row.status === '3'){ actions.push('已驳回 '); - actions.push('重新上传附件 '); + actions.push('重新上传附件 '); }else if (row.status === '4'){ actions.push('已完成 '); } - if (row.files && row.status !=='3'){ - actions.push('查看附件 '); - } - // actions.push('查看详情 '); return actions.join(''); } }] }; $.table.init(options); - $("#bootstrap-table").on('click',".openUpload",function () { + $("#bootstrap-table").on("click",".viewFiles912",function () { let _id = $(this)[0].dataset.id; let header = $(this)[0].dataset.header; let deptName = $(this)[0].dataset.deptname; let shotName = $(this)[0].dataset.shotname; - layer.open({ - title:'上传附件', - area:['80%','80%'], - type:2, - content:'/base/affairs/upload', - success(res,index){ - //传值 - parent.a_upload_id = _id; - parent.a_header = header; - parent.a_deptName = deptName; - parent.a_shotName = shotName; - parent.a_upload_index = index; - parent.a_upload_type = "1"; - }, - end(){ - $.table.search() - } - }) - }) - $("#bootstrap-table").on("click",".viewFiles912",function () { let _files = $(this)[0].dataset.files; layer.open({ - title:'查看附件', + title:'上传附件', area:['80%','90%'], type:2, content:'/base/affairs/viewFiles', success(res,index){ + parent.a_upload_obj = { + id:_id, + header:header, + deptName:deptName, + shotName:shotName, + files:_files, + url:'/base/affairs/commit' + } parent.a_upload_index = index; - parent.a_upload_files = _files; }, end(){ $.table.search() diff --git a/cyx-admin/src/main/resources/templates/base/affairs/day.html b/cyx-admin/src/main/resources/templates/base/affairs/day.html index 5a5564c..9c58e3c 100644 --- a/cyx-admin/src/main/resources/templates/base/affairs/day.html +++ b/cyx-admin/src/main/resources/templates/base/affairs/day.html @@ -255,52 +255,42 @@ formatter: function(value, row, index) { var actions = []; if (row.status === '1'){ - actions.push('上传附件 '); + actions.push('上传附件 '); }else if (row.status === '2'){ actions.push('待审核 '); + actions.push('上传附件 '); }else if(row.status === '3'){ actions.push('已驳回 '); - actions.push('重新上传附件 '); + actions.push('重新上传附件 '); }else if (row.status === '4'){ actions.push('已完成 '); } - if (row.files && row.status !=='3'){ - actions.push('查看附件 '); - } - // actions.push('查看详情 '); return actions.join(''); } }] }; $.table.init(options); - $("#bootstrap-table").on('click','.openUpload',function () { - let _id = $(this)[0].dataset.id; - layer.open({ - title:'上传附件', - area:['80%','80%'], - type:2, - content:'/base/affairs/upload', - success(res,index){ - //传值 - parent.a_upload_id = _id; - parent.a_upload_index = index; - parent.a_upload_type = "1"; - }, - end(){ - $.table.search() - } - }) - }); $("#bootstrap-table").on("click",".viewFiles912",function () { + let _id = $(this)[0].dataset.id; + let header = $(this)[0].dataset.header; + let deptName = $(this)[0].dataset.deptname; + let shotName = $(this)[0].dataset.shotname; let _files = $(this)[0].dataset.files; layer.open({ - title:'查看附件', + title:'上传附件', area:['80%','90%'], type:2, content:'/base/affairs/viewFiles', success(res,index){ + parent.a_upload_obj = { + id:_id, + header:header, + deptName:deptName, + shotName:shotName, + files:_files, + url:'/base/affairs/commit' + } parent.a_upload_index = index; - parent.a_upload_files = _files; }, end(){ $.table.search() diff --git a/cyx-admin/src/main/resources/templates/base/affairs/partystyle.html b/cyx-admin/src/main/resources/templates/base/affairs/partystyle.html index d8805ee..0bc1605 100644 --- a/cyx-admin/src/main/resources/templates/base/affairs/partystyle.html +++ b/cyx-admin/src/main/resources/templates/base/affairs/partystyle.html @@ -224,52 +224,42 @@ formatter: function(value, row, index) { var actions = []; if (row.status === '1'){ - actions.push('上传附件 '); + actions.push('上传附件 '); }else if (row.status === '2'){ actions.push('待审核 '); + actions.push('上传附件 '); }else if(row.status === '3'){ actions.push('已驳回 '); - actions.push('重新上传附件 '); + actions.push('重新上传附件 '); }else if (row.status === '4'){ actions.push('已完成 '); } - if (row.files && row.status !=='3'){ - actions.push('查看附件 '); - } - // actions.push('查看详情 '); return actions.join(''); } }] }; $.table.init(options); - $("#bootstrap-table").on('click','.openUpload',function () { - let _id = $(this)[0].dataset.id; - layer.open({ - title:'上传附件', - area:['80%','80%'], - type:2, - content:'/base/affairs/upload', - success(res,index){ - //传值 - parent.a_upload_id = _id; - parent.a_upload_index = index; - parent.a_upload_type = "1"; - }, - end(){ - $.table.search() - } - }) - }); $("#bootstrap-table").on("click",".viewFiles912",function () { + let _id = $(this)[0].dataset.id; + let header = $(this)[0].dataset.header; + let deptName = $(this)[0].dataset.deptname; + let shotName = $(this)[0].dataset.shotname; let _files = $(this)[0].dataset.files; layer.open({ - title:'查看附件', + title:'上传附件', area:['80%','90%'], type:2, content:'/base/affairs/viewFiles', success(res,index){ + parent.a_upload_obj = { + id:_id, + header:header, + deptName:deptName, + shotName:shotName, + files:_files, + url:'/base/affairs/commit' + } parent.a_upload_index = index; - parent.a_upload_files = _files; }, end(){ $.table.search() diff --git a/cyx-admin/src/main/resources/templates/base/affairs/viewFiles.html b/cyx-admin/src/main/resources/templates/base/affairs/viewFiles.html index 25ff0ac..665cdf8 100644 --- a/cyx-admin/src/main/resources/templates/base/affairs/viewFiles.html +++ b/cyx-admin/src/main/resources/templates/base/affairs/viewFiles.html @@ -6,22 +6,15 @@ .pre_view{ width: 100%; height: 100%; + box-sizing: border-box; + padding: 10px; position: relative; } - .pdf_pre_view{ - position: absolute; - width: 100%; - height: 100%; - background-color: rgba(61, 61, 61, 0.47); - top: 0; - left: 0; - display: none; - } .pre_view_list{ width: 100%; - height: 100%; - box-sizing: border-box; - padding: 10px; + height: 80vh; + overflow-y: auto; + margin-top: 10px; border:1px solid #e3e3e3; border-radius: 8px; display: flex; @@ -56,35 +49,86 @@ display: flex; justify-content: center; } + .upload_input{ + margin-bottom: 10px; + } + .err_tips{ + font-size: 14px; + color: #e32525; + } + .no_data{ + margin-top: 4%; + width: 100%; + font-size: 16px; + color: #5d5d5d; + text-align: center; + }
+
+
+ +
+ +
+
+ 保存 +
diff --git a/cyx-admin/src/main/resources/templates/base/affairs/warn.html b/cyx-admin/src/main/resources/templates/base/affairs/warn.html index 990cb95..4dccb88 100644 --- a/cyx-admin/src/main/resources/templates/base/affairs/warn.html +++ b/cyx-admin/src/main/resources/templates/base/affairs/warn.html @@ -171,16 +171,12 @@ formatter: function(value, row, index) { var actions = []; if (row.status === '1'){ - actions.push('上传附件 '); + actions.push('上传附件 '); }else if (row.status === '2'){ actions.push('审批 '); }else if (row.status === '3'){ actions.push('已驳回 '); - actions.push('重新上传附件 '); - } - if (row.files && row.status !=='3'){ - actions.push('查看图片 '); - actions.push('下载附件 '); + actions.push('重新上传附件 '); } return actions.join(''); } @@ -225,54 +221,33 @@ } }) }) - - $("#bootstrap-table").on("click",".viewFiles0828",function () { - let _files = $(this)[0].dataset.files.split(','); - let _type = $(this)[0].dataset.type; - let _dataImg = []; - let _downData = []; - _files.forEach((item,index) => { - if(item.indexOf(".jpg")>-1 || item.indexOf(".png")>-1){ - _dataImg.push({ - "alt": "", - "pid": index, //图片id - "src": window.location.origin+item, //原图地址 - "thumb": window.location.origin+item //缩略图地址 - }) - }else if(item.indexOf(".docx")> -1 || item.indexOf(".doc") > -1 || item.indexOf(".xlsx") > -1 || item.indexOf(".xls") > -1 || item.indexOf(".pdf") > -1){ - _downData.push(item); + $("#bootstrap-table").on("click",".viewFiles912",function () { + let _id = $(this)[0].dataset.id; + let header = $(this)[0].dataset.header; + let deptName = $(this)[0].dataset.deptname; + let shotName = $(this)[0].dataset.shotname; + let _files = $(this)[0].dataset.files; + layer.open({ + title:'上传附件', + area:['80%','90%'], + type:2, + content:'/base/affairs/viewFiles', + success(res,index){ + parent.a_upload_obj = { + id:_id, + header:header, + deptName:deptName, + shotName:shotName, + files:_files, + url:'/base/affairs/commit' + } + parent.a_upload_index = index; + }, + end(){ + $.table.search() } }) - if(_type === '1'){ //查看图片 - let json = { - "title": "查看图片", //相册标题 - "id": 123, //相册id - "start": 0, //初始显示的图片序号,默认0 - "data": _dataImg - }; - layer.photos({ - photos: json, - closeBtn: 0, //右上角按钮,可通过配置1和2来展示,如果不显示,则closeBtn: 0 - anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数) - }); - }else{ //下载附件 - if(_downData.length === 0){ - $.modal.msgError('暂无文件!') - return false; - } - _downData.forEach(item => { - let _lastNum = item.lastIndexOf('/')+1; - let _title = item.substr(_lastNum,item.length-1); - const a = document.createElement('a'); - a.style.display = 'none'; - a.download = _title; - a.href = window.location.origin+item; - document.body.appendChild(a); - a.click(); - document.body.removeChild(a); - }) - } - }); + }) }); diff --git a/cyx-admin/src/main/resources/templates/base/affairs/year.html b/cyx-admin/src/main/resources/templates/base/affairs/year.html index f88b9b0..3b4891c 100644 --- a/cyx-admin/src/main/resources/templates/base/affairs/year.html +++ b/cyx-admin/src/main/resources/templates/base/affairs/year.html @@ -249,52 +249,42 @@ formatter: function(value, row, index) { var actions = []; if (row.status === '1'){ - actions.push('上传附件 '); + actions.push('上传附件 '); }else if (row.status === '2'){ actions.push('待审核 '); + actions.push('上传附件 '); }else if(row.status === '3'){ actions.push('已驳回 '); - actions.push('重新上传附件 '); + actions.push('重新上传附件 '); }else if (row.status === '4'){ actions.push('已完成 '); } - if (row.files && row.status !=='3'){ - actions.push('查看附件 '); - } - // actions.push('查看详情 '); return actions.join(''); } }] }; $.table.init(options); - $("#bootstrap-table").on('click','.openUpload',function () { - let _id = $(this)[0].dataset.id; - layer.open({ - title:'上传附件', - area:['80%','80%'], - type:2, - content:'/base/affairs/upload', - success(res,index){ - //传值 - parent.a_upload_id = _id; - parent.a_upload_index = index; - parent.a_upload_type = "1"; - }, - end(){ - $.table.search() - } - }) - }); $("#bootstrap-table").on("click",".viewFiles912",function () { + let _id = $(this)[0].dataset.id; + let header = $(this)[0].dataset.header; + let deptName = $(this)[0].dataset.deptname; + let shotName = $(this)[0].dataset.shotname; let _files = $(this)[0].dataset.files; layer.open({ - title:'查看附件', + title:'上传附件', area:['80%','90%'], type:2, content:'/base/affairs/viewFiles', success(res,index){ + parent.a_upload_obj = { + id:_id, + header:header, + deptName:deptName, + shotName:shotName, + files:_files, + url:'/base/affairs/commit' + } parent.a_upload_index = index; - parent.a_upload_files = _files; }, end(){ $.table.search()