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

Commit 89a9b233 by 郭婉茹

bug in table

parent 1a21ec3b
......@@ -39,16 +39,9 @@
</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"
......@@ -63,10 +56,7 @@
: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>
......@@ -117,7 +107,7 @@ export default {
children: "children",
label: "label",
},
treeToArray : [],
treeToArray: [],
};
},
beforeMount() {
......@@ -250,7 +240,10 @@ export default {
// 属性
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 }); // 属性
this.treeToArray.push({
id: this.treeData[i].id,
label: this.treeData[i].label,
}); // 属性
if (this.treeData[i].children != []) {
this.transfer(this.treeData[i].children);
}
......@@ -266,6 +259,15 @@ export default {
// 定位原文token
select() {
if (window.getSelection().toString() != "") {
for (var i = 0; i < this.tokenList.length; i++) {
if (window.getSelection().toString() == this.tokenList[i].word) {
this.$message({
message: "“" + window.getSelection().toString() + "”已标注",
type: "info",
});
return;
}
}
//console.log(" token select" + JSON.stringify(this.token));
this.token.tokenId = "0";
this.token.word = window.getSelection().toString();
......@@ -410,10 +412,9 @@ export default {
this.$refs.tree.setCheckedNodes(res);
},
transfer(children) {
if (children == [])
return;
if (children == []) return;
for (var i = 0; i < children.length; i++) {
this.treeToArray.push({ "id": children[i].id, "label": children[i].label });
this.treeToArray.push({ id: children[i].id, label: children[i].label });
if (children[i] != []) {
this.transfer(children[i].children);
}
......
......@@ -60,13 +60,12 @@
<el-main class="filter-container2" style="background-color: #FFFFFF">
<div style="overflow-y:auto;height:100%;">
<!-- 表格界面 -->
<div class="content2">
<div class="content2" @mouseup="select()">
<el-table
:data="nowContent.tableData"
:cell-style="cellStyle"
border
style="width: 100%,height:200px"
@cell-click="select"
:cell-class-name="getCellIndex"
>
<el-table-column
......@@ -175,7 +174,7 @@ export default {
method: "post",
url: "/textAnnotation/insertDocument",
data: {
templateId: this.piece.template, // TODO 模板id
templateId: this.piece.template,
annotatorId: this.$store.state.userInfo.userId,
creatorId: this.task.creator_id,
relationId: this.relationId,
......@@ -290,27 +289,17 @@ export default {
}
},
// 定位原文token
select: function (row, column) {
this.row = row;
this.column = column;
this.token.tokenId = "0";
this.token.word = row[column.property];
this.token.begin = row.index;
this.token.end = column.index;
for (var i = 0; i < this.tokenList.length; i++) {
if (
this.token.begin == this.tokenList[i].begin &&
this.token.end == this.tokenList[i].end
) {
this.$message({
message: "选中单元格已标记",
type: "info",
});
return;
}
select() {
if (window.getSelection().toString() != "") {
//console.log(" token select" + JSON.stringify(this.token));
this.token.tokenId = "0";
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));
}
console.log(" token select" + JSON.stringify(this.token));
console.log(" tokenList select" + JSON.stringify(this.tokenList));
},
getCellIndex: function ({ row, column, rowIndex, columnIndex }) {
row.index = rowIndex;
......
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