xjc 2 年 前
コミット
8dbeb7e558
2 ファイル変更35 行追加15 行削除
  1. 33 15
      src/views/menu5/menu5-2/index.vue
  2. 2 0
      vue.config.js

+ 33 - 15
src/views/menu5/menu5-2/index.vue

@@ -74,23 +74,30 @@
       >
         <template slot="tableBtn">
           <div class="tableInfo">
-            <span>试卷名称:</span><span>2021年高一期末考试</span>
+            <span>试卷名称:</span><span>{{taskInfo.name}}</span>
           </div>
-          <div class="tableInfo"><span>学校:</span><span>石室中学</span></div>
-          <div class="tableInfo"><span>年级:</span><span>高一</span></div>
-          <div class="tableInfo"><span>班级:</span><span>5班</span></div>
+          <div class="tableInfo"><span>学校:</span><span>{{taskInfo.school_name}}</span></div>
+          <div class="tableInfo"><span>年级:</span><span>{{taskInfo.grade_name}}</span></div>
+          <div class="tableInfo"><span>班级:</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 style="width:100%" :src="imgSrc" alt=""> -->
+            
+            <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">
@@ -242,6 +249,12 @@ export default {
   computed: {},
   data() {
     return {
+      taskInfo:{
+        name:"",
+        school_name:"",
+        grade_name:"",
+        class_name:""
+      },
       status: 0, // 0,列表页,1,新增页,2,打印页
       curID: "0",
       curTree: {},
@@ -290,8 +303,8 @@ export default {
             id: "2",
             label: "状态",
             prop: "status",
-            filter: "upload_status",
             show: true,
+            custom: "scanStatus",
           },
         ],
         data: [],
@@ -424,6 +437,7 @@ export default {
         if (newV) {
           this.getList();
           this.timer = setInterval(() => {
+            this.imgSrc = "";
             this.getList();
           }, 2000); // 2s
         }
@@ -570,7 +584,11 @@ export default {
       let curTaskId = this.curTaskId;
       paperApi.getMarkTask({ tid: curTaskId }).then((res) => {
         this.dataTable.data = res.data.students;
-        this.imgArr = res.data.cur_imgs;
+        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;
         // res.data.students.forEach((ele) => {
         //   if (ele.pimgs.length > 0) {
         //     ele.pimgs.forEach((img) => {

+ 2 - 0
vue.config.js

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