Jelajahi Sumber

微信小程序作答按课程设置

deason 3 tahun lalu
induk
melakukan
3c61cd42c0

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

@@ -17,6 +17,7 @@ import notice from "../view/notice.vue";
 import studentSpecialSettings from "../view/studentSpecialSettings.vue";
 import stageSpecialSettings from "../view/stageSpecialSettings.vue";
 import examIpLimit from "../view/examIpLimit.vue";
+import weixinAnswerSetting from "../view/weixinAnswerSetting.vue";
 
 export default [
   {
@@ -96,6 +97,10 @@ export default [
         path: "examIpLimit/:id/:examName/:examTypeName",
         component: examIpLimit,
       },
+      {
+        path: "weixinAnswerSetting/:id",
+        component: weixinAnswerSetting,
+      },
       {
         path: "notice",
         component: notice,

+ 22 - 0
src/modules/examwork/view/examInfo.vue

@@ -232,6 +232,22 @@
                         >场次特殊设置</el-button
                       >
                     </el-dropdown-item>
+                    <el-dropdown-item>
+                      <el-button
+                        :disabled="
+                          !(
+                            scope.row.properties &&
+                            scope.row.properties.WEIXIN_ANSWER_ENABLED ===
+                              'true'
+                          )
+                        "
+                        size="mini"
+                        type="primary"
+                        icon="el-icon-edit"
+                        @click="weixinAnswerSetting(scope.row)"
+                        >微信小程序作答设置</el-button
+                      >
+                    </el-dropdown-item>
                     <el-dropdown-item>
                       <el-button
                         :disabled="!scope.row.ipLimitSettingsEnabled"
@@ -577,6 +593,12 @@ export default {
           this.getExamType(row.examType),
       });
     },
+    weixinAnswerSetting(row) {
+      this.setSearchParams();
+      this.$router.push({
+        path: "/examwork/weixinAnswerSetting/" + row.id,
+      });
+    },
     editIpSettings(row) {
       this.setSearchParams();
       this.$router.push({

+ 191 - 0
src/modules/examwork/view/weixinAnswerSetting.vue

@@ -0,0 +1,191 @@
+<template>
+  <section class="content">
+    <LinkTitlesCustom
+      :current-paths="['考试管理', '考试信息', '微信小程序作答设置']"
+    />
+
+    <div class="box box-info">
+      <div class="box-body">
+        <el-form
+          ref="searchForm"
+          :model="searchForm"
+          :inline="true"
+          label-width="70px"
+        >
+          <el-form-item label="课程代码">
+            <el-input
+              v-model="searchForm.courseCode"
+              class="input"
+              clearable
+            ></el-input>
+          </el-form-item>
+
+          <el-form-item label="课程名称">
+            <el-input
+              v-model="searchForm.courseName"
+              class="input"
+              clearable
+            ></el-input>
+          </el-form-item>
+
+          <el-form-item label="状态">
+            <el-select v-model="searchForm.weixinAnswerEnabled" class="input">
+              <el-option label="全部" value=""></el-option>
+              <el-option label="启用" value="true"></el-option>
+              <el-option label="禁用" value="false"></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item>
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-search"
+              @click="doSearch(1)"
+              >查询</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-button
+          size="small"
+          type="danger"
+          icon="el-icon-edit"
+          :disabled="noBatchSelected"
+          @click="xxx"
+          >批量启用</el-button
+        >
+        <el-button
+          size="small"
+          type="danger"
+          icon="el-icon-edit"
+          :disabled="noBatchSelected"
+          @click="xxx"
+          >批量禁用</el-button
+        >
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-upload2"
+          @click="xxx"
+          >导入设置</el-button
+        >
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-download"
+          @click="xxx"
+          >导出设置</el-button
+        >
+
+        <div style="width: 100%; margin-bottom: 10px"></div>
+
+        <el-table
+          :data="tableData"
+          style="width: 100%; text-align: center"
+          border
+          @selection-change="selectChange"
+        >
+          <el-table-column type="selection" width="50"></el-table-column>
+          <el-table-column prop="courseCode" label="课程代码"></el-table-column>
+          <el-table-column prop="courseName" label="课程名称"></el-table-column>
+          <el-table-column label="状态">
+            <template slot-scope="scope">
+              <span>{{ scope.row.weixinAnswerEnabled ? "启用" : "禁用" }}</span>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <div class="page pull-right">
+          <el-pagination
+            :current-page="searchForm.pageNo"
+            :page-size="searchForm.pageSize"
+            :page-sizes="[2, 20, 50, 100, 200, 300]"
+            :total="totalElements"
+            layout="total, sizes, prev, pager, next, jumper"
+            @current-change="handlePagerNo"
+            @size-change="handlePagerSize"
+          ></el-pagination>
+        </div>
+      </div>
+    </div>
+  </section>
+</template>
+
+<script>
+import { EXAM_WORK_API } from "@/constants/constants.js";
+import { mapState } from "vuex";
+
+export default {
+  data() {
+    return {
+      searchForm: {
+        examId: null,
+        courseCode: "",
+        courseName: "",
+        weixinAnswerEnabled: null,
+        pageNo: 1,
+        pageSize: 10,
+      },
+      loading: false,
+      tableData: [],
+      totalElements: 0,
+      selectedCourseIds: [],
+    };
+  },
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+    noBatchSelected() {
+      return this.selectedCourseIds.length === 0;
+    },
+  },
+  created() {
+    this.searchForm.examId = this.$route.params.id;
+    this.doSearch(1);
+  },
+  methods: {
+    back() {
+      this.$router.push({ path: "/examwork/examInfo" });
+    },
+    doSearch(pageNo) {
+      this.searchForm.pageNo = pageNo;
+
+      let url = EXAM_WORK_API + "/exam/course/list";
+      this.$httpWithMsg.post(url, this.searchForm).then((response) => {
+        this.tableData = response.data.content;
+        this.totalElements = response.data.totalElements;
+      });
+    },
+    xxx() {
+      console.log("examId", this.searchForm.examId);
+      console.log("courseIds", JSON.stringify(this.selectedCourseIds));
+    },
+    handlePagerNo(pageNo) {
+      this.doSearch(pageNo);
+    },
+    handlePagerSize(pageSize) {
+      this.searchForm.pageSize = pageSize;
+      this.doSearch(1);
+    },
+    selectChange(row) {
+      this.selectedCourseIds = [];
+      row.forEach((element) => {
+        this.selectedCourseIds.push(element.courseId);
+      });
+    },
+  },
+};
+</script>
+<style scoped>
+.input {
+  width: 180px;
+}
+</style>