|
@@ -427,7 +427,14 @@ export default {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- setNodeSort(oldIndex, newIndex) {
|
|
|
|
|
|
|
+ setNodeSort(oldIndex, newIndex, type) {
|
|
|
|
|
+ if (type == 'init') {
|
|
|
|
|
+ // 初始化给sort
|
|
|
|
|
+ this.dataListNew.forEach((item, index) => {
|
|
|
|
|
+ item.sort = index + 1
|
|
|
|
|
+ });
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
// 使用arr复制一份表格数组数据
|
|
// 使用arr复制一份表格数组数据
|
|
|
const arr = this.dataListNew;
|
|
const arr = this.dataListNew;
|
|
|
const currentRow = arr.splice(oldIndex, 1)[0]
|
|
const currentRow = arr.splice(oldIndex, 1)[0]
|
|
@@ -736,6 +743,8 @@ export default {
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
+ // 👇 初始化时主动触发一次
|
|
|
|
|
+ this.setNodeSort(null, null, 'init');
|
|
|
// 在 changes 完成后,手动调用 handleUploadSuccess
|
|
// 在 changes 完成后,手动调用 handleUploadSuccess
|
|
|
await this.handleUploadSuccess(null, fileData, this.fileList); // 传入空参数或实际参数
|
|
await this.handleUploadSuccess(null, fileData, this.fileList); // 传入空参数或实际参数
|
|
|
} catch (error) {
|
|
} catch (error) {
|