Ver código fonte

v1.3新增小版本需求完成

zhangjie 4 anos atrás
pai
commit
e9d5382499

+ 3 - 1
src/App.vue

@@ -1,5 +1,7 @@
 <template>
   <div id="app">
-    <router-view />
+    <keep-alive include="home">
+      <router-view />
+    </keep-alive>
   </div>
 </template>

+ 4 - 0
src/assets/styles/element-ui-costom.scss

@@ -161,6 +161,7 @@
 .el-button--primary {
   color: $--color-white;
   border-color: $--color-primary;
+  background: $--color-primary;
   background-image: linear-gradient(
     -90deg,
     $--color-success 0%,
@@ -171,6 +172,7 @@
   &:focus {
     color: $--color-white;
     border-color: $--color-primary;
+    background: $--color-primary;
     background-image: linear-gradient(
       -90deg,
       mix($--color-white, $--color-success, 20%) 0%,
@@ -181,6 +183,7 @@
 .el-button--warning {
   color: $--color-white;
   border-color: $--color-warning-lighter;
+  background: $--color-warning-lighter;
   background-image: linear-gradient(
     -90deg,
     $--color-warning-lighter 0%,
@@ -191,6 +194,7 @@
   &:focus {
     color: $--color-white;
     border-color: $--color-warning-lighter;
+    background: $--color-warning-lighter;
     background-image: linear-gradient(
       -90deg,
       mix($--color-white, $--color-warning-lighter, 20%) 0%,

+ 108 - 0
src/components/UploadFileDialog.vue

@@ -0,0 +1,108 @@
+<template>
+  <el-dialog
+    class="upload-file-dialog"
+    :visible.sync="modalIsShow"
+    title="上传文件"
+    top="10vh"
+    width="710px"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    @opened="visibleChange"
+  >
+    <div class="file-upload-body">
+      <upload-file-view
+        input-width="270px"
+        :format="format"
+        :upload-url="uploadUrl"
+        @upload-error="uplaodError"
+        @upload-success="uploadSuccess"
+        ref="UploadFileView"
+      ></upload-file-view>
+      <el-button @click="toPreview" style="margin-left: 10px;">预览</el-button>
+    </div>
+    <div slot="footer" style="text-align: right">
+      <el-button type="primary" @click="confirm">保存</el-button>
+      <el-button @click="cancel">返回</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import UploadFileView from "./UploadFileView";
+import { attachmentPreview } from "@/modules/login/api";
+
+export default {
+  name: "upload-file-dialog",
+  components: { UploadFileView },
+  props: {
+    paperAttachment: {
+      type: Object,
+      default() {
+        return {};
+      }
+    },
+    format: {
+      type: Array,
+      default() {
+        return ["xls", "xlsx"];
+      }
+    }
+  },
+  data() {
+    return {
+      modalIsShow: false,
+      attachment: {},
+      // import
+      uploadUrl: "/api/print/basic/sys/saveAttachment"
+    };
+  },
+  methods: {
+    visibleChange() {
+      this.$refs.UploadFileView.setAttachmentName(
+        `${this.paperAttachment.filename || ""}`
+      );
+      this.attachment = { ...this.paperAttachment };
+    },
+    // upload-handler
+    uplaodError(errorData) {
+      this.$notify.error({
+        title: "错误提示",
+        message: errorData.message
+      });
+    },
+    uploadSuccess(res) {
+      this.$message.success("上传成功!");
+      let infos = {
+        attachmentId: res.data.id,
+        filename: `${res.data.name}${res.data.type}`
+      };
+      this.attachment = Object.assign(this.attachment, infos);
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    confirm() {
+      this.$emit("confirm", this.attachment);
+      this.cancel();
+    },
+    async toPreview() {
+      if (!this.attachment.attachmentId) {
+        this.$message.error("请先上传附件!");
+        return;
+      }
+      const data = await attachmentPreview(this.attachment.attachmentId);
+      window.open(data.path);
+    }
+  }
+};
+</script>
+
+<style lang="css" scoped>
+.file-upload-body {
+  min-height: 150px;
+}
+</style>

+ 0 - 0
src/modules/exam-center/components/UploadFileView.vue → src/components/UploadFileView.vue


+ 6 - 1
src/modules/base/api.js

@@ -36,7 +36,12 @@ export const saveWarningRule = datas => {
 export const importExtendColums = datas => {
   return $post("/api/print/basic/cardRule/impExtendColums", datas);
 };
-
+export const checkinExamList = schoolId => {
+  return $get("/api/print/basic/checkin/exam/listPage", { schoolId });
+};
+export const saveCheckinExam = datas => {
+  return $post("/api/print/basic/checkin/save", datas);
+};
 // course-manage
 export const courseListPage = datas => {
   return $get("/api/print/basic/course/list", datas);

+ 102 - 0
src/modules/base/components/RuleExamroom.vue

@@ -0,0 +1,102 @@
+<template>
+  <div class="rule-examroom">
+    <div class="part-box">
+      <el-table ref="TableList" :data="dataList" border stripe>
+        <el-table-column prop="schoolId" label="学校ID"></el-table-column>
+        <el-table-column prop="schoolName" label="学校名称"></el-table-column>
+        <el-table-column prop="createTime" label="上传时间"></el-table-column>
+        <el-table-column label="操作" align="center">
+          <template slot-scope="scope">
+            <el-button
+              class="btn-table-icon"
+              type="text"
+              icon="icon icon-upload-act"
+              @click="toUpload(scope.row)"
+              title="上传"
+            ></el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="part-page">
+        <el-pagination
+          background
+          layout="prev, pager, next"
+          :current-page="current"
+          :total="total"
+          :page-size="size"
+          @current-change="toPage"
+          hide-on-single-page
+        >
+        </el-pagination>
+      </div>
+    </div>
+
+    <upload-file-dialog
+      :paper-attachment="curAttachment"
+      :format="['pdf']"
+      @confirm="uploadConfirm"
+      ref="UploadFileDialog"
+    ></upload-file-dialog>
+  </div>
+</template>
+
+<script>
+import { checkinExamList, saveCheckinExam } from "../api";
+import UploadFileDialog from "@/components/UploadFileDialog";
+
+export default {
+  name: "rule-examroom",
+  components: { UploadFileDialog },
+  data() {
+    return {
+      schoolId: this.$ls.get("schoolId"),
+      dataList: [],
+      current: 1,
+      size: this.GLOBAL.pageSize,
+      total: 0,
+      curAttachment: {},
+      curCheckinExam: {}
+    };
+  },
+  mounted() {
+    this.toPage(1);
+  },
+  methods: {
+    async getList() {
+      const data = await checkinExamList(this.schoolId);
+      this.dataList = data.records;
+      this.total = data.total;
+    },
+    toPage(page) {
+      this.current = page;
+      this.getList();
+    },
+    toUpload(row) {
+      this.curCheckinExam = row;
+      this.curAttachment = {
+        attachmentId: row.attachmentId,
+        filename: ""
+      };
+      this.$refs.UploadFileDialog.open();
+      console.log(row);
+    },
+    async uploadConfirm(attachment) {
+      const datas = {
+        attachmentId: attachment.attachmentId,
+        createId: "",
+        id: this.curCheckinExam.id,
+        schoolId: this.curCheckinExam.schoolId,
+        updateId: ""
+      };
+      const userId = this.$ls.get("user", { id: "" }).id;
+      const modInfo = this.curCheckinExam.id
+        ? { updateId: userId }
+        : { createId: userId };
+      await saveCheckinExam(Object.assign(datas, modInfo));
+
+      this.$message.success("编辑成功!");
+      this.getList();
+    }
+  }
+};
+</script>

+ 7 - 5
src/modules/base/views/RuleManage.vue

@@ -9,26 +9,28 @@
         >{{ item.name }}</el-button
       >
     </div>
-    <rule-card v-if="curMenu.id === '1'"></rule-card>
-    <rule-warning v-else></rule-warning>
+    <component :is="curMenu.component"></component>
   </div>
 </template>
 
 <script>
 import RuleCard from "../components/RuleCard";
 import RuleWarning from "../components/RuleWarning";
+import RuleExamroom from "../components/RuleExamroom";
 
 export default {
   name: "rule-manage",
   components: {
     RuleCard,
-    RuleWarning
+    RuleWarning,
+    RuleExamroom
   },
   data() {
     return {
       menus: [
-        { id: "1", name: "题卡规则" },
-        { id: "2", name: "预警规则" }
+        { id: "1", name: "题卡规则", component: "rule-card" },
+        { id: "2", name: "预警规则", component: "rule-warning" },
+        { id: "3", name: "考场情况登记表", component: "rule-examroom" }
       ],
       curMenu: {}
     };

+ 1 - 0
src/modules/card/views/CardDesign.vue

@@ -633,6 +633,7 @@ export default {
     this.$ls.remove("cardDetailId");
     this.$ls.remove("prepareTcPCard");
     this.initState();
+    delete window.submitCardTemp;
   }
 };
 </script>

+ 3 - 3
src/modules/exam-center/components/UploadPaperDialog.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-    class="file-upload-view"
+    class="upload-paper-dialog"
     :visible.sync="modalIsShow"
     :title="`上传${curConfig.title}`"
     top="10vh"
@@ -41,11 +41,11 @@
 </template>
 
 <script>
-import UploadFileView from "../components/UploadFileView";
+import UploadFileView from "@/components/UploadFileView";
 import { attachmentPreview } from "../../login/api";
 
 export default {
-  name: "file-upload-view",
+  name: "upload-paper-dialog",
   components: { UploadFileView },
   props: {
     paperAttachment: {

+ 27 - 0
src/modules/exam-center/views/ExamManage.vue

@@ -62,6 +62,12 @@
           <el-button type="warning" icon="icon icon-plus" @click="toAdd"
             >新建考试</el-button
           >
+          <el-button
+            type="warning"
+            icon="icon icon-download"
+            @click="toExportPackageData"
+            >导出卷袋贴条码核对数据</el-button
+          >
         </el-form-item>
       </el-form>
     </div>
@@ -290,6 +296,27 @@ export default {
       if (!data) return;
       this.$message.success("文件已开始下载!");
     },
+    async toExportPackageData() {
+      let load = this.$message({
+        iconClass: "el-message__icon el-icon-loading",
+        message: "Loading...",
+        duration: 0
+      });
+      const data = await download({
+        type: "get",
+        url: "/api/print/exam/exam/expPaperCodeCheckData",
+        fileName: `卷袋贴条码核对数据.xls`,
+        header: {
+          token: this.$ls.get("token")
+        }
+      }).catch(error => {
+        this.$message.error(error);
+      });
+
+      load.close();
+      if (!data) return;
+      this.$message.success("文件已开始下载!");
+    },
     toDetail(row) {
       this.$router.push({
         name: "ExamRomeDetail",

+ 6 - 2
src/modules/exam-center/views/ExamModify.vue

@@ -159,7 +159,11 @@
           style="width: 420px;"
           border
         >
-          <el-table-column prop="courseName" label="科目"></el-table-column>
+          <el-table-column prop="courseName" label="科目">
+            <span slot-scope="scope">
+              {{ scope.row.courseName }}({{ scope.row.courseCode }})
+            </span>
+          </el-table-column>
           <el-table-column label="命题老师" width="180px">
             <template slot-scope="scope">
               <el-select
@@ -209,7 +213,7 @@ import {
 import { uploadExam, examDetail } from "../api";
 import BusinessData from "../components/BusinessData";
 import ExamPlanData from "../components/ExamPlanData";
-import UploadFileView from "../components/UploadFileView";
+import UploadFileView from "@/components/UploadFileView";
 
 export default {
   name: "exam-modify",

+ 7 - 2
src/modules/exam-center/views/TopicTaskModify.vue

@@ -37,13 +37,14 @@
           placeholder="请选择"
           @change="courseChange"
           clearable
+          filterable
           v-if="!isEdit"
         >
           <el-option
             v-for="item in courses"
             :key="item.courseCode"
             :value="item.courseCode"
-            :label="item.courseName"
+            :label="item.label"
           ></el-option>
         </el-select>
         <el-input
@@ -170,7 +171,11 @@ export default {
       });
     },
     async getCourses() {
-      this.courses = await topicTaskExamCourseList(this.modalForm.examId);
+      const data = await topicTaskExamCourseList(this.modalForm.examId);
+      this.courses = data.map(item => {
+        item.label = `${item.courseName}(${item.courseCode})`;
+        return item;
+      });
     },
     async getTeachers() {
       this.teachers = await topicTaskExamTeacherList(this.modalForm.courseCode);

+ 1 - 1
src/modules/login/views/Login.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="login login-box">
-    <div class="login-body">
+    <div class="login-body" @keyup.enter="submit('loginForm')">
       <div class="login-title">
         <h1>逸教云</h1>
       </div>

+ 6 - 0
src/views/Home.vue

@@ -374,6 +374,12 @@ export default {
       this.switchNav(subNo);
       this.showMenu();
     }
+  },
+  beforeRouteLeave(to, from, next) {
+    if (to.name === "Login") {
+      this.$destroy();
+    }
+    next();
   }
 };
 </script>