@huilian/components-tms 3.7.6 → 3.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/bundle.esm.js CHANGED
@@ -554,9 +554,9 @@ dialogImageUrl:"",loading:"",noneBtnImg:false,drag:false,trans,headers:{}};},com
554
554
  // }
555
555
  },methods:{customHttpRequest({file,onSuccess,onError}){// 动态生成headers
556
556
  let headers={"Content-Type":"multipart/form-data"// 通常不需要手动设置,但为了完整性还是加上
557
- };if(window.HLEncryption){headers=window.HLEncryption.setRequestHeaders({url:this.apiUrl,headers:headers});}const formData=new FormData();formData.append("file",file);// 添加文件到FormData中
557
+ };const fileType=this.fileFormat(file.name.toLowerCase());console.log(fileType);const formData=new FormData();formData.append("file",file);// 添加文件到FormData中
558
558
  // 使用axios或fetch发送请求,这里使用axios为例
559
- for(let key in this.formData){formData.append(key,this.formData[key]);}axios$1.post(this.apiUrl,formData,{headers}).then(response=>{onSuccess(response.data,response);// 调用onSuccess回调
559
+ for(let key in this.formData){formData.append(key,this.formData[key]);}let apiUrl=this.apiUrl;if(fileType==="MP4"){apiUrl="/gateway/huilianApi/uploader/attachment";formData.delete("attachmenType");formData.append("attachmenType","VIDEO");}if(window.HLEncryption){headers=window.HLEncryption.setRequestHeaders({url:apiUrl,headers:headers});}axios$1.post(apiUrl,formData,{headers}).then(response=>{onSuccess(response.data,response);// 调用onSuccess回调
560
560
  }).catch(error=>{onError(error);// 调用onError回调
561
561
  });},// 处理格式
562
562
  formatFileType(){let arr=[];this.fileType.map(item=>{arr.push(item);arr.push(item.toUpperCase());});return arr.join(",");},// 缩略图展示
@@ -574,7 +574,7 @@ if(this.formMaxWH.width){const isSize=this.validImage(file).then(data=>{return f
574
574
  // }
575
575
  // 验证文件类型
576
576
  const nameList=file.name.split(".");const allowTypes=this.fileType.map(type=>type.toLowerCase());const ext="."+nameList[nameList.length-1].toLowerCase();if(!allowTypes.includes(ext)){setTimeout(()=>{this.$message({message:`请上传${this.fileType.join("、")}的文件!`,type:"warning"});},1);return false;}},// 校验图片宽高
577
- validImage(file){const _this=this;return new Promise(function(resolve,reject){const width=parseInt(_this.formMaxWH.width,10);const height=parseInt(_this.formMaxWH.height,10);let _URL=window.URL||window.webkitURL;let img=new Image();img.onload=function(){if(img.width!==width||img.height!==height){return reject({type:false,msg:`请上传${width}px * ${height}px的图片`});}return resolve({type:true});};img.src=_URL.createObjectURL(file);});},formHandleRemove(file,formFileList){if(file.status!=="ready"){this.formFileList.splice(this.formFileList.indexOf(file),1);this.noneBtnImg=this.formFileList.length>=this.limit;}this.handleRemoveCallback(file,formFileList);},handlePreview(file){if(this.listType==="text"){this.handlePictureCardPreview(file);}},handlePictureCardPreview(file){let type,url;if(file.raw){type=this.fileFormat(file.name.toLowerCase());url=file.response.data[0].attachmenturl;}else{type=this.fileFormat(file.url.toLowerCase());url=file.url;}if(type==="IMG"){this.dialogImageUrl=file.url;this.$refs.previewImg.showViewer=true;const m=e=>{e.preventDefault();};document.body.style.overflow="hidden";document.addEventListener("touchmove",m,false);// 禁止页面滑动
577
+ validImage(file){const _this=this;return new Promise(function(resolve,reject){const width=parseInt(_this.formMaxWH.width,10);const height=parseInt(_this.formMaxWH.height,10);let _URL=window.URL||window.webkitURL;let img=new Image();img.onload=function(){if(img.width!==width||img.height!==height){return reject({type:false,msg:`请上传${width}px * ${height}px的图片`});}return resolve({type:true});};img.src=_URL.createObjectURL(file);});},formHandleRemove(file,formFileList){if(file.status!=="ready"){this.formFileList.splice(this.formFileList.indexOf(file),1);this.noneBtnImg=this.formFileList.length>=this.limit;}if(this.handleRemoveCallback){this.handleRemoveCallback(file,formFileList);}},handlePreview(file){if(this.listType==="text"){this.handlePictureCardPreview(file);}},handlePictureCardPreview(file){let type,url;if(file.raw){type=this.fileFormat(file.name.toLowerCase());url=file.response.data[0].attachmenturl;}else{type=this.fileFormat(file.url.toLowerCase());url=file.url;}if(type==="IMG"){this.dialogImageUrl=file.url;this.$refs.previewImg.showViewer=true;const m=e=>{e.preventDefault();};document.body.style.overflow="hidden";document.addEventListener("touchmove",m,false);// 禁止页面滑动
578
578
  this.$nextTick(()=>{document.querySelector(".el-image-viewer__close").addEventListener("click",()=>{const m=e=>{e.preventDefault();};document.body.style.overflow="auto";document.removeEventListener("touchmove",m,true);});});}// else if (type === "PDF") {
579
579
  // window.open(
580
580
  // "https://www.hellogil.com/web/contractPreview.html?url=" +
@@ -594,11 +594,11 @@ getFileUrl(url.replace("http://","https://")).then(res=>{if(res.result==="succes
594
594
  }).then(res=>{this.downloadFile(res.data,name);});},downloadFile(data,name){const url=window.URL.createObjectURL(new Blob([data]));const link=document.createElement("a");link.style.display="none";link.href=url;link.setAttribute("download",name);document.body.appendChild(link);link.click();URL.revokeObjectURL(link.href);document.body.removeChild(link);this.$message({message:"下载成功",type:"success"});},// 允许上传文件个数验证
595
595
  formHandleExceed(files,formFileList){this.$message.warning(`最多上传 ${this.limit} 个文件!`);},// 上传文件
596
596
  handleUploadForm(file,fileList){if(!file.url){file.url=URL.createObjectURL(file.raw);}},// 上传成功
597
- handleSuccess(response,file,fileList){var num=0;for(var i=0;i<fileList.length;i++){if(fileList[i].status==="success"){num++;}}if(num===fileList.length){this.formFileList=fileList;this.$emit("update:fileUrl",this.formFileList);this.noneBtnImg=this.formFileList.length>=this.limit;if(this.handleSuccessCallback){this.handleSuccessCallback(response,file,fileList);}}this.$message({message:"上传成功",type:"success"});},// 上传失败
597
+ handleSuccess(response,file,fileList){var num=0;for(var i=0;i<fileList.length;i++){if(fileList[i].status==="success"){num++;}}if(num===fileList.length){this.formFileList=fileList;this.$emit("update:fileUrl",this.formFileList);this.noneBtnImg=this.formFileList.length>=this.limit;if(this.handleSuccessCallback){this.handleSuccessCallback(response,file,fileList);}}if(response.result==="success"){this.$message({message:"上传成功",type:"success"});}},// 上传失败
598
598
  handleError(err,file,fileList){console.log(err);// this.loading.close()
599
599
  },dragEnd(){// this.drag = false;
600
600
  this.$emit("update:fileUrl",this.formFileList);},showImgViewer(){this.imgViewerVisible=true;const m=e=>{e.preventDefault();};document.body.style.overflow="hidden";document.addEventListener("touchmove",m,false);// 禁止页面滑动
601
- },closeImgViewer(){this.imgViewerVisible=false;const m=e=>{e.preventDefault();};document.body.style.overflow="auto";document.removeEventListener("touchmove",m,true);}}};/* script */const __vue_script__$i=script$i;/* template */var __vue_render__$i=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("div",{staticClass:"upload_file_box"},[_c("div",{staticStyle:{height:"0",overflow:"hidden"}},[_c("el-image",{ref:"previewImg",attrs:{src:_vm.dialogImageUrl,"preview-src-list":_vm.formFileList.map(function(item){return _vm.bgImg(item);})}})],1),_vm._v(" "),_c("el-upload",{class:{disUoloadSty:_vm.noneBtnImg},attrs:{headers:_vm.headers,action:_vm.apiUrl,"list-type":_vm.listType,tip:_vm.tip,limit:_vm.limit,multiple:_vm.multiple,data:_vm.formData,accept:_vm.formatFileType(),disabled:_vm.fileDisabled,"file-list":_vm.formFileList,"on-exceed":_vm.formHandleExceed,"before-upload":_vm.beforeUploadForm,"on-change":_vm.handleUploadForm,"on-remove":_vm.formHandleRemove,"on-success":_vm.handleSuccess,"on-error":_vm.handleError,"on-preview":_vm.handlePreview,"http-request":_vm.customHttpRequest},scopedSlots:_vm._u([{key:"file",fn:function(ref){var file=ref.file;return _vm.listType==="picture-card"?_c("div",{staticClass:"upload_file_operation"},[_c("div",{staticClass:"upload_file_bg",style:"background: url("+_vm.bgImg(file)+") no-repeat 50% 50%; background-size: contain;"}),_vm._v(" "),file.status!=="success"?_c("span",{staticClass:"el-upload-list__item-actions",staticStyle:{opacity:"1"}},[_c("i",{staticClass:"el-icon-loading"})]):_vm._e()]):_vm._e();}}],null,true)},[_vm.listType==="text"?_c("div",{staticStyle:{"text-align":"left"}},[_c("el-button",{attrs:{type:"primary",disabled:_vm.fileDisabled}},[_vm._v(_vm._s(_vm.trans("点击上传")))]),_vm._v(" "),_c("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[_vm._v("\n "+_vm._s(_vm.tip?_vm.tip:""+_vm.trans("请选择要上传的附件,最多")+_vm.limit+_vm.trans("个")+","+_vm.trans("单个附件最大")+_vm.formMaxSize+"M")+"\n ")])],1):_vm._e(),_vm._v(" "),_vm.listType==="excel"?_c("div",{staticStyle:{"text-align":"left"}},[_c("el-button",{attrs:{type:"primary"}},[_vm._v(_vm._s(_vm.trans("点击上传")))]),_vm._v(" "),_vm._t("tip")],2):_vm._e(),_vm._v(" "),_vm.listType==="picture-card"?_c("draggable",_vm._b({staticClass:"el-upload-list el-upload-list--picture-card",style:{position:"absolute",left:0,top:0},attrs:{slot:"tip",tag:"ul"},on:{end:_vm.dragEnd},slot:"tip",model:{value:_vm.formFileList,callback:function($$v){_vm.formFileList=$$v;},expression:"formFileList"}},"draggable",_vm.dragOptions,false),_vm._l(_vm.formFileList,function(file,inex){return _c("li",{key:inex,staticClass:"el-upload-list__item is-success"},[_c("div",{staticClass:"upload_file_operation"},[_c("div",{staticClass:"upload_file_bg",style:"background: url("+_vm.bgImg(file)+") 50% 50% / contain no-repeat;"}),_vm._v(" "),_c("span",{staticClass:"el-upload-list__item-actions"},[_c("span",{staticClass:"el-upload-list__item-preview",on:{click:function($event){return _vm.handlePictureCardPreview(file);}}},[_c("i",{staticClass:"el-icon-zoom-in"})]),_vm._v(" "),_c("span",{staticClass:"el-upload-list__item-delete",on:{click:function($event){return _vm.handleDownload(file);}}},[_c("i",{staticClass:"el-icon-download"})]),_vm._v(" "),!_vm.fileDisabled?_c("span",{staticClass:"el-upload-list__item-delete",on:{click:function($event){return _vm.formHandleRemove(file);}}},[_c("i",{staticClass:"el-icon-delete"})]):_vm._e()])])]);}),0):_vm._e(),_vm._v(" "),_vm.listType==="picture-card"?_c("i",{staticClass:"el-icon-plus",attrs:{slot:"default"},slot:"default"}):_vm._e()],1)],1);};var __vue_staticRenderFns__$i=[];__vue_render__$i._withStripped=true;/* style */const __vue_inject_styles__$i=function(inject){if(!inject)return;inject("data-v-9c3e5fbc_0",{source:".upload_file_box {\n position: relative;\n}\n.upload_file_box .el-upload-list--picture-card .el-upload-list__item {\n width: 104px;\n height: 104px;\n transition: none;\n}\n.upload_file_box .el-upload--picture-card {\n width: 104px;\n height: 104px;\n line-height: 104px;\n position: relative;\n z-index: 1;\n}\n.upload_file_box .upload_file_operation {\n width: 100%;\n height: 100%;\n}\n.upload_file_box .upload_file_operation .upload_file_bg {\n width: 100%;\n height: 100%;\n background-size: contain;\n}\n.upload_file_box .disUoloadSty .el-upload--picture-card {\n display: none;\n}\n\n/*# sourceMappingURL=index.vue.map */",map:{"version":3,"sources":["D:\\项目\\npm\\components\\UploadFile\\index.vue","index.vue"],"names":[],"mappings":"AA0qBA;EACA,kBAAA;ACzqBA;AD4qBA;EACA,YAAA;EACA,aAAA;EACA,gBAAA;AC1qBA;AD8qBA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;EACA,kBAAA;EACA,UAAA;AC5qBA;AD+qBA;EACA,WAAA;EACA,YAAA;AC7qBA;AD+qBA;EACA,WAAA;EACA,YAAA;EACA,wBAAA;AC7qBA;ADkrBA;EACA,aAAA;AChrBA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"upload_file_box\">\r\n <div style=\"height: 0; overflow: hidden\">\r\n <el-image\r\n ref=\"previewImg\"\r\n :src=\"dialogImageUrl\"\r\n :preview-src-list=\"formFileList.map((item) => bgImg(item))\"\r\n />\r\n </div>\r\n\r\n <el-upload\r\n :class=\"{ disUoloadSty: noneBtnImg }\"\r\n :headers=\"headers\"\r\n :action=\"apiUrl\"\r\n :list-type=\"listType\"\r\n :tip=\"tip\"\r\n :limit=\"limit\"\r\n :multiple=\"multiple\"\r\n :data=\"formData\"\r\n :accept=\"formatFileType()\"\r\n :disabled=\"fileDisabled\"\r\n :file-list=\"formFileList\"\r\n :on-exceed=\"formHandleExceed\"\r\n :before-upload=\"beforeUploadForm\"\r\n :on-change=\"handleUploadForm\"\r\n :on-remove=\"formHandleRemove\"\r\n :on-success=\"handleSuccess\"\r\n :on-error=\"handleError\"\r\n :on-preview=\"handlePreview\"\r\n :http-request=\"customHttpRequest\"\r\n >\r\n <div v-if=\"listType === 'text'\" style=\"text-align: left\">\r\n <el-button type=\"primary\" :disabled=\"fileDisabled\">{{\r\n trans(\"点击上传\")\r\n }}</el-button>\r\n <div slot=\"tip\" class=\"el-upload__tip\">\r\n {{\r\n tip\r\n ? tip\r\n : `${trans(\"请选择要上传的附件,最多\")}${limit}${trans(\r\n \"个\"\r\n )},${trans(\"单个附件最大\")}${formMaxSize}M`\r\n }}\r\n </div>\r\n </div>\r\n <div v-if=\"listType === 'excel'\" style=\"text-align: left\">\r\n <el-button type=\"primary\">{{ trans(\"点击上传\") }}</el-button>\r\n <slot name=\"tip\"></slot>\r\n </div>\r\n\r\n <draggable\r\n slot=\"tip\"\r\n v-if=\"listType === 'picture-card'\"\r\n tag=\"ul\"\r\n v-model=\"formFileList\"\r\n v-bind=\"dragOptions\"\r\n @end=\"dragEnd\"\r\n class=\"el-upload-list el-upload-list--picture-card\"\r\n :style=\"{ position: 'absolute', left: 0, top: 0 }\"\r\n >\r\n <li\r\n class=\"el-upload-list__item is-success\"\r\n v-for=\"(file, inex) in formFileList\"\r\n :key=\"inex\"\r\n >\r\n <div class=\"upload_file_operation\">\r\n <div\r\n class=\"upload_file_bg\"\r\n :style=\"`background: url(${bgImg(\r\n file\r\n )}) 50% 50% / contain no-repeat;`\"\r\n />\r\n <span class=\"el-upload-list__item-actions\">\r\n <span\r\n class=\"el-upload-list__item-preview\"\r\n @click=\"handlePictureCardPreview(file)\"\r\n >\r\n <i class=\"el-icon-zoom-in\" />\r\n </span>\r\n <span\r\n class=\"el-upload-list__item-delete\"\r\n @click=\"handleDownload(file)\"\r\n >\r\n <i class=\"el-icon-download\" />\r\n </span>\r\n <span\r\n v-if=\"!fileDisabled\"\r\n class=\"el-upload-list__item-delete\"\r\n @click=\"formHandleRemove(file)\"\r\n >\r\n <i class=\"el-icon-delete\" />\r\n </span>\r\n </span>\r\n </div>\r\n </li>\r\n </draggable>\r\n\r\n <i\r\n slot=\"default\"\r\n class=\"el-icon-plus\"\r\n v-if=\"listType === 'picture-card'\"\r\n />\r\n <div\r\n slot=\"file\"\r\n slot-scope=\"{ file }\"\r\n class=\"upload_file_operation\"\r\n v-if=\"listType === 'picture-card'\"\r\n >\r\n <div\r\n class=\"upload_file_bg\"\r\n :style=\"`background: url(${bgImg(\r\n file\r\n )}) no-repeat 50% 50%; background-size: contain;`\"\r\n />\r\n <span\r\n v-if=\"file.status !== 'success'\"\r\n style=\"opacity: 1\"\r\n class=\"el-upload-list__item-actions\"\r\n >\r\n <i class=\"el-icon-loading\"></i>\r\n </span>\r\n </div>\r\n </el-upload>\r\n </div>\r\n</template>\r\n\r\n<script>\r\n// import { attachment } from '@/config/api/publicApi'\r\nimport draggable from \"vuedraggable\";\r\nimport { mapGetters } from \"vuex\";\r\nimport axios from \"axios\";\r\nimport CSV from \"./fileImages/CSV.png\";\r\nimport EXCEL from \"./fileImages/EXCEL.png\";\r\nimport PDF from \"./fileImages/PDF.png\";\r\nimport PPT from \"./fileImages/PPT.png\";\r\nimport RAR from \"./fileImages/RAR.png\";\r\nimport WORD from \"./fileImages/WORD.png\";\r\nimport ZIP from \"./fileImages/ZIP.png\";\r\nimport APK from \"./fileImages/APK.png\";\r\nimport PLIST from \"./fileImages/PLIST.png\";\r\nimport MP4 from \"./fileImages/MP4.png\";\r\nimport trans from \"../lang/trans\";\r\nimport { getFileUrl } from \"../public\";\r\n\r\nexport default {\r\n components: {\r\n draggable,\r\n },\r\n props: {\r\n limit: {\r\n // 限制文件个数\r\n default: 1,\r\n type: Number,\r\n },\r\n multiple: {\r\n // 上传多个文件\r\n default: false,\r\n type: Boolean,\r\n },\r\n formMaxSize: {\r\n // 限制文件大小\r\n default: 10, // M\r\n type: Number,\r\n },\r\n formMaxWH: {\r\n // 限制图片尺寸 单位px { width: 100, height: 100 }\r\n default: () => {\r\n return {};\r\n },\r\n type: Object,\r\n },\r\n fileUrl: {\r\n // 文件数组\r\n default: () => {\r\n return [];\r\n },\r\n type: Array,\r\n },\r\n tip: {\r\n // 上传文件说明\r\n default: \"\",\r\n type: String,\r\n },\r\n formData: {\r\n // 上传时附带的额外参数\r\n default: () => {\r\n return {\r\n attachmenType: \"VOUCHER\",\r\n };\r\n },\r\n type: Object,\r\n },\r\n handleSuccessCallback: {\r\n type: Function,\r\n },\r\n handleRemoveCallback: {\r\n type: Function,\r\n },\r\n fileType: {\r\n // 限制选择文件类型\r\n // default: '.pptx,.csv,.zip,.rar,image/*,application/msexcel,application/msword,application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document, text/plain',\r\n default: () => {\r\n return [\r\n \".pptx\",\r\n \".csv\",\r\n \".zip\",\r\n \".rar\",\r\n \".jpg\",\r\n \".jpeg\",\r\n \".png\",\r\n \".doc\",\r\n \".docx\",\r\n \".pdf\",\r\n \".xls\",\r\n \".xlsx\",\r\n \".mp4\",\r\n \".pdf\",\r\n ];\r\n },\r\n type: Array,\r\n },\r\n fileDisabled: {\r\n default: false,\r\n type: Boolean,\r\n },\r\n apiUrl: {\r\n default: \"/gateway/huilianApi/uploader/attachment\",\r\n type: String,\r\n },\r\n listType: {\r\n default: \"picture-card\",\r\n type: String,\r\n },\r\n },\r\n data() {\r\n return {\r\n formFileList: [], // 显示上传文件\r\n dialogImageUrl: \"\",\r\n loading: \"\",\r\n noneBtnImg: false,\r\n drag: false,\r\n trans,\r\n headers: {},\r\n };\r\n },\r\n computed: {\r\n ...mapGetters([\"userInfo\"]),\r\n dragOptions() {\r\n return {\r\n animation: 100,\r\n group: \"description\",\r\n disabled: false,\r\n ghostClass: \"ghost\",\r\n };\r\n },\r\n },\r\n watch: {\r\n fileUrl: {\r\n deep: true,\r\n immediate: true,\r\n handler() {\r\n this.formFileList = this.fileUrl;\r\n if (this.fileDisabled) {\r\n this.noneBtnImg = true;\r\n }\r\n if (this.fileUrl.length >= this.limit) {\r\n this.noneBtnImg = true;\r\n } else {\r\n this.noneBtnImg = false;\r\n }\r\n },\r\n },\r\n },\r\n mounted() {\r\n // if (window.HLEncryption) {\r\n // this.headers = window.HLEncryption.setRequestHeaders({\r\n // url: this.apiUrl,\r\n // headers: {},\r\n // });\r\n // }\r\n },\r\n methods: {\r\n customHttpRequest({ file, onSuccess, onError }) {\r\n // 动态生成headers\r\n let headers = {\r\n \"Content-Type\": \"multipart/form-data\", // 通常不需要手动设置,但为了完整性还是加上\r\n };\r\n\r\n if (window.HLEncryption) {\r\n headers = window.HLEncryption.setRequestHeaders({\r\n url: this.apiUrl,\r\n headers: headers,\r\n });\r\n }\r\n\r\n const formData = new FormData();\r\n formData.append(\"file\", file); // 添加文件到FormData中\r\n // 使用axios或fetch发送请求,这里使用axios为例\r\n for (let key in this.formData) {\r\n formData.append(key, this.formData[key]);\r\n }\r\n axios\r\n .post(this.apiUrl, formData, { headers })\r\n .then((response) => {\r\n onSuccess(response.data, response); // 调用onSuccess回调\r\n })\r\n .catch((error) => {\r\n onError(error); // 调用onError回调\r\n });\r\n },\r\n // 处理格式\r\n formatFileType() {\r\n let arr = [];\r\n this.fileType.map((item) => {\r\n arr.push(item);\r\n arr.push(item.toUpperCase());\r\n });\r\n return arr.join(\",\");\r\n },\r\n // 缩略图展示\r\n bgImg(file) {\r\n let type = \"\";\r\n const types = {\r\n IMG: \"\",\r\n WORD: WORD,\r\n EXCEL: EXCEL,\r\n PDF: PDF,\r\n CSV: CSV,\r\n RAR: RAR,\r\n ZIP: ZIP,\r\n PPT: PPT,\r\n APK: APK,\r\n PLIST: PLIST,\r\n MP4: MP4,\r\n };\r\n\r\n if (file.raw) {\r\n type = this.fileFormat(file.name.toLowerCase());\r\n } else {\r\n type = this.fileFormat(file.url.toLowerCase());\r\n }\r\n\r\n if (type === \"IMG\") {\r\n return file.url;\r\n } else {\r\n return types[type];\r\n }\r\n },\r\n // 文件格式\r\n fileFormat(name) {\r\n const images = \"bmp|jpg|jpeg|png|gif|svg|webp|JPG|JPEG|PNG\";\r\n const word = \"doc|docx|DOC|DOCX\";\r\n const excel = \"xls|xlsx|XLS|XLSX\";\r\n const pdf = \"pdf|PDF\";\r\n const csv = \"csv|CSV\";\r\n const rar = \"rar|RAR\";\r\n const zip = \"zip|ZIP\";\r\n const ppt = \"pptx|PPTX\";\r\n const apk = \"apk|APK\";\r\n const plist = \"plist|PLIST\";\r\n const mp4 = \"mp4|MP4\";\r\n\r\n const pattern_images = new RegExp(\".(\" + images + \")$\");\r\n const pattern_word = new RegExp(\".(\" + word + \")$\");\r\n const pattern_excel = new RegExp(\".(\" + excel + \")$\");\r\n const pattern_pdf = new RegExp(\".(\" + pdf + \")$\");\r\n const pattern_csv = new RegExp(\".(\" + csv + \")$\");\r\n const pattern_rar = new RegExp(\".(\" + rar + \")$\");\r\n const pattern_zip = new RegExp(\".(\" + zip + \")$\");\r\n const pattern_ppt = new RegExp(\".(\" + ppt + \")$\");\r\n const pattern_apk = new RegExp(\".(\" + apk + \")$\");\r\n const pattern_plist = new RegExp(\".(\" + plist + \")$\");\r\n const pattern_mp4 = new RegExp(\".(\" + mp4 + \")$\");\r\n\r\n if (name.indexOf(\"?\") > -1) {\r\n name = name.split(\"?\")[0];\r\n }\r\n\r\n if (pattern_images.test(name)) {\r\n return \"IMG\";\r\n } else if (pattern_word.test(name)) {\r\n return \"WORD\";\r\n } else if (pattern_excel.test(name)) {\r\n return \"EXCEL\";\r\n } else if (pattern_pdf.test(name)) {\r\n return \"PDF\";\r\n } else if (pattern_csv.test(name)) {\r\n return \"CSV\";\r\n } else if (pattern_rar.test(name)) {\r\n return \"RAR\";\r\n } else if (pattern_zip.test(name)) {\r\n return \"ZIP\";\r\n } else if (pattern_ppt.test(name)) {\r\n return \"PPT\";\r\n } else if (pattern_apk.test(name)) {\r\n return \"APK\";\r\n } else if (pattern_plist.test(name)) {\r\n return \"PLIST\";\r\n } else if (pattern_mp4.test(name)) {\r\n return \"MP4\";\r\n }\r\n },\r\n // 开始上传前验证\r\n beforeUploadForm(file) {\r\n // 验证文件大小\r\n if (file.size / 1024 / 1024 > this.formMaxSize) {\r\n setTimeout(() => {\r\n this.$message({\r\n message: `上传文件 “${file.name}” 大小不能超过${this.formMaxSize}M!`,\r\n type: \"warning\",\r\n });\r\n }, 1);\r\n return false;\r\n }\r\n\r\n // 验证尺寸是否符合\r\n if (this.formMaxWH.width) {\r\n const isSize = this.validImage(file).then(\r\n (data) => {\r\n return file;\r\n },\r\n (data) => {\r\n this.$message.error(data.msg);\r\n return Promise.reject();\r\n }\r\n );\r\n return isSize;\r\n }\r\n\r\n // 中文乱码处理\r\n // if (file.raw) {\r\n // let reader = new FileReader(); // 读取文件内容\r\n // reader.readAsText(file.raw, \"gb2312\"); // 防止中文乱码问题,不加reader.onload方法都不会触发\r\n // reader.onload = function(e) {\r\n // this.contentHtml = e.target.result; // txt文本内容,接下来就可以对其进行校验处理了\r\n // };\r\n // }\r\n\r\n // 验证文件类型\r\n const nameList = file.name.split(\".\");\r\n const allowTypes = this.fileType.map((type) => type.toLowerCase());\r\n const ext = \".\" + nameList[nameList.length - 1].toLowerCase();\r\n if (!allowTypes.includes(ext)) {\r\n setTimeout(() => {\r\n this.$message({\r\n message: `请上传${this.fileType.join(\"、\")}的文件!`,\r\n type: \"warning\",\r\n });\r\n }, 1);\r\n return false;\r\n }\r\n },\r\n // 校验图片宽高\r\n validImage(file) {\r\n const _this = this;\r\n return new Promise(function (resolve, reject) {\r\n const width = parseInt(_this.formMaxWH.width, 10);\r\n const height = parseInt(_this.formMaxWH.height, 10);\r\n let _URL = window.URL || window.webkitURL;\r\n let img = new Image();\r\n img.onload = function () {\r\n if (img.width !== width || img.height !== height) {\r\n return reject({\r\n type: false,\r\n msg: `请上传${width}px * ${height}px的图片`,\r\n });\r\n }\r\n return resolve({\r\n type: true,\r\n });\r\n };\r\n img.src = _URL.createObjectURL(file);\r\n });\r\n },\r\n formHandleRemove(file, formFileList) {\r\n if (file.status !== \"ready\") {\r\n this.formFileList.splice(this.formFileList.indexOf(file), 1);\r\n this.noneBtnImg = this.formFileList.length >= this.limit;\r\n }\r\n this.handleRemoveCallback(file, formFileList)\r\n\r\n },\r\n handlePreview(file) {\r\n if (this.listType === \"text\") {\r\n this.handlePictureCardPreview(file);\r\n }\r\n },\r\n handlePictureCardPreview(file) {\r\n let type, url;\r\n if (file.raw) {\r\n type = this.fileFormat(file.name.toLowerCase());\r\n url = file.response.data[0].attachmenturl;\r\n } else {\r\n type = this.fileFormat(file.url.toLowerCase());\r\n url = file.url;\r\n }\r\n\r\n if (type === \"IMG\") {\r\n this.dialogImageUrl = file.url;\r\n this.$refs.previewImg.showViewer = true;\r\n\r\n const m = (e) => {\r\n e.preventDefault();\r\n };\r\n document.body.style.overflow = \"hidden\";\r\n document.addEventListener(\"touchmove\", m, false); // 禁止页面滑动\r\n\r\n this.$nextTick(() => {\r\n document\r\n .querySelector(\".el-image-viewer__close\")\r\n .addEventListener(\"click\", () => {\r\n const m = (e) => {\r\n e.preventDefault();\r\n };\r\n document.body.style.overflow = \"auto\";\r\n document.removeEventListener(\"touchmove\", m, true);\r\n });\r\n });\r\n }\r\n // else if (type === \"PDF\") {\r\n // window.open(\r\n // \"https://www.hellogil.com/web/contractPreview.html?url=\" +\r\n // url.replace(\"http://\", \"https://\")\r\n // );\r\n // }\r\n else if (\r\n type === \"WORD\" ||\r\n type === \"EXCEL\" ||\r\n type === \"CSV\" ||\r\n type === \"PPT\" ||\r\n type === \"PDF\"\r\n ) {\r\n // window.open(\r\n // `https://file-preview.hellogil.com/onlinePreview?watermarkTxt=${this.userInfo.userName}${this.userInfo.jobCard}&url=` +\r\n // url.replace(\"http://\", \"https://\")\r\n // );\r\n const urlWithoutParams = url.split(\"?\")[0].toLowerCase();\r\n if (\r\n !urlWithoutParams.endsWith(\".doc\") &&\r\n !urlWithoutParams.endsWith(\".xlx\")\r\n ) {\r\n // URL后缀不包含.doc和.xlx时执行的代码\r\n // window.open(\r\n // `https://www.hellogil.com/web/#/officePreview?url=` +\r\n // encodeURIComponent(url.replace(\"http://\", \"https://\"))\r\n // );\r\n getFileUrl(url.replace(\"http://\", \"https://\")).then((res) => {\r\n if (res.result === \"success\") {\r\n window.open(res.data);\r\n } else {\r\n this.$message({\r\n message: \"该文件不支持预览!\",\r\n type: \"warning\",\r\n });\r\n }\r\n });\r\n } else {\r\n this.$message({\r\n message: \"该文件不支持预览!\",\r\n type: \"warning\",\r\n });\r\n }\r\n } else {\r\n this.$message({\r\n message: \"该文件不支持预览!\",\r\n type: \"warning\",\r\n });\r\n }\r\n },\r\n handleDownload(file) {\r\n console.log(file);\r\n var name;\r\n let url = file.response ? file.response.data[0].attachmenturl : file.url;\r\n if (file.name) {\r\n name = file.name;\r\n if (!name.indexOf(\".\") > -1) {\r\n var a = url.split(\"/\");\r\n var b = a[a.length - 1];\r\n name = file.name + \".\" + b.split(\".\")[1];\r\n }\r\n } else {\r\n var a = url.split(\"/\");\r\n name = a[a.length - 1];\r\n }\r\n axios({\r\n method: \"post\",\r\n url:\r\n process.env.VUE_APP_BASE_API +\r\n \"/huilianApi/uploader/downloadZipFiles\",\r\n data:\r\n \"fileUrls=\" +\r\n JSON.stringify([\r\n {\r\n imgName: name\r\n .replace(/\\&/g, \"-\")\r\n .replace(/\\?/g, \"-\")\r\n .replace(/\\%/g, \"-\"),\r\n dataImg: url,\r\n },\r\n ]),\r\n responseType: \"blob\", // 加上这个是重点\r\n }).then((res) => {\r\n this.downloadFile(res.data, name);\r\n });\r\n },\r\n downloadFile(data, name) {\r\n const url = window.URL.createObjectURL(new Blob([data]));\r\n const link = document.createElement(\"a\");\r\n link.style.display = \"none\";\r\n link.href = url;\r\n link.setAttribute(\"download\", name);\r\n document.body.appendChild(link);\r\n link.click();\r\n URL.revokeObjectURL(link.href);\r\n document.body.removeChild(link);\r\n this.$message({\r\n message: \"下载成功\",\r\n type: \"success\",\r\n });\r\n },\r\n // 允许上传文件个数验证\r\n formHandleExceed(files, formFileList) {\r\n this.$message.warning(`最多上传 ${this.limit} 个文件!`);\r\n },\r\n // 上传文件\r\n handleUploadForm(file, fileList) {\r\n if (!file.url) {\r\n file.url = URL.createObjectURL(file.raw);\r\n }\r\n },\r\n // 上传成功\r\n handleSuccess(response, file, fileList) {\r\n var num = 0;\r\n for (var i = 0; i < fileList.length; i++) {\r\n if (fileList[i].status === \"success\") {\r\n num++;\r\n }\r\n }\r\n if (num === fileList.length) {\r\n this.formFileList = fileList;\r\n this.$emit(\"update:fileUrl\", this.formFileList);\r\n this.noneBtnImg = this.formFileList.length >= this.limit;\r\n if (this.handleSuccessCallback) {\r\n this.handleSuccessCallback(response, file, fileList);\r\n }\r\n }\r\n this.$message({\r\n message: \"上传成功\",\r\n type: \"success\",\r\n });\r\n },\r\n // 上传失败\r\n handleError(err, file, fileList) {\r\n console.log(err);\r\n // this.loading.close()\r\n },\r\n\r\n dragEnd() {\r\n // this.drag = false;\r\n this.$emit(\"update:fileUrl\", this.formFileList);\r\n },\r\n showImgViewer() {\r\n this.imgViewerVisible = true;\r\n const m = (e) => {\r\n e.preventDefault();\r\n };\r\n document.body.style.overflow = \"hidden\";\r\n document.addEventListener(\"touchmove\", m, false); // 禁止页面滑动\r\n },\r\n closeImgViewer() {\r\n this.imgViewerVisible = false;\r\n const m = (e) => {\r\n e.preventDefault();\r\n };\r\n document.body.style.overflow = \"auto\";\r\n document.removeEventListener(\"touchmove\", m, true);\r\n },\r\n },\r\n};\r\n</script>\r\n\r\n<style lang=\"scss\">\r\n.upload_file_box {\r\n position: relative;\r\n\r\n .el-upload-list--picture-card {\r\n .el-upload-list__item {\r\n width: 104px;\r\n height: 104px;\r\n transition: none;\r\n }\r\n }\r\n\r\n .el-upload--picture-card {\r\n width: 104px;\r\n height: 104px;\r\n line-height: 104px;\r\n position: relative;\r\n z-index: 1;\r\n }\r\n\r\n .upload_file_operation {\r\n width: 100%;\r\n height: 100%;\r\n\r\n .upload_file_bg {\r\n width: 100%;\r\n height: 100%;\r\n background-size: contain;\r\n }\r\n }\r\n\r\n .disUoloadSty {\r\n .el-upload--picture-card {\r\n display: none;\r\n }\r\n }\r\n}\r\n</style>\r\n",".upload_file_box {\n position: relative;\n}\n.upload_file_box .el-upload-list--picture-card .el-upload-list__item {\n width: 104px;\n height: 104px;\n transition: none;\n}\n.upload_file_box .el-upload--picture-card {\n width: 104px;\n height: 104px;\n line-height: 104px;\n position: relative;\n z-index: 1;\n}\n.upload_file_box .upload_file_operation {\n width: 100%;\n height: 100%;\n}\n.upload_file_box .upload_file_operation .upload_file_bg {\n width: 100%;\n height: 100%;\n background-size: contain;\n}\n.upload_file_box .disUoloadSty .el-upload--picture-card {\n display: none;\n}\n\n/*# sourceMappingURL=index.vue.map */"]},media:undefined});};/* scoped */const __vue_scope_id__$i=undefined;/* module identifier */const __vue_module_identifier__$i=undefined;/* functional template */const __vue_is_functional_template__$i=false;/* style inject SSR */ /* style inject shadow dom */const __vue_component__$i=/*#__PURE__*/normalizeComponent({render:__vue_render__$i,staticRenderFns:__vue_staticRenderFns__$i},__vue_inject_styles__$i,__vue_script__$i,__vue_scope_id__$i,__vue_is_functional_template__$i,__vue_module_identifier__$i,false,createInjector,undefined,undefined);__vue_component__$i.install=function(Vue){Vue.component(__vue_component__$i.name,__vue_component__$i);};//
601
+ },closeImgViewer(){this.imgViewerVisible=false;const m=e=>{e.preventDefault();};document.body.style.overflow="auto";document.removeEventListener("touchmove",m,true);}}};/* script */const __vue_script__$i=script$i;/* template */var __vue_render__$i=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("div",{staticClass:"upload_file_box"},[_c("div",{staticStyle:{height:"0",overflow:"hidden"}},[_c("el-image",{ref:"previewImg",attrs:{src:_vm.dialogImageUrl,"preview-src-list":_vm.formFileList.map(function(item){return _vm.bgImg(item);})}})],1),_vm._v(" "),_c("el-upload",{class:{disUoloadSty:_vm.noneBtnImg},attrs:{headers:_vm.headers,action:_vm.apiUrl,"list-type":_vm.listType,tip:_vm.tip,limit:_vm.limit,multiple:_vm.multiple,data:_vm.formData,accept:_vm.formatFileType(),disabled:_vm.fileDisabled,"file-list":_vm.formFileList,"on-exceed":_vm.formHandleExceed,"before-upload":_vm.beforeUploadForm,"on-change":_vm.handleUploadForm,"on-remove":_vm.formHandleRemove,"on-success":_vm.handleSuccess,"on-error":_vm.handleError,"on-preview":_vm.handlePreview,"http-request":_vm.customHttpRequest},scopedSlots:_vm._u([{key:"file",fn:function(ref){var file=ref.file;return _vm.listType==="picture-card"?_c("div",{staticClass:"upload_file_operation"},[_c("div",{staticClass:"upload_file_bg",style:"background: url("+_vm.bgImg(file)+") no-repeat 50% 50%; background-size: contain;"}),_vm._v(" "),file.status!=="success"?_c("span",{staticClass:"el-upload-list__item-actions",staticStyle:{opacity:"1"}},[_c("i",{staticClass:"el-icon-loading"})]):_vm._e()]):_vm._e();}}],null,true)},[_vm.listType==="text"?_c("div",{staticStyle:{"text-align":"left"}},[_c("el-button",{attrs:{type:"primary",disabled:_vm.fileDisabled}},[_vm._v(_vm._s(_vm.trans("点击上传")))]),_vm._v(" "),_c("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[_vm._v("\n "+_vm._s(_vm.tip?_vm.tip:""+_vm.trans("请选择要上传的附件,最多")+_vm.limit+_vm.trans("个")+","+_vm.trans("单个附件最大")+_vm.formMaxSize+"M")+"\n ")])],1):_vm._e(),_vm._v(" "),_vm.listType==="excel"?_c("div",{staticStyle:{"text-align":"left"}},[_c("el-button",{attrs:{type:"primary"}},[_vm._v(_vm._s(_vm.trans("点击上传")))]),_vm._v(" "),_vm._t("tip")],2):_vm._e(),_vm._v(" "),_vm.listType==="picture-card"?_c("draggable",_vm._b({staticClass:"el-upload-list el-upload-list--picture-card",style:{position:"absolute",left:0,top:0},attrs:{slot:"tip",tag:"ul"},on:{end:_vm.dragEnd},slot:"tip",model:{value:_vm.formFileList,callback:function($$v){_vm.formFileList=$$v;},expression:"formFileList"}},"draggable",_vm.dragOptions,false),_vm._l(_vm.formFileList,function(file,inex){return _c("li",{key:inex,staticClass:"el-upload-list__item is-success"},[_c("div",{staticClass:"upload_file_operation"},[_c("div",{staticClass:"upload_file_bg",style:"background: url("+_vm.bgImg(file)+") 50% 50% / contain no-repeat;"}),_vm._v(" "),_c("span",{staticClass:"el-upload-list__item-actions"},[_c("span",{staticClass:"el-upload-list__item-preview",on:{click:function($event){return _vm.handlePictureCardPreview(file);}}},[_c("i",{staticClass:"el-icon-zoom-in"})]),_vm._v(" "),_c("span",{staticClass:"el-upload-list__item-delete",on:{click:function($event){return _vm.handleDownload(file);}}},[_c("i",{staticClass:"el-icon-download"})]),_vm._v(" "),!_vm.fileDisabled?_c("span",{staticClass:"el-upload-list__item-delete",on:{click:function($event){return _vm.formHandleRemove(file);}}},[_c("i",{staticClass:"el-icon-delete"})]):_vm._e()])])]);}),0):_vm._e(),_vm._v(" "),_vm.listType==="picture-card"?_c("i",{staticClass:"el-icon-plus",attrs:{slot:"default"},slot:"default"}):_vm._e()],1)],1);};var __vue_staticRenderFns__$i=[];__vue_render__$i._withStripped=true;/* style */const __vue_inject_styles__$i=function(inject){if(!inject)return;inject("data-v-18bf50de_0",{source:".upload_file_box {\n position: relative;\n}\n.upload_file_box .el-upload-list--picture-card .el-upload-list__item {\n width: 104px;\n height: 104px;\n transition: none;\n}\n.upload_file_box .el-upload--picture-card {\n width: 104px;\n height: 104px;\n line-height: 104px;\n position: relative;\n z-index: 1;\n}\n.upload_file_box .upload_file_operation {\n width: 100%;\n height: 100%;\n}\n.upload_file_box .upload_file_operation .upload_file_bg {\n width: 100%;\n height: 100%;\n background-size: contain;\n}\n.upload_file_box .disUoloadSty .el-upload--picture-card {\n display: none;\n}\n\n/*# sourceMappingURL=index.vue.map */",map:{"version":3,"sources":["D:\\项目\\npm\\components\\UploadFile\\index.vue","index.vue"],"names":[],"mappings":"AA2rBA;EACA,kBAAA;AC1rBA;AD6rBA;EACA,YAAA;EACA,aAAA;EACA,gBAAA;AC3rBA;AD+rBA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;EACA,kBAAA;EACA,UAAA;AC7rBA;ADgsBA;EACA,WAAA;EACA,YAAA;AC9rBA;ADgsBA;EACA,WAAA;EACA,YAAA;EACA,wBAAA;AC9rBA;ADmsBA;EACA,aAAA;ACjsBA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"upload_file_box\">\r\n <div style=\"height: 0; overflow: hidden\">\r\n <el-image\r\n ref=\"previewImg\"\r\n :src=\"dialogImageUrl\"\r\n :preview-src-list=\"formFileList.map((item) => bgImg(item))\"\r\n />\r\n </div>\r\n\r\n <el-upload\r\n :class=\"{ disUoloadSty: noneBtnImg }\"\r\n :headers=\"headers\"\r\n :action=\"apiUrl\"\r\n :list-type=\"listType\"\r\n :tip=\"tip\"\r\n :limit=\"limit\"\r\n :multiple=\"multiple\"\r\n :data=\"formData\"\r\n :accept=\"formatFileType()\"\r\n :disabled=\"fileDisabled\"\r\n :file-list=\"formFileList\"\r\n :on-exceed=\"formHandleExceed\"\r\n :before-upload=\"beforeUploadForm\"\r\n :on-change=\"handleUploadForm\"\r\n :on-remove=\"formHandleRemove\"\r\n :on-success=\"handleSuccess\"\r\n :on-error=\"handleError\"\r\n :on-preview=\"handlePreview\"\r\n :http-request=\"customHttpRequest\"\r\n >\r\n <div v-if=\"listType === 'text'\" style=\"text-align: left\">\r\n <el-button type=\"primary\" :disabled=\"fileDisabled\">{{\r\n trans(\"点击上传\")\r\n }}</el-button>\r\n <div slot=\"tip\" class=\"el-upload__tip\">\r\n {{\r\n tip\r\n ? tip\r\n : `${trans(\r\n \"请选择要上传的附件,最多\"\r\n )}${limit}${trans(\"个\")},${trans(\r\n \"单个附件最大\"\r\n )}${formMaxSize}M`\r\n }}\r\n </div>\r\n </div>\r\n <div v-if=\"listType === 'excel'\" style=\"text-align: left\">\r\n <el-button type=\"primary\">{{ trans(\"点击上传\") }}</el-button>\r\n <slot name=\"tip\"></slot>\r\n </div>\r\n\r\n <draggable\r\n slot=\"tip\"\r\n v-if=\"listType === 'picture-card'\"\r\n tag=\"ul\"\r\n v-model=\"formFileList\"\r\n v-bind=\"dragOptions\"\r\n @end=\"dragEnd\"\r\n class=\"el-upload-list el-upload-list--picture-card\"\r\n :style=\"{ position: 'absolute', left: 0, top: 0 }\"\r\n >\r\n <li\r\n class=\"el-upload-list__item is-success\"\r\n v-for=\"(file, inex) in formFileList\"\r\n :key=\"inex\"\r\n >\r\n <div class=\"upload_file_operation\">\r\n <div\r\n class=\"upload_file_bg\"\r\n :style=\"`background: url(${bgImg(\r\n file\r\n )}) 50% 50% / contain no-repeat;`\"\r\n />\r\n <span class=\"el-upload-list__item-actions\">\r\n <span\r\n class=\"el-upload-list__item-preview\"\r\n @click=\"handlePictureCardPreview(file)\"\r\n >\r\n <i class=\"el-icon-zoom-in\" />\r\n </span>\r\n <span\r\n class=\"el-upload-list__item-delete\"\r\n @click=\"handleDownload(file)\"\r\n >\r\n <i class=\"el-icon-download\" />\r\n </span>\r\n <span\r\n v-if=\"!fileDisabled\"\r\n class=\"el-upload-list__item-delete\"\r\n @click=\"formHandleRemove(file)\"\r\n >\r\n <i class=\"el-icon-delete\" />\r\n </span>\r\n </span>\r\n </div>\r\n </li>\r\n </draggable>\r\n\r\n <i\r\n slot=\"default\"\r\n class=\"el-icon-plus\"\r\n v-if=\"listType === 'picture-card'\"\r\n />\r\n <div\r\n slot=\"file\"\r\n slot-scope=\"{ file }\"\r\n class=\"upload_file_operation\"\r\n v-if=\"listType === 'picture-card'\"\r\n >\r\n <div\r\n class=\"upload_file_bg\"\r\n :style=\"`background: url(${bgImg(\r\n file\r\n )}) no-repeat 50% 50%; background-size: contain;`\"\r\n />\r\n <span\r\n v-if=\"file.status !== 'success'\"\r\n style=\"opacity: 1\"\r\n class=\"el-upload-list__item-actions\"\r\n >\r\n <i class=\"el-icon-loading\"></i>\r\n </span>\r\n </div>\r\n </el-upload>\r\n </div>\r\n</template>\r\n\r\n<script>\r\n// import { attachment } from '@/config/api/publicApi'\r\nimport draggable from \"vuedraggable\";\r\nimport { mapGetters } from \"vuex\";\r\nimport axios from \"axios\";\r\nimport CSV from \"./fileImages/CSV.png\";\r\nimport EXCEL from \"./fileImages/EXCEL.png\";\r\nimport PDF from \"./fileImages/PDF.png\";\r\nimport PPT from \"./fileImages/PPT.png\";\r\nimport RAR from \"./fileImages/RAR.png\";\r\nimport WORD from \"./fileImages/WORD.png\";\r\nimport ZIP from \"./fileImages/ZIP.png\";\r\nimport APK from \"./fileImages/APK.png\";\r\nimport PLIST from \"./fileImages/PLIST.png\";\r\nimport MP4 from \"./fileImages/MP4.png\";\r\nimport trans from \"../lang/trans\";\r\nimport { getFileUrl } from \"../public\";\r\n\r\nexport default {\r\n components: {\r\n draggable,\r\n },\r\n props: {\r\n limit: {\r\n // 限制文件个数\r\n default: 1,\r\n type: Number,\r\n },\r\n multiple: {\r\n // 上传多个文件\r\n default: false,\r\n type: Boolean,\r\n },\r\n formMaxSize: {\r\n // 限制文件大小\r\n default: 10, // M\r\n type: Number,\r\n },\r\n formMaxWH: {\r\n // 限制图片尺寸 单位px { width: 100, height: 100 }\r\n default: () => {\r\n return {};\r\n },\r\n type: Object,\r\n },\r\n fileUrl: {\r\n // 文件数组\r\n default: () => {\r\n return [];\r\n },\r\n type: Array,\r\n },\r\n tip: {\r\n // 上传文件说明\r\n default: \"\",\r\n type: String,\r\n },\r\n formData: {\r\n // 上传时附带的额外参数\r\n default: () => {\r\n return {\r\n attachmenType: \"VOUCHER\",\r\n };\r\n },\r\n type: Object,\r\n },\r\n handleSuccessCallback: {\r\n type: Function,\r\n },\r\n handleRemoveCallback: {\r\n type: Function,\r\n },\r\n fileType: {\r\n // 限制选择文件类型\r\n // default: '.pptx,.csv,.zip,.rar,image/*,application/msexcel,application/msword,application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document, text/plain',\r\n default: () => {\r\n return [\r\n \".pptx\",\r\n \".csv\",\r\n \".zip\",\r\n \".rar\",\r\n \".jpg\",\r\n \".jpeg\",\r\n \".png\",\r\n \".doc\",\r\n \".docx\",\r\n \".pdf\",\r\n \".xls\",\r\n \".xlsx\",\r\n \".mp4\",\r\n \".pdf\",\r\n ];\r\n },\r\n type: Array,\r\n },\r\n fileDisabled: {\r\n default: false,\r\n type: Boolean,\r\n },\r\n apiUrl: {\r\n default: \"/gateway/huilianApi/uploader/attachment\",\r\n type: String,\r\n },\r\n listType: {\r\n default: \"picture-card\",\r\n type: String,\r\n },\r\n },\r\n data() {\r\n return {\r\n formFileList: [], // 显示上传文件\r\n dialogImageUrl: \"\",\r\n loading: \"\",\r\n noneBtnImg: false,\r\n drag: false,\r\n trans,\r\n headers: {},\r\n };\r\n },\r\n computed: {\r\n ...mapGetters([\"userInfo\"]),\r\n dragOptions() {\r\n return {\r\n animation: 100,\r\n group: \"description\",\r\n disabled: false,\r\n ghostClass: \"ghost\",\r\n };\r\n },\r\n },\r\n watch: {\r\n fileUrl: {\r\n deep: true,\r\n immediate: true,\r\n handler() {\r\n this.formFileList = this.fileUrl;\r\n if (this.fileDisabled) {\r\n this.noneBtnImg = true;\r\n }\r\n if (this.fileUrl.length >= this.limit) {\r\n this.noneBtnImg = true;\r\n } else {\r\n this.noneBtnImg = false;\r\n }\r\n },\r\n },\r\n },\r\n mounted() {\r\n // if (window.HLEncryption) {\r\n // this.headers = window.HLEncryption.setRequestHeaders({\r\n // url: this.apiUrl,\r\n // headers: {},\r\n // });\r\n // }\r\n },\r\n methods: {\r\n customHttpRequest({ file, onSuccess, onError }) {\r\n // 动态生成headers\r\n let headers = {\r\n \"Content-Type\": \"multipart/form-data\", // 通常不需要手动设置,但为了完整性还是加上\r\n };\r\n const fileType = this.fileFormat(file.name.toLowerCase());\r\n console.log(fileType);\r\n\r\n const formData = new FormData();\r\n formData.append(\"file\", file); // 添加文件到FormData中\r\n // 使用axios或fetch发送请求,这里使用axios为例\r\n for (let key in this.formData) {\r\n formData.append(key, this.formData[key]);\r\n }\r\n let apiUrl = this.apiUrl;\r\n if (fileType === \"MP4\") {\r\n apiUrl = \"/gateway/huilianApi/uploader/attachment\";\r\n formData.delete(\"attachmenType\");\r\n formData.append(\"attachmenType\", \"VIDEO\");\r\n }\r\n\r\n if (window.HLEncryption) {\r\n headers = window.HLEncryption.setRequestHeaders({\r\n url: apiUrl,\r\n headers: headers,\r\n });\r\n }\r\n axios\r\n .post(apiUrl, formData, { headers })\r\n .then((response) => {\r\n onSuccess(response.data, response); // 调用onSuccess回调\r\n })\r\n .catch((error) => {\r\n onError(error); // 调用onError回调\r\n });\r\n },\r\n // 处理格式\r\n formatFileType() {\r\n let arr = [];\r\n this.fileType.map((item) => {\r\n arr.push(item);\r\n arr.push(item.toUpperCase());\r\n });\r\n return arr.join(\",\");\r\n },\r\n // 缩略图展示\r\n bgImg(file) {\r\n let type = \"\";\r\n const types = {\r\n IMG: \"\",\r\n WORD: WORD,\r\n EXCEL: EXCEL,\r\n PDF: PDF,\r\n CSV: CSV,\r\n RAR: RAR,\r\n ZIP: ZIP,\r\n PPT: PPT,\r\n APK: APK,\r\n PLIST: PLIST,\r\n MP4: MP4,\r\n };\r\n\r\n if (file.raw) {\r\n type = this.fileFormat(file.name.toLowerCase());\r\n } else {\r\n type = this.fileFormat(file.url.toLowerCase());\r\n }\r\n\r\n if (type === \"IMG\") {\r\n return file.url;\r\n } else {\r\n return types[type];\r\n }\r\n },\r\n // 文件格式\r\n fileFormat(name) {\r\n const images = \"bmp|jpg|jpeg|png|gif|svg|webp|JPG|JPEG|PNG\";\r\n const word = \"doc|docx|DOC|DOCX\";\r\n const excel = \"xls|xlsx|XLS|XLSX\";\r\n const pdf = \"pdf|PDF\";\r\n const csv = \"csv|CSV\";\r\n const rar = \"rar|RAR\";\r\n const zip = \"zip|ZIP\";\r\n const ppt = \"pptx|PPTX\";\r\n const apk = \"apk|APK\";\r\n const plist = \"plist|PLIST\";\r\n const mp4 = \"mp4|MP4\";\r\n\r\n const pattern_images = new RegExp(\".(\" + images + \")$\");\r\n const pattern_word = new RegExp(\".(\" + word + \")$\");\r\n const pattern_excel = new RegExp(\".(\" + excel + \")$\");\r\n const pattern_pdf = new RegExp(\".(\" + pdf + \")$\");\r\n const pattern_csv = new RegExp(\".(\" + csv + \")$\");\r\n const pattern_rar = new RegExp(\".(\" + rar + \")$\");\r\n const pattern_zip = new RegExp(\".(\" + zip + \")$\");\r\n const pattern_ppt = new RegExp(\".(\" + ppt + \")$\");\r\n const pattern_apk = new RegExp(\".(\" + apk + \")$\");\r\n const pattern_plist = new RegExp(\".(\" + plist + \")$\");\r\n const pattern_mp4 = new RegExp(\".(\" + mp4 + \")$\");\r\n\r\n if (name.indexOf(\"?\") > -1) {\r\n name = name.split(\"?\")[0];\r\n }\r\n\r\n if (pattern_images.test(name)) {\r\n return \"IMG\";\r\n } else if (pattern_word.test(name)) {\r\n return \"WORD\";\r\n } else if (pattern_excel.test(name)) {\r\n return \"EXCEL\";\r\n } else if (pattern_pdf.test(name)) {\r\n return \"PDF\";\r\n } else if (pattern_csv.test(name)) {\r\n return \"CSV\";\r\n } else if (pattern_rar.test(name)) {\r\n return \"RAR\";\r\n } else if (pattern_zip.test(name)) {\r\n return \"ZIP\";\r\n } else if (pattern_ppt.test(name)) {\r\n return \"PPT\";\r\n } else if (pattern_apk.test(name)) {\r\n return \"APK\";\r\n } else if (pattern_plist.test(name)) {\r\n return \"PLIST\";\r\n } else if (pattern_mp4.test(name)) {\r\n return \"MP4\";\r\n }\r\n },\r\n // 开始上传前验证\r\n beforeUploadForm(file) {\r\n // 验证文件大小\r\n if (file.size / 1024 / 1024 > this.formMaxSize) {\r\n setTimeout(() => {\r\n this.$message({\r\n message: `上传文件 “${file.name}” 大小不能超过${this.formMaxSize}M!`,\r\n type: \"warning\",\r\n });\r\n }, 1);\r\n return false;\r\n }\r\n\r\n // 验证尺寸是否符合\r\n if (this.formMaxWH.width) {\r\n const isSize = this.validImage(file).then(\r\n (data) => {\r\n return file;\r\n },\r\n (data) => {\r\n this.$message.error(data.msg);\r\n return Promise.reject();\r\n }\r\n );\r\n return isSize;\r\n }\r\n\r\n // 中文乱码处理\r\n // if (file.raw) {\r\n // let reader = new FileReader(); // 读取文件内容\r\n // reader.readAsText(file.raw, \"gb2312\"); // 防止中文乱码问题,不加reader.onload方法都不会触发\r\n // reader.onload = function(e) {\r\n // this.contentHtml = e.target.result; // txt文本内容,接下来就可以对其进行校验处理了\r\n // };\r\n // }\r\n\r\n // 验证文件类型\r\n const nameList = file.name.split(\".\");\r\n const allowTypes = this.fileType.map((type) => type.toLowerCase());\r\n const ext = \".\" + nameList[nameList.length - 1].toLowerCase();\r\n if (!allowTypes.includes(ext)) {\r\n setTimeout(() => {\r\n this.$message({\r\n message: `请上传${this.fileType.join(\"、\")}的文件!`,\r\n type: \"warning\",\r\n });\r\n }, 1);\r\n return false;\r\n }\r\n },\r\n // 校验图片宽高\r\n validImage(file) {\r\n const _this = this;\r\n return new Promise(function (resolve, reject) {\r\n const width = parseInt(_this.formMaxWH.width, 10);\r\n const height = parseInt(_this.formMaxWH.height, 10);\r\n let _URL = window.URL || window.webkitURL;\r\n let img = new Image();\r\n img.onload = function () {\r\n if (img.width !== width || img.height !== height) {\r\n return reject({\r\n type: false,\r\n msg: `请上传${width}px * ${height}px的图片`,\r\n });\r\n }\r\n return resolve({\r\n type: true,\r\n });\r\n };\r\n img.src = _URL.createObjectURL(file);\r\n });\r\n },\r\n formHandleRemove(file, formFileList) {\r\n if (file.status !== \"ready\") {\r\n this.formFileList.splice(this.formFileList.indexOf(file), 1);\r\n this.noneBtnImg = this.formFileList.length >= this.limit;\r\n }\r\n if (this.handleRemoveCallback) {\r\n this.handleRemoveCallback(file, formFileList);\r\n }\r\n },\r\n handlePreview(file) {\r\n if (this.listType === \"text\") {\r\n this.handlePictureCardPreview(file);\r\n }\r\n },\r\n handlePictureCardPreview(file) {\r\n let type, url;\r\n if (file.raw) {\r\n type = this.fileFormat(file.name.toLowerCase());\r\n url = file.response.data[0].attachmenturl;\r\n } else {\r\n type = this.fileFormat(file.url.toLowerCase());\r\n url = file.url;\r\n }\r\n\r\n if (type === \"IMG\") {\r\n this.dialogImageUrl = file.url;\r\n this.$refs.previewImg.showViewer = true;\r\n\r\n const m = (e) => {\r\n e.preventDefault();\r\n };\r\n document.body.style.overflow = \"hidden\";\r\n document.addEventListener(\"touchmove\", m, false); // 禁止页面滑动\r\n\r\n this.$nextTick(() => {\r\n document\r\n .querySelector(\".el-image-viewer__close\")\r\n .addEventListener(\"click\", () => {\r\n const m = (e) => {\r\n e.preventDefault();\r\n };\r\n document.body.style.overflow = \"auto\";\r\n document.removeEventListener(\"touchmove\", m, true);\r\n });\r\n });\r\n }\r\n // else if (type === \"PDF\") {\r\n // window.open(\r\n // \"https://www.hellogil.com/web/contractPreview.html?url=\" +\r\n // url.replace(\"http://\", \"https://\")\r\n // );\r\n // }\r\n else if (\r\n type === \"WORD\" ||\r\n type === \"EXCEL\" ||\r\n type === \"CSV\" ||\r\n type === \"PPT\" ||\r\n type === \"PDF\"\r\n ) {\r\n // window.open(\r\n // `https://file-preview.hellogil.com/onlinePreview?watermarkTxt=${this.userInfo.userName}${this.userInfo.jobCard}&url=` +\r\n // url.replace(\"http://\", \"https://\")\r\n // );\r\n const urlWithoutParams = url.split(\"?\")[0].toLowerCase();\r\n if (\r\n !urlWithoutParams.endsWith(\".doc\") &&\r\n !urlWithoutParams.endsWith(\".xlx\")\r\n ) {\r\n // URL后缀不包含.doc和.xlx时执行的代码\r\n // window.open(\r\n // `https://www.hellogil.com/web/#/officePreview?url=` +\r\n // encodeURIComponent(url.replace(\"http://\", \"https://\"))\r\n // );\r\n getFileUrl(url.replace(\"http://\", \"https://\")).then(\r\n (res) => {\r\n if (res.result === \"success\") {\r\n window.open(res.data);\r\n } else {\r\n this.$message({\r\n message: \"该文件不支持预览!\",\r\n type: \"warning\",\r\n });\r\n }\r\n }\r\n );\r\n } else {\r\n this.$message({\r\n message: \"该文件不支持预览!\",\r\n type: \"warning\",\r\n });\r\n }\r\n } else {\r\n this.$message({\r\n message: \"该文件不支持预览!\",\r\n type: \"warning\",\r\n });\r\n }\r\n },\r\n handleDownload(file) {\r\n console.log(file);\r\n var name;\r\n let url = file.response\r\n ? file.response.data[0].attachmenturl\r\n : file.url;\r\n if (file.name) {\r\n name = file.name;\r\n if (!name.indexOf(\".\") > -1) {\r\n var a = url.split(\"/\");\r\n var b = a[a.length - 1];\r\n name = file.name + \".\" + b.split(\".\")[1];\r\n }\r\n } else {\r\n var a = url.split(\"/\");\r\n name = a[a.length - 1];\r\n }\r\n axios({\r\n method: \"post\",\r\n url:\r\n process.env.VUE_APP_BASE_API +\r\n \"/huilianApi/uploader/downloadZipFiles\",\r\n data:\r\n \"fileUrls=\" +\r\n JSON.stringify([\r\n {\r\n imgName: name\r\n .replace(/\\&/g, \"-\")\r\n .replace(/\\?/g, \"-\")\r\n .replace(/\\%/g, \"-\"),\r\n dataImg: url,\r\n },\r\n ]),\r\n responseType: \"blob\", // 加上这个是重点\r\n }).then((res) => {\r\n this.downloadFile(res.data, name);\r\n });\r\n },\r\n downloadFile(data, name) {\r\n const url = window.URL.createObjectURL(new Blob([data]));\r\n const link = document.createElement(\"a\");\r\n link.style.display = \"none\";\r\n link.href = url;\r\n link.setAttribute(\"download\", name);\r\n document.body.appendChild(link);\r\n link.click();\r\n URL.revokeObjectURL(link.href);\r\n document.body.removeChild(link);\r\n this.$message({\r\n message: \"下载成功\",\r\n type: \"success\",\r\n });\r\n },\r\n // 允许上传文件个数验证\r\n formHandleExceed(files, formFileList) {\r\n this.$message.warning(`最多上传 ${this.limit} 个文件!`);\r\n },\r\n // 上传文件\r\n handleUploadForm(file, fileList) {\r\n if (!file.url) {\r\n file.url = URL.createObjectURL(file.raw);\r\n }\r\n },\r\n // 上传成功\r\n handleSuccess(response, file, fileList) {\r\n var num = 0;\r\n for (var i = 0; i < fileList.length; i++) {\r\n if (fileList[i].status === \"success\") {\r\n num++;\r\n }\r\n }\r\n if (num === fileList.length) {\r\n this.formFileList = fileList;\r\n this.$emit(\"update:fileUrl\", this.formFileList);\r\n this.noneBtnImg = this.formFileList.length >= this.limit;\r\n if (this.handleSuccessCallback) {\r\n this.handleSuccessCallback(response, file, fileList);\r\n }\r\n }\r\n if (response.result === \"success\") {\r\n this.$message({\r\n message: \"上传成功\",\r\n type: \"success\",\r\n });\r\n }\r\n },\r\n // 上传失败\r\n handleError(err, file, fileList) {\r\n console.log(err);\r\n // this.loading.close()\r\n },\r\n\r\n dragEnd() {\r\n // this.drag = false;\r\n this.$emit(\"update:fileUrl\", this.formFileList);\r\n },\r\n showImgViewer() {\r\n this.imgViewerVisible = true;\r\n const m = (e) => {\r\n e.preventDefault();\r\n };\r\n document.body.style.overflow = \"hidden\";\r\n document.addEventListener(\"touchmove\", m, false); // 禁止页面滑动\r\n },\r\n closeImgViewer() {\r\n this.imgViewerVisible = false;\r\n const m = (e) => {\r\n e.preventDefault();\r\n };\r\n document.body.style.overflow = \"auto\";\r\n document.removeEventListener(\"touchmove\", m, true);\r\n },\r\n },\r\n};\r\n</script>\r\n\r\n<style lang=\"scss\">\r\n.upload_file_box {\r\n position: relative;\r\n\r\n .el-upload-list--picture-card {\r\n .el-upload-list__item {\r\n width: 104px;\r\n height: 104px;\r\n transition: none;\r\n }\r\n }\r\n\r\n .el-upload--picture-card {\r\n width: 104px;\r\n height: 104px;\r\n line-height: 104px;\r\n position: relative;\r\n z-index: 1;\r\n }\r\n\r\n .upload_file_operation {\r\n width: 100%;\r\n height: 100%;\r\n\r\n .upload_file_bg {\r\n width: 100%;\r\n height: 100%;\r\n background-size: contain;\r\n }\r\n }\r\n\r\n .disUoloadSty {\r\n .el-upload--picture-card {\r\n display: none;\r\n }\r\n }\r\n}\r\n</style>\r\n",".upload_file_box {\n position: relative;\n}\n.upload_file_box .el-upload-list--picture-card .el-upload-list__item {\n width: 104px;\n height: 104px;\n transition: none;\n}\n.upload_file_box .el-upload--picture-card {\n width: 104px;\n height: 104px;\n line-height: 104px;\n position: relative;\n z-index: 1;\n}\n.upload_file_box .upload_file_operation {\n width: 100%;\n height: 100%;\n}\n.upload_file_box .upload_file_operation .upload_file_bg {\n width: 100%;\n height: 100%;\n background-size: contain;\n}\n.upload_file_box .disUoloadSty .el-upload--picture-card {\n display: none;\n}\n\n/*# sourceMappingURL=index.vue.map */"]},media:undefined});};/* scoped */const __vue_scope_id__$i=undefined;/* module identifier */const __vue_module_identifier__$i=undefined;/* functional template */const __vue_is_functional_template__$i=false;/* style inject SSR */ /* style inject shadow dom */const __vue_component__$i=/*#__PURE__*/normalizeComponent({render:__vue_render__$i,staticRenderFns:__vue_staticRenderFns__$i},__vue_inject_styles__$i,__vue_script__$i,__vue_scope_id__$i,__vue_is_functional_template__$i,__vue_module_identifier__$i,false,createInjector,undefined,undefined);__vue_component__$i.install=function(Vue){Vue.component(__vue_component__$i.name,__vue_component__$i);};//
602
602
  var script$h={props:{fileUrl:{// 文件数组
603
603
  default:()=>{return[];},type:Array},isShowDownload:{// 是否显示
604
604
  default:true,type:Boolean},showTitle:{// 是否显示图片名
@@ -10552,4 +10552,4 @@ for(let i=0;i<rows;i++){for(let j=0;j<cols;j++){watermarks.push({svg:`
10552
10552
  <text transform="translate(10,200) rotate(-45)" font-weight="bold" fill="#f5f5f5" style="font-size: 16px;opacity:0.7;">${text}</text>
10553
10553
  </svg>
10554
10554
  `,// absolutePosition: { x: 0, y: -100 }
10555
- absolutePosition:{x:j*(pageWidth/(cols-0.5)),y:i*(pageHeight/(rows-0.5))-100}});}}return watermarks;}}};/* script */const __vue_script__=script;/* template */var __vue_render__=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("div",{attrs:{id:"DataToPdfBox"}},[_c("el-dialog",{attrs:{title:_vm.dialogParams.title,visible:_vm.visible,width:_vm.dialogParams.width,"close-on-click-modal":false,"before-close":_vm.cancel},on:{"update:visible":function($event){_vm.visible=$event;}}},[_vm._t("html"),_vm._v(" "),_c("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[_c("el-button",{attrs:{loading:_vm.isSubmitLoading},on:{click:_vm.submit}},[_vm._v(_vm._s(_vm.dialogParams.buttonText))])],1)],2)],1);};var __vue_staticRenderFns__=[];__vue_render__._withStripped=true;/* style */const __vue_inject_styles__=undefined;/* scoped */const __vue_scope_id__=undefined;/* module identifier */const __vue_module_identifier__=undefined;/* functional template */const __vue_is_functional_template__=false;/* style inject */ /* style inject SSR */ /* style inject shadow dom */const __vue_component__=/*#__PURE__*/normalizeComponent({render:__vue_render__,staticRenderFns:__vue_staticRenderFns__},__vue_inject_styles__,__vue_script__,__vue_scope_id__,__vue_is_functional_template__,__vue_module_identifier__,false,undefined,undefined,undefined);__vue_component__.install=function(Vue){Vue.component(__vue_component__.name,__vue_component__);};var version="3.7.6";const components=[__vue_component__$k,__vue_component__$j,__vue_component__$i,__vue_component__$h,__vue_component__$4,__vue_component__$3,__vue_component__$2,__vue_component__$1,__vue_component__];const install=function(Vue){components.forEach(component=>{Vue.component(component.name,component);});};if(typeof window!=="undefined"&&window.Vue){install(window.Vue);}var index={version,install};export{__vue_component__ as DataToPdf,__vue_component__$2 as ExportList,__vue_component__$4 as FormTableScheme,__vue_component__$j as HelloVue,__vue_component__$3 as HtmlToImg,__vue_component__$k as MyButton,__vue_component__$h as ShowFile,__vue_component__$1 as StandardImport,__vue_component__$i as UploadFile,index as default,install};
10555
+ absolutePosition:{x:j*(pageWidth/(cols-0.5)),y:i*(pageHeight/(rows-0.5))-100}});}}return watermarks;}}};/* script */const __vue_script__=script;/* template */var __vue_render__=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("div",{attrs:{id:"DataToPdfBox"}},[_c("el-dialog",{attrs:{title:_vm.dialogParams.title,visible:_vm.visible,width:_vm.dialogParams.width,"close-on-click-modal":false,"before-close":_vm.cancel},on:{"update:visible":function($event){_vm.visible=$event;}}},[_vm._t("html"),_vm._v(" "),_c("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[_c("el-button",{attrs:{loading:_vm.isSubmitLoading},on:{click:_vm.submit}},[_vm._v(_vm._s(_vm.dialogParams.buttonText))])],1)],2)],1);};var __vue_staticRenderFns__=[];__vue_render__._withStripped=true;/* style */const __vue_inject_styles__=undefined;/* scoped */const __vue_scope_id__=undefined;/* module identifier */const __vue_module_identifier__=undefined;/* functional template */const __vue_is_functional_template__=false;/* style inject */ /* style inject SSR */ /* style inject shadow dom */const __vue_component__=/*#__PURE__*/normalizeComponent({render:__vue_render__,staticRenderFns:__vue_staticRenderFns__},__vue_inject_styles__,__vue_script__,__vue_scope_id__,__vue_is_functional_template__,__vue_module_identifier__,false,undefined,undefined,undefined);__vue_component__.install=function(Vue){Vue.component(__vue_component__.name,__vue_component__);};var version="3.7.8";const components=[__vue_component__$k,__vue_component__$j,__vue_component__$i,__vue_component__$h,__vue_component__$4,__vue_component__$3,__vue_component__$2,__vue_component__$1,__vue_component__];const install=function(Vue){components.forEach(component=>{Vue.component(component.name,component);});};if(typeof window!=="undefined"&&window.Vue){install(window.Vue);}var index={version,install};export{__vue_component__ as DataToPdf,__vue_component__$2 as ExportList,__vue_component__$4 as FormTableScheme,__vue_component__$j as HelloVue,__vue_component__$3 as HtmlToImg,__vue_component__$k as MyButton,__vue_component__$h as ShowFile,__vue_component__$1 as StandardImport,__vue_component__$i as UploadFile,index as default,install};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huilian/components-tms",
3
- "version": "3.7.6",
3
+ "version": "3.7.8",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "npx rollup -wc rollup.config.dev.js",