xjc vor 2 Jahren
Ursprung
Commit
1801f0f4d8
3 geänderte Dateien mit 56 neuen und 124 gelöschten Zeilen
  1. 0 7
      src/views/menu5/menu5-2/index.vue
  2. 55 116
      src/views/menu5/menu5-3/index.vue
  3. 1 1
      vue.config.js

+ 0 - 7
src/views/menu5/menu5-2/index.vue

@@ -593,13 +593,6 @@ export default {
         this.taskInfo.class_name = res.data.class_name;
         this.taskInfo.pno = res.data.pno;
         this.taskInfo.id = res.data.id;
-        // res.data.students.forEach((ele) => {
-        //   if (ele.pimgs.length > 0) {
-        //     ele.pimgs.forEach((img) => {
-        //       this.imgArr.push(img);
-        //     });
-        //   }
-        // });
       });
     },
     reset() {

+ 55 - 116
src/views/menu5/menu5-3/index.vue

@@ -28,7 +28,7 @@
     </el-col>-->
     <el-col :span="24" class="center">
       <div v-if="status != 0" class="tableTitle">
-        <span>新增阅卷</span>
+        <span>阅卷详情</span>
         <div v-if="status == 2" class="optBtn">
           <el-button size="small" @click="back">返回阅卷</el-button>
           <el-button class="add" size="small" @click="startScan"
@@ -47,41 +47,53 @@
         <template slot="tableBtn">
           <div class="tableInfo">
             <span>试卷名称:</span>
-            <span>2021年高一期末考试</span>
+            <span>{{taskInfo.name}}(T{{taskInfo.id}}-{{taskInfo.pno}})</span>
           </div>
           <div class="tableInfo">
             <span>学校:</span>
-            <span>石室中学</span>
+            <span>{{taskInfo.school_name}}</span>
           </div>
           <div class="tableInfo">
             <span>年级:</span>
-            <span>高一</span>
+            <span>{{taskInfo.grade_name}}</span>
           </div>
           <div class="tableInfo">
             <span>班级:</span>
-            <span>5班</span>
+            <span>{{taskInfo.class_name}}</span>
           </div>
           <div class="previewBox" id="XScannerContainer">
-            <img
-              style="position: absolute; top: 40%; left: 46%"
-              src="../../../assets/views/loading.png"
-              alt=""
-            />
-            <span style="position: absolute; top: 15%; color: #999999"
-              >等待扫描中</span
-            >
+            
+            <img v-if="imgSrc" style="width:100%" :src="imgSrc" alt="">
+            <div v-else>
+              <img
+                style="position: absolute; top: 40%; left: 46%"
+                src="../../../assets/views/loading.png"
+                alt=""
+              />
+              <span style="position: absolute; top: 15%; color: #999999"
+              >等待扫描中</span>
+            </div>
           </div>
         </template>
+        <template slot="scanStatus" slot-scope="scope">
+          <span v-if="scope.row.status==2" style="color:#2BA245;">已上传</span>
+          <span v-if="scope.row.status==1" style="color:#e6a23c;">上传中...</span>
+          <span v-if="scope.row.status==0">待上传</span>
+        </template>
       </cloudTable>
       <div class="newForm" v-if="status == 1">
         <el-form ref="newForm" :model="newForm" label-width="110px">
           <el-form-item label="试卷名称">
             <el-col :span="8">
-              <el-input
-                v-model="newForm.name"
-                placeholder="请输入试卷名称"
-                size="small"
-              ></el-input>
+              <el-select v-model="newForm.pid" placeholder="请选择试卷" filterable>
+                <el-option
+                  v-for="item in paperList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
             </el-col>
           </el-form-item>
           <el-form-item label="学校">
@@ -90,6 +102,7 @@
                 v-model="newForm.sid"
                 placeholder="请选择学校"
                 @change="Schange"
+                filterable
               >
                 <el-option
                   v-for="item in metaData['schools']"
@@ -128,75 +141,6 @@
               </el-select>
             </el-col>
           </el-form-item>
-          <el-form-item label="科目">
-            <el-col :span="8">
-              <el-select v-model="newForm.subject" placeholder="请选择科目">
-                <el-option
-                  v-for="item in metaData['subjects']"
-                  :key="item.name"
-                  :label="item.name"
-                  :value="item.name"
-                ></el-option>
-              </el-select>
-            </el-col>
-          </el-form-item>
-          <el-form-item label="答题卡">
-            <!-- <Button @click="choiceImg" icon="ios-cloud-upload-outline" type="primary">选择文件</Button> -->
-            <!-- <input ref="filElem" type="file" class="upload-file" @change="addFile" /> -->
-            <!-- <el-upload
-              class="uploadItems"
-              action="/v1/common/upfile"
-              :limit="1"
-              :name="'datafile'"
-              :headers="upHeader"
-              :on-success="handleAvatarSuccess"
-              :file-list="fileList"
-            >
-              <el-button size="small" type="primary">点击上传</el-button>
-            </el-upload>-->
-            <el-upload
-              action="/v1/common/upfile"
-              list-type="picture-card"
-              :name="'datafile'"
-              :headers="upHeader"
-              :on-success="handleAvatarSuccess"
-              :file-list="fileList"
-            >
-              <i slot="default" class="el-icon-plus"></i>
-              <div slot="file" slot-scope="{ file }">
-                <img
-                  class="el-upload-list__item-thumbnail"
-                  :src="file.url"
-                  alt
-                />
-                <span class="el-upload-list__item-actions">
-                  <span
-                    class="el-upload-list__item-preview"
-                    @click="handlePictureCardPreview(file)"
-                  >
-                    <i class="el-icon-zoom-in"></i>
-                  </span>
-                  <!-- <span
-                    v-if="!disabled"
-                    class="el-upload-list__item-delete"
-                    @click="handleDownload(file)"
-                  >
-                    <i class="el-icon-download"></i>
-                  </span>-->
-                  <span
-                    v-if="!disabled"
-                    class="el-upload-list__item-delete"
-                    @click="handleRemove(file)"
-                  >
-                    <i class="el-icon-delete"></i>
-                  </span>
-                </span>
-              </div>
-            </el-upload>
-            <el-dialog :visible.sync="dialogVisible">
-              <img width="100%" :src="dialogImageUrl" alt />
-            </el-dialog>
-          </el-form-item>
           <el-form-item>
             <el-button class="add" size="small" @click="confirm"
               >确认</el-button
@@ -288,6 +232,14 @@ export default {
   data() {
     var token = this.Cookies.get("www-authenticate");
     return {
+      taskInfo:{
+        id:"",
+        name:"",
+        pno:"",
+        school_name:"",
+        grade_name:"",
+        class_name:""
+      },
       status: 0,
       curID: "0",
       curTree: {},
@@ -344,9 +296,9 @@ export default {
           {
             id: "2",
             label: "状态",
-            prop: "is_completed",
-            filter: "upload_status",
+            prop: "status",
             show: true,
+            custom:"scanStatus"
           },
         ],
         data: [],
@@ -425,20 +377,6 @@ export default {
           className: "",
           data: [
             {
-              id: "1",
-              label: "设置答题卡",
-              FunName: "setAnswer",
-              size: "mini",
-              show: true,
-            },
-            // {
-            //   id: "2",
-            //   label: "上传试卷",
-            //   FunName: "upload",
-            //   size: "mini",
-            //   show: true,
-            // },
-            {
               id: "3",
               label: "查看",
               FunName: "detail",
@@ -474,9 +412,10 @@ export default {
       handler: function (newV, oldV) {
         if (newV) {
           this.getList();
-          // this.timer = setInterval(() => {
-          //   this.getList();
-          // }, 2000); // 2s
+          this.timer = setInterval(() => {
+            this.imgSrc = "";
+            this.getList();
+          }, 2000); // 2s
         }
       },
     },
@@ -560,6 +499,7 @@ export default {
       let params = {
         name: data ? data.name : "",
         ctgid: data.id,
+        ptype:"exam"
       };
       this.newForm.ctgid = params.ctgid;
       paperApi.getPapers(params).then((res) => {
@@ -638,14 +578,13 @@ export default {
       let curTaskId = this.curTaskId;
       paperApi.getMarkTask({ tid: curTaskId }).then((res) => {
         this.dataTable.data = res.data.students;
-        this.imgArr = res.data.cur_imgs;
-        // res.data.students.forEach((ele) => {
-        //   if (ele.pimgs.length > 0) {
-        //     ele.pimgs.forEach((img) => {
-        //       this.imgArr.push(img);
-        //     });
-        //   }
-        // });
+        this.imgSrc = res.data.cur_imgs[0];
+        this.taskInfo.name = res.data.name;
+        this.taskInfo.school_name = res.data.school_name;
+        this.taskInfo.grade_name = res.data.grade_name;
+        this.taskInfo.class_name = res.data.class_name;
+        this.taskInfo.pno = res.data.pno;
+        this.taskInfo.id = res.data.id;
       });
     },
 
@@ -665,8 +604,8 @@ export default {
 
     back() {
       this.status = 0;
-      this.getTask()
-       clearInterval(this.timer2);
+      this.getTask();
+      clearInterval(this.timer2);
     },
     addItems() {
       this.status = 1;

+ 1 - 1
vue.config.js

@@ -30,7 +30,7 @@ module.exports = {
         proxy: {
             "/": {
                 // target: "http://47.108.130.28:8000",
-                target: "http://192.168.192.131:8000",
+                target: "http://192.168.117.131:8000",
                 // target: "http://47.104.213.35",
                 changeOrigin: true,
                 // ws: true,//websocket支持