Prechádzať zdrojové kódy

Merge remote-tracking branch 'remotes/origin/release_v4.1.3'

deason 2 rokov pred
rodič
commit
07b86fae18

+ 6 - 0
src/modules/basic/routes/routes.js

@@ -20,6 +20,7 @@ import sys_notice from "../view/sys_notice";
 import sysLoginRuleList from "../view/sys_login_rule_list";
 import sysCryptoConfig from "../view/sys_crypto_config";
 import admin_operate from "../view/admin_operate";
+import BlackListApp from "../view/black_list_app";
 
 export default [
   {
@@ -130,6 +131,11 @@ export default [
         meta: { privilegeCodes: "sys_crypto_config" },
         component: sysCryptoConfig, //加密方案组合配置
       },
+      {
+        path: "black_list_app",
+        meta: { privilegeCodes: "black_list_app" },
+        component: BlackListApp, // 软件黑名单配置
+      },
     ],
   },
 ];

+ 107 - 0
src/modules/basic/view/black_list_app.vue

@@ -0,0 +1,107 @@
+<template>
+  <div v-loading="loading === 'fetch'" class="black-list-container">
+    <el-row style="margin-bottom: 20px">
+      <el-alert
+        title="软件黑名单配置"
+        type="warning"
+        show-icon
+        :closable="false"
+      >
+        注:编辑时以换行符分隔, 最好不要包含分号';'!
+        <el-button
+          class="el-alert__closebtn"
+          type="warning"
+          size="small"
+          round
+          plain
+          @click="onSave"
+        >
+          保存</el-button
+        >
+      </el-alert>
+    </el-row>
+    <el-row>
+      <el-col :span="8">
+        <h5>虚拟摄像头黑名单配置:</h5>
+        <el-input
+          v-model="vCamList"
+          type="textarea"
+          placeholder="虚拟摄像头黑名单配置"
+          :rows="20"
+        ></el-input>
+      </el-col>
+      <el-col :span="8" :offset="1">
+        <h5>远程桌面软件黑名单配置:</h5>
+        <el-input
+          v-model="remoteApp"
+          type="textarea"
+          placeholder="远程桌面软件黑名单配置"
+          :rows="20"
+        ></el-input>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "BasicBlackListApp",
+  data() {
+    return {
+      /** loading  'fetch' | 'add' */
+      loading: null,
+      /** 虚拟摄像头配置 */
+      vCamList: "",
+      /** 远程桌面软件配置 */
+      remoteApp: "",
+    };
+  },
+  mounted() {
+    this.fetchConfig();
+  },
+  methods: {
+    /** click 保存 */
+    async onSave() {
+      this.handleSaveConfig().then(this.fetchConfig);
+    },
+    /** 保存黑名单APP配置 */
+    async handleSaveConfig() {
+      try {
+        this.loading = "add";
+        const params = new URLSearchParams();
+        params.append(
+          "blacklist",
+          JSON.stringify({
+            vCamList: this.vCamList,
+            remoteApp: this.remoteApp,
+          })
+        );
+        await this.$http.put("/api/ecs_core/systemProperty/blacklist", params, {
+          headers: {
+            "content-type": "application/x-www-form-urlencoded",
+          },
+        });
+      } catch (error) {
+        error.message && this.$message.warning(error.message);
+      } finally {
+        this.loading = null;
+      }
+    },
+    /** 查询黑名单APP配置 */
+    async fetchConfig() {
+      try {
+        this.loading = "fetch";
+        const { vCamList = "", remoteApp = "" } = await this.$http
+          .get("/api/ecs_core/systemProperty/blacklist")
+          .then((response) => response.data);
+        this.vCamList = vCamList;
+        this.remoteApp = remoteApp;
+      } catch (error) {
+        error.message && this.$message.warning(error.message);
+      } finally {
+        this.loading = null;
+      }
+    },
+  },
+};
+</script>

+ 7 - 2
src/modules/marking/views/Marking.vue

@@ -229,9 +229,11 @@
             @changePaperSign="changePaperSign"
             @clearScores="clearScores"
             @changeSignScores="changeSignScores"
+            @showAnswerChange="showAnswerChange"
           ></tpMain>
           <!-- 文本图片给分板 -->
           <tpScoreboard
