eoss-ui 0.8.48 → 0.8.49

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.
@@ -110573,8 +110573,8 @@ form_src_table.install = function (Vue) {
110573
110573
  };
110574
110574
 
110575
110575
  /* harmony default export */ var table_form = (form_src_table);
110576
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/main.vue?vue&type=template&id=7388a79d&
110577
- var mainvue_type_template_id_7388a79d_render = function () {
110576
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/main.vue?vue&type=template&id=bf79f780&
110577
+ var mainvue_type_template_id_bf79f780_render = function () {
110578
110578
  var _vm = this
110579
110579
  var _h = _vm.$createElement
110580
110580
  var _c = _vm._self._c || _h
@@ -110957,11 +110957,11 @@ var mainvue_type_template_id_7388a79d_render = function () {
110957
110957
  )
110958
110958
  : _vm._e()
110959
110959
  }
110960
- var mainvue_type_template_id_7388a79d_staticRenderFns = []
110961
- mainvue_type_template_id_7388a79d_render._withStripped = true
110960
+ var mainvue_type_template_id_bf79f780_staticRenderFns = []
110961
+ mainvue_type_template_id_bf79f780_render._withStripped = true
110962
110962
 
110963
110963
 
110964
- // CONCATENATED MODULE: ./packages/upload/src/main.vue?vue&type=template&id=7388a79d&
110964
+ // CONCATENATED MODULE: ./packages/upload/src/main.vue?vue&type=template&id=bf79f780&
110965
110965
 
110966
110966
  // CONCATENATED MODULE: ./packages/upload/src/picture.js
110967
110967
  /* harmony default export */ var picture = ({
@@ -111697,6 +111697,7 @@ var mainvue_type_script_lang_js_props;
111697
111697
  lists: {
111698
111698
  deep: true,
111699
111699
  handler: function handler(val) {
111700
+ if (this._isSortRebuilding) return;
111700
111701
  this.$emit('update:fileCount', val.length);
111701
111702
  this.$emit('getFilesAmount', val.length);
111702
111703
  }
@@ -112137,6 +112138,19 @@ var mainvue_type_script_lang_js_props;
112137
112138
 
112138
112139
  console.log('files', files);
112139
112140
  if (this.isSort) {
112141
+ // 同步拖拽排序后的顺序到数据层,采用先清空再重建的方式
112142
+ // 避免 SortableJS 移动 DOM 后与 Vue 虚拟 DOM 产生引用错位
112143
+ this._isSortRebuilding = true;
112144
+ this.lists = [];
112145
+ this.$nextTick(function () {
112146
+ _this10.lists = files;
112147
+ _this10._isSortRebuilding = false;
112148
+ // 重建完成后清除 table-body 的 newData 缓存
112149
+ // 使下次拖拽基于最新的 this.data 而非旧缓存
112150
+ _this10.$nextTick(function () {
112151
+ _this10._resetTableBodyCache();
112152
+ });
112153
+ });
112140
112154
  if (this.onSort) {
112141
112155
  this.onSort(files);
112142
112156
  } else {
@@ -112222,11 +112236,17 @@ var mainvue_type_script_lang_js_props;
112222
112236
  this.onChange && this.onChange(file, fileList);
112223
112237
  },
112224
112238
  handleRemove: function handleRemove(file, fileList) {
112239
+ var _this11 = this;
112240
+
112225
112241
  this.cleanupChunk(file);
112226
112242
  this.$emit('input', fileList.length ? fileList : '');
112227
112243
  this.$emit('remove', file, fileList);
112228
112244
  this.$emit('change', fileList);
112229
112245
  this.onRemove && this.onRemove(file, fileList);
112246
+ // 删除后重置 table-body 的排序缓存,防止再次拖拽时已删除文件从旧 newData 中复活
112247
+ this.$nextTick(function () {
112248
+ _this11._resetTableBodyCache();
112249
+ });
112230
112250
  },
112231
112251
  handleError: function handleError(err, file, fileList) {
112232
112252
  console.log('err', err);
@@ -112261,7 +112281,7 @@ var mainvue_type_script_lang_js_props;
112261
112281
  // el-upload 的自定义上传实现:建立可暂停的运行态并返回受控 Promise。
112262
112282
  // 暂停时不 resolve/reject(promise 维持 pending,文件保持"上传中"而非失败),继续时再次进入流程。
112263
112283
  chunkUpload: function chunkUpload(options) {
112264
- var _this11 = this;
112284
+ var _this12 = this;
112265
112285
 
112266
112286
  var file = options.file;
112267
112287
  var uid = file.uid;
@@ -112276,13 +112296,13 @@ var mainvue_type_script_lang_js_props;
112276
112296
  return new Promise(function (resolve, reject) {
112277
112297
  state.resolve = resolve;
112278
112298
  state.reject = reject;
112279
- _this11.runChunkFlow(uid);
112299
+ _this12.runChunkFlow(uid);
112280
112300
  });
112281
112301
  },
112282
112302
 
112283
112303
  // 分片主流程(可被"继续"重新进入):MD5(缓存) → 秒传/断点续传检测 → 并发上传缺失分片 → 合并入库。
112284
112304
  runChunkFlow: function runChunkFlow(uid) {
112285
- var _this12 = this;
112305
+ var _this13 = this;
112286
112306
 
112287
112307
  var state = this._chunkState[uid];
112288
112308
  if (!state) return;
@@ -112290,13 +112310,13 @@ var mainvue_type_script_lang_js_props;
112290
112310
  var file = options.file;
112291
112311
  var onProgress = options.onProgress || function () {};
112292
112312
  var baseParams = function baseParams() {
112293
- return upload_src_mainvue_type_script_lang_js_extends({}, _this12.param, {
112313
+ return upload_src_mainvue_type_script_lang_js_extends({}, _this13.param, {
112294
112314
  fileMd5: state.fileMd5,
112295
112315
  fileName: file.name,
112296
112316
  fileSize: file.size,
112297
112317
  totalChunks: state.totalChunks,
112298
- bucketCode: _this12.code,
112299
- businessId: _this12.ownId
112318
+ bucketCode: _this13.code,
112319
+ businessId: _this13.ownId
112300
112320
  });
112301
112321
  };
112302
112322
  var isAbort = function isAbort(e) {
@@ -112304,13 +112324,13 @@ var mainvue_type_script_lang_js_props;
112304
112324
  };
112305
112325
 
112306
112326
  Promise.resolve().then(function () {
112307
- return state.fileMd5 || _this12.computeFileMd5(file, onProgress);
112327
+ return state.fileMd5 || _this13.computeFileMd5(file, onProgress);
112308
112328
  }).then(function (md5) {
112309
112329
  state.fileMd5 = md5;
112310
112330
  if (state.paused) return null;
112311
112331
  return utils_util.ajax({
112312
112332
  method: 'post',
112313
- url: _this12.chunkUrls.check,
112333
+ url: _this13.chunkUrls.check,
112314
112334
  data: baseParams(),
112315
112335
  params: baseParams(),
112316
112336
  headers: options.headers
@@ -112322,14 +112342,14 @@ var mainvue_type_script_lang_js_props;
112322
112342
  // 秒传命中:该业务桶下已存在同 MD5 文件,直接视为成功
112323
112343
  if (info.instant) {
112324
112344
  onProgress({ percent: 100 });
112325
- _this12.normalizeChunkDoc(info, file.name);
112326
- _this12.finishChunk(uid, {
112345
+ _this13.normalizeChunkDoc(info, file.name);
112346
+ _this13.finishChunk(uid, {
112327
112347
  rCode: 0,
112328
112348
  msg: checkRes.msg || '秒传成功',
112329
112349
  results: info
112330
112350
  });
112331
112351
  // 秒传文件已存在于服务端,刷新列表以展示其完整信息(含可下载/预览的 id)
112332
- _this12.requestFiles && _this12.getFiles();
112352
+ _this13.requestFiles && _this13.getFiles();
112333
112353
  return;
112334
112354
  }
112335
112355
  // 断点续传:跳过服务端已存在的分片
@@ -112345,9 +112365,9 @@ var mainvue_type_script_lang_js_props;
112345
112365
  });
112346
112366
  state.controller = typeof AbortController !== 'undefined' ? new AbortController() : null;
112347
112367
  var signal = state.controller ? state.controller.signal : undefined;
112348
- return _this12.runChunkQueue(pending, _this12._chunkConcurrent, function (index) {
112368
+ return _this13.runChunkQueue(pending, _this13._chunkConcurrent, function (index) {
112349
112369
  if (state.paused) return Promise.reject({ __aborted: true });
112350
- return _this12.uploadOneChunk(file, index, state.totalChunks, state.fileMd5, options.headers, signal).then(function () {
112370
+ return _this13.uploadOneChunk(file, index, state.totalChunks, state.fileMd5, options.headers, signal).then(function () {
112351
112371
  finished++;
112352
112372
  onProgress({
112353
112373
  percent: Math.min(95, 5 + Math.round(finished / state.totalChunks * 90))
@@ -112357,7 +112377,7 @@ var mainvue_type_script_lang_js_props;
112357
112377
  if (state.paused) return; // 暂停于上传阶段,维持 pending
112358
112378
  return utils_util.ajax({
112359
112379
  method: 'post',
112360
- url: _this12.chunkUrls.merge,
112380
+ url: _this13.chunkUrls.merge,
112361
112381
  data: baseParams(),
112362
112382
  params: baseParams(),
112363
112383
  headers: options.headers
@@ -112365,17 +112385,17 @@ var mainvue_type_script_lang_js_props;
112365
112385
  console.log('mergeRes', mergeRes);
112366
112386
  if (mergeRes.rCode !== 0) return Promise.reject(mergeRes);
112367
112387
  onProgress({ percent: 100 });
112368
- _this12.normalizeChunkDoc(mergeRes.results, file.name);
112369
- _this12.finishChunk(uid, mergeRes);
112388
+ _this13.normalizeChunkDoc(mergeRes.results, file.name);
112389
+ _this13.finishChunk(uid, mergeRes);
112370
112390
  // 刷新列表:让刚入库的文件以与其他行一致的结构展示(时间/大小/上传人等)
112371
- _this12.requestFiles && _this12.getFiles();
112391
+ _this13.requestFiles && _this13.getFiles();
112372
112392
  });
112373
112393
  });
112374
112394
  }).catch(function (e) {
112375
112395
  console.log('err', e);
112376
112396
  // 暂停导致的中止:保持 pending 等待"继续";其余才算失败
112377
112397
  if (state.paused || isAbort(e)) return;
112378
- _this12.failChunk(uid, e);
112398
+ _this13.failChunk(uid, e);
112379
112399
  });
112380
112400
  },
112381
112401
 
@@ -112488,7 +112508,7 @@ var mainvue_type_script_lang_js_props;
112488
112508
 
112489
112509
  // 上传单个分片(multipart/form-data);signal 用于暂停时中止
112490
112510
  uploadOneChunk: function uploadOneChunk(file, index, totalChunks, fileMd5, headers, signal) {
112491
- var _this13 = this;
112511
+ var _this14 = this;
112492
112512
 
112493
112513
  var start = index * this._chunkSize;
112494
112514
  var end = Math.min(start + this._chunkSize, file.size);
@@ -112502,7 +112522,7 @@ var mainvue_type_script_lang_js_props;
112502
112522
  formData.append('bucketCode', this.code);
112503
112523
  formData.append('businessId', this.ownId);
112504
112524
  Object.keys(this.param || {}).forEach(function (key) {
112505
- formData.append(key, _this13.param[key]);
112525
+ formData.append(key, _this14.param[key]);
112506
112526
  });
112507
112527
  return utils_util.ajax({
112508
112528
  method: 'post',
@@ -112519,10 +112539,10 @@ var mainvue_type_script_lang_js_props;
112519
112539
 
112520
112540
  // 分块读取文件并增量计算 MD5(避免大文件一次性读入内存)
112521
112541
  computeFileMd5: function computeFileMd5(file, onProgress) {
112522
- var _this14 = this;
112542
+ var _this15 = this;
112523
112543
 
112524
112544
  return new Promise(function (resolve, reject) {
112525
- var size = _this14._chunkSize;
112545
+ var size = _this15._chunkSize;
112526
112546
  var chunks = Math.max(1, Math.ceil(file.size / size));
112527
112547
  var spark = new external_spark_md5_default.a.ArrayBuffer();
112528
112548
  var reader = new FileReader();
@@ -112575,6 +112595,31 @@ var mainvue_type_script_lang_js_props;
112575
112595
  };
112576
112596
  schedule();
112577
112597
  });
112598
+ },
112599
+
112600
+ /**
112601
+ * 重置 table-body 组件内部的 newData 缓存。
112602
+ * table-body.js 在拖拽排序时会把结果存入 newData,后续排序优先从 newData 取数据源。
112603
+ * 但文件被删除后 newData 不会自动清除,导致已删除文件在下次拖拽时复活。
112604
+ */
112605
+ _resetTableBodyCache: function _resetTableBodyCache() {
112606
+ if (this.listType !== 'table') return;
112607
+ var upload = this.$refs.upload;
112608
+ if (!upload) return;
112609
+ var tableList = upload.$children.find(function (c) {
112610
+ return c.$options.name === 'TableList';
112611
+ });
112612
+ if (!tableList) return;
112613
+ var elTable = tableList.$children.find(function (c) {
112614
+ return c.$options.name === 'ElTable';
112615
+ });
112616
+ if (!elTable) return;
112617
+ var tableBody = elTable.$children.find(function (c) {
112618
+ return c.$options.name === 'ElTableBody';
112619
+ });
112620
+ if (tableBody) {
112621
+ tableBody.newData = null;
112622
+ }
112578
112623
  }
112579
112624
  }
112580
112625
  });
@@ -112590,8 +112635,8 @@ var mainvue_type_script_lang_js_props;
112590
112635
 
112591
112636
  var upload_src_main_component = normalizeComponent(
112592
112637
  packages_upload_src_mainvue_type_script_lang_js_,
112593
- mainvue_type_template_id_7388a79d_render,
112594
- mainvue_type_template_id_7388a79d_staticRenderFns,
112638
+ mainvue_type_template_id_bf79f780_render,
112639
+ mainvue_type_template_id_bf79f780_staticRenderFns,
112595
112640
  false,
112596
112641
  null,
112597
112642
  null,
@@ -113094,7 +113139,7 @@ if (typeof window !== 'undefined' && window.Vue) {
113094
113139
  }
113095
113140
 
113096
113141
  /* harmony default export */ var src_0 = __webpack_exports__["default"] = ({
113097
- version: '0.8.48',
113142
+ version: '0.8.49',
113098
113143
  install: install,
113099
113144
  Archives: archives,
113100
113145
  Button: packages_button,