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

Commit 1cef778b by wyy

得分计算

parent 4b6776ce
......@@ -44,21 +44,16 @@
v-for="it in tokenList"
:key="it"
style="user-select:none; float: left;"
@click="changeToken(it)"
:disable-transitions="false"
>
<el-checkbox>
<el-checkbox v-model="it.checked" @change="countScore(it)">
<a @click="changeToken(it)">
<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;">属性</a>
<a style="font-size: 14px;" v-html="it.attribute"></a>
<!--el-button
style="margin-left: auto;font-size: 12px"
@click="countScore()"
size="mini"
type="text"
>O</el-button-->
</a>
</el-checkbox>
</div>
</div>
......@@ -93,6 +88,7 @@ export default {
end: 0,
entityId: "",
attribute: [],
checked: false,
},
token: {
tokenId: "",
......@@ -101,6 +97,7 @@ export default {
end: 0,
entityId: "",
attribute: [],
checked: false,
},
// 实体属性列表
tokenList: [],
......@@ -118,6 +115,7 @@ export default {
accuracy: "",
score: "",
},
rightTokenList: [],
formLabelWidth: "120px",
executors: [],
computeScore: 0,
......@@ -146,11 +144,33 @@ export default {
}
this.uploadToken();
},
countScore() {
this.rightScore++;
countScore(selectToken) {
var flag = true;
console.log(this.rightTokenList);
for(var i=0;i<this.rightTokenList.length;i++){
if(selectToken.word == this.rightTokenList[i].word){
flag = false;
this.rightTokenList.splice(i,1);
this.tokenList.forEach((element) => {
if(selectToken.word == element.word){
element.checked = false;
}
})
}
}
if(flag == true){
this.tokenList.forEach((element) => {
if(selectToken.word == element.word){
this.rightTokenList.push(element);
element.checked = true;
}
})
}
this.rightScore = this.rightTokenList.length;
this.allScore = this.tokenList.length;
this.computeScore = (this.rightScore / this.allScore) * 100;
console.log(this.rightScore);
console.log(this.allScore);
console.log(this.computeScore)
// console.log(this.allScore);
},
// 插入数据库
insertDocument() {
......@@ -232,7 +252,11 @@ export default {
this.allScore = 0;
res.result.forEach((element) => {
this.tokenInit = element;
this.allScore++;
this.tokenInit.checked = false;
this.rightTokenList.forEach((item)=>{
if(item.word == this.tokenInit.word)
this.tokenInit.checked = true;
})
console.log(" token: " + JSON.stringify(this.tokenInit));
this.tokenList.push(this.tokenInit);
let replaceReg = new RegExp(this.tokenInit.word, "g"); // 匹配关键字正则
......@@ -425,6 +449,7 @@ export default {
this.token.begin = tag.begin;
this.token.end = tag.end;
this.token.entityId = tag.entityId;
this.token.checked = tag.checked;
let res = [];
for (var i = 0; i < this.treeToArray.length; i++) {
res[i] = {};
......
......@@ -84,21 +84,16 @@
v-for="it in tokenList"
:key="it"
style="user-select:none; float: left;"
@click="changeToken(it)"
:disable-transitions="false"
>
<el-checkbox>
<el-checkbox v-model="it.checked" @change="countScore(it)">
<a @click="changeToken(it)">
<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;">属性</a>
<a style="font-size: 14px;" v-html="it.attribute"></a>
<!--el-button
style="margin-left: auto;font-size: 12px"
@click="countScore()"
size="mini"
type="text"
>O</el-button-->
</a>
</el-checkbox>
</div>
</div>
......@@ -133,6 +128,7 @@ export default {
end: 0,
entityId: "",
attribute: [],
checked: false,
},
token: {
tokenId: "", // 编号
......@@ -141,6 +137,7 @@ export default {
end: 0, // 终止位置
entityId: "", // column
attribute: [], // 属性
checked: false,
},
row: [],
column: {},
......@@ -166,6 +163,7 @@ export default {
tableData: [],
name: [],
},
rightTokenList: [],
allContent: [],
numOfSheet: 0,
commentScore: false,
......@@ -176,6 +174,9 @@ export default {
formLabelWidth: "120px",
executors: [],
treeToArray: [],
computeScore: 0,
allScore: 1,
rightScore: 0
};
},
beforeMount() {
......@@ -197,6 +198,36 @@ export default {
}
this.uploadToken();
},
countScore(selectToken) {
var flag = true;
for(var i=0;i<this.rightTokenList.length;i++){
if(selectToken.word == this.rightTokenList[i].word){
flag = false;
this.rightTokenList.splice(i,1);
this.tokenList.forEach((element) => {
if(selectToken.word == element.word){
element.checked = false;
}
})
}
}
if(flag == true){
this.tokenList.forEach((element) => {
if(selectToken.word == element.word){
this.rightTokenList.push(element);
element.checked = true;
}
})
}
console.log(this.rightTokenList)
this.rightScore = this.rightTokenList.length;
this.allScore = this.tokenList.length;
if(this.allScore == 0){
this.allScore = 1;
}
this.computeScore = (this.rightScore / this.allScore) * 100;
// console.log(this.allScore);
},
// 插入数据库
insertDocument() {
// console.log("userId" + this.$store.state.userInfo.userId);
......@@ -274,6 +305,11 @@ export default {
if (res.return_code == 200) {
res.result.forEach((element) => {
this.tokenInit = element;
this.tokenInit.checked = false;
this.rightTokenList.forEach((item)=>{
if(item.word == this.tokenInit.word)
this.tokenInit.checked = true;
})
console.log(" token: " + JSON.stringify(this.tokenInit));
this.tokenList.push(this.tokenInit);
});
......@@ -471,6 +507,7 @@ export default {
this.token.begin = tag.begin;
this.token.end = tag.end;
this.token.entityId = tag.entityId;
this.token.checked = tag.checked;
let res = [];
for (var i = 0; i < this.treeToArray.length; i++) {
res[i] = {};
......
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