hbte-saas-ui 1.8.10 → 1.8.12

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.
@@ -1256,17 +1256,6 @@ _src_main_vue__WEBPACK_IMPORTED_MODULE_0__["default"].config = function (params)
1256
1256
  };
1257
1257
  /* harmony default export */ __webpack_exports__["default"] = (_src_main_vue__WEBPACK_IMPORTED_MODULE_0__["default"]);
1258
1258
 
1259
- /***/ }),
1260
-
1261
- /***/ "2070":
1262
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1263
-
1264
- "use strict";
1265
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_2c521d9c_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("695d");
1266
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_2c521d9c_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_2c521d9c_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
1267
- /* unused harmony reexport * */
1268
-
1269
-
1270
1259
  /***/ }),
1271
1260
 
1272
1261
  /***/ "2266":
@@ -19486,6 +19475,17 @@ module.exports = getPrototype;
19486
19475
 
19487
19476
  /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba"), __webpack_require__("62e4")(module)))
19488
19477
 
19478
+ /***/ }),
19479
+
19480
+ /***/ "2f12":
19481
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
19482
+
19483
+ "use strict";
19484
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_1b14089e_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("6207");
19485
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_1b14089e_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_main_vue_vue_type_style_index_0_id_1b14089e_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
19486
+ /* unused harmony reexport * */
19487
+
19488
+
19489
19489
  /***/ }),
19490
19490
 
19491
19491
  /***/ "2f62":
@@ -24661,6 +24661,13 @@ var nativeCreate = getNative(Object, 'create');
24661
24661
  module.exports = nativeCreate;
24662
24662
 
24663
24663
 
24664
+ /***/ }),
24665
+
24666
+ /***/ "6207":
24667
+ /***/ (function(module, exports, __webpack_require__) {
24668
+
24669
+ // extracted by mini-css-extract-plugin
24670
+
24664
24671
  /***/ }),
24665
24672
 
24666
24673
  /***/ "62e4":
@@ -24972,13 +24979,6 @@ module.exports = function isSubsetOf(other) {
24972
24979
  };
24973
24980
 
24974
24981
 
24975
- /***/ }),
24976
-
24977
- /***/ "695d":
24978
- /***/ (function(module, exports, __webpack_require__) {
24979
-
24980
- // extracted by mini-css-extract-plugin
24981
-
24982
24982
  /***/ }),
24983
24983
 
24984
24984
  /***/ "6964":
@@ -43670,12 +43670,12 @@ module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
43670
43670
  // ESM COMPAT FLAG
43671
43671
  __webpack_require__.r(__webpack_exports__);
43672
43672
 
