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

Commit a2ea92d3 by Wang Yuhang

Merge branch 'develop' of ssh://gitlab.redhtc.com:1422/Berlincen/DA-Platform into dev

parents 464f88ef 2f6eaa04
......@@ -33,6 +33,25 @@
<!-- <el-radio-button label="多边形标注"></el-radio-button>-->
<!-- </el-radio-group>-->
<el-button @click="save()">保存</el-button>
<!-- 看注释,打分按钮和提交按钮是对审核结果提交-->
<div style="overflow: auto">
<el-button type="primary" @click="commentScore = true">打分</el-button>
<el-button type="primary" @click="submit()">提交</el-button>
<el-dialog title="请打分" :visible.sync="commentScore" width="400px">
<el-form :model="scoreForm">
<el-form-item label="标注准确率" :label-width="formLabelWidth">
<el-input v-model="scoreForm.accuracy" autocomplete="off" clearable></el-input>
</el-form-item>
<el-form-item label="标注得分" :label-width="formLabelWidth">
<el-input v-model="scoreForm.score" autocomplete="off" clearable></el-input>
</el-form-item>
<el-button type="primary" @click="addScore()">确认</el-button>
</el-form>
</el-dialog>
</div>
<!-- -->
</div>
</div>
</el-aside>
......@@ -176,7 +195,12 @@ export default {
defaultProps: {
children: 'children',
label: 'label'
}
},
commentScore: false,
scoreForm: {
accuracy: "",
score: ""
},
}
},
async mounted () {
......@@ -863,7 +887,56 @@ export default {
window.onmousemove = null
console.log('鼠标松开了')
},
addScore() {
if (this.scoreForm.accuracy == "" || this.scoreForm.score == "")
this.$message("请输入内容");
else if (
!/^[0-9]+$/.test(this.scoreForm.accuracy) &&
!/^[0-9]+$/.test(this.scoreForm.accuracy) &&
!/^((([^0][0-9]+|0)\.([0-9]{1,2}))$)|^(([1-9]+)\.([0-9]{1,2})$)/.test(
this.scoreForm.score
) &&
!/^((([^0][0-9]+|0)\.([0-9]{1,2}))$)|^(([1-9]+)\.([0-9]{1,2})$)/.test(
this.scoreForm.accuracy
)
)
this.$message("输入非法字符");
else if (
parseInt(this.scoreForm.accuracy) > 100 ||
parseInt(this.scoreForm.accuracy) < 0
)
this.$message("准确度应在0~100范围内");
else if (
parseInt(this.scoreForm.score) > 100 ||
parseInt(this.scoreForm.score) < 0
)
this.$message("得分应该在0~100范围内");
else {
this.commentScore = false;
this.$message("打分成功");
}
},
submit() {
alert("打分成功");
this.$router.push({ path: "/taskhall" });
// alert("inin");
this.axios({
method: "get",
params: {
userId: this.$store.state.userInfo.userId,
fileId: this.file.id,
scoreForm: this.scoreForm
},
url: "task/gradePieces"
}).then(res => {
if (res.code == 0) {
alert("分数提交失败!");
} else if (res.code == 1) {
alert("打分成功");
this.$router.push({ path: "/taskhall" });
}
});
},
// // 监听鼠标事件
// brush_Listener () {
// let r1, r2
......
......@@ -39,6 +39,21 @@
<el-button @click="isInfo = false">取消</el-button>
<el-button @click="deleteLabelInList()">删除</el-button>
</div>
<div style="overflow: auto">
<el-button type="primary" @click="commentScore = true">打分</el-button>
<el-button type="primary" @click="submit()">提交</el-button>
<el-dialog title="请打分" :visible.sync="commentScore" width="400px">
<el-form :model="scoreForm">
<el-form-item label="标注准确率" :label-width="formLabelWidth">
<el-input v-model="scoreForm.accuracy" autocomplete="off" clearable></el-input>
</el-form-item>
<el-form-item label="标注得分" :label-width="formLabelWidth">
<el-input v-model="scoreForm.score" autocomplete="off" clearable></el-input>
</el-form-item>
<el-button type="primary" @click="addScore()">确认</el-button>
</el-form>
</el-dialog>
</div>
</div>
</transition>
<transition name="fade">
......@@ -682,7 +697,57 @@
message: '已取消删除'
});
});
}
},
addScore() {
if (this.scoreForm.accuracy == "" || this.scoreForm.score == "")
this.$message("请输入内容");
else if (
!/^[0-9]+$/.test(this.scoreForm.accuracy) &&
!/^[0-9]+$/.test(this.scoreForm.accuracy) &&
!/^((([^0][0-9]+|0)\.([0-9]{1,2}))$)|^(([1-9]+)\.([0-9]{1,2})$)/.test(
this.scoreForm.score
) &&
!/^((([^0][0-9]+|0)\.([0-9]{1,2}))$)|^(([1-9]+)\.([0-9]{1,2})$)/.test(
this.scoreForm.accuracy
)
)
this.$message("输入非法字符");
else if (
parseInt(this.scoreForm.accuracy) > 100 ||
parseInt(this.scoreForm.accuracy) < 0
)
this.$message("准确度应在0~100范围内");
else if (
parseInt(this.scoreForm.score) > 100 ||
parseInt(this.scoreForm.score) < 0
)
this.$message("得分应该在0~100范围内");
else {
this.commentScore = false;
this.$message("打分成功");
}
},
submit() {
alert("打分成功");
this.$router.push({ path: "/taskhall" });
// alert("inin");
this.axios({
method: "get",
params: {
userId: this.$store.state.userInfo.userId,
fileId: this.file.id,
scoreForm: this.scoreForm
},
url: "task/gradePieces"
}).then(res => {
if (res.code == 0) {
alert("分数提交失败!");
} else if (res.code == 1) {
alert("打分成功");
this.$router.push({ path: "/taskhall" });
}
});
},
},
};
</script>
......
......@@ -91,6 +91,7 @@ export default {
children: "children",
label: "label"
},
// 这个地方是打分的数据结构
commentScore: false,
scoreForm: {
accuracy: "",
......@@ -224,6 +225,11 @@ export default {
parseInt(this.scoreForm.accuracy) < 0
)
this.$message("准确度应在0~100范围内");
else if (
parseInt(this.scoreForm.score) > 100 ||
parseInt(this.scoreForm.score) < 0
)
this.$message("得分应该在0~100范围内");
else {
this.commentScore = false;
this.$message("打分成功");
......
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