Sfoglia il codice sorgente

多区域客观题拼接完成

Your Name 1 anno fa
parent
commit
ce817af6e5
2 ha cambiato i file con 18 aggiunte e 6 eliminazioni
  1. 6 6
      src/views/papers/Index.vue
  2. 12 0
      src/views/papers/cutPaper.vue

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

@@ -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,9 +153,8 @@
         this.form = {};
         // this.initCropper();
       },
-      handleSuccess(res){
-        this.fileList.push({"name":res.data.name,"url":res.data.url})
-        console.log(this.fileList,222222222222222)
+      handleSuccess(e,res,fileList){
+        this.fileList.push({"name":res.response.data.name,"url":res.response.data.url,"status":"success"})
       },
       handleRemove(file,fileList){
         this.fileList = fileList
@@ -168,6 +167,7 @@
           imgs.forEach((item,index)=>{
             this.fileList.push({"name":item,"url":item})
           })
+          console.log(this.fileList,222222222222222)
           this.open = true;
         })
       },

+ 12 - 0
src/views/papers/cutPaper.vue

@@ -529,6 +529,18 @@
         //更新客观题识别信息
         this.stdChoiceList[this.curAnsIndex]=this.curStdChoiceList;
         this.stdQueList[this.curAnsIndex] = this.curStdQueList;
+        this.curStdQueList.forEach((item,index)=>{
+          item.qno = String(item.qno)
+          item.points.forEach((iitem,iindex)=>{
+            iitem.qno = item.qno;
+          })
+        })
+        this.curStdQnoPoints.forEach((item,index)=>{
+          // item.qno = this.curStdQueList[index].qno;
+          item.forEach((iitem,iindex)=>{
+            iitem.qno = this.curStdQueList[index].qno;
+          })
+        })
         this.stdQnoPoints[this.curAnsIndex] = this.curStdQnoPoints;
         let params = {
           paper_id: this.$route.query.id,