|
@@ -148,7 +148,7 @@ export default function (materialType) {
|
|
|
type: materialType,
|
|
|
}).then((res) => {
|
|
|
this.folderTree = res.data
|
|
|
- console.log('onClickMoveFolder->>', res.data,this.folderTree);
|
|
|
+ console.log('onClickMoveFolder->>', res.data, this.folderTree);
|
|
|
if (this.folderTree.children.length === 0) {
|
|
|
this.$confirm({
|
|
|
title: this.$i18n.t('gather.move_folder_to'),
|
|
@@ -159,21 +159,24 @@ export default function (materialType) {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- onSubmitMoveFolder(targetFolderId) {
|
|
|
+ async onSubmitMoveFolder(targetFolderId) {
|
|
|
// const ancestors = this.folderPath.map((item) => {
|
|
|
// return item.id
|
|
|
// }).join(',')
|
|
|
const target = this.findFolderTreeById(this.folderTree, targetFolderId);
|
|
|
let targetAncestors = target ? target.ancestors + ',' + target.id : '1'
|
|
|
console.log('targetAncestors', targetAncestors);
|
|
|
- moveToFolder(this.selectedList, targetFolderId, targetAncestors).then(() => {
|
|
|
+ const res = await moveToFolder(this.selectedList, targetFolderId, targetAncestors);
|
|
|
+ // console.log('res', res.code === 0);
|
|
|
+ if (res) {
|
|
|
this.$msg.success(this.$i18n.t('gather.success'))
|
|
|
this.$nextTick(() => {
|
|
|
this.isShowMoveFolder = false;
|
|
|
this.selectedList = []
|
|
|
this.refreshListDebounced()
|
|
|
});
|
|
|
- })
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
|
|
|
findFolderTreeById(folderTree, id) {
|