|
@@ -233,7 +233,7 @@ export default {
|
|
subjectList: [],
|
|
subjectList: [],
|
|
originSubjectList: [],
|
|
originSubjectList: [],
|
|
searchSubject: '',
|
|
searchSubject: '',
|
|
- activeSubjectIndex: 2,
|
|
|
|
|
|
+ activeSubjectIndex: 0,
|
|
countArr: [],
|
|
countArr: [],
|
|
knowledgeTrees: undefined,
|
|
knowledgeTrees: undefined,
|
|
subTreeRoot: [],
|
|
subTreeRoot: [],
|
|
@@ -265,17 +265,18 @@ export default {
|
|
oldNew: [],
|
|
oldNew: [],
|
|
isLoadPoints: false,
|
|
isLoadPoints: false,
|
|
isParsing: false,
|
|
isParsing: false,
|
|
|
|
+ hostName: '',
|
|
files: [
|
|
files: [
|
|
{
|
|
{
|
|
- link: '/download/%E7%9F%A5%E8%AF%86%E7%82%B9%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF/point-cn.xlsx',
|
|
|
|
|
|
+ link: '/download/%E7%9F%A5%E8%AF%86%E7%82%B9%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF/point-CN.xlsx',
|
|
fileName: 'IES5知识点批量导入模板.xlsx'
|
|
fileName: 'IES5知识点批量导入模板.xlsx'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- link: '/download/%E7%9F%A5%E8%AF%86%E7%82%B9%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF/point-tw.xlsx',
|
|
|
|
|
|
+ link: '/download/%E7%9F%A5%E8%AF%86%E7%82%B9%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF/point-TW.xlsx',
|
|
fileName: 'IES5知識點批量導入模板.xlsx'
|
|
fileName: 'IES5知識點批量導入模板.xlsx'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- link: '/download/%E7%9F%A5%E8%AF%86%E7%82%B9%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF/point-us.xlsx',
|
|
|
|
|
|
+ link: '/download/%E7%9F%A5%E8%AF%86%E7%82%B9%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF/point-US.xlsx',
|
|
fileName: 'Batch import template of key concepts.xlsx'
|
|
fileName: 'Batch import template of key concepts.xlsx'
|
|
}
|
|
}
|
|
],
|
|
],
|
|
@@ -288,6 +289,7 @@ export default {
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.initSchoolData()
|
|
this.initSchoolData()
|
|
|
|
+ this.hostName = this.$evTools.getBlobHost()
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
},
|
|
},
|
|
@@ -760,7 +762,13 @@ export default {
|
|
if(notContinue) break
|
|
if(notContinue) break
|
|
}
|
|
}
|
|
if(!notContinue) {
|
|
if(!notContinue) {
|
|
- this.subTree = this.subTree.concat(pointTree)
|
|
|
|
|
|
+ this.pointHandle(pointTree, this.subTree, 1)
|
|
|
|
+ // el-tree未更新视图,需给subTree重新赋值,触发el-tree重新渲染
|
|
|
|
+ let tree = [...this.subTree]
|
|
|
|
+ this.subTree = []
|
|
|
|
+ this.subTree = tree
|
|
|
|
+ this.$forceUpdate()
|
|
|
|
+ // this.subTree = this.subTree.concat(pointTree)
|
|
this.$Message.success(this.$t("knowledge.import.sucTip"))
|
|
this.$Message.success(this.$t("knowledge.import.sucTip"))
|
|
this.batchUploadModal = false
|
|
this.batchUploadModal = false
|
|
this.updated = true
|
|
this.updated = true
|
|
@@ -809,6 +817,27 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ /*
|
|
|
|
+ * arrAdd:新增数组
|
|
|
|
+ * arrOld:原数组
|
|
|
|
+ * index:代表第几层
|
|
|
|
+ * pid:父代id
|
|
|
|
+ */
|
|
|
|
+ pointHandle(arrAdd, arrOld, index, pid) {
|
|
|
|
+ arrAdd.forEach(item => {
|
|
|
|
+ let sameIndex = arrOld.findIndex(old => old.name === item.name)
|
|
|
|
+ if(sameIndex === -1) {
|
|
|
|
+ let idLast4 = arrOld.length ? arrOld[arrOld.length - 1].id : '-0'
|
|
|
|
+ let id4 = idLast4.split(`-`)
|
|
|
|
+ item.id = `${pid}-${Number(id4[id4.length - 1]) + 1}`
|
|
|
|
+ item.level = index
|
|
|
|
+ item.pid = pid
|
|
|
|
+ arrOld.push(item)
|
|
|
|
+ } else {
|
|
|
|
+ this.pointHandle(item.children, arrOld[sameIndex].children, index + 1, arrOld[sameIndex].id)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
},
|
|
},
|
|
beforeRouteLeave(to, from, next) {
|
|
beforeRouteLeave(to, from, next) {
|
|
if (this.updated) {
|
|
if (this.updated) {
|