eoss-ui 0.8.47 → 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.
@@ -493,3 +493,18 @@ background-color: $--color-primary-light-9 !important;
493
493
  padding: 12px 16px 60px 16px !important;
494
494
  }
495
495
  }
496
+
497
+ .task-read{
498
+ overflow: hidden;
499
+ display: flex;
500
+ flex-direction: column;
501
+ &-form{
502
+ height: 100%;
503
+ display: flex;
504
+ flex-direction: column;
505
+ &-content{
506
+ flex:1;
507
+ overflow-y: auto;
508
+ }
509
+ }
510
+ }
@@ -770,6 +770,7 @@ export default {
770
770
  lists: {
771
771
  deep: true,
772
772
  handler(val) {
773
+ if (this._isSortRebuilding) return;
773
774
  this.$emit('update:fileCount', val.length);
774
775
  this.$emit('getFilesAmount', val.length);
775
776
  }
@@ -1355,6 +1356,19 @@ export default {
1355
1356
  handleSort(files) {
1356
1357
  console.log('files', files);
1357
1358
  if (this.isSort) {
1359
+ // 同步拖拽排序后的顺序到数据层,采用先清空再重建的方式
1360
+ // 避免 SortableJS 移动 DOM 后与 Vue 虚拟 DOM 产生引用错位
1361
+ this._isSortRebuilding = true;
1362
+ this.lists = [];
1363
+ this.$nextTick(() => {
1364
+ this.lists = files;
1365
+ this._isSortRebuilding = false;
1366
+ // 重建完成后清除 table-body 的 newData 缓存
1367
+ // 使下次拖拽基于最新的 this.data 而非旧缓存
1368
+ this.$nextTick(() => {
1369
+ this._resetTableBodyCache();
1370
+ });
1371
+ });
1358
1372
  if (this.onSort) {
1359
1373
  this.onSort(files);
1360
1374
  } else {
@@ -1460,6 +1474,10 @@ export default {
1460
1474
  this.$emit('remove', file, fileList);
1461
1475
  this.$emit('change', fileList);
1462
1476
  this.onRemove && this.onRemove(file, fileList);
1477
+ // 删除后重置 table-body 的排序缓存,防止再次拖拽时已删除文件从旧 newData 中复活
1478
+ this.$nextTick(() => {
1479
+ this._resetTableBodyCache();
1480
+ });
1463
1481
  },
1464
1482
  handleError(err, file, fileList) {
1465
1483
  console.log('err', err);
@@ -1832,6 +1850,30 @@ export default {
1832
1850
  };
1833
1851
  schedule();
1834
1852
  });
1853
+ },
1854
+ /**
1855
+ * 重置 table-body 组件内部的 newData 缓存。
1856
+ * table-body.js 在拖拽排序时会把结果存入 newData,后续排序优先从 newData 取数据源。
1857
+ * 但文件被删除后 newData 不会自动清除,导致已删除文件在下次拖拽时复活。
1858
+ */
1859
+ _resetTableBodyCache() {
1860
+ if (this.listType !== 'table') return;
1861
+ const upload = this.$refs.upload;
1862
+ if (!upload) return;
1863
+ const tableList = upload.$children.find(
1864
+ (c) => c.$options.name === 'TableList'
1865
+ );
1866
+ if (!tableList) return;
1867
+ const elTable = tableList.$children.find(
1868
+ (c) => c.$options.name === 'ElTable'
1869
+ );
1870
+ if (!elTable) return;
1871
+ const tableBody = elTable.$children.find(
1872
+ (c) => c.$options.name === 'ElTableBody'
1873
+ );
1874
+ if (tableBody) {
1875
+ tableBody.newData = null;
1876
+ }
1835
1877
  }
1836
1878
  }
1837
1879
  };
package/src/index.js CHANGED
@@ -127,7 +127,7 @@ if (typeof window !== 'undefined' && window.Vue) {
127
127
  }
128
128
 
129
129
  export default {
130
- version: '0.8.47',
130
+ version: '0.8.49',
131
131
  install,
132
132
  Archives,
133
133
  Button,