43673
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3c7c6be7-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/main.vue?vue&type=template&id=2c521d9c
43674
- var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{key:_vm.key,staticClass:"hb-upload"},[_c('div',{directives:[{name:"layout-flex",rawName:"v-layout-flex",value:({ gutter: 20, maxWidth: 280 }),expression:"{ gutter: 20, maxWidth: 280 }"}],staticClass:"hb-upload-wrapper"},[_vm._l((_vm.list),function(item,index){return _c('div',{key:index,staticClass:"unit-item-wrapper"},[_c('div',{staticClass:"file unit-item",on:{"click":function($event){return _vm.viewFile(item)}}},[_c('HbSvg',{attrs:{"iconClass":_vm._f("fileIcon")(true,_vm.getSuffix(item.fileName)),"fontSize":"44px"}}),_c('div',{staticClass:"right"},[_c('div',{staticClass:"title"},[_vm._v(" "+_vm._s(item.fileName)+" ")]),_c('div',{staticClass:"info"},[_c('div',{staticClass:"time"},[_vm._v(_vm._s(item.createTime))]),_c('div',{staticClass:"icon"},[(_vm.showCover)?_c('i',{staticClass:"icon-main-huanyuan mr10",on:{"click":function($event){$event.stopPropagation();return _vm.openCover(index)}}}):_vm._e(),(_vm.showDownLoad(item))?_c('i',{staticClass:"icon-main-xiazai mr10",on:{"click":function($event){$event.stopPropagation();return _vm.downloadFile(item)}}}):_vm._e(),(_vm.showRemove)?_c('i',{staticClass:"icon-main-shanchu",on:{"click":function($event){$event.stopPropagation();return _vm.remove(index, item.fileName)}}}):_vm._e()])])])],1),_vm._t("default",null,{"fileData":item})],2)}),(_vm.editAble)?_c('div',{staticClass:"upload unit-item"},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.netDisc),expression:"netDisc"}],staticClass:"netdisc",on:{"click":_vm.openNetDisc}},[_vm._v("选择网盘地址")]),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.link),expression:"link"}],staticClass:"link",on:{"click":_vm.openLink}},[_vm._v("自定义链接")]),_c('div',{staticClass:"local-file",on:{"click":_vm.openFile}},[_c('i',{staticClass:"el-icon-plus"}),_vm._v(" 上传附件 "),_c('input',{ref:"input",staticClass:"hidden",attrs:{"type":"file","multiple":""},on:{"change":_vm.chooseFile}})]),(_vm.maxUpload)?_c('div',{staticClass:"maxUploadShow"},[_vm._v(_vm._s(_vm.list.length)+" / "+_vm._s(_vm.maxUpload))]):_vm._e()]):_vm._e(),_c('input',{ref:"coverInput",staticClass:"hidden",attrs:{"type":"file"},on:{"change":function (ev) { return _vm.coverFile(ev); }}})],2),_c('NetDisc',{ref:"netDisc",on:{"submit":_vm.addNet}}),_c('CustomLink',{ref:"customLink",on:{"submit":_vm.addLink}})],1)}
43673
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3c7c6be7-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/main.vue?vue&type=template&id=1b14089e
43674
+ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{key:_vm.key,staticClass:"hb-upload"},[_c('div',{directives:[{name:"layout-flex",rawName:"v-layout-flex",value:({ gutter: 20, maxWidth: 280 }),expression:"{ gutter: 20, maxWidth: 280 }"}],staticClass:"hb-upload-wrapper"},[_vm._l((_vm.list),function(item,index){return _c('div',{key:String(item.fileUrl || item.id) + index,staticClass:"unit-item-wrapper"},[_c('div',{staticClass:"file unit-item",on:{"click":function($event){return _vm.viewFile(item)}}},[_c('HbSvg',{attrs:{"iconClass":_vm._f("fileIcon")(true,_vm.getSuffix(item.fileName)),"fontSize":"44px"}}),_c('div',{staticClass:"right"},[_c('div',{staticClass:"title"},[_vm._v(" "+_vm._s(item.fileName)+" ")]),_c('div',{staticClass:"info"},[_c('div',{staticClass:"time"},[_vm._v(_vm._s(item.createTime))]),_c('div',{staticClass:"icon"},[(_vm.showCover)?_c('i',{staticClass:"icon-main-huanyuan mr10",on:{"click":function($event){$event.stopPropagation();return _vm.openCover(index)}}}):_vm._e(),(_vm.showDownLoad(item))?_c('i',{staticClass:"icon-main-xiazai mr10",on:{"click":function($event){$event.stopPropagation();return _vm.downloadFile(item)}}}):_vm._e(),(_vm.showRemove)?_c('i',{staticClass:"icon-main-shanchu",on:{"click":function($event){$event.stopPropagation();return _vm.remove(index, item.fileName)}}}):_vm._e()])])])],1),_vm._t("default",null,{"fileData":item})],2)}),_vm._l((_vm.uploadingList),function(item,index){return _c('div',{key:'uploading-' + index,staticClass:"unit-item-wrapper"},[_c('div',{staticClass:"file unit-item"},[_c('HbSvg',{attrs:{"iconClass":_vm._f("fileIcon")(true,_vm.getSuffix(item.fileName)),"fontSize":"44px"}}),_c('div',{staticClass:"right",staticStyle:{"flex-direction":"row","align-items":"center"}},[_c('div',{staticStyle:{"flex":"1","overflow":"hidden","margin-right":"10px"}},[_c('div',{staticClass:"title"},[_vm._v(_vm._s(item.fileName))]),_c('div',{staticClass:"info"},[_vm._v(" "+_vm._s(item.status === "transmitSuccess" ? "处理中..." : "上传中...")+" ")])]),_c('div',{staticClass:"progress-wrapper"},[_c('el-progress',{attrs:{"type":"circle","percentage":Math.floor(item.progress * 100),"width":50,"stroke-width":4}}),(item.status === 'padding' || item.status === 'inline')?_c('i',{staticClass:"el-icon-close cancel-btn",on:{"click":function($event){$event.stopPropagation();return _vm.cancelUpload(item)}}}):_vm._e()],1)])],1)])}),(_vm.editAble)?_c('div',{staticClass:"upload unit-item"},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.netDisc),expression:"netDisc"}],staticClass:"netdisc",on:{"click":_vm.openNetDisc}},[_vm._v(" 选择网盘地址 ")]),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.link),expression:"link"}],staticClass:"link",on:{"click":_vm.openLink}},[_vm._v("自定义链接")]),_c('div',{staticClass:"local-file",on:{"click":_vm.openFile}},[_c('i',{staticClass:"el-icon-plus"}),_vm._v(" 上传附件 "),_c('input',{ref:"input",staticClass:"hidden",attrs:{"type":"file","multiple":""},on:{"change":_vm.chooseFile}})]),(_vm.maxUpload)?_c('div',{staticClass:"maxUploadShow"},[_vm._v(" "+_vm._s(_vm.list.length)+" / "+_vm._s(_vm.maxUpload)+" ")]):_vm._e()]):_vm._e(),_c('input',{ref:"coverInput",staticClass:"hidden",attrs:{"type":"file"},on:{"change":function (ev) { return _vm.coverFile(ev); }}})],2),_c('NetDisc',{ref:"netDisc",on:{"submit":_vm.addNet}}),_c('CustomLink',{ref:"customLink",on:{"submit":_vm.addLink}})],1)}
43675
43675
  var staticRenderFns = []
