From 683ff67711502092c8c4a5374b573e257e1f50f9 Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Tue, 28 Feb 2023 17:13:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/institution/institution-mapper.xml | 16 ++-- .../resources/templates/institution/save.html | 82 +++++++++++++++++++ .../templates/institution/update.html | 82 +++++++++++++++++++ .../pojo/dtos/institution/InstitutionDTO.java | 10 +++ .../pojo/vos/institution/InstitutionVO.java | 10 +++ 5 files changed, 195 insertions(+), 5 deletions(-) diff --git a/module-institution-management/src/main/resources/mybatis/mapper/institution/institution-mapper.xml b/module-institution-management/src/main/resources/mybatis/mapper/institution/institution-mapper.xml index 463fe54..e6065ec 100644 --- a/module-institution-management/src/main/resources/mybatis/mapper/institution/institution-mapper.xml +++ b/module-institution-management/src/main/resources/mybatis/mapper/institution/institution-mapper.xml @@ -21,6 +21,7 @@ + @@ -130,7 +131,8 @@ gmt_create, modifier, gmt_modified, - is_delete + is_delete, + sign_photo ) VALUES( #{institutionId}, #{institutionName}, @@ -152,7 +154,8 @@ #{gmtCreate}, #{modifier}, #{gmtModified}, - #{isDelete} + #{isDelete}, + #{signPhoto} ) @@ -207,7 +210,8 @@ institution_region_village = #{institutionRegionVillage}, institution_region_street = #{institutionRegionStreet}, gmt_modified = #{gmtModified}, - modifier = #{modifier} + modifier = #{modifier}, + sign_photo = #{signPhoto} WHERE institution_id = #{institutionId} @@ -230,7 +234,8 @@ t1.institution_region_village, t1.institution_region_street, t1.institution_type, - t1.institution_id + t1.institution_id, + t1.sign_photo FROM m_institution t1 WHERE @@ -329,7 +334,8 @@ t1.institution_region_street, t1.institution_type, t1.creator, - t1.gmt_create + t1.gmt_create, + t1.sign_photo FROM m_institution t1 WHERE diff --git a/module-institution-management/src/main/resources/templates/institution/save.html b/module-institution-management/src/main/resources/templates/institution/save.html index 76ee6cb..49b64cf 100644 --- a/module-institution-management/src/main/resources/templates/institution/save.html +++ b/module-institution-management/src/main/resources/templates/institution/save.html @@ -132,6 +132,36 @@ +
+ +
+ +
+ +
+
@@ -274,6 +304,57 @@ }); } + function initSignPhotoUploadFile() { + var files = $('#signPhoto').val(); + initFileList('signPhoto', files, function(fileName) { + var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false}); + viewerObj[fileName] = viewer; + }); + + form.on('button(signPhotoUploadFile)', 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(signPhotoRemoveFile)', 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 initInstitutionFoundingTimeDateTime() { laydate.render({ @@ -287,6 +368,7 @@ // 初始化内容 function initData() { initInstitutionImageUploadFile(); + initSignPhotoUploadFile(); initInstitutionFoundingTimeDateTime(); initMap('109.85017859252311', '40.66017700460503'); initDataDict(dictId,'institutionRegionProvince'); diff --git a/module-institution-management/src/main/resources/templates/institution/update.html b/module-institution-management/src/main/resources/templates/institution/update.html index ae290e4..e5c364f 100644 --- a/module-institution-management/src/main/resources/templates/institution/update.html +++ b/module-institution-management/src/main/resources/templates/institution/update.html @@ -124,6 +124,36 @@
+
+ +
+ +
+ +
+
@@ -277,6 +307,57 @@ }); } + function initSignPhotoUploadFile() { + var files = $('#signPhoto').val(); + initFileList('signPhoto', files, function(fileName) { + var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false}); + viewerObj[fileName] = viewer; + }); + + form.on('button(signPhotoUploadFile)', 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(signPhotoRemoveFile)', 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 initInstitutionFoundingTimeDateTime(v) { laydate.render({ @@ -299,6 +380,7 @@ form.val('dataForm', dataFormData); form.render(null, 'dataForm'); initInstitutionImageUploadFile(); + initSignPhotoUploadFile(); initInstitutionFoundingTimeDateTime(data.institutionFoundingTime); initMap(data.institutionX,data.institutionY); initDataDict(dictId,'institutionRegionProvince',data.institutionRegionProvince); diff --git a/pojo-institution-management/src/main/java/cn/com/tenlion/institutionmanagement/pojo/dtos/institution/InstitutionDTO.java b/pojo-institution-management/src/main/java/cn/com/tenlion/institutionmanagement/pojo/dtos/institution/InstitutionDTO.java index 1d4cb6d..9275264 100644 --- a/pojo-institution-management/src/main/java/cn/com/tenlion/institutionmanagement/pojo/dtos/institution/InstitutionDTO.java +++ b/pojo-institution-management/src/main/java/cn/com/tenlion/institutionmanagement/pojo/dtos/institution/InstitutionDTO.java @@ -50,6 +50,8 @@ public class InstitutionDTO { private String creator; @ApiModelProperty(name = "gmtCreate", value = "创建时间") private String gmtCreate; + @ApiModelProperty(name = "signPhoto", value = "水印") + private String signPhoto; public String getInstitutionId() { return institutionId == null ? "" : institutionId.trim(); @@ -194,4 +196,12 @@ public class InstitutionDTO { public void setInstitutionType(String institutionType) { this.institutionType = institutionType; } + + public String getSignPhoto() { + return signPhoto == null ? "" : signPhoto.trim(); + } + + public void setSignPhoto(String signPhoto) { + this.signPhoto = signPhoto; + } } diff --git a/pojo-institution-management/src/main/java/cn/com/tenlion/institutionmanagement/pojo/vos/institution/InstitutionVO.java b/pojo-institution-management/src/main/java/cn/com/tenlion/institutionmanagement/pojo/vos/institution/InstitutionVO.java index ce3747d..2040f07 100644 --- a/pojo-institution-management/src/main/java/cn/com/tenlion/institutionmanagement/pojo/vos/institution/InstitutionVO.java +++ b/pojo-institution-management/src/main/java/cn/com/tenlion/institutionmanagement/pojo/vos/institution/InstitutionVO.java @@ -46,6 +46,8 @@ public class InstitutionVO { private String institutionRegionStreet; @ApiModelProperty(name = "institutionType", value = "机构类型") private String institutionType; + @ApiModelProperty(name = "signPhoto", value = "水印") + private String signPhoto; public String getInstitutionName() { return institutionName == null ? "" : institutionName.trim(); @@ -166,4 +168,12 @@ public class InstitutionVO { public void setInstitutionType(String institutionType) { this.institutionType = institutionType; } + + public String getSignPhoto() { + return signPhoto == null ? "" : signPhoto.trim(); + } + + public void setSignPhoto(String signPhoto) { + this.signPhoto = signPhoto; + } }