+            ref="scoreboard"
             :objective-score="studentPaper.objectiveScore"
             :paper-mark-sign="paperMarkSign"
             :sign-item="signItem"
@@ -244,6 +246,7 @@
             :student-paper-id="studentPaper.id"
             :score-step="studentPaper.scoreStep"
             :mark-task-id="task.id"
+            :exam-type="examType"
             @submitMark="getNext"
             @changeSign="changeSign"
           ></tpScoreboard>
@@ -373,6 +376,10 @@ export default {
     this.loading = false;
   },
   methods: {
+    showAnswerChange() {
+      this.$refs.scoreboard.showBodyChange();
+      this.$refs.scoreboard.showAnswerChange();
+    },
     getTags() {
       this.$http.get(MARKING_API + "/markResults/tag").then((response) => {
         this.tags = response.data;
@@ -543,7 +550,6 @@ export default {
       this.changeTasks = tempData;
     },
     async getPaper() {
-      console.log("getPaper");
       var self = this;
       await self.$http
         .get(DATA_PROCESS_API + "/studentPapers?markTaskId=" + self.task.id)
@@ -552,7 +558,6 @@ export default {
             self.studentPaper = response.data.data;
             self.examType = self.studentPaper.examType;
             self.paperMark = true;
-            console.log("paper", self.studentPaper);
           } else {
             if (response.data.resultCode == "1") {
               self.$notify({

+ 12 - 0
src/modules/marking/views/TpMain.vue

@@ -173,6 +173,9 @@ export default {
       }
     },
     studentPaper() {
+      this.$nextTick(() => {
+        this.$emit("showAnswerChange");
+      });
       if (this.markSign) {
         this.intMarkDraw();
       }
@@ -540,6 +543,15 @@ img {
   background: rgb(250, 250, 250);
   overflow-wrap: break-word;
 }
+.paper >>> .right-answer {
+  border: 1px solid #ccc;
+  border-radius: 5px;
+  margin: 10px;
+  padding: 0 10px;
+  background: rgb(250, 250, 250);
+  color: rgb(85, 191, 255);
+  overflow-wrap: break-word;
+}
 .paper >>> .right-font {
   font-weight: bold;
   color: rgb(85, 191, 255);

+ 42 - 0
src/modules/marking/views/TpScoreBoard.vue

@@ -12,6 +12,10 @@
           inactive-color="#13ce66"
         ></el-switch>
       </div>
+      <div v-show="examType != 'OFFLINE'" class="first-board">
+        <el-checkbox v-model="showBody">显示题干</el-checkbox
+        ><el-checkbox v-model="showAnswer">显示标答</el-checkbox>
+      </div>
       <div class="second-board">
         <div class="board-title"><span>总分</span></div>
         <div class="board-score">
@@ -266,9 +270,15 @@ export default {
       type: Number,
       default: 0.5,
     },
+    examType: {
+      type: String,
+      default: "",
+    },
   },
   data() {
     return {
+      showBody: true,
+      showAnswer: true,
       resultItemsData: this.resultItems,
       signOptionData: this.signOption,
       signScoresData: this.signScores,
@@ -415,12 +425,44 @@ export default {
         this.initKeyBoardMode();
       }
     },
+    showAnswer: {
+      immediate: false,
+      handler() {
+        this.showAnswerChange();
+      },
+    },
+    showBody: {
+      immediate: false,
+      handler() {
+        this.showBodyChange();
+      },
+    },
   },
   created() {
     this.getTags();
   },
   methods: {
     ...mapActions([USER_SIGNOUT]),
+    showAnswerChange() {
+      if (this.examType == "OFFLINE") {
+        return;
+      }
+      var es = Array.from(document.getElementsByClassName("right-answer"));
+      var displayVal = this.showAnswer ? "block" : "none";
+      es.forEach((element) => {
+        element.style.display = displayVal;
+      });
+    },
+    showBodyChange() {
+      if (this.examType == "OFFLINE") {
+        return;
+      }
+      var es = Array.from(document.getElementsByClassName("question-body"));
+      var displayVal = this.showBody ? "block" : "none";
+      es.forEach((element) => {
+        element.style.display = displayVal;
+      });
+    },
     resetProblem() {
       if (this.markedResultData.tag) {
         this.markedResultData.tag = "";