{"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\\common\\ImgFileUpload.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\common\\ImgFileUpload.vue","mtime":1667327529075},{"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.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//\nimport { mapState } from \"vuex\";\nimport req from \"@/request.js\";\nimport { Base64 } from \"js-base64\";\nexport default {\n  components: {},\n  props: [\"fileJson\"],\n  data: function data() {\n    return {\n      src: \"\",\n      fileId: \"\",\n      fileTree: \"\",\n      iframeSrc: \"\",\n      files: [],\n      uploadingFiles: {},\n      list: [],\n      isChecking: true,\n      accept: \".jpg,.jpeg,.png,.JPG,.JPEG,.gif,.PNG,.GIF\",\n      num: 0\n    };\n  },\n  watch: {\n    fileJson: {\n      handler: function handler(val, oldVal) {\n        if (val) {\n          this.files = JSON.parse(val);\n        }\n      }\n    }\n  },\n  computed: mapState({\n    header: function header(state) {\n      return {\n        Authorization: \"Bearer \".concat(state.login.currentUser.token)\n      };\n    },\n    actionUrl: function actionUrl() {\n      return window.context.portal + \"/file/v1/upload\";\n    }\n  }),\n  mounted: function mounted() {\n    if (this.$attrs.value) {\n      this.files = JSON.parse(this.$attrs.value);\n    }\n  },\n  methods: {\n    exceed: function exceed(file, fileList) {\n      if (fileList.length == 1 || file.length > 1) {\n        this.$message.warning(\"只能上传一个文件\");\n      }\n    },\n    preview: function preview(files) {\n      var id = files.id;\n      alert(id);\n    },\n    beforeRemove: function beforeRemove(file, fileList) {\n      var _this = this;\n\n      if (this.isChecking) {\n        return this.$confirm(\"\\u786E\\u5B9A\\u79FB\\u9664 \".concat(file.name, \"\\uFF1F\")).then(function () {\n          _this.$emit(\"input\", \"\");\n        });\n      }\n    },\n    error: function error(response, file, fileList) {\n      delete this.uploadingFiles[Base64.encode(file.name)];\n    },\n    success: function success(response, file, fileList) {\n      this.$emit(\"input\", JSON.stringify([{\n        id: response.fileId,\n        name: response.fileName\n      }]));\n    },\n    getFiles: function getFiles() {\n      if (this.files.length == 0) {\n        return \"\";\n      } else {\n        return this.files;\n      }\n    },\n    isFinishUpload: function isFinishUpload() {\n      if (JSON.stringify(this.uploadingFiles) != \"{}\") {\n        this.$message.warning(\"正在上传附件，请稍后！\");\n        throw \"正在上传附件，请稍后！\";\n      }\n    },\n    beforeAvatarUpload: function beforeAvatarUpload(file) {\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      this.isChecking = !isExt;\n\n      if (isExt) {\n        if (this.accept == \"false\") {\n          this.$message.error(\"请配置可上传文件的格式!\");\n        } else {\n          this.$message.error(\"上传的附件只能是 \" + this.accept + \"格式!\");\n        }\n\n        return !isExt;\n      }\n\n      this.uploadingFiles[Base64.encode(name)] = \"eror\";\n    }\n  }\n};",null]}