Browse Source

离线文件上传变量重命名

lideyin 4 years ago
parent
commit
4c5cc85054

+ 5 - 0
src/modules/examwork/routes/routes.js

@@ -15,6 +15,7 @@ import onlineHomeworkOrgSettings from "../view/onlineHomeworkOrgSettings.vue";
 import Tips from "../../portal/views/tips/Tips.vue";
 import notice from "../view/notice.vue";
 import studentSpecialSettings from "../view/studentSpecialSettings.vue";
+import stageSpecialSettings from "../view/stageSpecialSettings.vue";
 
 export default [
   {
@@ -86,6 +87,10 @@ export default [
         path: "studentSpecialSettings/:id",
         component: studentSpecialSettings
       },
+      {
+        path: "stageSpecialSettings/:id", //场次特殊设置
+        component: stageSpecialSettings
+      },
       {
         path: "notice",
         component: notice

+ 6 - 6
src/modules/examwork/view/examInfo.vue

@@ -216,19 +216,19 @@
                     </el-dropdown-item>
                     <el-dropdown-item>
                       <el-button
-                        v-show="
+                        :disabled="
                           rolePrivileges.update_exam &&
                             (scope.row.examType == 'OFFLINE' ||
                               scope.row.examType == 'ONLINE' ||
                               scope.row.examType == 'ONLINE_HOMEWORK') &&
                             scope.row.specialSettingsEnabled &&
-                            scope.row.specialSettingsType == 'STUDENT_BASED'
+                            scope.row.specialSettingsType == 'STAGE_BASED'
                         "
                         size="mini"
                         type="primary"
                         icon="el-icon-edit"
-                        @click="editStudentSettings(scope.row)"
-                        >学生特殊设置</el-button
+                        @click="editStageSettings(scope.row)"
+                        >场次特殊设置</el-button
                       >
                     </el-dropdown-item>
                   </el-dropdown-menu>
@@ -531,10 +531,10 @@ export default {
         });
       }
     },
