zhangjie 2 éve
szülő
commit
7e91197174

+ 59 - 0
card/assets/styles/card-preview.scss

@@ -1508,6 +1508,65 @@
     }
   }
 }
+// elem-undertaking
+.elem-undertaking {
+  position: absolute;
+  width: 60px;
+  top: 60px;
+  bottom: 60px;
+  right: 10px;
+  font-size: 12px;
+  line-height: 15px;
+
+  .para-text {
+    width: 15px;
+    text-align: center;
+    position: absolute;
+    top: 0;
+
+    span {
+      display: inline-block;
+      transform: rotate(90deg);
+      -webkit-transform: rotate(90deg);
+    }
+    em {
+      display: inline-block;
+      margin-left: 5px;
+      margin-bottom: 5px;
+      height: 10px;
+      line-height: 10px;
+    }
+  }
+  .para-title {
+    right: 0;
+    top: 50%;
+    transform: translateY(-50%);
+    -webkit-transform: translateY(-50%);
+  }
+  .para-cl {
+    right: 15px;
+  }
+  .para-body {
+    right: 30px;
+    height: 100%;
+    width: 30px;
+
+    > p {
+      display: block;
+      width: 15px;
+      height: 100%;
+      float: right;
+      &:first-child {
+        padding-top: 30px;
+      }
+    }
+  }
+  .para-std {
+    bottom: 150px;
+    top: auto;
+    left: 0;
+  }
+}
 
 // card-free-preview
 .card-free-preview {

+ 56 - 0
card/assets/styles/card-temp.css

@@ -1259,6 +1259,62 @@
   padding: 0;
 }
 
