|
|
@@ -176,7 +176,7 @@
|
|
|
this.weight = d.weight;
|
|
|
this.analysis = d.analysis;
|
|
|
this.keyPoints = d.keyPoints;
|
|
|
- this.knowledgeId = d.knowledgeId;
|
|
|
+ this.knowledgeId = d.knowledgeId ? d.knowledgeId : [];
|
|
|
this.tags = d.tags;
|
|
|
this.options = d.options;
|
|
|
this.blanks = d.blanks;
|
|
|
@@ -196,7 +196,7 @@
|
|
|
/* 提交 */
|
|
|
modify() {
|
|
|
if(confirm("您确定要进行修改?")) {
|
|
|
- this.knowledgeId = this.knowledgeName.map(name => this.searchNodeByNodeName(name)["id"]);
|
|
|
+ this.knowledgeId = this.knowledgeName.map(name => this.searchNodeByNodeName(name)["abbreviation"]);
|
|
|
let questionVO = {
|
|
|
id: this.questionId,
|
|
|
type: this.type,
|
|
|
@@ -233,10 +233,10 @@
|
|
|
this.knowledgeName.splice(this.knowledgeName.indexOf(k_name), 1);
|
|
|
this.$refs.tree.getNode(k_name).setChecked(false);
|
|
|
},
|
|
|
- /* 在知识点树中,通过id获取节点 */
|
|
|
- searchNodeByNodeId(id) {
|
|
|
+ /* 在知识点树中,通过abbreviation获取节点 */
|
|
|
+ searchNodeByNodeAbbr(abbreviation) {
|
|
|
for(let i=0;i<this.knowledgeList.length;i++) {
|
|
|
- if(this.knowledgeList[i].id === id) return this.knowledgeList[i];
|
|
|
+ if(this.knowledgeList[i].abbreviation === abbreviation) return this.knowledgeList[i];
|
|
|
}
|
|
|
},
|
|
|
/* 在知识点树中,通过name获取节点 */
|
|
|
@@ -310,10 +310,14 @@
|
|
|
/* 构建知识点标签列表 */
|
|
|
/* 点亮对应的知识点树节点 */
|
|
|
setTimeout(()=>{
|
|
|
- this.knowledgeId.forEach(id => {
|
|
|
- let name = this.searchNodeByNodeId(id)["name"];
|
|
|
- this.knowledgeName.push(name);
|
|
|
- this.$refs.tree.getNode(name).setChecked(true);
|
|
|
+ // debugger
|
|
|
+ this.knowledgeId.forEach(abbreviation => {
|
|
|
+ let node = this.searchNodeByNodeAbbr(abbreviation);
|
|
|
+ if(node) {
|
|
|
+ let name = node["name"];
|
|
|
+ this.knowledgeName.push(name);
|
|
|
+ this.$refs.tree.getNode(name).setChecked(true);
|
|
|
+ }
|
|
|
});
|
|
|
}, 0);
|
|
|
|