|
@@ -164,8 +164,8 @@ export default function (materialType) {
|
|
|
// return item.id
|
|
|
// }).join(',')
|
|
|
const target = this.findFolderTreeById(this.folderTree, targetFolderId);
|
|
|
- let targetAncestors = target? target.ancestors + ',' + target.id : '1'
|
|
|
- console.log('targetAncestors', targetAncestors);
|
|
|
+ let targetAncestors = target ? target.ancestors + ',' + target.id : '1'
|
|
|
+ console.log('targetAncestors', targetAncestors);
|
|
|
moveToFolder(this.selectedList, targetFolderId, targetAncestors).then(() => {
|
|
|
this.$msg.success(this.$i18n.t('gather.success'))
|
|
|
this.$nextTick(() => {
|
|
@@ -236,11 +236,14 @@ export default function (materialType) {
|
|
|
getFolderTree({
|
|
|
type: materialType,
|
|
|
}).then((res) => {
|
|
|
+
|
|
|
this.folderTree = res.data
|
|
|
+ console.log('clickedItem.type', clickedItem);
|
|
|
if (clickedItem.type === 'dir') {
|
|
|
const targetPathIdList = clickedItem.ancestors.split(',').map((item) => {
|
|
|
return Number(item)
|
|
|
})
|
|
|
+
|
|
|
this.folderPath = nodeIdList2nodeInfoListByNodeTree(targetPathIdList, this.folderTree)
|
|
|
} else {
|
|
|
// 在folderTree里找到id等于clickedItem.dirId的那个文件夹,从而确定folderPath
|
|
@@ -252,8 +255,12 @@ export default function (materialType) {
|
|
|
return false
|
|
|
}
|
|
|
}, targetNodePath)
|
|
|
+
|
|
|
this.folderPath = targetNodePath.map((item) => {
|
|
|
- return item.id
|
|
|
+ return {
|
|
|
+ id: item.id,
|
|
|
+ name: item.name
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
this.searchKey = ''
|