Browse Source

小程序作答标记

xiatian 3 months ago
parent
commit
fec768aeba
1 changed files with 86 additions and 1 deletions
  1. 86 1
      src/modules/questions/views/GenPaper.vue

+ 86 - 1
src/modules/questions/views/GenPaper.vue

@@ -8,7 +8,7 @@
         :inline="true"
         :model="formSearch"
         label-position="right"
-        label-width="70px"
+        label-width="90px"
       >
         <el-row>
           <el-col :span="6">
@@ -113,6 +113,20 @@
               </el-select>
             </el-form-item>
           </el-col>
+          <el-col :span="6">
+            <el-form-item label="小程序作答">
+              <el-select
+                v-model="formSearch.appAnswer"
+                class="search_width"
+                clearable
+                placeholder="请选择"
+                size="small"
+              >
+                <el-option value="true" label="是"> </el-option>
+                <el-option value="false" label="否"> </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
           <el-col :span="6">
             <div class="search_down">
               <el-button size="small" type="primary" @click="searchFrom"
@@ -239,6 +253,11 @@
             }}</span>
           </template>
         </el-table-column>
+        <el-table-column label="小程序作答" width="100">
+          <template slot-scope="scope">
+            <span>{{ scope.row.appAnswer == true ? "是" : "否" }}</span>
+          </template>
+        </el-table-column>
         <el-table-column label="录入员" width="150">
           <template slot-scope="scope">
             <span>{{ scope.row.creator }}</span>
@@ -338,6 +357,15 @@
                       ><i class="el-icon-delete"></i> 删除</el-button
                     >
                   </el-dropdown-item> -->
+                  <el-dropdown-item>
+                    <el-button
+                      size="mini"
+                      type="primary"
+                      plain
+                      @click="openMarkAppDialog(scope.row)"
+                      ><i class="el-icon-share"></i>标记小程序上传</el-button
+                    >
+                  </el-dropdown-item>
                 </el-dropdown-menu>
               </el-dropdown>
             </div>
@@ -357,6 +385,25 @@
         </el-pagination>
       </div>
     </div>
+    <el-dialog title="标记小程序上传" :visible.sync="markAppDialog">
+      <el-form :model="markAppModel" label-position="right" label-width="280px">
+        <el-row>
+          <el-col :md="24">
+            <el-form-item label="当前试卷是否包含需要小程序作答的试题">
+              <el-radio-group v-model="markAppModel.appAnswer" class="input">
+                <el-radio label="true">是</el-radio>
+                <el-radio label="false">否</el-radio>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :md="24" class="text-center">
+            <el-button type="primary" @click="markApp">确定</el-button>
+          </el-col>
+        </el-row>
+      </el-form>
+    </el-dialog>
     <el-dialog title="导出" :visible.sync="exportDialog">
       <el-form :model="exportModel" label-position="right" label-width="80px">
         <el-row v-if="isShow">
@@ -568,6 +615,7 @@ export default {
       isClear: 0,
       courseLoading: false,
       formSearch: {
+        appAnswer: "",
         auditStatus: "",
         courseNo: "",
         courseName: "",
@@ -593,6 +641,11 @@ export default {
       },
       uploadData: {},
       fileLoading: false,
+      markAppDialog: false,
+      markAppModel: {
+        paperId: null,
+        appAnswer: false,
+      },
       exportDialog: false,
       exportModel: {
         id: "",
@@ -995,6 +1048,12 @@ export default {
           this.courseLoading = false;
         });
     },
+
+    openMarkAppDialog(row) {
+      this.markAppDialog = true;
+      this.markAppModel.appAnswer = row.appAnswer == true ? "true" : "false";
+      this.markAppModel.paperId = row.id;
+    },
     //打开导出弹框
     openExportDialog(row) {
       this.isShow = true;
@@ -1027,6 +1086,32 @@ export default {
       this.isShowPrintExamPackagePassword = false;
       this.printExamPackagePassword = "";
     },
+    markApp() {
+      this.loading = true;
+      let param = new URLSearchParams({
+        paperId: this.markAppModel.paperId,
+        appAnswer: this.markAppModel.appAnswer,
+      });
+      this.$http.post(QUESTION_API + "/paper/mark/app-answer", param).then(
+        () => {
+          this.$notify({
+            message: "标记成功",
+            type: "success",
+          });
+          this.searchGenPaper();
+          this.loading = false;
+          this.markAppDialog = false;
+        },
+        (response) => {
+          this.$notify({
+            message: response.response.data.desc,
+            type: "error",
+          });
+          this.markAppDialog = false;
+          this.loading = false;
+        }
+      );
+    },
     //导出试卷,答案,机考数据包
     exportPaperInfo() {
       if (this.exportModel.exportContentList.length == 0) {