{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\eipControl\\EipAttachment.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\eipControl\\EipAttachment.vue","mtime":1667327529200},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\babel.config.js","mtime":1667327525434},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.number.constructor\";\nimport \"core-js/modules/es6.function.name\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport { mapState } from \"vuex\";\nimport utils from \"@/utils.js\";\nimport req from \"@/request.js\";\nimport sub_pio_mixin from \"@/sub-permission-mixin.js\";\nimport FilePreview from \"@/components/common/FilePreview.vue\";\nimport { Message } from \"element-ui\";\nexport default {\n name: \"eip-attachment\",\n components: {\n FilePreview: FilePreview\n },\n props: [\"validate\", \"value\", \"name\", \"permission\", \"size\", \"limit\", \"multiple\", \"accept\", \"propConf\", \"allowPreview\", \"allowDownload\", \"simplicity\"],\n mixins: [sub_pio_mixin],\n //混入方式引入表单组件中公共属性,处理子表、孙表行内联动(切面修改permission_sub)\n data: function data() {\n return {\n limits: 9999,\n propConfList: [],\n inputVal: this.value,\n refreshTime: new Date().getTime(),\n src: \"\",\n fileId: \"\",\n fileTree: \"\",\n iframeSrc: \"\",\n acceptFile: \"\",\n newValidate: null,\n actionUrl: window.context.portal + \"/system/file/v1/upload\"\n };\n },\n computed: mapState({\n inputValidate: function inputValidate() {\n if (this.newValidate) {\n return this.newValidate;\n }\n\n var validateObj = this.$store.state.index.validate;\n return utils.addRequiredOrNot(this.permission_sub, this.validate, validateObj, this);\n },\n header: function header(state) {\n return {\n Authorization: \"Bearer \".concat(state.login.currentUser.token)\n };\n },\n //actionUrl: function() {\n // return window.context.portal + \"/system/file/v1/upload\";\n //},\n inputName: function inputName() {\n var labeldesc = \"\";\n\n if (this.$slots && this.$slots.labeldesc && this.$slots.labeldesc[0].children && this.$slots.labeldesc[0].children[0].text) {\n labeldesc = this.$slots.labeldesc[0].children[0].text;\n return this.name ? this.name : utils.getName() + \"-\" + labeldesc;\n } else {\n return this.name ? this.name : utils.getName();\n }\n },\n previewAble: function previewAble() {\n if (this.permission_sub != 'w' && !this.allowPreview) {\n return false;\n }\n\n return true;\n },\n downloadAble: function downloadAble() {\n if (this.permission_sub != 'w' && !this.allowDownload) {\n return false;\n }\n\n return true;\n }\n }),\n watch: {\n inputVal: function inputVal(val) {\n this.$emit(\"input\", val);\n },\n value: function value(val) {\n var _this = this;\n\n this.inputVal = val;\n setTimeout(function () {\n _this.refreshTime = new Date().getTime();\n }, 300);\n }\n },\n mounted: function mounted() {\n if (this.limit) {\n this.limits = Number(this.limit);\n }\n\n try {\n var formInst = utils.getOnlineFormInstance(this);\n\n if (formInst.flowKey) {\n this.actionUrl = this.actionUrl + '?flowKey=' + formInst.flowKey;\n }\n } catch (error) {}\n },\n beforeDestroy: function beforeDestroy() {},\n destroyed: function destroyed() {},\n created: function created() {\n var _this2 = this;\n\n if (this.propConf) {\n var list = JSON.parse(this.propConf);\n list.forEach(function (element) {\n if (element.desc) {\n if (element.requried) {\n element.inputValidate = \"required:true\";\n }\n\n _this2.propConfList.push(element);\n }\n });\n }\n\n if (this.accept) {\n this.acceptFile = \".\" + this.accept.split(\",\").join(\",.\");\n }\n\n this.$validator = this.$root.$validator;\n },\n methods: {\n onSuccess: function onSuccess(file) {},\n beforeAvatarUpload: function beforeAvatarUpload(file) {\n if (!this.accept || typeof this.accept == 'undefined') {\n return true;\n } // 文件类型限制\n\n\n var name = file.name ? file.name : \"\";\n var ext = name ? name.substr(name.lastIndexOf(\".\") + 1, name.length) : true;\n var isExt = this.accept.indexOf(ext) < 0;\n\n if (isExt) {\n if (this.accept == \"\" || this.accept == undefined) {\n this.$message.error(\"请配置可上传文件的格式!\");\n } else {\n this.$message.error(\"上传的附件只能是 \" + this.accept + \"格式!\");\n }\n }\n\n return !isExt;\n },\n download: function download(file) {\n if (!file.response && !file.id) {\n this.$message.warning(\"请稍后再试!\");\n return;\n }\n\n var fileId = \"\";\n\n if (file.id) {\n fileId = file.id;\n } else {\n fileId = file.response.fileId;\n }\n\n req.download(\"${portal}/system/file/v1/downloadFile?fileId=\" + fileId);\n },\n preview: function preview(files) {\n if (!files.response && !files.id) {\n this.$message.warning(\"请稍后再试!\");\n return;\n }\n\n if (files.id) {\n var obj = {};\n obj.id = files.id;\n obj.name = files.name;\n obj.size = files.size;\n this.$refs.filePreview.preview(obj);\n } else {\n var fileData = files.response;\n var _obj = {};\n _obj.id = fileData.fileId;\n _obj.name = fileData.fileName;\n _obj.size = fileData.size;\n this.$refs.filePreview.preview(_obj);\n }\n }\n }\n};",null]}