|
@@ -353,8 +353,7 @@
|
|
|
},
|
|
|
created() {
|
|
|
this.initSchoolData()
|
|
|
- this.hostName = this.$store.state.privateSas ? this.$store.state.privateSas.url :
|
|
|
- 'https://teammodelstorage.blob.core.chinacloudapi.cn'
|
|
|
+ this.hostName = this.$evTools.getBlobHost()
|
|
|
},
|
|
|
methods: {
|
|
|
onDownload(val) {
|
|
@@ -434,7 +433,7 @@
|
|
|
this.$api.knowledge.SaveOrUpdateKnowledge(params).then(res => {
|
|
|
if (res) {
|
|
|
this.$Message.success(this.$t('knowledge.saveSuccess'))
|
|
|
- this.getPointsData()
|
|
|
+ this.updated = false
|
|
|
this.initBlockCount()
|
|
|
} else {
|
|
|
this.$Message.warning(this.$t('knowledge.saveFail'))
|
|
@@ -522,14 +521,11 @@
|
|
|
let schoolBaseInfo = res.school_base
|
|
|
if (schoolBaseInfo) {
|
|
|
this.schoolInfo = schoolBaseInfo
|
|
|
- this.originSchoolData = schoolBaseInfo // 默认选择第一个
|
|
|
- this.originData = schoolBaseInfo // 默认选择第一个
|
|
|
+ this.originSchoolData = schoolBaseInfo
|
|
|
+ this.originData = schoolBaseInfo
|
|
|
if (schoolBaseInfo.period.length) {
|
|
|
this.periodList = schoolBaseInfo.period
|
|
|
this.currentParams.school_code = schoolBaseInfo.id
|
|
|
- // this.currentParams.periodId = schoolBaseInfo.period[0].id
|
|
|
- // this.currentPeriodIndex = 0 // 默认选择第一个学段
|
|
|
- // this.onPeriodChange(0)
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -537,7 +533,6 @@
|
|
|
|
|
|
// 获取当前册别数量(每次都获取最新的数据)
|
|
|
initBlockCount() {
|
|
|
-
|
|
|
let params = {}
|
|
|
for (let data of this.subjectList) {
|
|
|
params[this.$store.state.userInfo.schoolCode + "-" + data.id] = this.periodList[this
|
|
@@ -569,6 +564,8 @@
|
|
|
let list = res[0].blocks
|
|
|
this.blockList = list
|
|
|
this.originBlockList = JSON.parse(JSON.stringify(list))
|
|
|
+ this.pointList = [...new Set(res[0].points)]
|
|
|
+ this.originPointList = JSON.parse(JSON.stringify(this.pointList))
|
|
|
setTimeout(function() {
|
|
|
that.isLoadBlocks = false
|
|
|
}, 400)
|
|
@@ -587,10 +584,12 @@
|
|
|
"pk": "Knowledge",
|
|
|
}]
|
|
|
that.pointDatas = params
|
|
|
- let list = params[0].blocks
|
|
|
- this.blockList = list
|
|
|
- this.originBlockList = JSON.parse(JSON.stringify(list))
|
|
|
+ this.blockList = []
|
|
|
+ this.originBlockList = []
|
|
|
+ this.pointList = []
|
|
|
+ this.originPointList = []
|
|
|
}
|
|
|
+ this.updated = false
|
|
|
}).catch(err => {
|
|
|
this.$Message.error(this.$t('knowledge.warn'))
|
|
|
this.isLoadBlocks = false
|
|
@@ -600,17 +599,17 @@
|
|
|
|
|
|
// 根据学科获取学科下所有知识点数据
|
|
|
getPointsData() {
|
|
|
- let that = this
|
|
|
- this.$api.knowledge.GetSchoolPoints(this.currentParams).then(res => {
|
|
|
- if (res.length) {
|
|
|
- this.pointList = [...new Set(res[0].points)]
|
|
|
- this.originPointList = JSON.parse(JSON.stringify(this.pointList))
|
|
|
- setTimeout(function() {
|
|
|
- that.isLoadPoints = false
|
|
|
- }, 800)
|
|
|
- this.updated = false
|
|
|
- }
|
|
|
- })
|
|
|
+ // let that = this
|
|
|
+ // this.$api.knowledge.GetSchoolPoints(this.currentParams).then(res => {
|
|
|
+ // if (res.length) {
|
|
|
+ // this.pointList = [...new Set(res[0].points)]
|
|
|
+ // this.originPointList = JSON.parse(JSON.stringify(this.pointList))
|
|
|
+ // setTimeout(function() {
|
|
|
+ // that.isLoadPoints = false
|
|
|
+ // }, 800)
|
|
|
+ // this.updated = false
|
|
|
+ // }
|
|
|
+ // })
|
|
|
},
|
|
|
|
|
|
// 校本知识块与个人切换
|
|
@@ -619,12 +618,10 @@
|
|
|
this.tabIndex = index
|
|
|
switch (index) {
|
|
|
case 0:
|
|
|
- this.getPointsData()
|
|
|
this.getBlocksData()
|
|
|
this.pointOwn = 'school'
|
|
|
break
|
|
|
case 1:
|
|
|
- this.getPointsData()
|
|
|
this.getBlocksData()
|
|
|
this.pointOwn = 'personal'
|
|
|
break
|
|
@@ -730,7 +727,6 @@
|
|
|
this.currentParams.subjectId = this.subjectList[index].id
|
|
|
this.activeSubjectIndex = index
|
|
|
this.isLoadBlocks = true
|
|
|
- this.getPointsData()
|
|
|
this.getBlocksData()
|
|
|
},
|
|
|
onCancel: () => {
|
|
@@ -754,7 +750,6 @@
|
|
|
this.currentParams.subjectId = this.subjectList[index].id
|
|
|
this.activeSubjectIndex = index
|
|
|
this.isLoadBlocks = true
|
|
|
- this.getPointsData()
|
|
|
this.getBlocksData()
|
|
|
}
|
|
|
|