{"remainingRequest":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\artfess-module\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\artfess-module\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\artfess-module\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\artfess-module\\src\\components\\HtFile.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\artfess-module\\src\\components\\HtFile.vue","mtime":1675232038574},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es6.regexp.split\";\nimport _toConsumableArray from \"D:/jenkins/workspace/artfess-module/node_modules/@babel/runtime/helpers/esm/toConsumableArray\";\nimport \"core-js/modules/es6.function.name\";\nimport _defineProperty from \"D:/jenkins/workspace/artfess-module/node_modules/@babel/runtime/helpers/esm/defineProperty\";\nimport \"core-js/modules/es6.number.constructor\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\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//\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//\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//\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//\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//\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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport utils from \"@/utils.js\";\nimport HtFieldTail from \"@/components/HtFieldTail.vue\";\nimport FileUpload from \"@/components/common/FileUpload.vue\";\nimport Locale from \"@/mixins/locale\";\nexport default {\n  name: \"ht-file\",\n  mixins: [Locale],\n  props: {\n    isSimple: {\n      type: Boolean,\n      default: false\n    },\n    withCredentials: {\n      type: Boolean,\n      default: false\n    },\n    actionUrl: {\n      type: String,\n      default: \"https://jsonplaceholder.typicode.com/posts/\"\n    },\n    value: {\n      type: String\n    },\n    validate: {\n      type: Object\n    },\n    name: {\n      type: String\n    },\n    multiple: {\n      type: Boolean,\n      default: false\n    },\n    permission: {\n      type: String,\n      default: \"w\",\n      validator: function validator(value) {\n        return [\"b\", \"w\", \"r\", \"n\"].indexOf(value) !== -1;\n      }\n    },\n    accept: {\n      type: String\n    },\n    limit: {\n      type: Number\n    },\n    header: {\n      type: Object\n    },\n    size: {\n      type: Number\n    },\n    previewable: {\n      type: Boolean,\n      default: true\n    },\n    downloadable: {\n      type: Boolean,\n      default: true\n    },\n    propConfList: {\n      type: Array,\n      default: function _default() {\n        return [];\n      }\n    },\n    beforeUpload: {\n      type: Function\n    },\n    onSuccess: {\n      type: Function\n    },\n    onError: {\n      type: Function\n    },\n    columnShow: {\n      type: Object,\n      default: function _default() {\n        return {};\n      }\n    }\n  },\n  components: {\n    HtFieldTail: HtFieldTail,\n    FileUpload: FileUpload\n  },\n  data: function data() {\n    return {\n      operateWidth: this.permission === \"r\" ? \"70\" : \"260\",\n      inputName: null,\n      writeable: true,\n      files: [],\n      filesData: [],\n      progressPercent: 0,\n      progressFlag: false\n    };\n  },\n  computed: {\n    inputWriteable: function inputWriteable() {\n      return this.writeable ? utils.getWriteable(this.permission) : this.writeable;\n    },\n    inputValidate: function inputValidate() {\n      return utils.addRequiredOrNot(this.permission, this.validate, this);\n    },\n    calColumnShow: function calColumnShow() {\n      var defaultSetting = {\n        fileType: true,\n        fileSize: true\n      };\n      return _objectSpread(_objectSpread({}, defaultSetting), this.columnShow);\n    }\n  },\n  watch: {\n    filesData: function filesData(newVal) {\n      var r = \"\";\n\n      if (newVal && newVal.constructor === Array && newVal.length > 0) {\n        // 只有上传成功的附件才能更新v-model值\n        var ary = newVal.filter(function (m) {\n          return m.status === \"success\";\n        });\n\n        if (ary && ary.length > 0) {\n          r = JSON.stringify(ary);\n        }\n      }\n\n      this.$emit(\"input\", r);\n    },\n    files: function files(newVal) {\n      if (!newVal || newVal.length == 0) {\n        this.filesData = [];\n      }\n    }\n  },\n  created: function created() {\n    this.inputName = this.name ? this.name : utils.getName();\n    this.$validator = this.$root.$validator;\n\n    if (this.value && this.value.constructor === String) {\n      if (!this.value.response) {\n        var fileVal = _toConsumableArray(JSON.parse(this.value)); //获取附件类型\n\n\n        for (var i = 0; i < fileVal.length; i++) {\n          if (fileVal[i].name && fileVal[i].name.split(\".\")) {\n            fileVal[i].type = this.substringType(fileVal[i].name);\n            fileVal[i].state = \"success\";\n            fileVal[i].percentage = 100;\n          }\n        }\n\n        this.files = fileVal;\n        this.filesData = fileVal;\n      } else {\n        this.files = JSON.parse(this.value);\n        this.filesData = JSON.parse(this.value);\n      }\n    }\n  },\n  methods: {\n    //获取指定字符串点最后一个字符\n    substringType: function substringType(str) {\n      var valueArr = str.split(\".\");\n      return valueArr[valueArr.length - 1];\n    },\n    handleError: function handleError() {\n      this.progressFlag = false;\n    },\n    handleProgress: function handleProgress(event, file, fileList) {\n      this.progressFlag = true;\n      this.progressPercent = Math.floor(event.percent);\n    },\n    move: function move(item, direct) {\n      this.filesData = utils.arrayMove(this.filesData, item, direct);\n    },\n    uploadSuccess: function uploadSuccess(response, file, fileList) {\n      //获取附件类型\n      var type = \"\";\n\n      if (file.name && file.name.split(\".\")) {\n        type = this.substringType(file.name);\n      } else {\n        type = file.type;\n      }\n\n      for (var i = 0; i < this.filesData.length; i++) {\n        if (this.filesData[i].uid == file.uid) {\n          this.filesData.splice(i, 1);\n          break;\n        }\n      }\n\n      this.filesData.push({\n        name: file.name,\n        size: file.size,\n        percentage: file.percentage,\n        status: file.status,\n        state: file.status,\n        response: file.response,\n        username: file.response.username || \"\",\n        type: type,\n        uid: file.uid,\n        prop1: \"\",\n        prop2: \"\",\n        prop3: \"\",\n        prop4: \"\",\n        prop5: \"\",\n        prop6: \"\"\n      });\n      this.progressPercent === 100 ? this.progressFlag = false : this.progressFlag = true;\n      this.$emit(\"onSuccess\", response, file, fileList);\n    },\n    removeFile: function removeFile(file) {\n      var _this = this;\n\n      this.$confirm(\"\\u786E\\u5B9A\\u5220\\u9664\".concat(file.name, \"?\")).then(function () {\n        _this.filesData.remove(file);\n\n        _this.$refs.fileUpload.remove(file);\n\n        _this.$emit(\"remove\", file, _this.files);\n      }).catch(function () {});\n    },\n    download: function download(file) {\n      this.$emit(\"download\", file, this.files);\n    },\n    preview: function preview(file) {\n      if (this.previewable) {\n        this.$emit(\"preview\", file, this.files);\n      } else {\n        var msg = this.t(\"ht.file.nopreview\");\n        this.$message.warning(msg);\n      }\n    }\n  }\n};",null]}