43676
43676
 
43677
43677
 
43678
- // CONCATENATED MODULE: ./packages/upload/src/main.vue?vue&type=template&id=2c521d9c
43678
+ // CONCATENATED MODULE: ./packages/upload/src/main.vue?vue&type=template&id=1b14089e
43679
43679
 
43680
43680
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
43681
43681
  var es_array_push = __webpack_require__("14d9");
@@ -43683,6 +43683,9 @@ var es_array_push = __webpack_require__("14d9");
43683
43683
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.constructor.js
43684
43684
  var es_iterator_constructor = __webpack_require__("e9f5");
43685
43685
 
43686
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.find.js
43687
+ var es_iterator_find = __webpack_require__("f665");
43688
+
43686
43689
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.for-each.js
43687
43690
  var es_iterator_for_each = __webpack_require__("7d54");
43688
43691
 
@@ -43921,12 +43924,12 @@ var component = Object(componentNormalizer["a" /* default */])(
43921
43924
  )
43922
43925
 
43923
43926
  /* harmony default export */ var NetDisc = (component.exports);
43924
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3c7c6be7-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/component/CustomLink.vue?vue&type=template&id=01816d01
43925
- var CustomLinkvue_type_template_id_01816d01_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('hb-dialog',{ref:"dialog",attrs:{"width":"480px","title":"添加自定义链接","formData":_vm.formData,"rules":_vm.rules,"append-to-body":true,"destroy-on-close":true},on:{"submit":_vm.submit,"closed":_vm.clear},scopedSlots:_vm._u([{key:"form",fn:function(){return [_c('el-form-item',{attrs:{"label":"文件名","prop":"fileName"}},[_c('el-input',{attrs:{"maxlength":"50"},model:{value:(_vm.formData.fileName),callback:function ($$v) {_vm.$set(_vm.formData, "fileName", $$v)},expression:"formData.fileName"}})],1),_c('el-form-item',{attrs:{"label":"链接","prop":"fileUrl"}},[_c('el-input',{attrs:{"maxlength":"200"},model:{value:(_vm.formData.fileUrl),callback:function ($$v) {_vm.$set(_vm.formData, "fileUrl", $$v)},expression:"formData.fileUrl"}})],1)]},proxy:true}])})}
43926
- var CustomLinkvue_type_template_id_01816d01_staticRenderFns = []
43927
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3c7c6be7-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/component/CustomLink.vue?vue&type=template&id=16ec7968
43928
+ var CustomLinkvue_type_template_id_16ec7968_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('hb-dialog',{ref:"dialog",attrs:{"width":"480px","title":"添加自定义链接","formData":_vm.formData,"rules":_vm.rules,"append-to-body":true,"destroy-on-close":true},on:{"submit":_vm.submit,"closed":_vm.clear},scopedSlots:_vm._u([{key:"form",fn:function(){return [_c('el-form-item',{attrs:{"label":"文件名","prop":"fileName"}},[_c('el-input',{attrs:{"maxlength":"50"},model:{value:(_vm.formData.fileName),callback:function ($$v) {_vm.$set(_vm.formData, "fileName", $$v)},expression:"formData.fileName"}})],1),_c('el-form-item',{attrs:{"label":"链接","prop":"fileUrl"}},[_c('el-input',{attrs:{"maxlength":"200"},model:{value:(_vm.formData.fileUrl),callback:function ($$v) {_vm.$set(_vm.formData, "fileUrl", $$v)},expression:"formData.fileUrl"}})],1)]},proxy:true}])})}
43929
+ var CustomLinkvue_type_template_id_16ec7968_staticRenderFns = []
43927
43930
 
