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

Commit e1750c9c by renqing122

标注选中优化

parent 94b61719
......@@ -39,9 +39,16 @@
</div>
</el-aside>
<!-- 文本界面 -->
<el-main class="filter-container1" style="background-color: #FFFFFF">
<el-main
class="filter-container1"
style="background-color: #FFFFFF"
>
<div style="overflow-y:auto;height:100%;">
<div class="content1" @mouseup="select()" v-html="content"></div>
<div
class="content1"
@mouseup="select()"
v-html="content"
></div>
<div class="content_left">
<div
class="tokenList1"
......@@ -56,7 +63,10 @@
:disable-transitions="false"
@close="deleteToken(it)"
>
<a class="token1" v-html="it.word"></a>
<a
class="token1"
v-html="it.word"
></a>
</el-tag>
</div>
</div>
......@@ -107,6 +117,7 @@ export default {
children: "children",
label: "label",
},
treeToArray : [],
};
},
beforeMount() {
......@@ -238,6 +249,12 @@ export default {
this.token.entityId = res.result.templateName;
// 属性
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 {
this.$message({
message: res.return_info,
......@@ -254,6 +271,7 @@ export default {
this.token.word = window.getSelection().toString();
this.token.begin = window.getSelection().anchorOffset; //开始位置
this.token.end = window.getSelection().focusOffset; //结束位置
this.$refs.tree.setCheckedNodes([]);
//console.log(" token select" + JSON.stringify(this.token));
//console.log(" tokenList select" + JSON.stringify(this.tokenList));
}
......@@ -304,11 +322,12 @@ export default {
if (res.return_code == 200) {
this.tokenList = [];
this.getTokenList();
console.log(" token uploadToken" + JSON.stringify(token));
console.log(" token uploadToken" + JSON.stringify(this.token));
console.log(
" tokenList uploadToken" + JSON.stringify(this.tokenList)
);
// console.log(" token uploadToken" + JSON.stringify(token));
// console.log(" token uploadToken" + JSON.stringify(this.token));
// console.log(
// " tokenList uploadToken" + JSON.stringify(this.tokenList)
// );
this.$refs.tree.setCheckedNodes([]);
this.$message({
message: "已保存",
type: "success",
......@@ -378,6 +397,27 @@ export default {
this.token.begin = tag.begin;
this.token.end = tag.end;
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() {
......
......@@ -39,9 +39,16 @@
</div>
</el-aside>
<!-- 文本界面 -->
<el-main class="filter-container3" style="background-color: #FFFFFF">
<el-main
class="filter-container3"
style="background-color: #FFFFFF"
>
<div style="overflow-y:auto;height:100%;">
<div class="content3" @mouseup="select()" v-html="content"></div>
<div
class="content3"
@mouseup="select()"
v-html="content"
></div>
<div class="content_left1">
<div
......@@ -57,11 +64,20 @@
:disable-transitions="false"
@close="deleteToken(it)"
>
<a style="font-size: 18px;" v-html="it.word"></a>
<a
style="font-size: 18px;"
v-html="it.word"
></a>
<a style="font-size: 14px;">: 实体</a>
<a style="font-size: 14px;" v-html="it.entityId"></a>
<a
style="font-size: 14px;"
v-html="it.entityId"
></a>
<a style="font-size: 14px;">属性</a>
<a style="font-size: 14px;" v-html="it.attribute"></a>
<a
style="font-size: 14px;"
v-html="it.attribute"
></a>
<el-button
style="margin-left: auto;font-size: 12px"
@click="countScore()"
......@@ -132,6 +148,7 @@ export default {
computeScore: 0,
allScore: 1,
rightScore: 0,
treeToArray: [],
};
},
beforeMount() {
......@@ -271,6 +288,12 @@ export default {
this.token.entityId = res.result.templateName;
// 属性
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 {
this.$message({
message: res.return_info,
......@@ -287,6 +310,7 @@ export default {
this.token.word = window.getSelection().toString();
this.token.begin = window.getSelection().anchorOffset; //开始位置
this.token.end = window.getSelection().focusOffset; //结束位置
this.$refs.tree.setCheckedNodes([]);
//console.log(" token select" + JSON.stringify(this.token));
//console.log(" tokenList select" + JSON.stringify(this.tokenList));
}
......@@ -337,11 +361,12 @@ export default {
if (res.return_code == 200) {
this.tokenList = [];
this.getTokenList();
console.log(" token uploadToken" + JSON.stringify(token));
console.log(" token uploadToken" + JSON.stringify(this.token));
console.log(
" tokenList uploadToken" + JSON.stringify(this.tokenList)
);
// console.log(" token uploadToken" + JSON.stringify(token));
// console.log(" token uploadToken" + JSON.stringify(this.token));
// console.log(
// " tokenList uploadToken" + JSON.stringify(this.tokenList)
// );
this.$refs.tree.setCheckedNodes([]);
this.$message({
message: "已保存",
type: "success",
......@@ -411,6 +436,27 @@ export default {
this.token.begin = tag.begin;
this.token.end = tag.end;
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);
}
}
},
save() {
alert("打分成功");
......
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