文档服务地址:http://47.92.0.57:3000/ 周报索引地址:http://47.92.0.57:3000/s/NruNXRYmV

Commit c5745d82 by 张欣玥

表格优化

parent 67bbd65e
...@@ -157,6 +157,7 @@ export default { ...@@ -157,6 +157,7 @@ export default {
}, },
allContent: [], allContent: [],
numOfSheet: 0, numOfSheet: 0,
treeToArray: []
}; };
}, },
beforeMount() { beforeMount() {
...@@ -271,6 +272,15 @@ export default { ...@@ -271,6 +272,15 @@ export default {
this.value = res.result.templateName; // 现在的实体与模板相近,所以就先固定了 this.value = res.result.templateName; // 现在的实体与模板相近,所以就先固定了
// 属性 // 属性
this.treeData = res.result.entityList; this.treeData = res.result.entityList;
for (var i = 0; i < this.treeData.length; i++) {
this.treeToArray.push({
id: this.treeData[i].id,
label: this.treeData[i].label,
}); // 属性
if (this.treeData[i].children != []) {
this.transfer(this.treeData[i].children);
}
}
} else { } else {
this.$message({ this.$message({
message: res.return_info, message: res.return_info,
...@@ -426,6 +436,7 @@ export default { ...@@ -426,6 +436,7 @@ export default {
message: "已保存", message: "已保存",
type: "success", type: "success",
}); });
this.$refs.tree.setCheckedNodes([]);
} else { } else {
this.$message({ this.$message({
message: res.return_info, message: res.return_info,
...@@ -471,6 +482,26 @@ export default { ...@@ -471,6 +482,26 @@ export default {
this.token.begin = tag.begin; this.token.begin = tag.begin;
this.token.end = tag.end; this.token.end = tag.end;
this.token.entityId = tag.entityId; this.token.entityId = tag.entityId;
let res = [];
for (var i = 0; i < this.treeToArray.length; i++) {
res[i] = {};
for (var j = 0; j < this.treeToArray.length; j++) {
if (this.treeToArray[j].label == tag.attribute[i]) {
res[i].id = this.treeToArray[j].id;
break;
}
}
}
this.$refs.tree.setCheckedNodes(res);
},
transfer(children) {
if (children == []) return;
for (var i = 0; i < children.length; i++) {
this.treeToArray.push({ id: children[i].id, label: children[i].label });
if (children[i] != []) {
this.transfer(children[i].children);
}
}
}, },
// 提交已标注文档 // 提交已标注文档
submit() { submit() {
...@@ -613,4 +644,4 @@ export default { ...@@ -613,4 +644,4 @@ export default {
margin-top: 3px; margin-top: 3px;
margin-bottom: 3px; margin-bottom: 3px;
} }
</style> </style>
\ No newline at end of file
...@@ -182,6 +182,7 @@ export default { ...@@ -182,6 +182,7 @@ export default {
}, },
formLabelWidth: "120px", formLabelWidth: "120px",
executors: [], executors: [],
treeToArray: []
}; };
}, },
beforeMount() { beforeMount() {
...@@ -297,6 +298,15 @@ export default { ...@@ -297,6 +298,15 @@ export default {
this.value = res.result.templateName; // 现在的实体与模板相近,所以就先固定了 this.value = res.result.templateName; // 现在的实体与模板相近,所以就先固定了
// 属性 // 属性
this.treeData = res.result.entityList; this.treeData = res.result.entityList;
for (var i = 0; i < this.treeData.length; i++) {
this.treeToArray.push({
id: this.treeData[i].id,
label: this.treeData[i].label,
}); // 属性
if (this.treeData[i].children != []) {
this.transfer(this.treeData[i].children);
}
}
} else { } else {
this.$message({ this.$message({
message: res.return_info, message: res.return_info,
...@@ -335,6 +345,7 @@ export default { ...@@ -335,6 +345,7 @@ export default {
return; return;
} }
} }
this.$refs.tree.setCheckedNodes([]);
console.log(" token select" + JSON.stringify(this.token)); console.log(" token select" + JSON.stringify(this.token));
console.log(" tokenList select" + JSON.stringify(this.tokenList)); console.log(" tokenList select" + JSON.stringify(this.tokenList));
}, },
...@@ -410,6 +421,7 @@ export default { ...@@ -410,6 +421,7 @@ export default {
message: "已保存", message: "已保存",
type: "success", type: "success",
}); });
this.$refs.tree.setCheckedNodes([]);
} else { } else {
this.$message({ this.$message({
message: res.return_info, message: res.return_info,
...@@ -455,6 +467,26 @@ export default { ...@@ -455,6 +467,26 @@ export default {
this.token.begin = tag.begin; this.token.begin = tag.begin;
this.token.end = tag.end; this.token.end = tag.end;
this.token.entityId = tag.entityId; this.token.entityId = tag.entityId;
let res = [];
for (var i = 0; i < this.treeToArray.length; i++) {
res[i] = {};
for (var j = 0; j < this.treeToArray.length; j++) {
if (this.treeToArray[j].label == tag.attribute[i]) {
res[i].id = this.treeToArray[j].id;
break;
}
}
}
this.$refs.tree.setCheckedNodes(res);
},
transfer(children) {
if (children == []) return;
for (var i = 0; i < children.length; i++) {
this.treeToArray.push({ id: children[i].id, label: children[i].label });
if (children[i] != []) {
this.transfer(children[i].children);
}
}
}, },
// 打分 // 打分
addScore() { addScore() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment