From 3d0b1dcf44fa27dfacb6921e4ca901df8c15a685 Mon Sep 17 00:00:00 2001 From: LiuY <1622779752@qq.com> Date: Tue, 20 Feb 2024 17:03:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/route/indexWebController.java | 1 + .../pojo/dtos/dutylistform/HeartTalkDTO.java | 10 +++ .../dutylistform/dutylistform-mapper.xml | 10 ++- .../route/hearttalk/audit-heart-talk.html | 80 +++++++++++++++++- .../route/hearttalk/edit-heart-talk.html | 82 ++++++++++++++++++ .../route/hearttalk/print-heart-talk.html | 30 ++++++- .../route/hearttalk/save-heart-talk.html | 84 +++++++++++++++++++ .../route/hearttalk/show-heart-talk.html | 73 ++++++++++++++++ 8 files changed, 361 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/tenlion/twoduty/controller/route/indexWebController.java b/src/main/java/com/tenlion/twoduty/controller/route/indexWebController.java index e42ffbb..f496aa1 100644 --- a/src/main/java/com/tenlion/twoduty/controller/route/indexWebController.java +++ b/src/main/java/com/tenlion/twoduty/controller/route/indexWebController.java @@ -69,6 +69,7 @@ public class indexWebController extends DefaultBaseController { for (RoleSimpleDTO role : roles) { if(ROLE_CODE_1.equals(role.getRoleCode())){ mv.setViewName("default-home"); + //mv.setViewName("count_role_1"); break; } diff --git a/src/main/java/com/tenlion/twoduty/pojo/dtos/dutylistform/HeartTalkDTO.java b/src/main/java/com/tenlion/twoduty/pojo/dtos/dutylistform/HeartTalkDTO.java index 5f008c0..0bf882f 100644 --- a/src/main/java/com/tenlion/twoduty/pojo/dtos/dutylistform/HeartTalkDTO.java +++ b/src/main/java/com/tenlion/twoduty/pojo/dtos/dutylistform/HeartTalkDTO.java @@ -77,6 +77,8 @@ public class HeartTalkDTO { private String talkDateTime2; @ApiModelProperty(name = "talkPlace2", value = "谈话地点二") private String talkPlace2; + @ApiModelProperty(name = "talkPhotos", value = "谈话图片附件") + private String talkPhotos; public String getDutyIndexLibName() { @@ -319,4 +321,12 @@ public class HeartTalkDTO { public void setTalkPlace2(String talkPlace2) { this.talkPlace2 = talkPlace2; } + + public String getTalkPhotos() { + return talkPhotos; + } + + public void setTalkPhotos(String talkPhotos) { + this.talkPhotos = talkPhotos; + } } diff --git a/src/main/resources/mybatis/mapper/dutylistform/dutylistform-mapper.xml b/src/main/resources/mybatis/mapper/dutylistform/dutylistform-mapper.xml index 39238ff..b9039cb 100644 --- a/src/main/resources/mybatis/mapper/dutylistform/dutylistform-mapper.xml +++ b/src/main/resources/mybatis/mapper/dutylistform/dutylistform-mapper.xml @@ -191,6 +191,7 @@ + @@ -269,12 +270,12 @@ report_id,duty_index_lib_id,duty_title,org_name,talk_obj,political_status,org_job,talk_reason, talk_person,talk_person_org_job,note_taker,talk_date_time,talk_place,talk_content, talk_obj_opinion,talk_obj_sign,sign_data_time,audit_status,creator,gmt_create,modifier,gmt_modified,is_delete,talk_type, - talk_person_2,talk_person_org_Job_2,talk_date_time_2,talk_place_2 + talk_person_2,talk_person_org_Job_2,talk_date_time_2,talk_place_2,talk_photos ) VALUES ( #{reportId},#{dutyIndexLibId},#{dutyTitle},#{orgName},#{talkObj},#{politicalStatus},#{orgJob},#{talkReason}, #{talkPerson},#{talkPersonOrgJob},#{noteTaker},#{talkDateTime},#{talkPlace},#{talkContent}, #{talkObjOpinion},#{talkObjSign},#{signDataTime},#{auditStatus},#{creator},#{gmtCreate},#{modifier},#{gmtModified},#{isDelete},#{talkType}, - #{talkPerson2},#{talkPersonOrgJob2},#{talkDateTime2},#{talkPlace2} + #{talkPerson2},#{talkPersonOrgJob2},#{talkDateTime2},#{talkPlace2},#{talkPhotos} ) @@ -353,7 +354,10 @@ talk_date_time_2 = #{talkDateTime2}, - talk_place_2 = #{talkPlace2} + talk_place_2 = #{talkPlace2}, + + + talk_photos = #{talkPhotos} WHERE report_id = #{reportId} diff --git a/src/main/resources/static/route/hearttalk/audit-heart-talk.html b/src/main/resources/static/route/hearttalk/audit-heart-talk.html index 22aef6a..f2035a1 100644 --- a/src/main/resources/static/route/hearttalk/audit-heart-talk.html +++ b/src/main/resources/static/route/hearttalk/audit-heart-talk.html @@ -171,10 +171,9 @@ {{# var files = d[fileName];}} {{# for(var i = 0, item = files[i]; item = files[i++];) { }}
- - - - + + +
{{# } }} {{# } }} @@ -187,6 +186,27 @@ +
+ +
+ +
+ +
+
+ @@ -235,6 +255,7 @@ form.val('dataForm', dataFormData); form.render(null, 'dataForm'); initTalkObjSignUploadFile(); + inittalkPhotosUploadFile(); initNationTemplate(); }, function(code, data) { top.dialog.msg(data.msg); @@ -296,6 +317,57 @@ }); }); } + // 初始化附加图片图片上传 + function inittalkPhotosUploadFile() { + var files = $('#talkPhotos').val(); + initFileList('talkPhotos', files, function(fileName) { + var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false}); + viewerObj[fileName] = viewer; + }); + + form.on('button(talkPhotosUploadFile)', function(obj) { + var name = this.dataset.name; + var explain = this.dataset.explain; + top.dialog.file({ + type: 'image', + title: '上传'+ explain, + width: '400px', + height: '420px', + maxFileCount: '1', + onClose: function() { + var uploadFileArray = top.dialog.dialogData.uploadFileArray; + if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) { + var files = $('#'+ name).val(); + for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) { + if(files.length > 0) { + files += ','; + } + files += file.data; + } + initFileList(name, files, function(fileName) { + viewerObj[fileName].update(); + }); + } + } + }); + }); + + form.on('button(talkPhotosRemoveFile)', function(obj) { + var name = this.dataset.name; + var id = this.dataset.id; + var files = $('#'+ name).val().replace(id, ''); + files = files.replace(/\,+/g, ','); + if(files.charAt(0) == ',') { + files = files.substring(1); + } + if(files.charAt(files.length - 1) == ',') { + files = files.substring(0, files.length - 1); + } + initFileList(name, files, function(fileName) { + viewerObj[fileName].update(); + }); + }); + } // 初始化文件列表 function initFileList(fileName, ids, callback) { diff --git a/src/main/resources/static/route/hearttalk/edit-heart-talk.html b/src/main/resources/static/route/hearttalk/edit-heart-talk.html index 6d112e9..c583957 100644 --- a/src/main/resources/static/route/hearttalk/edit-heart-talk.html +++ b/src/main/resources/static/route/hearttalk/edit-heart-talk.html @@ -193,6 +193,36 @@ +
+ +
+ +
+ +
+
@@ -265,6 +295,7 @@ form.val('dataForm', dataFormData); form.render(null, 'dataForm'); initTalkObjSignUploadFile(); + initTalkPhotosUploadFile(); initNationTemplate(data.talkType); }, function(code, data) { top.dialog.msg(data.msg); @@ -327,6 +358,57 @@ }); } + function initTalkPhotosUploadFile() { + var files = $('#talkPhotos').val(); + initFileList('talkPhotos', files, function(fileName) { + var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false}); + viewerObj[fileName] = viewer; + }); + + form.on('button(talkPhotosUploadFile)', function(obj) { + var name = this.dataset.name; + var explain = this.dataset.explain; + top.dialog.file({ + type: 'image', + title: '上传'+ explain, + width: '400px', + height: '420px', + maxFileCount: '1', + onClose: function() { + var uploadFileArray = top.dialog.dialogData.uploadFileArray; + if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) { + var files = $('#'+ name).val(); + for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) { + if(files.length > 0) { + files += ','; + } + files += file.data; + } + initFileList(name, files, function(fileName) { + viewerObj[fileName].update(); + }); + } + } + }); + }); + + form.on('button(talkPhotosRemoveFile)', function(obj) { + var name = this.dataset.name; + var id = this.dataset.id; + var files = $('#'+ name).val().replace(id, ''); + files = files.replace(/\,+/g, ','); + if(files.charAt(0) == ',') { + files = files.substring(1); + } + if(files.charAt(files.length - 1) == ',') { + files = files.substring(0, files.length - 1); + } + initFileList(name, files, function(fileName) { + viewerObj[fileName].update(); + }); + }); + } + // 初始化文件列表 function initFileList(fileName, ids, callback) { var dataForm = {}; diff --git a/src/main/resources/static/route/hearttalk/print-heart-talk.html b/src/main/resources/static/route/hearttalk/print-heart-talk.html index ef7c8f1..baecbf9 100644 --- a/src/main/resources/static/route/hearttalk/print-heart-talk.html +++ b/src/main/resources/static/route/hearttalk/print-heart-talk.html @@ -144,6 +144,20 @@ 签字时间 {{ d.signDataTime}} + + 图片附件 + +
+ {{# layui.each(d.talkPhotosList, function(index, item){ }} +
+ + + +
+ {{# }); }} +
+ +
@@ -186,6 +200,7 @@ view.innerHTML = html; }); var viewer = new Viewer(document.getElementById('indexGeneralImagesFileBox'), {navbar: false}); + var viewer = new Viewer(document.getElementById('talkPhotosFileBox'), {navbar: false}); } function initImages(formdata){ @@ -193,17 +208,28 @@ ids: formdata.talkObjSign }, null, function(code, data) { formdata['imagesList'] = data; + initImages2(formdata) + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + + function initImages2(formdata){ + top.restAjax.get(top.restAjax.path('api/file/list', []), { + ids: formdata.talkPhotos + }, null, function(code, data) { + formdata['talkPhotosList'] = data; dataTemplet(formdata) }, function(code, data) { top.dialog.msg(data.msg); }); - - } + // 初始化内容 function initData() { var loadLayerIndexl; diff --git a/src/main/resources/static/route/hearttalk/save-heart-talk.html b/src/main/resources/static/route/hearttalk/save-heart-talk.html index d647b19..61f1229 100644 --- a/src/main/resources/static/route/hearttalk/save-heart-talk.html +++ b/src/main/resources/static/route/hearttalk/save-heart-talk.html @@ -193,6 +193,38 @@
+
+ +
+ +
+ +
+
+ +
@@ -320,6 +352,7 @@ initSignDataTimeDateTime(); initNationTemplate(); initTalkObjSignUploadFile(); + initTalkPhotosUploadFile(); } initData(); @@ -384,6 +417,57 @@ }); }); } + // 初始化附加图片图片上传 + function initTalkPhotosUploadFile() { + var files = $('#talkPhotos').val(); + initFileList('talkPhotos', files, function(fileName) { + var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false}); + viewerObj[fileName] = viewer; + }); + + form.on('button(talkPhotosUploadFile)', function(obj) { + var name = this.dataset.name; + var explain = this.dataset.explain; + top.dialog.file({ + type: 'image', + title: '上传'+ explain, + width: '400px', + height: '420px', + maxFileCount: '1', + onClose: function() { + var uploadFileArray = top.dialog.dialogData.uploadFileArray; + if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) { + var files = $('#'+ name).val(); + for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) { + if(files.length > 0) { + files += ','; + } + files += file.data; + } + initFileList(name, files, function(fileName) { + viewerObj[fileName].update(); + }); + } + } + }); + }); + + form.on('button(talkPhotosRemoveFile)', function(obj) { + var name = this.dataset.name; + var id = this.dataset.id; + var files = $('#'+ name).val().replace(id, ''); + files = files.replace(/\,+/g, ','); + if(files.charAt(0) == ',') { + files = files.substring(1); + } + if(files.charAt(files.length - 1) == ',') { + files = files.substring(0, files.length - 1); + } + initFileList(name, files, function(fileName) { + viewerObj[fileName].update(); + }); + }); + } diff --git a/src/main/resources/static/route/hearttalk/show-heart-talk.html b/src/main/resources/static/route/hearttalk/show-heart-talk.html index 198d945..dcd37e2 100644 --- a/src/main/resources/static/route/hearttalk/show-heart-talk.html +++ b/src/main/resources/static/route/hearttalk/show-heart-talk.html @@ -155,6 +155,26 @@
+
+ +
+ +
+ +
+
@@ -191,6 +211,7 @@ form.val('dataForm', dataFormData); form.render(null, 'dataForm'); initTalkObjSignUploadFile(); + inittalkPhotosUploadFile(); }, function(code, data) { top.dialog.msg(data.msg); }, function() { @@ -252,6 +273,58 @@ }); } + // 初始化附加图片图片上传 + function inittalkPhotosUploadFile() { + var files = $('#talkPhotos').val(); + initFileList('talkPhotos', files, function(fileName) { + var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false}); + viewerObj[fileName] = viewer; + }); + + form.on('button(talkPhotosUploadFile)', function(obj) { + var name = this.dataset.name; + var explain = this.dataset.explain; + top.dialog.file({ + type: 'image', + title: '上传'+ explain, + width: '400px', + height: '420px', + maxFileCount: '1', + onClose: function() { + var uploadFileArray = top.dialog.dialogData.uploadFileArray; + if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) { + var files = $('#'+ name).val(); + for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) { + if(files.length > 0) { + files += ','; + } + files += file.data; + } + initFileList(name, files, function(fileName) { + viewerObj[fileName].update(); + }); + } + } + }); + }); + + form.on('button(talkPhotosRemoveFile)', function(obj) { + var name = this.dataset.name; + var id = this.dataset.id; + var files = $('#'+ name).val().replace(id, ''); + files = files.replace(/\,+/g, ','); + if(files.charAt(0) == ',') { + files = files.substring(1); + } + if(files.charAt(files.length - 1) == ',') { + files = files.substring(0, files.length - 1); + } + initFileList(name, files, function(fileName) { + viewerObj[fileName].update(); + }); + }); + } + // 初始化文件列表 function initFileList(fileName, ids, callback) { var dataForm = {};