+.elem-undertaking {
+  position: absolute;
+  width: 60px;
+  top: 60px;
+  bottom: 60px;
+  right: 10px;
+  font-size: 12px;
+  line-height: 15px;
+}
+.elem-undertaking .para-text {
+  width: 15px;
+  text-align: center;
+  position: absolute;
+  top: 0;
+}
+.elem-undertaking .para-text span {
+  display: inline-block;
+  transform: rotate(90deg);
+  -webkit-transform: rotate(90deg);
+}
+.elem-undertaking .para-text em {
+  display: inline-block;
+  margin-left: 5px;
+  margin-bottom: 5px;
+  height: 10px;
+  line-height: 10px;
+}
+.elem-undertaking .para-title {
+  right: 0;
+  top: 50%;
+  transform: translateY(-50%);
+  -webkit-transform: translateY(-50%);
+}
+.elem-undertaking .para-cl {
+  right: 15px;
+}
+.elem-undertaking .para-body {
+  right: 30px;
+  height: 100%;
+  width: 30px;
+}
+.elem-undertaking .para-body > p {
+  display: block;
+  width: 15px;
+  height: 100%;
+  float: right;
+}
+.elem-undertaking .para-body > p:first-child {
+  padding-top: 30px;
+}
+.elem-undertaking .para-std {
+  bottom: 150px;
+  top: auto;
+  left: 0;
+}
+
 .card-free-preview:not(.card-print) {
   padding: 10px 0;
   background-color: #f0f0f0;

+ 7 - 1
card/components/CardDesign.vue

@@ -193,6 +193,10 @@
               :total="pages.length"
               :current="pageNo + 1"
             ></page-number>
+            <elem-undertaking
+              v-if="cardConfig.undertakingEnable && pageNo % 2 === 1"
+              :content="cardConfig.undertakingBody"
+            ></elem-undertaking>
           </div>
         </div>
       </div>
@@ -274,6 +278,7 @@ import PageNumber from "../components/PageNumber";
 import PaperParams from "../components/PaperParams";
 import CardHeadSample from "../elements/card-head/CardHead";
 import TopicSelectDialog from "../components/TopicSelectDialog";
+import ElemUndertaking from "../elements/undertaking/ElemUndertaking.vue";
 import timeMixin from "../mixins/timeMixin";
 
 export default {
@@ -306,6 +311,7 @@ export default {
     PageNumber,
     PaperParams,
     TopicSelectDialog,
+    ElemUndertaking,
   },
   data() {
     return {
@@ -338,7 +344,7 @@ export default {
   },
   mounted() {
     this.initCard();
-    this.openAutoSave();
+    // this.openAutoSave();
   },
   beforeDestroy() {
     this.initState();

+ 6 - 1
card/components/CardView.vue

@@ -76,6 +76,10 @@
             :total="pages.length"
             :current="pageNo + 1"
           ></page-number>
+          <elem-undertaking
+            v-if="cardConfig.undertakingEnable && pageNo % 2 === 1"
+            :content="cardConfig.undertakingBody"
+          ></elem-undertaking>
         </div>
       </div>
     </template>
@@ -84,13 +88,14 @@
 
 <script>
 import TopicElementPreview from "./TopicElementPreview";
+import ElemUndertaking from "../elements/undertaking/ElemUndertaking.vue";
 import PageNumber from "./PageNumber";
 import previewTemp from "../previewTemp";
 import exchangeMixins from "../mixins/exchange";
 
 export default {
   name: "card-view",
-  components: { TopicElementPreview, PageNumber },
+  components: { TopicElementPreview, PageNumber, ElemUndertaking },
   mixins: [exchangeMixins],
   props: {
     pages: {

+ 22 - 3
card/components/PagePropEdit.vue

@@ -42,7 +42,7 @@
       <!-- <el-form-item label="禁答区域">
         <el-checkbox
           v-model="form.showForbidArea"
-          @change="showForbidAreaChange"
+          @change="cardConfigChange"
           >启用</el-checkbox
         >
       </el-form-item> -->
@@ -56,10 +56,24 @@
           >查看题卡结构<i class="el-icon-arrow-right"></i
         ></el-button>
       </el-form-item>
+      <el-form-item label="考生承诺书" label-width="80px">
+        <el-checkbox v-model="form.undertakingEnable" @change="cardConfigChange"
+          >启用</el-checkbox
+        >
+        <el-button
+          v-if="form.undertakingEnable"
+          type="text"
+          class="btn-primary ml-2"
+          @click="toEditUndertaking"
+          >编辑</el-button
+        >
+      </el-form-item>
     </el-form>
 
     <!-- PageStructDialog -->
     <page-struct-dialog ref="PageStructDialog"></page-struct-dialog>
+    <!-- EditUndertaking -->
+    <edit-undertaking ref="EditUndertaking"></edit-undertaking>
   </div>
 </template>
 
@@ -67,6 +81,7 @@
 import { mapState, mapMutations, mapActions } from "vuex";
 import { objAssign } from "../plugins/utils";
 import PageStructDialog from "./PageStructDialog.vue";
+import EditUndertaking from "../elements/undertaking/EditUndertaking.vue";
 
 const COLUMN_OPTIONS = [
   {
@@ -101,7 +116,7 @@ const COLUMN_OPTIONS = [
 
 export default {
   name: "page-prop-edit",
-  components: { PageStructDialog },
+  components: { PageStructDialog, EditUndertaking },
   data() {
     return {
       columnOptions: [],
@@ -113,6 +128,7 @@ export default {
         columnGap: 4,
         aOrB: false,
         showForbidArea: false,
+        undertakingEnable: false,
       },
       prePageSize: "A3",
     };
@@ -168,7 +184,7 @@ export default {
       this.setTopicSeries([]);
       this.$emit("init-page");
     },
-    showForbidAreaChange() {
+    cardConfigChange() {
       this.setCardConfig(this.form);
     },
     configChange() {
@@ -199,6 +215,9 @@ export default {
     toViewStruct() {
       this.$refs.PageStructDialog.open();
     },
+    toEditUndertaking() {
+      this.$refs.EditUndertaking.open();
+    },
   },
 };
 </script>

+ 2 - 1
card/elements/card-head/cardHeadSpin/HeadNotice.vue

@@ -30,7 +30,8 @@ export default {
       ];
     },
     notices() {
-      return this.data.attention.split("\n") || [];
+      const conts = this.data.attention.split("\n") || [];
+      return conts.map((item) => item.trim()).filter((item) => !!item);
     },
   },
   methods: {},

+ 119 - 0
card/elements/undertaking/EditUndertaking.vue

@@ -0,0 +1,119 @@
+<template>
+  <el-dialog
+    class="edit-undertaking edit-dialog"
+    :visible.sync="modalIsShow"
+    title="编辑承诺书"
+    top="10vh"
+    width="640px"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    :before-close="cancel"
+    append-to-body
+    @open="initData"
+  >
+    <h3 class="ut-title">考生承诺书</h3>
+    <p>本人郑重承诺:</p>
+    <el-form
+      ref="modalFormComp"
+      :model="modalForm"
+      :rules="rules"
+      label-width="0"
+    >
+      <el-form-item prop="undertakingBody">
+        <el-input
+          type="textarea"
+          :rows="4"
+          placeholder="请输入内容"
+          v-model="modalForm.undertakingBody"
+          maxlength="100"
+          show-word-limit
+          class="ut-textarea"
+          @input="contentChange"
+        >
+        </el-input>
+      </el-form-item>
+    </el-form>
+    <p class="ut-std">承诺人(签名):</p>
+
+    <div slot="footer">
+      <el-button type="primary" @click="submit">确认</el-button>
+      <el-button @click="cancel">取消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { mapState, mapMutations } from "vuex";
+
+export default {
+  name: "edit-undertaking",
+  props: {
+    instance: {
+      type: Object,
+      default() {
+        return {};
+      },
+    },
+  },
+  data() {
+    return {
+      modalForm: { undertakingBody: "" },
+      modalIsShow: false,
+      rules: {
+        undertakingBody: [
+          {
+            required: true,
+            message: "请输入文本内容",
+            trigger: "change",
+          },
+        ],
+      },
+    };
+  },
+  computed: {
+    ...mapState("card", ["cardConfig"]),
+  },
+  methods: {
+    ...mapMutations("card", ["setCardConfig"]),
+    initData() {
+      this.modalForm = {
+        undertakingBody: this.cardConfig.undertakingBody,
+      };
+    },
+    contentChange() {
+      this.modalForm.undertakingBody = this.modalForm.undertakingBody.replace(
+        "\n",
+        ""
+      );
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    async submit() {
+      const valid = await this.$refs.modalFormComp.validate().catch(() => {});
+      if (!valid) return;
+      this.setCardConfig(this.modalForm);
+      this.cancel();
+    },
+  },
+};
+</script>
+
+<style scoped>
+.ut-title {
+  text-align: center;
+}
+.ut-std {
+  text-align: right;
+  margin-right: 100px;
+}
+.ut-textarea >>> .el-textarea__inner {
+  padding: 5px;
+  text-indent: 28px;
+  font-size: 14px;
+  margin: 0 -5px;
+}
+</style>

+ 46 - 0
card/elements/undertaking/ElemUndertaking.vue

@@ -0,0 +1,46 @@
+<template>
+  <div class="elem-undertaking">
+    <h3 class="para-text para-title">考生承诺书</h3>
+    <p class="para-text para-cl">本人郑重承诺<em>:</em></p>
+    <div class="para-text para-body">
+      <p v-for="(cont, index) in contentList" :key="index" v-html="cont"></p>
+    </div>
+    <p class="para-text para-std">
+      承诺人<span>(</span>签名 <span>)</span> :
+    </p>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "elem-undertaking",
+  props: {
+    content: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {};
+  },
+  computed: {
+    contentList() {
+      let len = this.content.length;
+      const maxParaCharCount = 65;
+      const count = Math.ceil(len / maxParaCharCount);
+      let conts = [];
+      for (let i = 0; i < count; i++) {
+        let cont = this.content.substring(
+          i * maxParaCharCount,
+          (i + 1) * maxParaCharCount
+        );
+        cont = cont.replace(/([((【】))])/g, "<span>$1</span>");
+        cont = cont.replace(/([,。?])/g, "<em>$1</em>");
+        conts[i] = cont;
+      }
+      return conts;
+    },
+  },
+  methods: {},
+};
+</script>

+ 3 - 0
card/enumerate.js

@@ -96,3 +96,6 @@ export const SHORTCUT_KEYS = [
     keys: ["Ctrl", "Shift", "S"],
   },
 ];
+
+export const UNDERTAKING_BODY =
+  "在考试过程中,严格遵守考场纪律,服从监考老师安排,不请他(她)人代考,不将通讯设备、电子设备带入考场,不携带与有考试内容相关的纸质材料,不扰乱考场秩序,如违反,自愿承担相应责任。";

+ 5 - 0
card/modules/free/components/ElementTierEdit.vue

@@ -80,6 +80,11 @@ export default {
       );
       if (columnIndex === -1) return;
       this.selectColumn(this.curPage.columns[columnIndex]);
+
+      this.$nextTick(() => {
+        const tierDom = document.getElementById(`tier-${this.curElement.id}`);
+        this.$refs.TierList.scrollTop = tierDom.offsetTop;
+      });
     },
   },
   methods: {

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
card/previewTemp.js


+ 3 - 0
src/modules/card/views/CardEdit.vue

@@ -29,6 +29,7 @@ import CardFreeDesign from "../../../../card/modules/free/components/CardFreeDes
 import CardPreviewDialog from "../components/CardPreviewDialog.vue";
 import { examRuleDetail } from "../../base/api";
 import { getEnums } from "../../login/api";
+import { UNDERTAKING_BODY } from "../../../../card/enumerate";
 
 export default {
   name: "card-edit",
@@ -155,6 +156,8 @@ export default {
             columnNumber: 2,
             columnGap: 20,
             showForbidArea: false,
+            undertakingEnable: false,
+            undertakingBody: UNDERTAKING_BODY,
             cardDesc: "",
             makeMethod: this.prepareTcPCard.makeMethod,
           },

+ 15 - 10
vue.config.js

@@ -5,7 +5,7 @@ var package = require("./package.json");
 var v = package.version;
 const timestamp = Date.now();
 
-module.exports = defineConfig({
+let config = {
   transpileDependencies: true,
   // publicPath: './',
   devServer: {
@@ -22,16 +22,21 @@ module.exports = defineConfig({
     },
   },
   productionSourceMap: false,
-  configureWebpack: {
-    output: {
-      filename: `js/[name].${v}.${timestamp}.js`,
-      chunkFilename: `js/[name].${v}.${timestamp}.js`,
-    },
-  },
-  css: {
+};
+
+if (process.env.NODE_ENV === "production") {
+  config.css = Object.assign(config.css || {}, {
     extract: {
       filename: `css/[name].${v}.${timestamp}.css`,
       chunkFilename: `css/[name].${v}.${timestamp}.css`,
     },
-  },
-});
+  });
+  config.configureWebpack = Object.assign(config.configureWebpack || {}, {
+    output: {
+      filename: `js/[name].${v}.${timestamp}.js`,
+      chunkFilename: `js/[name].${v}.${timestamp}.js`,
+    },
+  });
+}
+
+module.exports = defineConfig(config);

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott