Merge pull request 'zhuhao_dev' (#34) from zhuhao_dev into main

Reviewed-on: #34
This commit is contained in:
朱浩 2024-07-18 09:14:41 +08:00
commit 9384ca8035
2 changed files with 13 additions and 12 deletions

View File

@ -8,3 +8,13 @@ export const isHaveLocalFile = async (fileNewName)=>{
}) })
}) })
} }
export const parseCataByNode = (node) => {
if (node.parentNode) {
let arr = parseCataByNode(node.parentNode)
arr.push(node.id)
return arr
} else {
return [node.id]
}
}

View File

@ -77,7 +77,7 @@ import FileListItem from '@/views/prepare/container/file-list-item.vue'
import { getSmarttalkPage, moveSmarttalk } from '@/api/file' import { getSmarttalkPage, moveSmarttalk } from '@/api/file'
import { toTimeText } from '@/utils/date' import { toTimeText } from '@/utils/date'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { isHaveLocalFile } from '@/utils/talkFile' import { isHaveLocalFile, parseCataByNode } from '@/utils/talkFile'
import FileOperBatch from '@/views/prepare/container/file-oper-batch.vue' import FileOperBatch from '@/views/prepare/container/file-oper-batch.vue'
const { ipcRenderer } = window.electron || {} const { ipcRenderer } = window.electron || {}
export default { export default {
@ -192,7 +192,7 @@ export default {
id: ids.join(), id: ids.join(),
textbookId: cataData.textBook.curBookId textbookId: cataData.textBook.curBookId
} }
let cata = this.parseCataByNode(cataData.node) let cata = parseCataByNode(cataData.node)
if ( if (
this.uploadData.levelFirstId == cata[0] && this.uploadData.levelFirstId == cata[0] &&
this.uploadData.levelSecondId == cata[1] && this.uploadData.levelSecondId == cata[1] &&
@ -250,7 +250,7 @@ export default {
nodeClick(data) { nodeClick(data) {
if (this.currentNode.id === data.node.id) return if (this.currentNode.id === data.node.id) return
this.checkFileList = [] this.checkFileList = []
let cata = this.parseCataByNode(data.node) let cata = parseCataByNode(data.node)
this.currentNode = data.node this.currentNode = data.node
this.uploadData.levelFirstId = cata[0] this.uploadData.levelFirstId = cata[0]
this.uploadData.levelSecondId = cata[1] this.uploadData.levelSecondId = cata[1]
@ -276,15 +276,6 @@ export default {
console.log(res) console.log(res)
this.isLoading = false this.isLoading = false
}) })
},
parseCataByNode(node) {
if (node.parentNode) {
let arr = this.parseCataByNode(node.parentNode)
arr.push(node.id)
return arr
} else {
return [node.id]
}
} }
} }
} }