-    editStudentSettings(row) {
+    editStageSettings(row) {
       this.setSearchParams();
       this.$router.push({
-        path: "/examwork/studentSpecialSettings/" + row.id
+        path: "/examwork/stageSpecialSettings/" + row.id
       });
     },
     showExamCourseSettingsDialog(row) {

+ 1 - 1
src/modules/examwork/view/offlineExam.vue

@@ -160,7 +160,7 @@
                       class="input"
                     >
                       <el-radio label="ORG_BASED">机构特殊设置</el-radio>
-                      <el-radio label="STUDENT_BASED">学生特殊设置</el-radio>
+                      <el-radio label="STAGE_BASED">场次特殊设置</el-radio>
                     </el-radio-group>
                   </el-form-item>
                 </el-row>

+ 1 - 1
src/modules/examwork/view/onlineExam.vue

@@ -196,7 +196,7 @@
                       class="input"
                     >
                       <el-radio label="ORG_BASED">机构特殊设置</el-radio>
-                      <el-radio label="STUDENT_BASED">学生特殊设置</el-radio>
+                      <el-radio label="STAGE_BASED">场次特殊设置</el-radio>
                     </el-radio-group>
                   </el-form-item>
                 </el-row>

+ 1 - 1
src/modules/examwork/view/onlineHomework.vue

@@ -196,7 +196,7 @@
                       class="input"
                     >
                       <el-radio label="ORG_BASED">机构特殊设置</el-radio>
-                      <el-radio label="STUDENT_BASED">学生特殊设置</el-radio>
+                      <el-radio label="STAGE_BASED">场次特殊设置</el-radio>
                     </el-radio-group>
                   </el-form-item>
                 </el-row>

+ 203 - 0
src/modules/examwork/view/stageSpecialSettings.vue

@@ -0,0 +1,203 @@
+<template>
+  <section class="content">
+    <div class="box box-info">
+      <div
+        class="box-body"
+        v-loading.body="loading"
+        v-loading.fullscreen="loading"
+        element-loading-text="请稍后..."
+      >
+        <!-- 表单 -->
+        <el-form inline :model="formSearch">
+          <el-form-item label="学生ID">
+            <el-input
+              placeholder="学生ID"
+              v-model="formSearch.studentId"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="身份证号">
+            <el-input
+              placeholder="身份证号"
+              v-model="formSearch.identityNumber"
+            ></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-search"
+              @click="handleSearchBtn"
+            >
+              查询
+            </el-button>
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-arrow-left"
+              @click="back"
+            >
+              返回
+            </el-button>
+          </el-form-item>
+        </el-form>
+
+        <div class="block-seperator"></div>
+        <!-- 页面列表 -->
+        <el-table
+          :data="tableData"
+          border
+          resizable
+          stripe
+          style="width: 100%;"
+        >
+          <el-table-column prop="studentId" width="180" label="学生ID">
+          </el-table-column>
+          <el-table-column prop="identityNumber" label="学生身份证">
+          </el-table-column>
+          <el-table-column width="180" prop="beginTime" label="考试开始时间">
+          </el-table-column>
+          <el-table-column width="180" prop="endTime" label="考试结束时间">
+          </el-table-column>
+          <el-table-column width="120" label="是否禁止考试">
+            <template slot-scope="scope">
+              <div>
+                <span>{{ getYesNo(scope.row.examLimit) }}</span>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+        <div class="page pull-right">
+          <el-pagination
+            v-if="paginationShow"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            :page-size="pageSize"
+            :page-sizes="[10, 20, 50, 100, 200, 300]"
+            @size-change="handleSizeChange"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="total"
+          />
+        </div>
+      </div>
+    </div>
+  </section>
+</template>
+<script>
+import { EXAM_WORK_API } from "@/constants/constants.js";
+import { mapState } from "vuex";
+
+export default {
+  name: "StudentSpecialSettings",
+  data() {
+    return {
+      loading: false,
+      paginationShow: false,
+      yesNoList: [
+        {
+          value: true,
+          label: "是"
+        },
+        {
+          value: false,
+          label: "否"
+        }
+      ],
+      formSearch: {
+        examId: null,
+        studentId: null,
+        identityNumber: null
+      },
+      tableData: [],
+      currentPage: 1,
+      pageSize: 10,
+      total: 10
+    };
+  },
+  computed: {
+    ...mapState({ user: state => state.user }),
+    isSuperAdmin() {
+      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
+    }
+  },
+  methods: {
+    getYesNo(val) {
+      for (let temv of this.yesNoList) {
+        if (temv.value == val) {
+          return temv.label;
+        }
+      }
+    },
+    back() {
+      this.$router.push({ path: "/examwork/examInfo" });
+    },
+    handleSearchBtn() {
+      this.currentPage = 1;
+      this.searchForm();
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.searchForm();
+    },
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.searchForm();
+    },
+    //查询
+    searchForm() {
+      let regx = /^\d*$/;
+      if (this.formSearch.studentId && !regx.test(this.formSearch.studentId)) {
+        this.$notify({
+          title: "警告",
+          message: "学生ID只能输入数字",
+          type: "warning"
+        });
+        return false;
+      }
+      this.loading = true;
+      let temParams = Object.assign({}, this.formSearch);
+      if (!temParams.identityNumber) {
+        delete temParams.identityNumber;
+      }
+      var url =
+        EXAM_WORK_API +
+        "/exam/getStudentSpecialSettingsList/" +
+        (this.currentPage - 1) +
+        "/" +
+        this.pageSize;
+      this.$httpWithMsg
+        .get(url, { params: temParams })
+        .then(response => {
+          this.tableData = response.data.list;
+          this.total = response.data.total;
+          this.loading = false;
+
+          this.$nextTick(function() {
+            this.paginationShow = true;
+          });
+        })
+        .finally(() => (this.loading = false));
+    }
+  },
+  //初始化查询
+  created() {
+    this.formSearch.examId = this.$route.params.id;
+    this.searchForm();
+  }
+};
+</script>
+
+<style scoped>
+.page {
+  margin-top: 10px;
+}
+.pull-length {
+  width: 300px;
+}
+.pull-center {
+  margin-top: 20px;
+}
+.editForm .el-form-item {
+  margin-bottom: 12px;
+}
+</style>

+ 22 - 13
src/modules/examwork/view/studentSpecialSettings.vue

@@ -27,17 +27,15 @@
               type="primary"
               icon="el-icon-search"
               @click="handleSearchBtn"
+              >查询</el-button
             >
-              查询
-            </el-button>
             <el-button
               size="small"
               type="primary"
               icon="el-icon-arrow-left"
               @click="back"
+              >返回</el-button
             >
-              返回
-            </el-button>
           </el-form-item>
         </el-form>
 
@@ -50,14 +48,25 @@
           stripe
           style="width: 100%;"
         >
-          <el-table-column prop="studentId" width="180" label="学生ID">
-          </el-table-column>
-          <el-table-column prop="identityNumber" label="学生身份证">
-          </el-table-column>
-          <el-table-column width="180" prop="beginTime" label="考试开始时间">
-          </el-table-column>
-          <el-table-column width="180" prop="endTime" label="考试结束时间">
-          </el-table-column>
+          <el-table-column
+            prop="studentId"
+            width="180"
+            label="学生ID"
+          ></el-table-column>
+          <el-table-column
+            prop="identityNumber"
+            label="学生身份证"
+          ></el-table-column>
+          <el-table-column
+            width="180"
+            prop="beginTime"
+            label="考试开始时间"
+          ></el-table-column>
+          <el-table-column
+            width="180"
+            prop="endTime"
+            label="考试结束时间"
+          ></el-table-column>
           <el-table-column width="120" label="是否禁止考试">
             <template slot-scope="scope">
               <div>
@@ -87,7 +96,7 @@ import { EXAM_WORK_API } from "@/constants/constants.js";
 import { mapState } from "vuex";
 
 export default {
-  name: "StudentSpecialSettings",
+  name: "stageSpecialSettings",
   data() {
     return {
       loading: false,

+ 2 - 2
src/modules/oe/views/examScheduling.vue

@@ -935,7 +935,7 @@ export default {
       params.append("examRecordDataId", this.currentOfflineExamRecordDataId);
       params.append("fileType", this.fileType);
       for (let f of this.fileList) {
-        params.append("files", f.raw);
+        params.append("fileArray", f.raw);
       }
 
       //先对文件md5进行排序(按索引正序排列)
@@ -944,7 +944,7 @@ export default {
       for (let s of this.summaryList) {
         summaries.push(s.summary);
       }
-      params.append("summaries", summaries);
+      params.append("fileMd5Array", summaries);
 
       let config = {
         headers: { "Content-Type": "multipart/form-data" }