Browse Source

Merge branch 'master' of http://118.190.145.217:3000/xiaojincai/supermarkpp into master

tanyanfei 3 months ago
parent
commit
8f40b88360

+ 59 - 2
src/api.js

@@ -149,6 +149,9 @@ export default {
     getPaperInfo: params => {
         return axios.get(`${baseURL}/api/admin/papers`, { params: params })
     },
+    getPaperQueInfo: params => {
+        return axios.get(`${baseURL}/api/admin/papers/queinfo`, { params: params })
+    },
     addPaperInfo: params => {
         return axios.post(`${baseURL}/api/admin/papers`, params)
     },
@@ -325,6 +328,60 @@ export default {
 	//打分
 	mark: params => {
 	    return axios.post(`${baseURL}/api/admin/teacher/mark/que/mark`, params)
-	},
-	
+    },
+    // 查询阅卷任务图片列表
+    getTaskImgList:params => {
+		return axios.get(`${baseURL}/api/admin/teacher/mark/task/img/list`, {
+			params: params,
+		});
+    },
+    // 开始识别
+    startRecPaper: params => {
+	    return axios.post(`${baseURL}/api/admin/teacher/mark/task/starRec`, params)
+    },
+    // 获取
+	getStdQueList:params => {
+		return axios.get(`${baseURL}/api/admin/papers/quelist`, {
+			params: params,
+		});
+    },
+    // 保存客观题
+    saveObjectiveQue: params => {
+	    return axios.put(`${baseURL}/api/admin/papers/objective/update`, params)
+    },
+    saveTaskObjectiveQue: params => {
+	    return axios.put(`${baseURL}/api/admin/papers/task/objective/update`, params)
+    },
+    // 保存主观题
+    saveSubjectiveQue: params => {
+	    return axios.put(`${baseURL}/api/admin/papers/subjective/update`, params)
+    },
+    // 获取阅卷老师账号
+	getSchoolUser:params => {
+		return axios.get(`${baseURL}/api/admin/school/user/list`, {
+			params: params,
+		});
+    },
+    // 更新客观题识别信息
+    savePaperTplObjectiveQue: params => {
+	    return axios.put(`${baseURL}/api/admin/papers/tpl/objective/update`, params)
+    },
+    // 更新主观题切片
+    savePaperTplSubjectiveQue: params => {
+        return axios.put(`${baseURL}/api/admin/papers/tpl/subjective/update`, params)
+    },
+    // 修改考号
+    saveModifyStudentNo: params => {
+        return axios.put(`${baseURL}/api/admin/papers/task/modify/studentno`, params)
+    },
+    //修改客观题答案
+    saveModifQueAns: params => {
+        return axios.put(`${baseURL}/api/admin/papers/task/modify/queans`, params)
+    },
+    // 搜索学生信息
+    searchStudents:params => {
+		return axios.get(`${baseURL}/api/admin/students/search`, {
+			params: params,
+		});
+    },
 }

+ 8 - 8
src/constant.js

@@ -44,12 +44,12 @@ export default{
         {label:"G",value:"G",flag:0}
     ],
     recErrorList:[
-        {label:"考号异常",value:0},
-        {label:"少识别选项",value:-1},
-        {label:"多识别选项",value:-2},
-        {label:"单选题多涂",value:-3},
-        {label:"考号异常,少识别选项",value:-11},
-        {label:"考号异常,多识别选项",value:-12},
-        {label:"考号异常,单选题多涂",value:-13}
-    ]
+        {label:"待上传",value:0},
+        {label:"考号异常",value:-1},
+        {label:"客观题异常",value:-2},
+    ],
+    ansOptionIndex:{
+        "A":0,"B":1,"C":2,"D":3,"E":4,"F":5,"G":6,
+        0:"A",1:"B",2:"C",3:"D",4:"E",5:"F",6:"G"
+    }
 }

+ 8 - 1
src/router.js