43928
43931
 
43929
- // CONCATENATED MODULE: ./packages/upload/src/component/CustomLink.vue?vue&type=template&id=01816d01
43932
+ // CONCATENATED MODULE: ./packages/upload/src/component/CustomLink.vue?vue&type=template&id=16ec7968
43930
43933
 
43931
43934
  // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/component/CustomLink.vue?vue&type=script&lang=js
43932
43935
  //
@@ -43980,9 +43983,9 @@ var CustomLinkvue_type_template_id_01816d01_staticRenderFns = []
43980
43983
  this.$refs.dialog.clearValidate();
43981
43984
  },
43982
43985
  submit() {
43983
- this.formData.fileUrl;
43984
43986
  this.$emit("submit", {
43985
- ...this.formData
43987
+ ...this.formData,
43988
+ onlineUrl: this.formData.fileUrl
43986
43989
  });
43987
43990
  this.$refs.dialog.close();
43988
43991
  },
@@ -44007,8 +44010,8 @@ var CustomLinkvue_type_template_id_01816d01_staticRenderFns = []
44007
44010
 
44008
44011
  var CustomLink_component = Object(componentNormalizer["a" /* default */])(
44009
44012
  component_CustomLinkvue_type_script_lang_js,
44010
- CustomLinkvue_type_template_id_01816d01_render,
44011
- CustomLinkvue_type_template_id_01816d01_staticRenderFns,
44013
+ CustomLinkvue_type_template_id_16ec7968_render,
44014
+ CustomLinkvue_type_template_id_16ec7968_staticRenderFns,
44012
44015
  false,
44013
44016
  null,
44014
44017
  null,
@@ -44025,6 +44028,56 @@ var CustomLink_component = Object(componentNormalizer["a" /* default */])(
44025
44028
 
44026
44029
 
44027
44030
 
44031
+
44032
+ //
44033
+ //
44034
+ //
44035
+ //
44036
+ //
44037
+ //
44038
+ //
44039
+ //
44040
+ //
44041
+ //
44042
+ //
44043
+ //
44044
+ //
44045
+ //
44046
+ //
44047
+ //
44048
+ //
44049
+ //
44050
+ //
44051
+ //
44052
+ //
44053
+ //
44054
+ //
44055
+ //
44056
+ //
44057
+ //
44058
+ //
44059
+ //
44060
+ //
44061
+ //
44062
+ //
44063
+ //
44064
+ //
44065
+ //
44066
+ //
44067
+ //
44068
+ //
44069
+ //
44070
+ //
44071
+ //
44072
+ //
44073
+ //
44074
+ //
44075
+ //
44076
+ //
44077
+ //
44078
+ //
44079
+ //
44080
+ //
44028
44081
  //
44029
44082
  //
44030
44083
  //
@@ -44075,16 +44128,47 @@ var CustomLink_component = Object(componentNormalizer["a" /* default */])(
44075
44128
  //
44076
44129
  //
44077
44130
  //
44131
+ //
44132
+ //
44133
+ //
44134
+ //
44135
+ //
44136
+ //
44137
+ //
44138
+ //
44139
+ //
44140
+ //
44141
+ //
44142
+
44078
44143
 
44079
44144
 
44080
44145
 
44146
+ // 提取文件图标映射配置,避免在过滤器中重复创建,提升性能
44147
+ const FILE_ICON_MAP = [{
44148
+ suffix: [".jpg", ".jpeg", ".png", ".gif"],
44149
+ icon: "icon-color-JPG"
44150
+ }, {
44151
+ suffix: [".doc", ".docx"],
44152
+ icon: "icon-color-wendang"
44153
+ }, {
44154
+ suffix: [".xls", ".xlsx"],
44155
+ icon: "icon-color-excel"
44156
+ }, {
44157
+ suffix: ".pdf",
44158
+ icon: "icon-color-pdf"
44159
+ }, {
44160
+ suffix: ".txt",
44161
+ icon: "icon-color-txt"
44162
+ }];
44081
44163
  /* harmony default export */ var mainvue_type_script_lang_js = ({
44082
44164
  name: "HbUpload",
44083
44165
  componentName: "HbUpload",
44084
44166
  data() {
44085
44167
  return {
44086
44168
  key: Math.random(),
44087
- coverIndex: 0 // 要覆盖的文件索引
44169
+ coverIndex: 0,
44170
+ // 要覆盖的文件索引
44171
+ uploadingList: [] // 正在上传的文件列表
44088
44172
  };
44089
44173
  },
44090
44174
  props: {
@@ -44104,21 +44188,55 @@ var CustomLink_component = Object(componentNormalizer["a" /* default */])(
44104
44188
  type: Boolean,
44105
44189
  default: true
44106
44190
  },
44191
+ // 操作按钮权限
44107
44192
  oprationAuth: {
44108
44193
  type: Object,
44109
44194
  default: () => {}
44110
44195
  },
44196
+ // 最大上传数量
44111
44197
  maxUpload: {
44112
44198
  type: Number,
44113
44199
  default: 0
44200
+ },
44201
+ // 简单上传与分片上传的阈值
44202
+ _simpleUploadThreshold: {
44203
+ type: Number,
44204
+ default: 50 * 1024 * 1024 // 50MB
44114
44205
  }
44115
44206
  },
44207
+ created() {
44208
+ // 监听阿里OSS的上传进度和状态变化
44209
+ // 注意:这里使用的是 window 全局事件,可能会影响页面上其他相同组件实例
44210
+ // 建议:如果可能有多个实例,应确保事件携带唯一标识符
44211
+ window.addEventListener("netdiscItemProgress", this.onUploadProgress);
44212
+ window.addEventListener("netdiscItemStatusChange", this.onUploadStatusChange);
44213
+ },
44214
+ beforeDestroy() {
44215
+ // 取消上传 : 传输中或排队中的文件
44216
+ this.uploadingList.forEach(item => {
44217
+ if (item.status === "padding" || item.status === "inline") {
44218
+ window.dispatchEvent(new CustomEvent("netdiscCancelUpload", {
44219
+ bubbles: false,
44220
+ detail: {
44221
+ file: item.file
44222
+ }
44223
+ }));
44224
+ }
44225
+ });
44226
+ window.removeEventListener("netdiscItemProgress", this.onUploadProgress);
44227
+ window.removeEventListener("netdiscItemStatusChange", this.onUploadStatusChange);
44228
+ },
44116
44229
  methods: {
44117
44230
  viewFile(item) {
44118
44231
  if (!item.onlineUrl) {
44119
44232
  this.$message.error("没有此网盘文件的预览权限!");
44120
44233
  return;
44121
44234
  }
44235
+ const urlReg = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\*\+,;=.]+$/;
44236
+ if (!urlReg.test(item.onlineUrl)) {
44237
+ this.$message.error("无效的预览链接");
44238
+ return;
44239
+ }
44122
44240
  window.open(item.onlineUrl);
44123
44241
  },
44124
44242
  downloadFile(item) {
@@ -44139,27 +44257,62 @@ var CustomLink_component = Object(componentNormalizer["a" /* default */])(
44139
44257
  this.$refs.coverInput.click();
44140
44258
  },
44141
44259
  coverFile(ev) {
44142
- console.log(ev.target.files[0]);
44143
- let files = new FormData();
44144
- files.append("files[0]", ev.target.files[0]);
44145
- this.$http.post("/sysFiles/uploads", files).then(res => {
44146
- this.$message.success("上传成功");
44147
- //处理返回的数据
44148
- let coverList = res.map(item => ({
44149
- fileName: item.fileName,
44150
- fileType: "1",
44151
- fileUrl: item.fileUrl,
44152
- downUrl: item.downUrl,
44153
- onlineUrl: item.onlineUrl,
44154
- fileSize: item.fileSize
44155
- }));
44156
- const coverOriginData = this.$lodash.cloneDeep(this.list[this.coverIndex]);
44157
- this.list.splice(this.coverIndex, 1, coverList[0]);
44158
- this.$emit("coverSuccess", {
44159
- index: this.coverIndex,
44160
- fileList: this.list,
44161
- coverOriginData
44260
+ const file = ev.target.files[0];
44261
+ if (!file) return;
44262
+
44263
+ // Check if there's already an active cover upload for this index
44264
+ const existingCover = this.uploadingList.find(item => item.isCover && item.coverIndex === this.coverIndex && (item.status === "padding" || item.status === "inline"));
44265
+ if (existingCover) {
44266
+ this.$confirm("当前正在覆盖该文件,是否取消之前的上传并开始新的覆盖?", "提示", {
44267
+ confirmButtonText: "确定",
44268
+ cancelButtonText: "取消",
44269
+ type: "warning"
44270
+ }).then(() => {
44271
+ // Cancel the previous upload
44272
+ this.cancelUpload(existingCover, false); // Pass false to skip confirm dialog inside cancelUpload
44273
+ this.startCoverUpload(file);
44274
+ }).catch(() => {
44275
+ // Do nothing, keep the old upload
44276
+ ev.target.value = "";
44162
44277
  });
44278
+ } else {
44279
+ this.startCoverUpload(file);
44280
+ }
44281
+ ev.target.value = "";
44282
+ },
44283
+ // 点击覆盖按钮 执行阿里OSS上传操作
44284
+ startCoverUpload(file) {
44285
+ const uploadItem = {
44286
+ fileName: file.name,
44287
+ fileSize: file.size,
44288
+ progress: 0,
44289
+ status: "padding",
44290
+ file: file,
44291
+ // Keep reference
44292
+ isCover: true,
44293
+ // Mark as cover operation
44294
+ coverIndex: this.coverIndex // Store the index
44295
+ };
44296
+ this.uploadingList.push(uploadItem);
44297
+ // 通过后端接口获取到上传阿里所需token
44298
+ this.getSTSToken().then(res => {
44299
+ window.dispatchEvent(new CustomEvent("netdiscUpload", {
44300
+ bubbles: false,
44301
+ detail: {
44302
+ type: "file",
44303
+ fileList: [file],
44304
+ path: [],
44305
+ token: res,
44306
+ _unUploadByNetdisc: true,
44307
+ // 不是在网盘上传的文件
44308
+ _doNotOpenUploader: true,
44309
+ // 不需要打开上传进度
44310
+ _simpleUploadThreshold: this._simpleUploadThreshold // 简单上传与分片上传的阈值
44311
+ }
44312
+ }));
44313
+ }).catch(() => {
44314
+ this.$message.error("ali-oss token获取失败");
44315
+ this.removeFromUploading(uploadItem);
44163
44316
  });
44164
44317
  },
44165
44318
  openNetDisc() {
@@ -44183,16 +44336,102 @@ var CustomLink_component = Object(componentNormalizer["a" /* default */])(
44183
44336
  }
44184
44337
  this.$refs.input.click();
44185
44338
  },
44339
+ // 选择文件 执行上传阿里OSS操作
44186
44340
  chooseFile(ev) {
44187
44341
  let fileList = Array.from(ev.target.files);
44188
- console.log(ev);
44189
- let files = new FormData();
44190
- fileList.forEach((item, index) => {
44191
- files.append(`files[${index}]`, item);
44342
+ fileList.forEach(file => {
44343
+ this.uploadingList.push({
44344
+ fileName: file.name,
44345
+ fileSize: file.size,
44346
+ progress: 0,
44347
+ status: "padding",
44348
+ file: file // Keep reference
44349
+ });
44350
+ });
44351
+ // 通过后端接口获取到上传阿里所需token
44352
+ this.getSTSToken().then(res => {
44353
+ window.dispatchEvent(new CustomEvent("netdiscUpload", {
44354
+ bubbles: false,
44355
+ detail: {
44356
+ type: "file",
44357
+ fileList: fileList,
44358
+ path: [],
44359
+ token: res,
44360
+ _unUploadByNetdisc: true,
44361
+ // 不是在网盘上传的文件
44362
+ _doNotOpenUploader: true,
44363
+ // 不需要打开上传进度
44364
+ _simpleUploadThreshold: this._simpleUploadThreshold // 简单上传与分片上传的阈值
44365
+ }
44366
+ }));
44367
+ }).catch(() => {
44368
+ this.$message.error("ali-oss token获取失败");
44369
+ // Remove from uploading list if token fails
44370
+ fileList.forEach(file => {
44371
+ const index = this.uploadingList.findIndex(i => i.file === file);
44372
+ if (index > -1) this.uploadingList.splice(index, 1);
44373
+ });
44374
+ });
44375
+ ev.target.value = "";
44376
+ },
44377
+ getSTSToken() {
44378
+ return this.$http.get("/ndRecord/getStsToken", {
44379
+ baseURL: "/platform"
44380
+ }).then(res => {
44381
+ let token = {
44382
+ region: "oss-cn-hangzhou",
44383
+ accessKeyId: res.credentials.accessKeyId,
44384
+ accessKeySecret: res.credentials.accessKeySecret,
44385
+ stsToken: res.credentials.securityToken,
44386
+ bucket: res.bucket
44387
+ };
44388
+ return Promise.resolve(token);
44389
+ }).catch(error => {
44390
+ return Promise.reject(error);
44192
44391
  });
44193
- this.$http.post("/sysFiles/uploads", files).then(res => {
44194
- this.$message.success("上传成功");
44195
- //处理返回的数据
44392
+ },
44393
+ // 监听阿里上传进度
44394
+ onUploadProgress(e) {
44395
+ const {
44396
+ file,
44397
+ progress
44398
+ } = e.detail;
44399
+ const item = this.uploadingList.find(i => i.file === file);
44400
+ if (item) {
44401
+ item.progress = progress;
44402
+ }
44403
+ },
44404
+ // 监听阿里上传状态变化
44405
+ onUploadStatusChange(e) {
44406
+ const {
44407
+ file,
44408
+ status
44409
+ } = e.detail;
44410
+ const item = this.uploadingList.find(i => i.file === file);
44411
+ if (item) {
44412
+ item.status = status;
44413
+ if (status === "transmitSuccess") {
44414
+ this.handleUploadSuccess(item); // 上传阿里成功
44415
+ } else if (status === "failed") {
44416
+ this.$message.error(`${item.fileName} 上传失败`);
44417
+ this.removeFromUploading(item); // 上传阿里失败
44418
+ } else if (status === "cancel") {
44419
+ this.removeFromUploading(item); // 上传阿里取消
44420
+ }
44421
+ }
44422
+ },
44423
+ // 上传阿里成功 执行保存文件信息操作
44424
+ handleUploadSuccess(item) {
44425
+ const payload = [{
44426
+ fileName: item.fileName,
44427
+ fileSize: item.fileSize,
44428
+ fileSuffix: this.getSuffix(item.fileName),
44429
+ fileType: "1",
44430
+ fileUrl: item.file.path
44431
+ }];
44432
+ // 经过后端拿到上传到阿里的文件的信息
44433
+ this.$http.post("/sysFiles/getSysFilesVo", payload).then(res => {
44434
+ // 处理返回的数据
44196
44435
  let addList = res.map(item => ({
44197
44436
  fileName: item.fileName,
44198
44437
  fileType: "1",
@@ -44201,15 +44440,36 @@ var CustomLink_component = Object(componentNormalizer["a" /* default */])(
44201
44440
  onlineUrl: item.onlineUrl,
44202
44441
  fileSize: item.fileSize
44203
44442
  }));
44204
- addList.forEach(item => {
44205
- this.list.push(item);
44206
- });
44207
- this.$emit("uploadSuccess", {
44208
- fileList: this.list,
44209
- addData: this.$lodash.cloneDeep(addList)
44210
- });
44443
+ if (item.isCover) {
44444
+ const coverOriginData = this.$lodash.cloneDeep(this.list[item.coverIndex]);
44445
+ this.list.splice(item.coverIndex, 1, addList[0]);
44446
+ this.$emit("coverSuccess", {
44447
+ index: item.coverIndex,
44448
+ fileList: this.list,
44449
+ coverOriginData
44450
+ });
44451
+ } else {
44452
+ addList.forEach(item => {
44453
+ this.list.push(item);
44454
+ });
44455
+ this.$emit("uploadSuccess", {
44456
+ fileList: this.list,
44457
+ addData: this.$lodash.cloneDeep(addList)
44458
+ });
44459
+ }
44460
+ this.removeFromUploading(item);
44461
+ }).catch(() => {
44462
+ this.$message.error("保存文件信息失败");
44463
+ this.removeFromUploading(item);
44211
44464
  });
44212
44465
  },
44466
+ // 移除正在进行阿里上传的文件项
44467
+ removeFromUploading(item) {
44468
+ const index = this.uploadingList.indexOf(item);
44469
+ if (index > -1) {
44470
+ this.uploadingList.splice(index, 1);
44471
+ }
44472
+ },
44213
44473
  addLink(data) {
44214
44474
  if (this.maxUpload && this.list.length + 1 > this.maxUpload) {
44215
44475
  this.$message.error("最多上传" + this.maxUpload + "个文件");
@@ -44242,6 +44502,29 @@ var CustomLink_component = Object(componentNormalizer["a" /* default */])(
44242
44502
  });
44243
44503
  }).catch(() => {});
44244
44504
  },
44505
+ // 取消上传阿里
44506
+ cancelUpload(item, confirm = true) {
44507
+ const doCancel = () => {
44508
+ window.dispatchEvent(new CustomEvent("netdiscCancelUpload", {
44509
+ bubbles: false,
44510
+ detail: {
44511
+ file: item.file
44512
+ }
44513
+ }));
44514
+ this.removeFromUploading(item);
44515
+ };
44516
+ if (confirm) {
44517
+ this.$confirm(`确定要取消上传 ${item.fileName} 吗?`, "提示", {
44518
+ confirmButtonText: "确定",
44519
+ cancelButtonText: "取消",
44520
+ type: "warning"
44521
+ }).then(() => {
44522
+ doCancel();
44523
+ }).catch(() => {});
44524
+ } else {
44525
+ doCancel();
44526
+ }
44527
+ },
44245
44528
  rerendering() {
44246
44529
  this.key = Math.random();
44247
44530
  }
@@ -44275,30 +44558,14 @@ var CustomLink_component = Object(componentNormalizer["a" /* default */])(
44275
44558
  },
44276
44559
  filters: {
44277
44560
  fileIcon(isFile, fileType) {
44278
- var _fileMap$find;
44561
+ var _FILE_ICON_MAP$find;
44279
44562
  if (!isFile) {
44280
44563
  return "icon-color-wenjianjia";
44281
44564
  }
44282
44565
  const lowerFileType = fileType.toLowerCase();
44283
- const fileMap = [{
44284
- suffix: [".jpg", ".jpeg", ".png", ".gif"],
44285
- icon: "icon-color-JPG"
44286
- }, {
44287
- suffix: [".doc", ".docx"],
44288
- icon: "icon-color-wendang"
44289
- }, {
44290
- suffix: [".xls", ".xlsx"],
44291
- icon: "icon-color-excel"
44292
- }, {
44293
- suffix: ".pdf",
44294
- icon: "icon-color-pdf"
44295
- }, {
44296
- suffix: ".txt",
44297
- icon: "icon-color-txt"
44298
- }];
44299
- const iconClass = (_fileMap$find = fileMap.find(item => {
44566
+ const iconClass = (_FILE_ICON_MAP$find = FILE_ICON_MAP.find(item => {
44300
44567
  return typeof item.suffix === "string" ? item.suffix === lowerFileType : item.suffix.includes(lowerFileType);
44301
- })) === null || _fileMap$find === void 0 ? void 0 : _fileMap$find.icon;
44568
+ })) === null || _FILE_ICON_MAP$find === void 0 ? void 0 : _FILE_ICON_MAP$find.icon;
44302
44569
  return iconClass || "icon-color-qita1";
44303
44570
  }
44304
44571
  },
@@ -44309,8 +44576,8 @@ var CustomLink_component = Object(componentNormalizer["a" /* default */])(
44309
44576
  });
44310
44577
  // CONCATENATED MODULE: ./packages/upload/src/main.vue?vue&type=script&lang=js
44311
44578
  /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
44312
- // EXTERNAL MODULE: ./packages/upload/src/main.vue?vue&type=style&index=0&id=2c521d9c&prod&lang=scss
44313
- var mainvue_type_style_index_0_id_2c521d9c_prod_lang_scss = __webpack_require__("2070");
44579
+ // EXTERNAL MODULE: ./packages/upload/src/main.vue?vue&type=style&index=0&id=1b14089e&prod&lang=scss
44580
+ var mainvue_type_style_index_0_id_1b14089e_prod_lang_scss = __webpack_require__("2f12");
44314
44581
 
44315
44582
  // CONCATENATED MODULE: ./packages/upload/src/main.vue
44316
44583