|
@@ -38,6 +38,7 @@
|
|
|
<el-select
|
|
|
v-model="tid"
|
|
|
clearable
|
|
|
+ @change="getRatio"
|
|
|
placeholder="请选择"
|
|
|
style="width: 150px; margin-left: 5px"
|
|
|
>
|
|
@@ -60,7 +61,7 @@
|
|
|
<span class="el-icon-setting"></span> 设置错误率
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="error">错误率:{{ ratio }}%</div>
|
|
|
+ <div class="error" v-if="is_ratio&&ratio>0">错误率:{{ ratio }}%</div>
|
|
|
<div class="error_coll">
|
|
|
<li class="d-f j-s" v-for="(item, i) in tableData" :key="i + 'a'">
|
|
|
<div>
|
|
@@ -200,7 +201,7 @@ import topNav from "@/components/assembly/topnav";
|
|
|
import topHead from "@/components/assembly/head";
|
|
|
import foot from "@/components/assembly/foot";
|
|
|
import sonNav from "@/components/assembly/err_nav";
|
|
|
-import { classes, clsErr, tasks } from "@/util/api";
|
|
|
+import { classes, clsErr, tasks,cls_err_ratio } from "@/util/api";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -217,6 +218,7 @@ export default {
|
|
|
total: 0,
|
|
|
is_show: false,
|
|
|
is_answer: false,
|
|
|
+ is_ratio: false,
|
|
|
source: "", //来源
|
|
|
sour_list: [],
|
|
|
};
|
|
@@ -252,6 +254,7 @@ export default {
|
|
|
//设置错题率
|
|
|
sure_ratio() {
|
|
|
var regs = /^([1-9]{1}[0-9]{0,7})\d*$/;
|
|
|
+ var that = this;
|
|
|
if (!this.ratio) {
|
|
|
this.$message.warning("请输入1-100内的整数");
|
|
|
return;
|
|
@@ -260,10 +263,22 @@ export default {
|
|
|
this.$message.warning("请输入1-100内的整数");
|
|
|
return;
|
|
|
}
|
|
|
+ if(!this.tid){
|
|
|
+ this.$message.warning("请选择来源信息");
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (regs.test(this.ratio)) {
|
|
|
this.params.page = 1;
|
|
|
+
|
|
|
this.is_show = false;
|
|
|
- this.getList();
|
|
|
+ var obj = {};
|
|
|
+ obj.tid = this.tid;
|
|
|
+ obj.ratio = this.ratio;
|
|
|
+ cls_err_ratio(obj).then(res=>{
|
|
|
+ if(res.errcode==0){
|
|
|
+ that.getList();
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
this.$message.warning("请输入1-100内的整数");
|
|
|
}
|
|
@@ -272,7 +287,8 @@ export default {
|
|
|
sourceList(val) {
|
|
|
var that = this,
|
|
|
obj = {};
|
|
|
- this.params.tid = "";
|
|
|
+ this.tid = "";
|
|
|
+ this.ratio = '';
|
|
|
obj.mtype = val;
|
|
|
tasks(obj).then((res) => {
|
|
|
if (res.errcode == 0) {
|
|
@@ -280,6 +296,20 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ getRatio(val){
|
|
|
+ if(val){
|
|
|
+ this.is_ratio = true;
|
|
|
+ this.sour_list.forEach(item=>{
|
|
|
+ if(item.id == val){
|
|
|
+ this.ratio = item.error_ratio
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.is_ratio = false
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
drawRose() {
|
|
|
var roseCharts = document.getElementsByClassName("roseChart");
|
|
|
var index = 0;
|
|
@@ -429,7 +459,9 @@ export default {
|
|
|
var that = this;
|
|
|
this.params.tid = this.tid ? this.tid : 0;
|
|
|
this.params.cid = this.cid ? this.cid : 0;
|
|
|
- this.params.ratio = this.ratio;
|
|
|
+ if(this.tid){
|
|
|
+ this.params.ratio = this.ratio
|
|
|
+ }
|
|
|
clsErr(this.params).then((res) => {
|
|
|
if (res.errcode == 0) {
|
|
|
that.tableData = res.data ? res.data : [];
|