@@ -145,7 +145,14 @@ export default new Router({
 				        import ('./views/tasks/stdAnalysis'),
 				    name: '成绩分析',
 					hide: 1,
-				},
+                },
+                {
+                    path: '/task/uploadPaper',
+                    component: () =>
+                        import ('./views/tasks/uploadPaper.vue'),
+                    name: '试卷上传',
+                    hide:1
+                }
             ]
         },
         {

+ 1 - 1
src/style/home.scss

@@ -117,7 +117,7 @@ $height: 64px;
         // padding: 20px !important;
         height: 100vh;
         margin: 0 !important;
-        height: calc(100vh - 100px);
+        // height: calc(100vh - 100px);
         box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.12);
         // overflow:scroll;
         &>h1 {

+ 2 - 2
src/views/Login.vue

@@ -140,8 +140,8 @@ export default {
       tp:'',
       code:'',
       logindata:{
-        username:'',
-        password:'',
+        username:'root',
+        password:'hnwz@2021',
         imgcode_id:'',
         imgcode:'',
         utype:2

+ 7 - 7
src/views/papers/Index.vue

@@ -1,4 +1,4 @@
-<style lang="scss">
+<style lang="scss" scoped>
 
 </style>
 <template>
@@ -32,7 +32,7 @@
       <el-table-column align="center" prop="ctime" label="创建时间" />
       <el-table-column align="center" prop="date" label="操作" width="320">
         <template slot-scope="scope">
-            <el-button @click="edit(scope.row.id)" size="mini" type="primary">编辑</el-button>
+            <el-button @click="edit(scope.row.id)" size="mini" type="warning">编辑</el-button>
           <el-button @click="cutpaper(scope.row.id)" size="mini" type="warning">试卷分隔</el-button>
           <el-button @click="del(scope.row.id)" size="mini" type="danger">删除</el-button>
         </template>
@@ -57,14 +57,14 @@
             </el-option>
           </el-select>
         </el-form-item> -->
-        <el-form-item label="试卷图片" prop>
+        <el-form-item label="试卷图片" prop v-if="!form.id">
           <el-upload
             class="upload-demo"
             action="/api/admin/uploadfile"
             :on-success="handleSuccess"
             :on-remove="handleRemove"
             :file-list="fileList"
-            list-type="picture">
+            list-type="picture-card">
             <el-button size="small" type="primary">点击上传</el-button>
             <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
           </el-upload>
@@ -153,11 +153,10 @@
         this.form = {};
         // this.initCropper();
       },
-      handleSuccess(res){
-        this.fileList.push({"name":res.data.name,"url":res.data.url})
+      handleSuccess(e,res,fileList){
+        this.fileList.push({"name":res.response.data.name,"url":res.response.data.url,"status":"success"})
       },
       handleRemove(file,fileList){
-        console.log(file,fileList,22222222222)
         this.fileList = fileList
       },
       edit(id) {
@@ -168,6 +167,7 @@
           imgs.forEach((item,index)=>{
             this.fileList.push({"name":item,"url":item})
           })
+          console.log(this.fileList,222222222222222)
           this.open = true;
         })
       },

+ 5 - 2
src/views/papers/canvasDrawer.vue

@@ -38,7 +38,8 @@
         props: {
             srcImg: String,
             curId:String,
-            khType:Number
+            khType:Number,
+            khPoints:String
         },
         data() {
             return {
@@ -400,7 +401,9 @@
                     stdKhList:this.stdKhList,
                     khType:this.khType,
                     khLength:this.khLength,
-                    khPoints:this.srcImg
+                    khPoints:this.khPoints,
+                    khPointsCrop:this.srcImg,
+                    updateType:"stdKh"
                 }
                 this.$api.updatePaperInfo(params).then(res => {
                     this.msgSuccess("成功!");

File diff suppressed because it is too large
+ 375 - 261
src/views/papers/cutPaper.vue


+ 2 - 2
src/views/school/ClassList.vue

@@ -29,7 +29,7 @@
 			      v-for="item in schoolList"
 			      :key="item.value"
 			      :label="item.name"
-			      :value="item.id"
+			      :value="item.school_id"
 			    >
 			    </el-option>
 			  </el-select>
@@ -134,7 +134,7 @@
 		      v-for="item in schoolList"
 		      :key="item.value"
 		      :label="item.name"
-		      :value="item.id"
+		      :value="item.school_id"
 		    >
 		    </el-option>
 		  </el-select>

+ 365 - 153
src/views/tasks/Index.vue

@@ -31,91 +31,91 @@
       </el-row>
     </el-form>
     <el-table v-loading="loading" :data="list" style="width: 100%; margin-top: 10px" height="50vh">
-      <el-table-column prop="name" label="作业名称"> </el-table-column>
-      	  <el-table-column prop="full_score" label="满分">
-      	    <template slot-scope="scope">
-      	      <div class="bold">{{ scope.row.full_score }}</div>
-      	    </template>
-      	  </el-table-column>
-      	  <el-table-column prop="max_score" label="最高分">
-      	    <template slot-scope="scope">
-      	      <div class="bold">{{ scope.row.max_score }}</div>
-      	    </template>
-      	  </el-table-column>
-      	  <el-table-column prop="avg_score" label="平均分">
-      	    <template slot-scope="scope">
-      	      <div class="bold">{{ scope.row.avg_score }}</div>
-      	    </template>
-      	  </el-table-column>
-      	  <el-table-column prop="pass_rate" label="及格率">
-      	    <template slot-scope="scope">
-      	      <div class="bold" style="color: #0a9dff">
-      	        {{ scope.row.pass_rate }}
-      	      </div>
-      	    </template>
-      	  </el-table-column>
-      	  <el-table-column prop="phone" label="批阅进度" width="180">
-      	    <template slot-scope="scope">
-      	     <div class="d-f prosss_box">
-      	        <el-progress
-      	          :percentage="scope.row.ww"
-      	          :stroke-width="8"
-      	          :color="
-      	            scope.row.total_students == scope.row.marked_students
-      	              ? '#0A9DFF'
-      	              : '#FA0A2F'
-      	          "
-      	        ></el-progress>
-      	        <div class="contrasts">
-      	          <span>{{ scope.row.marked_students }}/</span>
-      	          <span>{{ scope.row.total_students }}</span>
-      	        </div>
-      	      </div>
-      	    </template>
-      	  </el-table-column>
-      <el-table-column align="center" prop="ctime" label="创建时间" />
-      <el-table-column align="center" prop="date" label="操作" width="360">
+      <el-table-column prop="name" label="考试名称"> </el-table-column>
+      <el-table-column prop="phone" label="阅卷进度" width="280">
+        <template slot-scope="scope">
+            123人已上传,23%阅卷进度,2份仲裁卷
+        </template>
+      </el-table-column>
+      <el-table-column align="center" prop="date" label="操作" width="580">
         <template slot-scope="scope">
-			
           <el-button @click="jump(
 	            '/task/markpaper?title=' +
 	              scope.row.name +
 	              '&id=' +
-	              scope.row.id
-	          )" size="mini" type="success">开始阅卷</el-button>
-		  <el-button @click="edit(scope.row.id)" size="mini" type="warning">编辑</el-button>
-          <el-button @click="openUploadPaper(scope.row.id)" size="mini" type="primary">上传试卷</el-button>
-          <el-button @click="del(scope.row.id)" size="mini" type="danger">删除</el-button>
+	              scope.row.task_id
+            )" size="mini" type="success">开始阅卷</el-button>
+          <el-button @click="remarkSet(scope.row)" size="mini" type="warning">阅卷设置</el-button>
+          <!--<el-button @click="edit(scope.row)" size="mini" type="warning">编辑</el-button>-->
+          <el-button @click="openUploadPaper(scope.row.task_id)" size="mini" type="primary">上传试卷</el-button>
+          <el-button @click="del(scope.row.task_id)" size="mini" type="danger">删除</el-button>
         </template>
       </el-table-column>
     </el-table>
     <Page ref="pageButton" :current="form.page" :page_size="form.page_size" :total="total" @pageChange="gopage" />
     <!-- 新增/编辑阅卷任务 -->
-    <el-dialog title="新增/编辑阅卷任务" :visible.sync="open" width="500px" append-to-body>
+    <el-dialog title="新增/编辑阅卷任务" :visible.sync="open" width="80%" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="名称" prop="name">
-          <el-input clearable v-model="form.name" placeholder="请输入名称"></el-input>
-        </el-form-item>
-        <el-form-item label="试卷模板" prop="role">
-          <el-select v-model="form.paper_id" placeholder="请选择试卷模板" filterable>
-            <el-option v-for="item in papersList" :key="item.id" :label="item.name" :value="item.id">
-            </el-option>
-          </el-select>
-        </el-form-item>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="考试名称" prop="name">
+              <el-input clearable v-model="form.name" placeholder="请输入名称"></el-input>
+            </el-form-item>
+            <el-form-item label="参考班级" prop="role">
+              <el-row>
+                <el-col :span="12">
+                  <el-select @change="getClassList" v-model="form.school_id" placeholder="请选择学校" filterable clearable>
+                    <el-option v-for="item in schoolList" :key="item.id" :label="item.name" :value="item.school_id">
+                    </el-option>
+                  </el-select>
+                </el-col>
+                <el-col :span="12">
+                  <el-select @change="getClassList" v-model="form.grade_name" placeholder="请选择年级" filterable clearable>
+                    <el-option v-for="item in gradeList" :key="item" :label="item" :value="item">
+                    </el-option>
+                  </el-select>
+                </el-col>
+                <el-col :span="24" v-if="form.grade_name">
+                  <el-checkbox-group v-model="checkClassList">
+                    <el-checkbox v-for="item in classList" :key="item.class_id" :label="item.class_id">{{item.name}}
+                    </el-checkbox>
+                  </el-checkbox-group>
+                </el-col>
+              </el-row>
+            </el-form-item>
+            <el-form-item label="备注" prop="name">
+              <el-input clearable v-model="form.remark" placeholder="请输入备注"></el-input>
+            </el-form-item>
+
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="试卷模板" prop="role">
+              <el-select v-model="form.paper_id" placeholder="请选择试卷模板" filterable>
+                <el-option v-for="item in papersList" :key="item.id" :label="item.name" :value="item.id">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="open = false">取 消</el-button>
       </div>
     </el-dialog>
+
     <!-- 预览识别结果 -->
-    <el-dialog title="预览识别结果" :visible.sync="showAnsVisible" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-image :src="curStudentRecImg">
-          <div slot="error" class="image-slot">
-            <i class="el-icon-picture-outline"></i>
-          </div>
-        </el-image>
+    <el-dialog title="预览识别结果" :visible.sync="showAnsVisible" width="1080px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px" :inline="true">
+        <el-form-item label="修改考号:" v-if="activeName==-1">
+          <el-input v-model="curStudentNo" />
+        </el-form-item>
+        <el-form-item v-if="activeName==-1">
+          <el-button type="primary" @click="saveModifyStudentNo">保存</el-button>
+        </el-form-item>
+        <img :src="curStudentRecImg" id="myCanvasImg" style="display:none;" />
+        <canvas id="myCanvas" ref="myCanvas" :width="srcImgWidth*canvasImgScale" :height="srcImgHeight*canvasImgScale"></canvas>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="showAnsVisible = false">关 闭</el-button>
@@ -124,7 +124,7 @@
     <!-- 上传试卷 -->
     <el-dialog title="试卷上传" :visible.sync="uploadDialogVisible" width="90%" @close="closeUploadDialog">
       <el-row :gutter="20">
-        <el-col :span="16">
+        <el-col :span="24">
           <!-- <el-row>
             <el-col :span="6">参考人数:{{studentsList.length}}</el-col>
             <el-col :span="6">已上传:{{studentsList.length}}</el-col>
@@ -134,12 +134,12 @@
             <el-form-item label="姓名">
               <el-input size="mini" placeholder="请输入姓名/考号" v-model="queryName" clearable></el-input>
             </el-form-item>
-            <el-form-item label="识别异常">
+            <!--<el-form-item label="识别异常">
               <el-select v-model="queryMarkStatus" size="mini" clearable>
                 <el-option v-for="item in $const.recErrorList" :label="item.label" :value="item.value"></el-option>
 
               </el-select>
-            </el-form-item>
+            </el-form-item>-->
             <el-form-item>
               <el-button type="primary" size="mini" @click=searchMarkData>搜索</el-button>
               <el-button size="mini" @click="reSetMarkData">重置</el-button>
@@ -147,36 +147,42 @@
                 导出</el-button>
               <el-button @click="reTryMark" size="mini" type="success" icon="el-icon-printer">重新识别</el-button>
             </el-form-item>
+            <el-form-item>
+              <el-button size="mini" type="warning" icon="el-icon-printer">
+                试卷扫描</el-button>
+
+            </el-form-item>
+            <el-form-item>
+              <el-upload class="upload-demo" action="http://test.scxjc.club/api/admin/papers/uploadpaper"
+                :on-success="handleUploadSuccess" :data="{taskid:taskid}" :on-change="handleChange" list-type="picture"
+                multiple>
+                <el-button size="mini" type="primary" @click="openTaskImgList">点击上传</el-button>
+              </el-upload>
+            </el-form-item>
           </el-form>
           <el-row>
             <el-col :span="24">
               <el-tabs v-model="activeName" @tab-click="handleTabClick">
-                <el-tab-pane :label="'正常('+recSucTotal+')'" name="1"></el-tab-pane>
-                <el-tab-pane :label="'异常('+recErrTotal+')'" name="100"></el-tab-pane>
+                <el-tab-pane :label="'正确('+recSucTotal+')'" name="1"></el-tab-pane>
+                <el-tab-pane :label="'考号异常('+recKhErrTotal+')'" name="-1"></el-tab-pane>
+                <el-tab-pane :label="'客观题异常('+recObjErrTotal+')'" name="-2"></el-tab-pane>
+                <el-tab-pane :label="'待上传('+recWaitingErrTotal+')'" name="0"></el-tab-pane>
               </el-tabs>
             </el-col>
           </el-row>
-          <el-table v-loading="loading" 
-            :data="studentsList" 
-            style="width: 100%; margin-top: 10px"
-            @selection-change="handleSelectionChange" 
-            height="60vh">
+          <el-table v-loading="loading" :data="studentsList" style="width: 100%; margin-top: 10px"
+            @selection-change="handleSelectionChange" height="60vh">
             <el-table-column type="selection" width="45" v-if="activeName==100"></el-table-column>
-            <el-table-column align="center" prop="student_no" label="姓名" width="80" />
+            <el-table-column align="center" prop="student_name" label="姓名" width="80" />
             <el-table-column align="center" prop="student_no" label="考号" width="150">
               <template slot-scope="scope">
                 <el-button type="text" @click="showStudentImgs(scope.row)" size="mini">{{scope.row.student_no}}
                 </el-button>
               </template>
             </el-table-column>
-            <el-table-column align="center" prop="objective_score" label="得分" />
-            <!-- <el-table-column align="center" prop="mark_status" label="试卷状态">
-              <template slot-scope="scope">
-                <span v-if="scope.row.mark_status==0" style="color:#e6a23c;">待上传</span>
-                <span v-if="scope.row.mark_status==1" style="color:#85ce61;">已上传</span>
-              </template>
-            </el-table-column> -->
-            <el-table-column align="center" prop="mark_status_name" label="识别状态">
+            <el-table-column align="center" prop="objective_ans" label="客观题识别结果"/>
+            <el-table-column align="center" prop="objective_score" label="客观题得分" width="100" />
+            <el-table-column align="center" prop="mark_status_name" label="识别状态" width="80">
               <template slot-scope="scope">
                 <span v-if="scope.row.mark_status<=0" style="color:#f78989;">{{scope.row.mark_status_name}}</span>
                 <span v-if="scope.row.mark_status==1" style="color:#85ce61;">正常</span>
@@ -187,36 +193,38 @@
                 <span style="font-size:12px;">{{scope.row.ctime}}</span>
               </template>
             </el-table-column>
-            <el-table-column align="center" prop="date" label="操作" fixed="right" width="120px">
+            <el-table-column align="center" prop="date" label="操作" fixed="right" width="160px">
               <template slot-scope="scope">
-                <el-button @click="showCurRecImg(scope.row)" size="mini" type="text">查看</el-button>
-                <el-button @click="showCurRecKhImg(scope.row)" size="mini" type="text">考号</el-button>
-                <el-button @click="delStudents(scope.row.id,scope.$index)" size="mini" type="text">删除</el-button>
+                <!--<el-button v-if="scope.row.mark_status!=0" @click="showCurRecImg(scope.row)" size="mini" type="text">查看
+                </el-button>
+                <el-button v-if="scope.row.mark_status!=0" @click="showCurRecKhImg(scope.row)" size="mini" type="text">
+                  考号</el-button>-->
+                <el-button @click="delStudents(scope.row.student_id,scope.$index,'delRec')" size="mini" type="text">删除识别结果
+                </el-button>
+                <el-button @click="delStudents(scope.row.student_id,scope.$index,'delStudent')" size="mini" type="text">删除学生
+                </el-button>
               </template>
             </el-table-column>
           </el-table>
           <Page ref="pageButton" :current="recPage" :page_size="recPageSize" :total="recTotal"
             @pageChange="goRecPage" />
         </el-col>
-        <el-col :span="8">
-          <div style="height:85vh;overflow-y:scroll;position: relative;">
-            <el-button style="position:absolute;top:0px;left:100px;" size="small" type="warning" icon="el-icon-printer">
-              试卷扫描</el-button>
-            <span style="position:absolute;top:0px;right:40px;color:green;">成功上传:{{fileList.length}}</span>
-            <el-upload class="upload-demo" action="http://test.scxjc.club/api/admin/papers/uploadpaper"
-              :on-success="handleUploadSuccess" :file-list="fileList" list-type="picture" :data="{taskid:taskid}"
-              multiple>
-              <el-button size="small" type="primary">点击上传</el-button>
-              <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
-            </el-upload>
-            <img v-if="fileList.length<1" src="../../assets/scanner.png" alt=""
-              style="position:absolute;left: 50%;transform: translate(-50%,120px)">
-          </div>
-        </el-col>
       </el-row>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="closeUploadDialog">关 闭</el-button>
       </div>
+      <!-- 试卷上传 -->
+      <el-dialog title="试卷预览" :visible.sync="imgListVisible" width="750px" @close="closeTaskImgDialog" append-to-body>
+        <div style="text-align:right;">
+          <font>成功上传:{{taskImgTotal}}</font>&nbsp;&nbsp;&nbsp;&nbsp;
+          <el-button v-loading="loading" type="primary" size="mini" @click="startRecPaper">开始识别</el-button>
+        </div>
+        <div style="width:156px;display: inline-block;margin:10px;border:1px solid #ccc;"
+          v-for="(item,index) in fileList">
+          <el-image width="100px" alt="" :src="item.url" :preview-src-list="[item.url]"></el-image>
+        </div>
+        <Page ref="pageImgButton" :current="imgForm.page" :page_size="imgForm.page_size" :total="taskImgTotal" @pageChange="goTaskImg" />
+      </el-dialog>
     </el-dialog>
     <!-- 重新识别 -->
     <el-dialog title="重新识别" :visible.sync="remarkDialogVisible" width="60%" @close="closeRemarkDialog">
@@ -238,67 +246,106 @@
         <el-button type="primary" @click="doReTryMark">确 定</el-button>
       </div>
     </el-dialog>
+    <!--阅卷设置-->
+    <MarkTaskSetDialog :remarkSetVisible="remarkSetVisible" :paperId="curPaperId" :taskId="curTaskId" @close="closeMarkTaskSet" />
   </section>
 </template>
 <script>
   import Page from "../../components/Page";
+  import MarkTaskSetDialog from "./components/MarkTaskSetDialog";
+  import Cropper from 'cropperjs'
   export default {
     components: {
       Page,
+      MarkTaskSetDialog
     },
     data() {
       return {
         loading: false,
         queryParams: {
           page: 1,
-		  page_size:20
+          page_size: 20
         },
         form: {
-          khVoiceNum:5,
-          khFillRate:3.0,
-          tmVoiceNum:3,
-          tmFillRate:1.8
+          khVoiceNum: 5,
+          khFillRate: 3.0,
+          tmVoiceNum: 3,
+          tmFillRate: 1.8,
+          class_list: ["高三一班", "高三二班"],
+          checkList: []
+        },
+        imgForm:{
+          page:1,
+          page_size:20
         },
         form1: {},
         form2: {},
         list: [{}, {}],
         total: 0,
+        imgTotal:0,
         title: "新增用户",
         open: false,
         doctorList: [],
         rules: {},
         uploadDialogVisible: false,
-        remarkDialogVisible:false,
+        remarkDialogVisible: false,
         fileList: [],
         papersList: [],
         taskid: null,
         timer: null,
+        timer2: null,
         studentsList: [],
         showAnsVisible: false,
         curStudentRecImg: "",
         activeName: "1",
         curTaskId: null,
+        curPaperId:null,
         recPage: 1,
         recPageSize: 20,
         recTotal: 0,
         recParams: {},
         recSucTotal: 0,
-        recErrTotal: 0,
+        recKhErrTotal: 0,
+        recObjErrTotal: 0,
+        recWaitingErrTotal:0,
         queryName: "",
         queryMarkStatus: null,
-        selectException:[]
+        selectException: [],
+        checkClassList: [],
+        schoolList: [],
+        gradeList: [],
+        classList: [],
+        imgListVisible: false,
+        taskImgTotal: 0,
+        remarkSetVisible: false,
+        activeSetName: "first",
+        addQueForm:{},
+        objectiveQueList:[],
+        subjectiveQueList:[],
+        subjectiveMarkTeacherList:[],
+        checkList:[],
+        srcImgWidth:null,
+        srcImgHeight:null,
+        canvasImgScale:1,
+        ctx:null,
+        curStudentNo:null
       };
     },
     methods: {
-		jump(url,id) {
-				  id==2?localStorage.setItem("sonNav",2):'';
-				  if (url) {
-				    this.$router.push(url);
-				  }
-		},
+      jump(url, id) {
+        id == 2 ? localStorage.setItem("sonNav", 2) : '';
+        if (url) {
+          this.$router.push(url);
+        }
+      },
       submitUpload() {
         this.$refs.upload.submit();
       },
+      edit(row){
+        this.open = true;
+        this.form = row;
+        this.classList = row.class_id.split(",");
+      },
       del(id) {
         this.$confirm("确认删除?", "提示", {
           type: "warning",
@@ -324,6 +371,21 @@
         this.queryParams.page = this.$refs.pageButton.page;
         this.getData();
       },
+      goTaskImg(page){
+        if (page) {
+          this.imgForm.page_size = size;
+        }
+        this.imgForm.page = this.$refs.pageImgButton.page;
+        let that = this;
+        that.$api.getTaskImgList({
+            task_id: that.curTaskId,
+            page:that.imgForm.page,
+            page_size:that.imgForm.page_size
+          }).then(res => {
+            that.fileList = res.data.data.list
+            that.taskImgTotal = res.data.data.total;
+          })
+      },
       goRecPage(size) {
         if (size) {
           this.recPageSize = size;
@@ -342,17 +404,49 @@
       },
       getData() {
         this.loading = true;
+        // 试卷列表
         this.$api
           .getPapersSearch({})
           .then((res) => {
             this.papersList = res.data.data;
             this.loading = false
           });
+        // 阅卷任务列表
         this.$api.getMarkTaskList(this.queryParams).then(res => {
           this.total = res.data.data.total;
           this.list = res.data.data.list;
         })
       },
+      getSchoolList() {
+        let params = {
+          school_id: this.form.school_id,
+          grade_name: this.form.grade_name,
+          page: 1,
+          page_size: 1000
+        }
+        // 学校列表
+        this.$api.schoolList(params).then(res => {
+          this.schoolList = res.data.data.list;
+        })
+      },
+      getGradeList() {
+        // 年级列表
+        this.$api.gradeList({}).then(res => {
+          this.gradeList = res.data.data;
+        })
+      },
+      getClassList() {
+        let params = {
+          school_id: this.form.school_id,
+          grade_name: this.form.grade_name,
+          page: 1,
+          page_size: 1000
+        }
+        // 班级列表
+        this.$api.classList(params).then(res => {
+          this.classList = res.data.data.list;
+        })
+      },
       handleAdd() {
         this.open = true;
         this.title = "新增医生";
@@ -362,6 +456,11 @@
       submitForm() {
         this.$refs["form"].validate((valid) => {
           if (valid) {
+            this.form.class_id = this.checkClassList.join();
+            let selSchool = this.schoolList.filter(item => item.school_id == this.form.school_id);
+            this.form.school_name = selSchool[0].name;
+            let selClass = this.classList.filter(item => this.checkClassList.indexOf(item.class_id) != -1);
+            this.form.class_name = selClass.map(item => item.name).join();
             if (this.form.id != null) {
               this.$api.editMarkTask(this.form).then((res) => {
                 if (res.data.code == 0) {
@@ -417,6 +516,9 @@
         this.openUploadPaper(this.curTaskId);
       },
       openUploadPaper(id) {
+        const routeData = this.$router.resolve({path:"/task/uploadPaper",query:{id:id}});
+        window.open(routeData.href, '_blank');
+        return 
         this.curTaskId = id
         this.uploadDialogVisible = true
         this.taskid = id
@@ -444,7 +546,9 @@
           })
           this.recTotal = res.data.data.total;
           this.recSucTotal = res.data.data.suc_total;
-          this.recErrTotal = res.data.data.err_total;
+          this.recKhErrTotal = res.data.data.kh_err_total;
+          this.recObjErrTotal = res.data.data.obj_err_cnt;
+          this.recWaitingErrTotal = res.data.data.waiting_cnt;
           this.loading = false;
         })
         window.clearInterval(this.timer);
@@ -463,7 +567,9 @@
             })
             that.recTotal = res.data.data.total;
             that.recSucTotal = res.data.data.suc_total;
-            that.recErrTotal = res.data.data.err_total;
+            that.recKhErrTotal = res.data.data.kh_err_total;
+            that.recObjErrTotal = res.data.data.obj_err_cnt;
+            that.recWaitingErrTotal = res.data.data.waiting_cnt;
           })
         }, 4000)
       },
@@ -472,12 +578,33 @@
         this.fileList = [];
         window.clearInterval(this.timer);
       },
-      closeRemarkDialog(){
+      closeRemarkDialog() {
         this.remarkDialogVisible = false;
+        this.fileList = []
+      },
+      closeTaskImgDialog() {
+        this.imgListVisible = false;
+        window.clearInterval(this.timer2);
       },
       handlePreview(file) {
         console.log(file);
       },
+      handleChange(file, fileList) {},
+      openTaskImgList() {
+        let that = this;
+        this.imgListVisible = true
+        window.clearInterval(this.timer2);
+        this.timer2 = setInterval(function () {
+          that.$api.getTaskImgList({
+            task_id: that.curTaskId,
+            page:that.imgForm.page,
+            page_size:that.imgForm.page_size
+          }).then(res => {
+            that.fileList = res.data.data.list
+            that.taskImgTotal = res.data.data.total;
+          })
+        }, 2000)
+      },
       handleUploadSuccess(res, file, fileList) {
         if (!res.code) {
           if (fileList.every(item => item.status == "success")) {
@@ -490,9 +617,10 @@
           }
         }
       },
-      delStudents(id, index) {
+      delStudents(id, index,action) {
         this.$api.delMarkTaskStudents({
-          id: id
+          id: id,
+          action:action
         }).then(res => {
           this.msgSuccess("删除成功!");
           this.studentsList.splice(index, 1)
@@ -501,9 +629,63 @@
       handleRemove(e) {
         console.log(e)
       },
+      drawRect(x, y, lineW, lineY) {
+          //   开始绘制;
+          this.ctx.beginPath();
+          //   //设置线条颜色,必须放在绘制之前
+          this.ctx.strokeStyle = "red";
+          //   console.log("44444444");
+          //   // 线宽设置,必须放在绘制之前
+          this.ctx.lineWidth = 1;
+          //   console.log("5555555555");
+          // strokeRect参数:(左上角x坐标,y:左上角y坐标,绘画矩形的宽度,绘画矩形的高度)
+          this.ctx.strokeRect(x, y, lineW, lineY);
+          //   console.log("66666666666666");
+      },
       showStudentImgs(row) {
-        this.curStudentRecImg = row.imgs;
+        this.curStudentRecImg = JSON.parse(row.imgs)[0];
         this.showAnsVisible = true;
+        this.curStudentNo = row.student_no;
+        this.form.student_no = this.curStudentNo;
+        let that = this;
+
+        this.$nextTick(function () {
+            let objective_result = row.objective_result;
+              that.canvas = document.getElementById("myCanvas");
+              that.ctx = that.canvas.getContext("2d");
+
+              let image = new Image();
+              image.src = that.curStudentRecImg;
+
+              image.onload = function(){
+                that.srcImgWidth = image.width;
+                that.srcImgHeight = image.height;
+                that.canvasImgScale = 1000/image.width;
+                that.ctx.drawImage(image, 0, 0, that.srcImgWidth, that.srcImgHeight, 0, 0, that.srcImgWidth*that.canvasImgScale, that
+                      .srcImgHeight*that.canvasImgScale)
+
+                objective_result.forEach(item=>{
+                  item.forEach(iitem=>{
+                    that.drawRect(iitem.absX*that.canvasImgScale,iitem.absY*that.canvasImgScale,iitem.w*that.canvasImgScale,iitem.h*that.canvasImgScale);
+                    that.ctx.font = '12px Arial';
+                    that.ctx.fillStyle = 'red';
+                    that.ctx.fillText(iitem.ans, iitem.absX*that.canvasImgScale,iitem.absY*that.canvasImgScale);
+                  })
+                })
+                
+              }
+
+        })
+
+      },
+      saveModifyStudentNo(){
+        let params = {
+          student_no:this.curStudentNo,
+          task_id:this.curTaskId
+        }
+        this.$api.saveModifyStudentNo(params).then(res=>{
+          console.log(res,1111111111111)
+        })
       },
       showCurRecImg(row) {
         this.curStudentRecImg = row.ans_imgs.replace(".png", "_draw_ans.png");
@@ -556,61 +738,87 @@
       },
       handleSelectionChange(val) {
         this.selectException = [];
-        if(val.length > 0){
-          val.forEach(item=>{
-            let task_img = item.task_id+";;"+item.imgs+";;"+item.id;
+        if (val.length > 0) {
+          val.forEach(item => {
+            let task_img = item.task_id + ";;" + item.imgs + ";;" + item.id;
             this.selectException.push(task_img);
           })
           window.clearInterval(this.timer);
         }
       },
-      reTryMark(){
-        if(this.selectException.length < 1){
+      reTryMark() {
+        if (this.selectException.length < 1) {
           this.msgError("请选择需要重新识别的答卷!");
-        }else{
+        } else {
           this.remarkDialogVisible = true;
         }
       },
-      doReTryMark(){
+      doReTryMark() {
         let urls = []
-        this.selectException.forEach(item=>{
+        this.selectException.forEach(item => {
           item = item + ";;" + String(this.form.khVoiceNum) + ";;" + String(this.form.khFillRate);
           item = item + ";;" + String(this.form.tmVoiceNum) + ";;" + String(this.form.tmFillRate);
           urls.push(item);
         })
         let that = this;
-        this.$api.reTryMarkPaper({urls:urls}).then(res=>{
+        this.$api.reTryMarkPaper({
+          urls: urls
+        }).then(res => {
           this.remarkDialogVisible = false;
           this.getData();
           window.clearInterval(this.timer);
           this.timer = setInterval(function () {
-          that.$api.getMarkTaskStudents(that.recParams).then(res => {
-            that.studentsList = res.data.data.list;
-            that.studentsList.forEach(item => {
-              let mark_status = item.mark_status;
-              if (mark_status != 1) {
-                item.mark_status_name = that.$const.recErrorList.filter((ritem) => {
-                  return ritem.value == mark_status;
-                })[0].label
-              } else {
-                item.mark_status_name = "正常"
-              }
+            that.$api.getMarkTaskStudents(that.recParams).then(res => {
+              that.studentsList = res.data.data.list;
+              that.studentsList.forEach(item => {
+                let mark_status = item.mark_status;
+                if (mark_status != 1) {
+                  item.mark_status_name = that.$const.recErrorList.filter((ritem) => {
+                    return ritem.value == mark_status;
+                  })[0].label
+                } else {
+                  item.mark_status_name = "正常"
+                }
+              })
+              that.recTotal = res.data.data.total;
+              that.recSucTotal = res.data.data.suc_total;
+              that.recKhErrTotal = res.data.data.kh_err_total;
+              that.recObjErrTotal = res.data.data.obj_err_cnt;
+              that.recWaitingErrTotal = res.data.data.waiting_cnt;
             })
-            that.recTotal = res.data.data.total;
-            that.recSucTotal = res.data.data.suc_total;
-            that.recErrTotal = res.data.data.err_total;
-          })
-        }, 4000)
+          }, 4000)
         })
+      },
+      startRecPaper() {
+        this.loading = true
+        this.$api.startRecPaper({
+          task_id: this.curTaskId
+        }).then(res => {
+          this.loading = false
+        })
+      },
+      remarkSet(row) {
+        this.remarkSetVisible = true
+        this.curTaskId = row.task_id;
+        this.curPaperId = row.paper_id;
+      },
+      closeMarkTaskSet(){
+        this.remarkSetVisible = false
       }
     },
     created() {
       this.getData();
-
+      this.getSchoolList();
+      this.getGradeList();
+      this.getClassList();
     },
   };
 </script>
 <style lang="scss">
+  .el-upload-list {
+    display: none !important;
+  }
+
   .el-upload-list--picture .el-upload-list__item {
     width: 150px;
     float: left;
@@ -628,17 +836,21 @@
   .el-upload-list--picture .el-upload-list__item-thumbnail {
     width: 125px;
   }
+
   .prosss_box .el-progress.el-progress--line {
     width: 88px;
     margin: auto 5px auto 0;
   }
+
   .prosss_box .el-progress-bar {
     padding-right: 0;
   }
+
   .prosss_box .el-progress__text {
     display: none;
   }
-  .prosss_box{
-  	display:flex;
+
+  .prosss_box {
+    display: flex;
   }
 </style>

+ 379 - 0
src/views/tasks/components/MarkTaskSetDialog.vue

@@ -0,0 +1,379 @@
+<template>
+    <div>
+    <!-- 阅卷设置 -->
+    <el-dialog title="阅卷设置" :visible.sync="remarkSetVisibleTmp" width="80%" @close="closeRemarkDialog">
+      <el-tabs v-model="activeSetName" @tab-click="handleClick">
+        <el-tab-pane label="客观题设置" name="1">
+            <el-form :inline="true" v-model="addQueForm">
+                <el-form-item label="题号">
+                  <el-input size="mini" v-model="addQueForm.fQno"></el-input>
+                </el-form-item>
+                <el-form-item label="至">
+                  <el-input size="mini" v-model="addQueForm.tQno"></el-input>
+                </el-form-item>
+                <el-form-item label="分数">
+                  <el-input size="mini" v-model="addQueForm.score"></el-input>
+                </el-form-item>
+                <el-form-item>
+                  <el-button size="mini" type="warning" @click="addQues">设置</el-button>
+                </el-form-item>
+                <el-form-item>
+                  <el-button size="mini" type="primary" @click="saveObjectiveQue">保存</el-button>
+                </el-form-item>
+              </el-form>
+              <el-table :data="objectiveQueList">
+                  <el-table-column label="序号" prop="qno" width="60px">
+                    <template slot-scope="scope">
+                      {{scope.$index+1}}
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="题号" prop="qno" width="60px"></el-table-column>
+                  <el-table-column label="点选答案" prop="score" width="360px">
+                    <template slot-scope="scope">
+                      <el-tag v-for="item in ansOptionList" :key="item.label" type="success"
+                        :effect="scope.row.stdAns.indexOf(item.value)==-1?'plain':'dark'" @click="setStdAns(scope.row,item)"
+                        size="small">
+                        {{ item.label }}
+                      </el-tag>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="输入答案" prop="score">
+                    <template slot-scope="scope">
+                      <el-input v-model="scope.row.stdAns" size="mini" />
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="满分" prop="qtype">
+                    <template slot-scope="scope">
+                      <el-input type="number" v-model="scope.row.score" size="mini" />
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="部分分" prop="partScore">
+                    <template slot-scope="scope">
+                      <el-input type="number" v-model="scope.row.partScore" size="mini" />
+                    </template>
+                  </el-table-column>
+              </el-table>
+        </el-tab-pane>
+        <el-tab-pane label="主观题设置" name="2">
+          <el-form :inline="true" v-model="addQueForm">
+            <el-form-item label="题号">
+              <el-input size="mini" v-model="addQueForm.fQno"></el-input>
+            </el-form-item>
+            <el-form-item label="至">
+              <el-input size="mini" v-model="addQueForm.tQno"></el-input>
+            </el-form-item>
+            <el-form-item label="分数">
+              <el-input size="mini" v-model="addQueForm.score"></el-input>
+            </el-form-item>
+            <el-form-item>
+              <el-button size="mini" type="warning" @click="addQues">设置</el-button>
+            </el-form-item>
+            <el-form-item>
+              <el-button size="mini" type="primary" @click="saveSubjectiveQue">保存</el-button>
+            </el-form-item>
+          </el-form>
+          <el-table :data="subjectiveQueList">
+              <el-table-column label="序号" prop="qno" width="60px">
+                <template slot-scope="scope">
+                  {{scope.$index+1}}
+                </template>
+              </el-table-column>
+              <el-table-column label="题号" prop="qno"></el-table-column>
+              <el-table-column label="分数" prop="std_score">
+                  <template slot-scope="scope">
+                    <el-input size="mini" v-model="scope.row.std_score" />
+                  </template>
+              </el-table-column>
+              <el-table-column label="查看切图" prop="qtype">
+                <template slot-scope="scope">
+                  <el-button type="text">查看</el-button>
+                </template>
+              </el-table-column>
+              <el-table-column label="单双评" prop="mark_mode">
+                <template slot-scope="scope">
+                    <el-select v-model="scope.row.mark_mode" size="mini">
+                      <el-option label="单评" value="单评">单评</el-option>
+                      <el-option label="双评" value="双评">双评</el-option>
+                      <el-option label="多评" value="多评">多评</el-option>
+                    </el-select>
+                </template>
+              </el-table-column>
+              <el-table-column label="双评阈值" prop="mark_diffmax">
+                <template slot-scope="scope">
+                  <el-input v-model="scope.row.mark_diffmax" type="text" size="mini"></el-input>
+                </template>
+              </el-table-column>
+              <el-table-column label="小题设置" prop="score">
+                <template slot-scope="scope">
+                  <span style="color:#67c23a;" v-if="scope.row.sub_que_list.length>1">已设置</span>
+                  <span v-else>未设置</span>  
+                  <i class="el-icon-setting" @click="setSubQue(scope.row,scope.$index)"></i>
+                </template>
+              </el-table-column>
+              <el-table-column label="给分点" prop="score">
+                <template slot-scope="scope">
+                  <span style="color:#67c23a;" v-if="scope.row.mark_points.mark_points">已设置</span>
+                  <span v-else>未设置</span>  
+                  <i class="el-icon-setting" @click="setMarkPoints(scope.row,scope.$index)"></i>
+                </template>
+              </el-table-column>
+          </el-table>
+        </el-tab-pane>
+        <el-tab-pane label="分配阅卷员" name="3">
+            <el-form :inline="true" v-model="addQueForm">
+              <el-form-item>
+                <el-button size="mini" type="primary" @click="saveSubjectiveQue">全选</el-button>
+              </el-form-item>
+              <el-form-item>
+                <el-button size="mini" @click="saveSubjectiveQue">全不选</el-button>
+              </el-form-item>
+              <el-form-item>
+                <el-button size="mini" type="primary" @click="saveSubjectiveQue">保存设置</el-button>
+              </el-form-item>
+            </el-form>
+            <el-table :data="subjectiveMarkTeacherList">
+                <el-table-column label="教工号" prop="phone" width="80px"></el-table-column>
+                <el-table-column label="姓名" prop="realname" width="80px"></el-table-column>
+                <el-table-column label="阅卷权限" prop="role_name" width="300px">
+                    <el-checkbox-group v-model="checkList">
+                      <el-checkbox label="科目组长"></el-checkbox>
+                      <el-checkbox label="评卷仲裁"></el-checkbox>
+                      <el-checkbox label="评卷教师"></el-checkbox>
+                    </el-checkbox-group>
+                </el-table-column>
+                <el-table-column label="试题分配" prop="qtype">
+                    <el-checkbox-group v-model="checkList">
+                      <el-checkbox v-for="(item,index) in subjectiveQueList" :label="item.qno"></el-checkbox>
+                    </el-checkbox-group>
+                </el-table-column>
+            </el-table>
+        </el-tab-pane>
+      </el-tabs>
+      <!--小题设置-->
+      <el-dialog title="小题设置" :visible.sync="subQueSetVisible" width="50%" @close="closeSubQueDialog" append-to-body>
+          <el-table :data="curSubQueList">
+              <el-table-column label="序号" prop="qno" width="60px">
+                <template slot-scope="scope">
+                  {{scope.$index+1}}
+                </template>
+              </el-table-column>
+              <el-table-column label="题号" prop="qno">
+                  <template slot-scope="scope">
+                    <el-input size="mini" v-model="scope.row.qno" />
+                  </template>
+              </el-table-column>
+              <el-table-column label="分数" prop="std_score">
+                  <template slot-scope="scope">
+                    <el-input size="mini" v-model="scope.row.std_score" />
+                  </template>
+              </el-table-column>
+              <el-table-column label="阈值" prop="mark_diffmax">
+                  <template slot-scope="scope">
+                    <el-input size="mini" v-model="scope.row.mark_diffmax" />
+                  </template>
+              </el-table-column>
+          </el-table>
+          <div slot="footer" class="dialog-footer">
+            <el-button type="primary" @click="saveSubQue" size="mini">确定</el-button>
+            <el-button type="" @click="closeSubQueDialog" size="mini">取消</el-button>
+          </div>
+      </el-dialog>
+      <!--给分点设置-->
+      <el-dialog title="给分点设置" :visible.sync="markPointsSetVisible" width="50%" @close="closeSubQueDialog" append-to-body>
+          <el-row :gutter="20">
+            <el-col :span="6">
+              <el-select v-model="curMarkPoints.mark_type">
+                <el-option label="步长值" value="step"></el-option>
+                <el-option label="给分点" value="points"></el-option>
+              </el-select>
+            </el-col>
+            <el-col :span="18">
+              <el-input v-model="curMarkPoints.mark_points" />
+            </el-col>
+          </el-row>
+          <div slot="footer" class="dialog-footer">
+            <el-button type="primary" @click="saveMarkPoints" size="mini">确定</el-button>
+            <el-button type="" @click="closeMarkPointsDialog" size="mini">取消</el-button>
+          </div>
+      </el-dialog>
+    </el-dialog>
+    </div>
+</template>
+
+<script>
+export default {
+    compnets:{},
+    props:["remarkSetVisible","taskId","paperId"],
+    data(){
+        return {
+            activeSetName: "1",
+            addQueForm:{},
+            objectiveQueList:[],
+            subjectiveQueList:[],
+            subjectiveMarkTeacherList:[],
+            checkList:[],
+            remarkSetVisibleTmp:this.remarkSetVisible,
+            curTaskId:this.taskId,
+            curPaperId:this.paperId,
+            ansOptionList: [{
+              label: "A",
+              value: "A",
+              flag: 0
+            },
+            {
+              label: "B",
+              value: "B",
+              flag: 0
+            },
+            {
+              label: "C",
+              value: "C",
+              flag: 0
+            },
+            {
+              label: "D",
+              value: "D",
+              flag: 0
+            },
+            {
+              label: "E",
+              value: "E",
+              flag: 0
+            },
+            {
+              label: "F",
+              value: "F",
+              flag: 0
+            },
+            {
+              label: "G",
+              value: "G",
+              flag: 0
+            }
+          ],
+          subQueSetVisible:false,
+          curSubQueList:[],
+          curRowIndex:0,
+          curMarkPoints:{mark_type:"step"},
+          markPointsSetVisible:false,
+        }
+    },
+    watch:{
+        remarkSetVisible(){
+            this.remarkSetVisibleTmp = this.remarkSetVisible
+            this.curTaskId = this.taskId
+            this.curPaperId = this.paperId
+            this.getPaperPieces(this.activeSetName,this.curPaperId,this.curTaskId)
+        },
+    },
+    methods:{
+        closeRemarkDialog() {
+            this.remarkSetVisibleTmp = false;
+            this.$emit("close")
+            this.fileList = []
+        },
+        closeSubQueDialog(){
+            this.subQueSetVisible = false;
+        },
+        closeMarkPointsDialog(){
+            this.markPointsSetVisible = false;
+        },
+        handleClick(){
+          this.getPaperPieces(this.activeSetName,this.curPaperId,this.curTaskId);
+          this.getMarkPaperTeachers();
+        },
+        addQues(){
+
+        },
+        getPaperPieces(quetype,paper_id,task_id){
+          this.$api.getStdQueList({"quetype":quetype,"paper_id":paper_id,"task_id":task_id}).then(res=>{
+            if(quetype==1){
+              // this.objectiveQueList = [];
+              // res.data.data.forEach((item,index)=>{
+              //   item.forEach((iitem,iindex)=>{
+              //     this.objectiveQueList.push(iitem)
+              //   })
+              // })
+              this.objectiveQueList = res.data.data;
+            }else{
+              this.subjectiveQueList = res.data.data;
+            }
+          })
+        },
+        // 获取阅卷老师列表
+        getMarkPaperTeachers(){
+          this.$api.getSchoolUser().then(res=>{
+            this.subjectiveMarkTeacherList = res.data.data;
+          })
+        },
+        setStdAns(row, item) {
+          let orgAns = row.stdAns.split(",")
+          orgAns = orgAns.filter((item) => {
+            return item.length > 0
+          })
+          if (orgAns.indexOf(item.value) == -1) {
+            orgAns.push(item.value)
+          } else {
+            orgAns.splice(orgAns.indexOf(item.value), 1)
+          }
+          row.stdAns = orgAns.join(",")
+        },
+        setSubQue(row,index){
+          this.subQueSetVisible = true;
+          if(row.sub_que_list && row.sub_que_list.length>0){
+            this.curSubQueList = row.sub_que_list;
+          }else{
+            let subQueList = []
+            row.qno.split("-").forEach((item,index)=>{
+              subQueList.push({
+                qno:item,
+                std_score:0,
+                mark_diffmax:0
+              })
+            })
+            this.curSubQueList = subQueList;
+          }
+          this.curRowIndex = index
+        },
+        setMarkPoints(row,index){
+          this.markPointsSetVisible = true;
+          if(row.mark_points.mark_points){
+            this.curMarkPoints = row.mark_points;
+          }else{
+            this.curMarkPoints = {"mark_type":"step"}
+          }
+        },
+        saveSubQue(){
+          this.subjectiveQueList[this.curRowIndex].sub_que_list = this.curSubQueList;
+          this.subQueSetVisible = false
+        },
+        saveMarkPoints(){
+          this.subjectiveQueList[this.curRowIndex].mark_points = this.curMarkPoints;
+          this.markPointsSetVisible = false
+        },
+        saveObjectiveQue(){
+          this.$api.saveTaskObjectiveQue({task_id:this.curTaskId,paper_id:this.curPaperId,objectiveQueList:this.objectiveQueList}).then(res=>{
+              if(!res.data.code){
+                this.msgSuccess("成功!");
+                this.getPaperPieces(this.activeSetName,this.curPaperId,this.curTaskId)
+              }
+          })
+        },
+        saveSubjectiveQue(){
+          this.$api.saveSubjectiveQue({paper_id:this.curPaperId,subjectiveQueList:this.subjectiveQueList}).then(res=>{
+              if(!res.data.code){
+                this.msgSuccess("成功!");
+                this.getPaperPieces(this.activeSetName,this.curPaperId,this.curTaskId)
+              }
+          })
+        },
+    },
+    created(){
+      console.log(this.curTaskId,333333333333)
+
+    }
+}
+</script>
+<style lang="scss">
+    
+</style>

+ 80 - 32
src/views/tasks/markPaper.vue

@@ -16,16 +16,18 @@
 	  	</el-tabs>
 	  </div>
 	  <div class="yj_area">
-	  	<div class="left" v-if="list1.length>0">
-			<template v-if='tab_index == "1"'>
-				<p>第 <b>{{list1[qno_index].qno}}</b> 题   <span><b>{{stu_index+1}}</b>/{{list1[qno_index].total}}人</span></p>
-				<ul>
-					<li v-for="(item,index) in list2" :key='index' :class="stu_index==index?'act':''" @click="changeStu(index)">
-						<p>{{index+1}}.{{item.student_name}}   <span>{{item.mark_score}}分</span></p>
-						<img :src="item.imgs" alt="">
-					</li>
-				</ul>
-			</template>
+	  	<div :class="tab_index=='1'?'progress':'left'" v-if="list1.length>0">
+			
+			<template  v-if='tab_index == 1'>
+					<p>批阅进度</p>
+					<ul>
+						<li v-for="(item,index) in list1" :key='index' :class="qno_index==index?'act':''" @click="changeQno(index)">
+							<span>第{{item.qno}}题</span>
+							<el-progress :show-text='false' :percentage="item.mark_num/item.total*100"></el-progress>
+							<span>{{item.mark_num}}/{{item.total}}人</span>
+						</li>
+					</ul>
+				</template>
 			<template v-else>
 				<ul>
 					<li v-for="(item,index) in list1" :key='index' :class="stu_index==index?'act':''" @click="changeStu(index)">
@@ -69,7 +71,7 @@
 			</div>
 		</div>
 		<!-- 进度 -->
-		<div class="progress">
+		<div :class="tab_index=='1'?'left':'progress'">
 				   <div class="mark_df" v-if='0'>
 								  <div class="df_title">
 									   <b>智能阅卷打分板</b><br>
@@ -90,21 +92,20 @@
 									</div>
 								  </div>
 				  </div>
-				  <template  v-if='tab_index == 1'>
-					  <p>批阅进度</p>
-					  <ul>
-						  <li v-for="(item,index) in list1" :key='index' :class="qno_index==index?'act':''" @click="changeQno(index)">
-							  <span>第{{item.qno}}题</span>
-							  <el-progress :show-text='false' :percentage="item.mark_num/item.total*100"></el-progress>
-							  <span>{{item.mark_num}}/{{item.total}}人</span>
-						  </li>
-					  </ul>
-				  </template>
+				  <template v-if='tab_index == "1"'>
+							<p>第 <b>{{list1[qno_index].qno}}</b> 题   <span><b>{{stu_index+1}}</b>/{{list1[qno_index].total}}人</span></p>
+							<ul>
+								<li v-for="(item,index) in list2" :key='index' :class="stu_index==index?'act':''" @click="changeStu(index)">
+									<p>{{index+1}}.{{item.student_name}}   <span>{{item.mark_score}}分</span></p>
+									<!-- <img :src="item.imgs" alt=""> -->
+								</li>
+							</ul>
+						</template>
 				   <template  v-else>
 					  <p>试题</p>
 					  <ul class="papers">
 						  <li  v-for="(item,index) in list2" :key='index' :class="qno_index==index?'act':''" @click="changeQno(index)">
-							  <img width="100%"    :src="item.imgs" alt=""><br>
+							  <!-- <img width="100%"    :src="item.imgs" alt=""><br> -->
 							  <span style="margin: 10px auto;">第{{item.qno}}题({{item.mark_score}}分)</span>
 						  </li>
 					  </ul>
@@ -339,13 +340,16 @@
 						
 						setTimeout(()=>{
 							// init(res.data.data[0].imgs)
-							this.init(res.data.data[0].imgs)
+							// this.init(res.data.data[0].imgs)
+							console.log(res.data.data[0].imgs,333333333333333)
+							this.initFabric(res.data.data[0].imgs)
 						},100)
 					}
 				})
 			},
 			//切换题目
 			changeQno(index){
+				console.log(111111111111111)
 				this.qno_index=index
 				this.first=1
 				this.add_score_step=0
@@ -354,11 +358,11 @@
 					this.stu_index=0
 					this.getDataDetail()
 				}else{
-					
-					this.init(this.list2[index].imgs)
+					// this.init(this.list2[index].imgs)
+					console.log(this.list2[index].imgs,2222222222222222)
+					this.initFabric(this.list2[index].imgs)
 					this.score=this.list2[index].mark_score?this.list2[index].mark_score:''
 				}
-				
 			},
 			//切换学生
 			changeStu(index){
@@ -367,7 +371,8 @@
 				this.add_score_step=0
 				if(this.tab_index == 1){
 					this.score=this.list2[index].mark_score?this.list2[index].mark_score:''
-					this.init(this.list2[index].imgs)
+					// this.init(this.list2[index].imgs)
+					this.initFabric(this.list2[index].imgs)
 				}else{
 					this.list2=[]
 					this.qno_index=0
@@ -647,6 +652,47 @@
 				}
 				this.fabricObjAddEvent()
 			},
+			initFabric(urls){
+				var width=document.querySelector('.mark_area').clientWidth
+				this.fabricObj = new fabric.Canvas("canvas", {
+				  isDrawingMode: true,
+				  selectable: false,
+				  selection: false,
+				  devicePixelRatio: true, //Retina 高清屏 屏幕支持
+				});
+				this.fabricObj.freeDrawingBrush.color = "#E34F51";
+				this.fabricObj.freeDrawingBrush.width = 2;
+				this.fabricObj.setWidth(width-10);
+				let totalHeight = 0;
+				urls.forEach((url,index)=>{
+					var imgElement = new Image();
+					imgElement.src = url;
+					totalHeight += imgElement.height;
+				})
+				
+				this.fabricObj.setHeight(totalHeight);
+				urls.forEach((url,index)=>{
+					var imgElement = new Image();
+					imgElement.src = url;
+					var that=this
+					let scaleX = width/imgElement.width
+					let scaleY = 200/imgElement.height
+
+					imgElement.onload=function(){
+						var legimg = new fabric.Image(imgElement,{  //设置图片位置和样子
+							left:10,
+							top:50 + index*imgElement.height,
+							height:imgElement.height,
+							scaleX:scaleX,
+							// scaleY:scaleY,
+							angle:0,//设置图形顺时针旋转角度
+						});
+						that.fabricObj.add(legimg);
+					}
+				})
+				
+				this.fabricObjAddEvent()
+			},
 			drawScore(text,x,y){
 				var text = new fabric.Textbox(text, {
 				  left: x||20,
@@ -1067,7 +1113,7 @@
 			}
 		}
 		.progress{
-			width: 300px;
+			width: 256px;
 			/* margin-top: 20px; */
 			background-color: #fff;
 			padding: 15px;
@@ -1096,7 +1142,7 @@
 					border-radius: 4px;
 				}
 				.el-progress{
-					width: 60% !important;
+					width: 80% !important;
 					top: 8px;
 				}
 			}
@@ -1171,9 +1217,11 @@
 				display: flex;
 				flex-wrap: wrap;
 				li{
-					width: 47%;
-					height: 110px;
-					margin-bottom: 10px;
+					width: 46%;
+					/* height: 110px; */
+					/* margin-bottom: 10px; */
+					margin:3px;
+					border:1px solid #ccc;
 				}
 			}
 		}

+ 839 - 0
src/views/tasks/uploadPaper.vue

@@ -0,0 +1,839 @@
+<template>
+  <section class="content">
+    <div class="breadcrumb">
+      <el-breadcrumb separator="/">
+        <el-breadcrumb-item><a href="/">阅卷管理</a></el-breadcrumb-item>
+        <el-breadcrumb-item>上传试卷</el-breadcrumb-item>
+      </el-breadcrumb>
+    </div>
+    <!-- 上传试卷 -->
+    <el-row :gutter="20">
+        <el-col :span="24">
+          <!-- <el-row>
+            <el-col :span="6">参考人数:{{studentsList.length}}</el-col>
+            <el-col :span="6">已上传:{{studentsList.length}}</el-col>
+            <el-col :span="6">识别异常:</el-col>
+          </el-row> -->
+          <el-form :inline="true">
+            <el-form-item label="姓名">
+              <el-input size="mini" placeholder="请输入姓名/考号" v-model="queryName" clearable></el-input>
+            </el-form-item>
+            <!--<el-form-item label="识别异常">
+              <el-select v-model="queryMarkStatus" size="mini" clearable>
+                <el-option v-for="item in $const.recErrorList" :label="item.label" :value="item.value"></el-option>
+
+              </el-select>
+            </el-form-item>-->
+            <el-form-item>
+              <el-button type="primary" size="mini" @click="searchMarkData">搜索</el-button>
+              <el-button size="mini" @click="reSetMarkData">重置</el-button>
+              <el-button @click="downloadObjectiveResult(curTaskId)" type="warning" size="mini" icon="el-icon-download">
+                导出</el-button>
+              <el-button @click="reTryMark" size="mini" type="success" icon="el-icon-printer">重新识别</el-button>
+            </el-form-item>
+            <el-form-item>
+              <el-button size="mini" type="warning" icon="el-icon-printer">
+                试卷扫描</el-button>
+
+            </el-form-item>
+            <el-form-item>
+              <el-upload class="upload-demo" action="http://test.scxjc.club/api/admin/papers/uploadpaper"
+                :on-success="handleUploadSuccess" :data="{taskid:taskid}" :on-change="handleChange" list-type="picture"
+                multiple>
+                <el-button size="mini" type="primary" @click="openTaskImgList">点击上传</el-button>
+              </el-upload>
+            </el-form-item>
+          </el-form>
+          <el-row>
+            <el-col :span="24">
+              <el-tabs v-model="activeName" @tab-click="handleTabClick">
+                <el-tab-pane :label="'正确('+recSucTotal+')'" name="1"></el-tab-pane>
+                <el-tab-pane :label="'定位异常('+recKhErrTotal+')'" name="-5"></el-tab-pane>
+                <el-tab-pane :label="'考号异常('+recKhErrTotal+')'" name="-1"></el-tab-pane>
+                <el-tab-pane :label="'考号重复('+recKhErrTotal+')'" name="-3"></el-tab-pane>
+                <el-tab-pane :label="'缺考异常('+recKhErrTotal+')'" name="-4"></el-tab-pane>
+                <el-tab-pane :label="'客观题异常('+recObjErrTotal+')'" name="-2"></el-tab-pane>
+                <el-tab-pane :label="'待上传('+recWaitingErrTotal+')'" name="0"></el-tab-pane>
+              </el-tabs>
+            </el-col>
+          </el-row>
+          <el-table v-loading="loading" :data="studentsList" style="width: 100%; margin-top: 10px"
+            @selection-change="handleSelectionChange" height="60vh">
+            <el-table-column type="selection" width="45" v-if="activeName==100"></el-table-column>
+            <el-table-column align="center" prop="student_name" label="姓名" width="80" />
+            <el-table-column align="center" prop="student_no" label="考号" width="150">
+              <template slot-scope="scope">
+                <el-button type="text" @click="showStudentImgs(scope.row)" size="mini">{{scope.row.student_no}}
+                </el-button>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" prop="objective_ans_str" label="客观题识别结果"/>
+            <el-table-column align="center" prop="objective_score" label="客观题得分" width="100" />
+            <el-table-column align="center" prop="mark_status_name" label="识别状态" width="80">
+              <template slot-scope="scope">
+                <span v-if="scope.row.mark_status<=0" style="color:#f78989;">{{scope.row.mark_status_name}}</span>
+                <span v-if="scope.row.mark_status==1" style="color:#85ce61;">正常</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" prop="ctime" label="时间" width="140px">
+              <template slot-scope="scope">
+                <span style="font-size:12px;">{{scope.row.ctime}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" prop="date" label="操作" fixed="right" width="160px">
+              <template slot-scope="scope">
+                <!--<el-button v-if="scope.row.mark_status!=0" @click="showCurRecImg(scope.row)" size="mini" type="text">查看
+                </el-button>
+                <el-button v-if="scope.row.mark_status!=0" @click="showCurRecKhImg(scope.row)" size="mini" type="text">
+                  考号</el-button>-->
+                <el-button @click="delStudents(scope.row.student_id,scope.$index,'delRec')" size="mini" type="text">删除识别结果
+                </el-button>
+                <el-button @click="delStudents(scope.row.student_id,scope.$index,'delStudent')" size="mini" type="text">删除学生
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <Page ref="pageButton" :current="recPage" :page_size="recPageSize" :total="recTotal"
+            @pageChange="goRecPage" />
+        </el-col>
+      </el-row>
+      <!-- 试卷上传预览 -->
+      <el-dialog title="试卷预览" :visible.sync="imgListVisible" width="750px" @close="closeTaskImgDialog" append-to-body>
+        <div style="text-align:right;">
+          <font>成功上传:{{taskImgTotal}}</font>&nbsp;&nbsp;&nbsp;&nbsp;
+          <el-button v-loading="loading" type="primary" size="mini" @click="startRecPaper">开始识别</el-button>
+        </div>
+        <div style="width:156px;display: inline-block;margin:10px;border:1px solid #ccc;"
+          v-for="(item,index) in fileList">
+          <el-image width="100px" alt="" :src="item.url" :preview-src-list="[item.url]"></el-image>
+        </div>
+        <Page ref="pageImgButton" :current="imgForm.page" :page_size="imgForm.page_size" :total="taskImgTotal" @pageChange="goTaskImg" />
+      </el-dialog>
+
+    <!-- 预览识别结果 -->
+    <el-dialog title="异常处理" :visible.sync="showAnsVisible" width="90%" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px" :inline="true">
+        <el-row :gutter="20">
+          <!--试卷预览-->
+          <el-col :span="16" style="border:1px solid #ccc;">
+            <img :src="curStudentRecImg" id="myCanvasImg" style="display:none;" />
+            <canvas id="myCanvas" ref="myCanvas" :width="srcImgWidth*canvasImgScale" :height="srcImgHeight*canvasImgScale"></canvas>
+          </el-col>
+          <!--异常处理-->
+          <el-col :span="8">
+            <!--考号异常-->
+            <el-row v-if="activeName==-1">
+              <el-col :span="20">
+                <el-form-item v-if="activeName==-1" label-width="80">
+                  <el-input v-model="curStudentNo" size="mini" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="4">
+                <el-form-item v-if="activeName==-1">
+                  <el-button type="primary" @click="searchStudents" size="mini">搜索</el-button>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <!--客观题异常-->
+            <el-row v-if="activeName==-2">
+              <div class="kgtContainer">
+                <div class="topContainer">
+                  <div class="topItem">待处理:2</div>
+                  <div class="topItem">
+                    <el-button type="primary" size="mini" @click="saveModifQueAns">保存</el-button>
+                  </div>
+                </div>
+                <div class="kgtItem" v-for="oitem in objectiveRecResult">
+                  <span class="tag-group__title">{{oitem.qno}}、</span>
+                  <el-tag :effect="oitem.fillNum.indexOf(index)!=-1?'dark':'plain'" v-for="(item,index) in oitem.points.length" :key="item.label" type="success"
+                    @click="setStdAns(oitem,index)"
+                    size="small">
+                    {{ $const.ansOptionList[index]["label"] }}
+                  </el-tag>&nbsp;&nbsp;&nbsp;&nbsp;
+                  <el-tag effect="dark" size="small" :type="oitem.fillNum.length<1?'danger':'plain'">未涂</el-tag>
+                  <el-tag effect="dark" size="small" :type="oitem.fillNum.length>1 && oitem.qtype==1?'danger':'plain'">多涂</el-tag>
+                </div>
+              </div>
+            </el-row>
+            <el-row style="border:1px solid #ccc;padding:10px;" v-for="(item,index) in searchStudentsData">
+              <el-col :span="20">
+                <p>{{item.name}}</p>
+                <p>{{item.student_no}}</p>
+                <p>{{item.school_name}}{{item.grade_name}}{{item.class_name}}</p>
+              </el-col>
+              <el-col :span="4">
+                  <el-button type="primary" @click="saveModifyStudentNo" size="mini">确定</el-button>
+              </el-col>
+            </el-row>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="showAnsVisible = false">关 闭</el-button>
+      </div>
+    </el-dialog>
+    <!-- 重新识别 -->
+    <el-dialog title="重新识别" :visible.sync="remarkDialogVisible" width="60%" @close="closeRemarkDialog">
+      <el-form :inline="true">
+        <el-form-item label="考号噪声参数">
+          <el-input-number v-model="form.khVoiceNum" :min="1" :max="5"></el-input-number>
+        </el-form-item>
+        <el-form-item label="考号填涂比例阈值">
+          <el-input-number v-model="form.khFillRate" :min="1" :max="5"></el-input-number>
+        </el-form-item>
+        <el-form-item label="题目噪声参数">
+          <el-input-number v-model="form.tmVoiceNum" :min="1" :max="5"></el-input-number>
+        </el-form-item>
+        <el-form-item label="题目填涂比例阈值">
+          <el-input-number v-model="form.tmFillRate" :min="1" :max="5"></el-input-number>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="doReTryMark">确 定</el-button>
+      </div>
+    </el-dialog>
+    <!--阅卷设置-->
+    <MarkTaskSetDialog :remarkSetVisible="remarkSetVisible" :paperId="curPaperId" :taskId="curTaskId" @close="closeMarkTaskSet" />
+  </section>
+</template>
+<script>
+  import Page from "../../components/Page";
+  import MarkTaskSetDialog from "./components/MarkTaskSetDialog";
+  import Cropper from 'cropperjs'
+  export default {
+    components: {
+      Page,
+      MarkTaskSetDialog
+    },
+    data() {
+      return {
+        loading: false,
+        queryParams: {
+          page: 1,
+          page_size: 20
+        },
+        form: {
+          khVoiceNum: 5,
+          khFillRate: 3.0,
+          tmVoiceNum: 3,
+          tmFillRate: 1.8,
+          class_list: ["高三一班", "高三二班"],
+          checkList: []
+        },
+        imgForm:{
+          page:1,
+          page_size:20
+        },
+        form1: {},
+        form2: {},
+        list: [{}, {}],
+        total: 0,
+        imgTotal:0,
+        title: "新增用户",
+        open: false,
+        doctorList: [],
+        rules: {},
+        uploadDialogVisible: false,
+        remarkDialogVisible: false,
+        fileList: [],
+        papersList: [],
+        taskid: null,
+        timer: null,
+        timer2: null,
+        studentsList: [],
+        showAnsVisible: false,
+        curStudentRecImg: "",
+        activeName: "1",
+        curTaskId: null,
+        curPaperId:null,
+        recPage: 1,
+        recPageSize: 20,
+        recTotal: 0,
+        recParams: {},
+        recSucTotal: 0,
+        recKhErrTotal: 0,
+        recObjErrTotal: 0,
+        recWaitingErrTotal:0,
+        queryName: "",
+        queryMarkStatus: null,
+        selectException: [],
+        checkClassList: [],
+        schoolList: [],
+        gradeList: [],
+        classList: [],
+        imgListVisible: false,
+        taskImgTotal: 0,
+        remarkSetVisible: false,
+        activeSetName: "first",
+        addQueForm:{},
+        objectiveQueList:[],
+        subjectiveQueList:[],
+        subjectiveMarkTeacherList:[],
+        checkList:[],
+        srcImgWidth:null,
+        srcImgHeight:null,
+        canvasImgScale:1,
+        ctx:null,
+        curStudentNo:null,
+        searchStudentsData:[],
+        ansOptionList: [{
+              label: "A",
+              value: "A",
+              flag: 0
+            },
+            {
+              label: "B",
+              value: "B",
+              flag: 0
+            },
+            {
+              label: "C",
+              value: "C",
+              flag: 0
+            },
+            {
+              label: "D",
+              value: "D",
+              flag: 0
+            },
+            {
+              label: "E",
+              value: "E",
+              flag: 0
+            },
+            {
+              label: "F",
+              value: "F",
+              flag: 0
+            },
+            {
+              label: "G",
+              value: "G",
+              flag: 0
+            }
+          ],
+        objectiveRecResult:[]
+      };
+    },
+    methods: {
+      jump(url, id) {
+        id == 2 ? localStorage.setItem("sonNav", 2) : '';
+        if (url) {
+          this.$router.push(url);
+        }
+      },
+      submitUpload() {
+        this.$refs.upload.submit();
+      },
+      edit(row){
+        this.open = true;
+        this.form = row;
+        this.classList = row.class_id.split(",");
+      },
+      del(id) {
+        this.$confirm("确认删除?", "提示", {
+          type: "warning",
+        }).then(() => {
+          this.$api
+            .delMarkTask({
+              id: id,
+            })
+            .then((res) => {
+              if (!res.data.code) {
+                this.msgSuccess("删除成功");
+                this.getData();
+              } else {
+                this.$msgError(res.data.message);
+              }
+            });
+        });
+      },
+      gopage(size) {
+        if (size) {
+          this.queryParams.page_size = size;
+        }
+        this.queryParams.page = this.$refs.pageButton.page;
+        this.getData();
+      },
+      goTaskImg(page){
+        if (page) {
+          this.imgForm.page_size = size;
+        }
+        this.imgForm.page = this.$refs.pageImgButton.page;
+        let that = this;
+        that.$api.getTaskImgList({
+            task_id: that.curTaskId,
+            page:that.imgForm.page,
+            page_size:that.imgForm.page_size
+          }).then(res => {
+            that.fileList = res.data.data.list
+            that.taskImgTotal = res.data.data.total;
+          })
+      },
+      goRecPage(size) {
+        if (size) {
+          this.recPageSize = size;
+        }
+        this.recPage = this.$refs.pageButton.page;
+        this.recParams = {
+          task_id: this.curTaskId,
+          page: this.recPage,
+          page_size: this.recPageSize,
+          status: this.activeName,
+          name: this.queryName,
+          err_status: this.queryMarkStatus
+        }
+        window.clearInterval(this.timer);
+        this.getData(this.curTaskId)
+      },
+      searchMarkData() {
+        this.recParams.name = this.queryName;
+        this.recParams.errStatus = this.queryMarkStatus;
+        window.clearInterval(this.timer);
+        this.getData(this.curTaskId);
+      },
+      reSetMarkData() {
+        this.queryName = null;
+        this.queryMarkStatus = null;
+        this.queryParams.name = null;
+        this.queryParams.err_status = null;
+        window.clearInterval(this.timer);
+        this.getData(this.curTaskId);
+      },
+      getData() {
+        let id = this.$route.query.id;
+        this.curTaskId = id
+        this.uploadDialogVisible = true
+        this.taskid = id
+        let that = this;
+        this.loading = true;
+        this.recParams = {
+          task_id: id,
+          page: this.recPage,
+          page_size: this.recPageSize,
+          status: this.activeName,
+          name: this.queryName,
+          err_status: this.queryMarkStatus
+        }
+        this.$api.getMarkTaskStudents(this.recParams).then(res => {
+          this.studentsList = res.data.data.list;
+          this.studentsList.forEach(item => {
+            let mark_status = item.mark_status;
+            if (mark_status != 1) {
+              item.mark_status_name = this.$const.recErrorList.filter((ritem) => {
+                return ritem.value == mark_status;
+              })[0].label
+            } else {
+              item.mark_status_name = "正常"
+            }
+          })
+          this.recTotal = res.data.data.total;
+          this.recSucTotal = res.data.data.suc_total;
+          this.recKhErrTotal = res.data.data.kh_err_total;
+          this.recObjErrTotal = res.data.data.obj_err_cnt;
+          this.recWaitingErrTotal = res.data.data.waiting_cnt;
+          this.loading = false;
+        })
+        window.clearInterval(this.timer);
+        this.timer = setInterval(function () {
+          that.$api.getMarkTaskStudents(that.recParams).then(res => {
+            that.studentsList = res.data.data.list;
+            that.studentsList.forEach(item => {
+              let mark_status = item.mark_status;
+              if (mark_status != 1) {
+                item.mark_status_name = that.$const.recErrorList.filter((ritem) => {
+                  return ritem.value == mark_status;
+                })[0].label
+              } else {
+                item.mark_status_name = "正常"
+              }
+            })
+            that.recTotal = res.data.data.total;
+            that.recSucTotal = res.data.data.suc_total;
+            that.recKhErrTotal = res.data.data.kh_err_total;
+            that.recObjErrTotal = res.data.data.obj_err_cnt;
+            that.recWaitingErrTotal = res.data.data.waiting_cnt;
+          })
+        }, 4000)
+      },
+      closeRemarkDialog() {
+        this.remarkDialogVisible = false;
+        this.fileList = []
+      },
+      closeTaskImgDialog() {
+        this.imgListVisible = false;
+        window.clearInterval(this.timer2);
+      },
+      handlePreview(file) {
+        console.log(file);
+      },
+      handleChange(file, fileList) {},
+
+      openTaskImgList() {
+        let that = this;
+        this.imgListVisible = true
+        window.clearInterval(this.timer2);
+        this.timer2 = setInterval(function () {
+          that.$api.getTaskImgList({
+            task_id: that.curTaskId,
+            page:that.imgForm.page,
+            page_size:that.imgForm.page_size
+          }).then(res => {
+            that.fileList = res.data.data.list
+            that.taskImgTotal = res.data.data.total;
+          })
+        }, 2000)
+      },
+      handleUploadSuccess(res, file, fileList) {
+        if (!res.code) {
+          if (fileList.every(item => item.status == "success")) {
+            fileList.map(item => {
+              item.response && this.fileList.push({
+                "url": res.data.url,
+                "name": res.data.name
+              })
+            })
+          }
+        }
+      },
+      delStudents(id, index,action) {
+        this.$api.delMarkTaskStudents({
+          id: id,
+          action:action
+        }).then(res => {
+          this.msgSuccess("删除成功!");
+          this.studentsList.splice(index, 1)
+        })
+      },
+      handleRemove(e) {
+        console.log(e)
+      },
+      drawRect(x, y, lineW, lineY) {
+          //   开始绘制;
+          this.ctx.beginPath();
+          //   //设置线条颜色,必须放在绘制之前
+          this.ctx.strokeStyle = "red";
+          //   console.log("44444444");
+          //   // 线宽设置,必须放在绘制之前
+          this.ctx.lineWidth = 1;
+          //   console.log("5555555555");
+          // strokeRect参数:(左上角x坐标,y:左上角y坐标,绘画矩形的宽度,绘画矩形的高度)
+          this.ctx.strokeRect(x, y, lineW, lineY);
+          //   console.log("66666666666666");
+      },
+      showStudentImgs(row) {
+        this.curStudentRecImg = JSON.parse(row.imgs)[0];
+        this.showAnsVisible = true;
+        this.curStudentNo = row.student_no;
+        this.form.student_no = this.curStudentNo;
+        this.searchStudentsData = [];
+        let that = this;
+        let objective_result = row.objective_result;
+        let objective_ans = row.objective_ans;
+
+        // 获取试卷客观题标准填涂
+        let paper_id = row.paper_id;
+        that.objectiveRecResult = [];
+        this.$api.getPaperQueInfo({id:paper_id}).then(res=>{
+          let stdQueList = JSON.parse(res.data.data.stdQueList)
+          stdQueList.forEach(item=>{
+            that.objectiveRecResult = that.objectiveRecResult.concat(item);
+            console.log(objective_ans,222222222222222)
+            // 补全填涂答案
+            let rec_result = {}
+            let rec_result_num = {}
+            objective_ans.forEach(iitem=>{
+              let fillAns = iitem["ans"];
+              let fillNum = [];
+              fillAns.split(",").forEach(fans=>{
+                fillNum.push(this.$const.ansOptionIndex[fans])
+              })
+              rec_result[iitem["qno"]] = fillAns
+              rec_result_num[iitem["qno"]] = fillNum
+            })
+
+            that.objectiveRecResult.forEach(orr=>{
+              orr["fillAns"] = rec_result[orr["qno"]]?rec_result[orr["qno"]]:""
+              orr["fillNum"] = rec_result_num[orr["qno"]]?rec_result_num[orr["qno"]]:[]
+            })
+          })
+        })
+
+        this.$nextTick(function () {
+            
+              that.canvas = document.getElementById("myCanvas");
+              that.ctx = that.canvas.getContext("2d");
+
+              let image = new Image();
+              image.src = that.curStudentRecImg;
+
+              image.onload = function(){
+                that.srcImgWidth = image.width;
+                that.srcImgHeight = image.height;
+                that.canvasImgScale = 680/image.width;
+                that.ctx.drawImage(image, 0, 0, that.srcImgWidth, that.srcImgHeight, 0, 0, that.srcImgWidth*that.canvasImgScale, that
+                      .srcImgHeight*that.canvasImgScale)
+                objective_result.forEach(item=>{
+                  item.forEach(iitem=>{
+                    that.drawRect(iitem.absX*that.canvasImgScale,iitem.absY*that.canvasImgScale,iitem.w*that.canvasImgScale,iitem.h*that.canvasImgScale);
+                    that.ctx.font = '12px Arial';
+                    that.ctx.fillStyle = 'red';
+                    if(iitem.ans){
+                      that.ctx.fillText(iitem.ans, iitem.absX*that.canvasImgScale,iitem.absY*that.canvasImgScale);
+                    }
+                  })
+                })
+                
+              }
+
+        })
+      },
+      saveModifQueAns(){
+        let params = {
+            task_id:this.curTaskId,
+            student_no:this.curStudentNo
+        }
+        let objective_ans = [];
+        this.objectiveRecResult.forEach(item=>{
+          if(item.fillNum.length>0){
+            objective_ans.push({
+              qno:item.qno,
+              ans:item.fillAns
+            })
+          }
+        })
+        params.objective_ans = objective_ans;
+        let that = this;
+        this.$api.saveModifQueAns(params).then(res=>{
+          if(!res.data.code){
+            this.msgSuccess("保存成功!");
+            this.showAnsVisible = false;
+          }else{
+            this.msgError(res.data.message);
+          }
+        })
+      },
+      setStdAns(oitem, index) {
+        //oitem表示每一题,index表示每一个选项
+        let fillNum = oitem.fillNum; //已识别的填涂选项
+        if(fillNum.indexOf(index)==-1){
+          fillNum.push(index)
+        }else{
+          fillNum.splice(fillNum.indexOf(index),1);
+        }
+        //重新计算fillAns
+        let fillAns = [];
+        fillNum.forEach(num=>{
+          if(num){
+            fillAns.push(this.$const.ansOptionIndex[num])
+          }
+        })
+        oitem.fillAns = fillAns.join();
+        this.$forceUpdate();
+      },
+      searchStudents(){
+        let params = {
+          student_no:this.curStudentNo
+        }
+        this.$api.searchStudents(params).then(res=>{
+          this.searchStudentsData = res.data.data;
+        })
+      },
+      saveModifyStudentNo(){
+        let params = {
+          student_no:this.curStudentNo,
+          task_id:this.curTaskId
+        }
+        this.$api.saveModifyStudentNo(params).then(res=>{
+          console.log(res,1111111111111)
+          this.showAnsVisible = false;
+        })
+      },
+      showCurRecImg(row) {
+        this.curStudentRecImg = row.ans_imgs.replace(".png", "_draw_ans.png");
+        this.showAnsVisible = true;
+      },
+      showCurRecKhImg(row) {
+        let ext = row.ans_imgs.split("/").pop()
+        if (ext) {
+          ext = "." + ext.split(".")[1]
+        }
+        this.curStudentRecImg = row.ans_imgs.replace("_ans" + ext, "_sno" + ext);
+        this.showAnsVisible = true;
+      },
+
+      handleTabClick(tab, event) {
+        this.activeName = tab.name;
+        this.recPage = 1;
+        this.recParams = {
+          task_id: this.curTaskId,
+          page: this.recPage,
+          page_size: this.recPageSize,
+          status: this.activeName,
+          name: this.queryName,
+          err_status: this.queryMarkStatus
+        }
+        window.clearInterval(this.timer);
+        this.getData(this.curTaskId)
+      },
+      downloadObjectiveResult(task_id) {
+        this.$api
+          .downloadObjectiveResult({
+            task_id: task_id
+          })
+          .then((res) => {
+            var elink = document.createElement("a");
+            let blob = new Blob([res.data], {
+              type: "application/vnd.ms-excel,charset=UTF-8",
+            });
+            let objUrl = URL.createObjectURL(blob);
+            let file_name = decodeURIComponent(
+              res.headers["content-disposition"].split("=")[1]
+            );
+            elink.download = file_name;
+            elink.style.display = "none";
+            elink.href = objUrl;
+            document.body.appendChild(elink);
+            elink.click();
+            document.body.removeChild(elink);
+            this.download_loading = false;
+          });
+      },
+      handleSelectionChange(val) {
+        this.selectException = [];
+        if (val.length > 0) {
+          val.forEach(item => {
+            let task_img = item.task_id + ";;" + item.imgs + ";;" + item.id;
+            this.selectException.push(task_img);
+          })
+          window.clearInterval(this.timer);
+        }
+      },
+      reTryMark() {
+        if (this.selectException.length < 1) {
+          this.msgError("请选择需要重新识别的答卷!");
+        } else {
+          this.remarkDialogVisible = true;
+        }
+      },
+      doReTryMark() {
+        let urls = []
+        this.selectException.forEach(item => {
+          item = item + ";;" + String(this.form.khVoiceNum) + ";;" + String(this.form.khFillRate);
+          item = item + ";;" + String(this.form.tmVoiceNum) + ";;" + String(this.form.tmFillRate);
+          urls.push(item);
+        })
+        let that = this;
+        this.$api.reTryMarkPaper({
+          urls: urls
+        }).then(res => {
+          this.remarkDialogVisible = false;
+          this.getData();
+          window.clearInterval(this.timer);
+          this.timer = setInterval(function () {
+            that.$api.getMarkTaskStudents(that.recParams).then(res => {
+              that.studentsList = res.data.data.list;
+              that.studentsList.forEach(item => {
+                let mark_status = item.mark_status;
+                if (mark_status != 1) {
+                  item.mark_status_name = that.$const.recErrorList.filter((ritem) => {
+                    return ritem.value == mark_status;
+                  })[0].label
+                } else {
+                  item.mark_status_name = "正常"
+                }
+              })
+              that.recTotal = res.data.data.total;
+              that.recSucTotal = res.data.data.suc_total;
+              that.recKhErrTotal = res.data.data.kh_err_total;
+              that.recObjErrTotal = res.data.data.obj_err_cnt;
+              that.recWaitingErrTotal = res.data.data.waiting_cnt;
+            })
+          }, 4000)
+        })
+      },
+      startRecPaper() {
+        this.loading = true
+        this.$api.startRecPaper({
+          task_id: this.curTaskId
+        }).then(res => {
+          this.loading = false
+        })
+      },
+      remarkSet(row) {
+        this.remarkSetVisible = true
+        this.curTaskId = row.task_id;
+        this.curPaperId = row.paper_id;
+      },
+      closeMarkTaskSet(){
+        this.remarkSetVisible = false
+      }
+    },
+    created() {
+      this.getData();
+      this.getSchoolList();
+      this.getGradeList();
+      this.getClassList();
+    },
+  };
+</script>
+<style lang="scss">
+  .el-upload-list {
+    display: none !important;
+  }
+
+  .el-upload-list--picture .el-upload-list__item {
+    width: 150px;
+    float: left;
+    margin-right: 10px;
+    position: relative;
+  }
+
+  .el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name {
+    position: absolute;
+    z-index: 100;
+    height: 70px;
+    line-height: 130px;
+  }
+
+  .el-upload-list--picture .el-upload-list__item-thumbnail {
+    width: 125px;
+  }
+
+  .prosss_box .el-progress.el-progress--line {
+    width: 88px;
+    margin: auto 5px auto 0;
+  }
+
+  .prosss_box .el-progress-bar {
+    padding-right: 0;
+  }
+
+  .prosss_box .el-progress__text {
+    display: none;
+  }
+
+  .prosss_box {
+    display: flex;
+  }
+  .kgtContainer{
+    border:1px solid #ccc;
+    padding:10px;
+    .topContainer{
+      display:flex;
+      .topItem{
+        width:50%;
+        flex-direction:column;
+      }
+      .topItem:last-child{
+        width:50%;
+        flex-direction:column;
+        text-align:right;
+      }
+    }
+    .kgtItem{
+      margin:10px;
+    }
+  }
+  
+</style>