Explorar o código

考生承诺书样式调整

Michael Wang %!s(int64=3) %!d(string=hai) anos
pai
achega
29919f0e3c

+ 74 - 0
src/features/OnlineExam/CommittmentDialog.vue

@@ -0,0 +1,74 @@
+<template>
+  <Modal
+    ref="modalRef"
+    title="考生承诺书"
+    footer-hide
+    width="800"
+    :closable="false"
+    :mask-closable="false"
+  >
+    <div style="font-size: 16px">
+      <div class="privacy-content" v-html="content"></div>
+
+      <div style="display: flex; justify-content: center; margin-top: 10px">
+        <i-button
+          style="margin: 0; margin-right: 5px; width: 150px"
+          class="qm-primary-button"
+          @click="onOk"
+        >
+          同意
+        </i-button>
+        <i-button
+          style="margin: 0; margin-right: 5px; width: 150px"
+          class="qm-primary-button"
+          @click="onDecline"
+        >
+          拒绝
+        </i-button>
+      </div>
+    </div>
+  </Modal>
+</template>
+
+<script>
+export default {
+  name: "CommittmentDialog",
+  props: {
+    content: { type: String, default: "" },
+  },
+  methods: {
+    showDialog(resolve, reject) {
+      this.$refs.modalRef.visible = true;
+      this.parentResolve = resolve;
+      this.parentReject = reject;
+      return true;
+    },
+    onOk() {
+      this.parentResolve(true);
+      this.$refs.modalRef.visible = false;
+      this.logger({ action: "考生承诺书", detail: "承诺同意" });
+    },
+    onDecline() {
+      this.parentReject(false);
+      this.$refs.modalRef.visible = false;
+      this.logger({ action: "考生承诺书", detail: "拒绝承诺" });
+    },
+  },
+};
+</script>
+
+<style scoped>
+.home {
+  margin: 20px;
+}
+.privacy-content {
+  font-size: 14px;
+  width: 100%;
+  height: 400px;
+  overflow-y: scroll;
+  text-align: left;
+}
+.privacy-content p {
+  margin-bottom: 5px;
+}
+</style>

+ 10 - 14
src/features/OnlineExam/OnlineExamList.vue

@@ -181,6 +181,10 @@
         @on-close="resumeEnterExam"
       />
     </Modal>
+    <CommittmentDialog
+      ref="committmentDialogRef"
+      :content="committmentHtmlContent"
+    />
   </div>
 </template>
 
@@ -196,6 +200,7 @@ import {
 const { mapState, mapMutations } = createNamespacedHelpers("examHomeModule");
 import CheckComputer from "./CheckComputer";
 import { tryLimit } from "@/utils/tryLimit";
+import CommittmentDialog from "./CommittmentDialog.vue";
 
 export default {
   name: "EcsOnlineList",
@@ -203,6 +208,7 @@ export default {
     "ecs-online-exam-result-list": OnlineExamResultList,
     OnlineExamFaceCheckModal,
     CheckComputer,
+    CommittmentDialog,
   },
   props: {
     courses: {
@@ -234,6 +240,7 @@ export default {
       enterButtonClicked: false,
       overFlowStyle: false,
       selectExamState: "EXAMING",
+      committmentHtmlContent: "",
     };
   },
   computed: {
@@ -413,20 +420,9 @@ export default {
       }
       if (course.showUndertaking) {
         this.logger({ page: "在线考试列表页面", detail: "考生承诺书" });
-        const res = await new Promise((resolve) => {
-          this.$Modal.confirm({
-            title: "考生承诺书",
-            content: course.undertaking,
-            onOk: () => {
-              this.logger({ action: "考生承诺书", detail: "承诺同意" });
-              resolve(true);
-            },
-
-            onCancel: () => {
-              this.logger({ action: "考生承诺书", detail: "拒绝承诺" });
-              resolve(false);
-            },
-          });
+        const res = await new Promise((resolve, reject) => {
+          this.committmentHtmlContent = course.undertaking;
+          this.$refs.committmentDialogRef.showDialog(resolve, reject);
         });
         if (!res) {
           return;