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

Commit 26f0cb43 by 郭婉茹

表格着色bug

parent 3c61f10c
...@@ -158,7 +158,7 @@ export default { ...@@ -158,7 +158,7 @@ export default {
}, },
}).then((res) => { }).then((res) => {
if (res.return_code == 200) { if (res.return_code == 200) {
// console.log(" getContent: " + res.result); console.log(" getContent: " + res.result);
this.content = res.result; this.content = res.result;
this.$nextTick(function () { this.$nextTick(function () {
this.getTokenList(); this.getTokenList();
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 文本列表 --> <!-- 表单列表 -->
<div class="sidebar-box3"> <div class="sidebar-box3">
<div> <div>
<div class="img-list-title3">表单列表</div> <div class="img-list-title3">表单列表</div>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
border border
style="width: 100%,height:200px" style="width: 100%,height:200px"
@cell-click="select" @cell-click="select"
:row-class-name="tableRowClassName" :cell-class-name="getCellIndex"
> >
<el-table-column <el-table-column
v-for="col in nowContent.name" v-for="col in nowContent.name"
...@@ -288,20 +288,20 @@ export default { ...@@ -288,20 +288,20 @@ export default {
} }
}, },
// 定位原文token // 定位原文token
select(row, column) { select: function (row, column) {
this.row = row; this.row = row;
this.column = column; this.column = column;
this.token.word = row[column.property]; this.token.word = row[column.property];
this.token.begin = column.property; this.token.begin = row.index;
this.token.entityId = row[1]; this.token.end = column.index;
console.log(JSON.stringify(row)); // console.log("select: "+JSON.stringify(row.index));
console.log(JSON.stringify(column)); // console.log("select: "+JSON.stringify(column.index));
console.log(JSON.stringify(this.token.word)); // console.log(JSON.stringify(this.token.word));
console.log(this.token.begin);
console.log(JSON.stringify(this.token.entityId));
// 禁止重复标注,沾边的也不行
for (var i = 0; i < this.tokenList.length; i++) { for (var i = 0; i < this.tokenList.length; i++) {
if (this.token.word == this.tokenList[i].word) { if (
this.token.begin == this.tokenList[i].begin &&
this.token.end == this.tokenList[i].end
) {
this.$message({ this.$message({
message: "选中单元格已标记", message: "选中单元格已标记",
type: "info", type: "info",
...@@ -313,16 +313,28 @@ export default { ...@@ -313,16 +313,28 @@ export default {
console.log(" tokenList select" + JSON.stringify(this.tokenList)); console.log(" tokenList select" + JSON.stringify(this.tokenList));
this.ifAlert = true; // 打开标注弹窗 this.ifAlert = true; // 打开标注弹窗
}, },
// tableRowClassName({ row, rowIndex }) { getCellIndex: function ({ row, column, rowIndex, columnIndex }) {
// if (rowIndex === 0) { row.index = rowIndex;
// return "success-row"; column.index = columnIndex;
// } else if (rowIndex === 3) { },
// return "success-row";
// }
// return "";
// },
// 表格标注颜色 // 表格标注颜色
cellStyle(row, column, rowIndex, columnIndex) {}, cellStyle: function (row, column, rowIndex, columnIndex) {
for (var i = 0; i < this.tokenList.length; i++) {
// console.log("draw token" + JSON.stringify(this.tokenList[i]));
// console.log("draw rowindex" + JSON.stringify(this.tokenList[i].begin));
// console.log("draw columnindex" + JSON.stringify(this.tokenList[i].end));
// console.log("draw rowindex" + JSON.stringify(row.rowIndex));
// console.log("draw columnindex" + JSON.stringify(row.columnIndex));
if (
row.rowIndex === this.tokenList[i].begin &&
row.columnIndex === this.tokenList[i].end
) {
// console.log("draw token" + JSON.stringify(this.token));
return "background: #d9ecff;";
}
}
return "";
},
// 添加标注 // 添加标注
uploadToken() { uploadToken() {
this.ifAlert = false; this.ifAlert = false;
...@@ -346,7 +358,7 @@ export default { ...@@ -346,7 +358,7 @@ export default {
token: { token: {
word: this.token.word, word: this.token.word,
begin: this.token.begin, begin: this.token.begin,
end: 0, end: this.token.end,
entityId: this.token.entityId, entityId: this.token.entityId,
attribute: arr, attribute: arr,
}, },
...@@ -358,8 +370,8 @@ export default { ...@@ -358,8 +370,8 @@ export default {
tokenId: res.result, tokenId: res.result,
word: this.token.word, word: this.token.word,
begin: this.token.begin, begin: this.token.begin,
end: 0, end: this.token.end,
entityId: this.token.entityId, entityId: this.value,
attribute: arr, attribute: arr,
}; };
this.tokenList.push(token); this.tokenList.push(token);
...@@ -481,16 +493,16 @@ export default { ...@@ -481,16 +493,16 @@ export default {
width: 30%; width: 30%;
.img-list-title3 { .img-list-title3 {
padding: 0 0 0 0; padding: 0 0 0 0;
width: 300px; width: 300px;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
background: #409eff; background: #409eff;
color: white; color: white;
box-shadow: 0px 0px 10px #dbdbdb; box-shadow: 0px 0px 10px #dbdbdb;
} }
.img-title-list-box3 { .img-title-list-box3 {
padding: 0 0 0 0; padding: 0 0 0 0;
width: 300px; width: 300px;
height: 200px; height: 200px;
overflow: auto; overflow: auto;
background-color: white; background-color: white;
...@@ -547,4 +559,4 @@ export default { ...@@ -547,4 +559,4 @@ export default {
margin-top: 3px; margin-top: 3px;
margin-bottom: 3px; margin-bottom: 3px;
} }
</style> </style>
\ No newline at end of file
...@@ -240,6 +240,24 @@ export default { ...@@ -240,6 +240,24 @@ export default {
} }
}); });
}, },
// 表格标注颜色
cellStyle: function (row, column, rowIndex, columnIndex) {
for (var i = 0; i < this.tokenList.length; i++) {
// console.log("draw token" + JSON.stringify(this.tokenList[i]));
// console.log("draw rowindex" + JSON.stringify(this.tokenList[i].begin));
// console.log("draw columnindex" + JSON.stringify(this.tokenList[i].end));
// console.log("draw rowindex" + JSON.stringify(row.rowIndex));
// console.log("draw columnindex" + JSON.stringify(row.columnIndex));
if (
row.rowIndex === this.tokenList[i].begin &&
row.columnIndex === this.tokenList[i].end
) {
// console.log("draw token" + JSON.stringify(this.token));
return "background: #d9ecff;";
}
}
return "";
},
submit() { submit() {
this.$router.push({ path: "/taskhall" }); this.$router.push({ path: "/taskhall" });
......
...@@ -252,6 +252,24 @@ export default { ...@@ -252,6 +252,24 @@ export default {
} }
}); });
}, },
// 表格标注颜色
cellStyle: function (row, column, rowIndex, columnIndex) {
for (var i = 0; i < this.tokenList.length; i++) {
// console.log("draw token" + JSON.stringify(this.tokenList[i]));
// console.log("draw rowindex" + JSON.stringify(this.tokenList[i].begin));
// console.log("draw columnindex" + JSON.stringify(this.tokenList[i].end));
// console.log("draw rowindex" + JSON.stringify(row.rowIndex));
// console.log("draw columnindex" + JSON.stringify(row.columnIndex));
if (
row.rowIndex === this.tokenList[i].begin &&
row.columnIndex === this.tokenList[i].end
) {
// console.log("draw token" + JSON.stringify(this.token));
return "background: #d9ecff;";
}
}
return "";
},
// 打分 // 打分
addScore() { addScore() {
if (this.scoreForm.accuracy == "" || this.scoreForm.score == "") if (this.scoreForm.accuracy == "" || this.scoreForm.score == "")
......
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