|
@@ -230,6 +230,8 @@ export default {
|
|
subjectIndexArr: [],
|
|
subjectIndexArr: [],
|
|
tagIndexArr: [],
|
|
tagIndexArr: [],
|
|
tagList: [],
|
|
tagList: [],
|
|
|
|
+ apiTags: [],
|
|
|
|
+ oldNewTags: [],
|
|
analysisArr: [vm.$t('lessonRecord.count1'), vm.$t('lessonRecord.count2'), vm.$t('lessonRecord.count3'), vm.$t('lessonRecord.count4'), vm.$t('lessonRecord.count5'), vm.$t('lessonRecord.count6'), vm.$t('lessonRecord.count7')],
|
|
analysisArr: [vm.$t('lessonRecord.count1'), vm.$t('lessonRecord.count2'), vm.$t('lessonRecord.count3'), vm.$t('lessonRecord.count4'), vm.$t('lessonRecord.count5'), vm.$t('lessonRecord.count6'), vm.$t('lessonRecord.count7')],
|
|
analysisCount: [],
|
|
analysisCount: [],
|
|
isEdit: false,
|
|
isEdit: false,
|
|
@@ -694,6 +696,7 @@ export default {
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.$refs.baseForm.tags = res.setting.lessonTag
|
|
this.$refs.baseForm.tags = res.setting.lessonTag
|
|
this.tagList = res.setting.lessonTag
|
|
this.tagList = res.setting.lessonTag
|
|
|
|
+ this.apiTags = this._.cloneDeep(this.tagList)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -948,11 +951,34 @@ export default {
|
|
this.$Message.warning(this.$t('lessonRecord.tagTip2'))
|
|
this.$Message.warning(this.$t('lessonRecord.tagTip2'))
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ let oldVal = this.tags[this.curEditIndex]
|
|
|
|
+ let newVal = this.curEditTag
|
|
|
|
+ if (oldVal) {
|
|
|
|
+ if (this.oldNewTags.find(i => i._new === oldVal)) {
|
|
|
|
+ this.oldNewTags.find(i => i._new === oldVal)._new = newVal
|
|
|
|
+ } else {
|
|
|
|
+ this.oldNewTags.push({
|
|
|
|
+ _old: oldVal,
|
|
|
|
+ _new: newVal
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
this.tags[this.curEditIndex] = this.curEditTag
|
|
this.tags[this.curEditIndex] = this.curEditTag
|
|
this.curEditIndex = -1
|
|
this.curEditIndex = -1
|
|
},
|
|
},
|
|
/* 删除类别 */
|
|
/* 删除类别 */
|
|
onDeleteTag(item, index) {
|
|
onDeleteTag(item, index) {
|
|
|
|
+ if (this.apiTags.includes(item)) {
|
|
|
|
+ if (this.oldNewTags.find(i => i._new === item)) {
|
|
|
|
+ this.oldNewTags.find(i => i._new === item)._new = null
|
|
|
|
+ } else {
|
|
|
|
+ this.oldNewTags.push({
|
|
|
|
+ _old: item,
|
|
|
|
+ _new: null
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
this.tags.splice(index, 1)
|
|
this.tags.splice(index, 1)
|
|
this.curEditIndex = -1
|
|
this.curEditIndex = -1
|
|
},
|
|
},
|
|
@@ -973,12 +999,15 @@ export default {
|
|
this.$api.lessonRecord.setLessonTags({
|
|
this.$api.lessonRecord.setLessonTags({
|
|
schoolId: this.$store.state.userInfo.schoolCode,
|
|
schoolId: this.$store.state.userInfo.schoolCode,
|
|
opt: 'UpsertLessonTag',
|
|
opt: 'UpsertLessonTag',
|
|
- lessonTag: saveTags
|
|
|
|
|
|
+ lessonTag: saveTags,
|
|
|
|
+ old_new: this.oldNewTags
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (!res.error) {
|
|
if (!res.error) {
|
|
this.$Message.success(this.$t('lessonRecord.saveSuc'))
|
|
this.$Message.success(this.$t('lessonRecord.saveSuc'))
|
|
this.tagLoading = false
|
|
this.tagLoading = false
|
|
this.categoryModal = false
|
|
this.categoryModal = false
|
|
|
|
+ this.apiTags = res.setting.lessonTag
|
|
|
|
+ this.oldNewTags = []
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|