qq 2 rokov pred
rodič
commit
9f2b2a10f8

+ 2 - 2
src/components/customer/student_per_jh.vue

@@ -493,8 +493,8 @@ margin-top: 16px;
   font-weight: bold;
 }
 .error_coll .t_img img {
-  width: 100%;
-  height: 155px;
+  /* width: 100%; */
+  height: 160px;
   margin-bottom: 30px;
 }
 .error_coll .t_img .stem {

+ 37 - 5
src/components/customer/topic.vue

@@ -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 : [];

+ 2 - 1
src/util/api.js

@@ -34,4 +34,5 @@ export const clsPushEp = p => get('/v1/api/cls-push-errs/' + p, ) //班级错题
 export const errbook = p => get('/v1/api/stu-errs/' + p, ) //班级错题推送详情
 export const cleDel = p => del('/v1/api/cls-push-errs/' + p, ) //错题推送删除
 export const relQuestions = p => get('/v1/api/stu-errs/' + p + '/rel-questions', ) //举一反三
-export const stu_err_stati = p => get('/v1/api/stu-errs/' + p + '/tasks', ) //学生错题-任务错题统一
+export const stu_err_stati = p => get('/v1/api/stu-errs/' + p + '/tasks', ) //学生错题-任务错题统一
+export const cls_err_ratio = p => post('/v1/api/cls-err/ratio', p) //设置错题率