基础文件上传核心开发
This commit is contained in:
parent
36989c5ba3
commit
50fc1e106d
|
@ -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]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue