zhangjie hace 3 años
padre
commit
43ce444a2f

+ 36 - 26
src/assets/styles/adaptive.scss

@@ -1,26 +1,36 @@
-@media screen and (min-width: 1440px) {
-  // home
-  .home-breadcrumb {
-    font-size: $--font-size-base;
-
-    .el-breadcrumb {
-      font-size: $--font-size-base;
-    }
-  }
-  .custom-tree-node {
-    font-size: $--font-size-base;
-  }
-  // element-ui
-  .el-form {
-    &--label-top {
-      .el-form-item__label {
-        padding-bottom: 8px;
-        font-size: $--font-size-base;
-      }
-    }
-  }
-  .el-table,
-  .el-button--small.el-button--text {
-    font-size: $--font-size-base;
-  }
-}
+@media screen and (min-width: 1440px) {
+  // home
+  .home-header {
+    .menu-list {
+      li {
+        padding: 10px 25px;
+        span {
+          margin-left: 8px;
+        }
+      }
+    }
+  }
+  .home-breadcrumb {
+    font-size: $--font-size-base;
+
+    .el-breadcrumb {
+      font-size: $--font-size-base;
+    }
+  }
+  .custom-tree-node {
+    font-size: $--font-size-base;
+  }
+  // element-ui
+  .el-form {
+    &--label-top {
+      .el-form-item__label {
+        padding-bottom: 8px;
+        font-size: $--font-size-base;
+      }
+    }
+  }
+  .el-table,
+  .el-button--small.el-button--text {
+    font-size: $--font-size-base;
+  }
+}

+ 341 - 341
src/assets/styles/home.scss

@@ -1,341 +1,341 @@
-/* home */
-.home {
-  position: absolute;
-  width: 100%;
-  height: 100%;
-  z-index: auto;
-}
-.home-body {
-  position: absolute;
-  left: 0;
-  top: 50px;
-  right: 0;
-  bottom: 0;
-  overflow: auto;
-  background: $--color-background;
-  z-index: 98;
-}
-.home-main {
-  position: relative;
-  padding: 20px 30px 50px 250px;
-  min-height: 100%;
-}
-
-/* navs */
-.home-navs {
-  position: absolute;
-  width: 220px;
-  top: 0;
-  left: 0;
-  bottom: 0;
-  z-index: 100;
-  overflow: auto;
-  font-size: 14px;
-  background: $--color-white;
-  border-top-right-radius: $--border-radius-huge;
-  border-bottom-right-radius: $--border-radius-huge;
-
-  &::before {
-    content: "";
-    display: block;
-    position: absolute;
-    height: 100%;
-    width: 1px;
-    right: 0;
-    bottom: 0;
-    z-index: 9;
-    background: rgba(229, 229, 229, 1);
-  }
-
-  .head-logo {
-    padding: 0 40px;
-    font-size: 20px;
-    line-height: 40px;
-    text-align: center;
-    &-content {
-      display: block;
-      padding: 30px 0;
-      border-bottom: 1px solid #eff0f5;
-    }
-    img {
-      display: block;
-      max-width: 160px;
-      height: 40px;
-    }
-  }
-
-  .nav-part {
-    padding: 20px 0;
-    border-top: 1px solid $--color-border;
-  }
-
-  .nav-head {
-    padding: 10px 0;
-    color: $--color-text-gray-2;
-    font-size: $--font-size-base;
-    line-height: 20px;
-    position: relative;
-    font-weight: 500;
-    > span {
-      display: inline-block;
-      vertical-align: top;
-      font-weight: 600;
-    }
-    &-right-icon {
-      position: absolute;
-      right: 0;
-      top: 50%;
-      transform: translateY(-50%);
-      color: #d3d5e0;
-      font-size: 12px;
-    }
-  }
-
-  // .nav-list {
-  //   padding: 0 0 0 23px;
-  // }
-  .nav-item {
-    overflow: hidden;
-    color: $--color-text-dark-1;
-    &-main {
-      padding: 10px 0;
-      line-height: 20px;
-      position: relative;
-      font-weight: 500;
-      cursor: pointer;
-      &-act,
-      &:hover {
-        font-weight: 600;
-        color: $--color-primary;
-      }
-    }
-    &-icon {
-      display: block;
-      position: absolute;
-      width: 20px;
-      height: 20px;
-      top: 50%;
-      margin-top: -10px;
-      text-align: center;
-      line-height: 20px;
-    }
-    &-icon-right {
-      right: 5px;
-    }
-    &-info {
-      display: block;
-      position: absolute;
-      padding: 0 3px;
-      min-width: 16px;
-      height: 16px;
-      font-size: 12px;
-      line-height: 16px;
-      top: 12px;
-      right: 40px;
-      background-color: $--color-warning;
-      color: #fff;
-      text-align: center;
-      border-radius: 3px;
-    }
-  }
-}
-.el-menu-home {
-  padding-top: 20px;
-  .el-submenu {
-    margin-bottom: 20px;
-  }
-  .el-submenu__title {
-    padding: 0 40px !important;
-    height: 50px;
-    line-height: 50px;
-    font-weight: 600;
-
-    > .icon {
-      margin-right: 12px;
-    }
-  }
-  .el-menu-item {
-    height: auto;
-    min-height: 40px;
-    line-height: 20px;
-    padding: 10px 40px !important;
-    white-space: normal;
-  }
-  .el-menu-item.is-active {
-    font-weight: 600;
-  }
-  .el-submenu__icon-arrow {
-    right: 40px;
-  }
-}
-
-/* head */
-.home-header {
-  position: absolute;
-  width: 100%;
-  height: 50px;
-  top: 0;
-  left: 0;
-  z-index: 99;
-  color: #fff;
-  padding-left: 220px;
-  background-color: $--color-text-dark;
-  overflow: hidden;
-
-  .menu-list {
-    li {
-      display: inline-block;
-      vertical-align: top;
-      padding: 10px 25px;
-      height: 50px;
-      line-height: 30px;
-      opacity: 0.4;
-      font-size: 16px;
-      position: relative;
-      text-align: center;
-      cursor: pointer;
-
-      &:hover {
-        opacity: 1;
-      }
-
-      &.menu-item-act {
-        opacity: 1;
-      }
-
-      span {
-        display: inline-block;
-        vertical-align: top;
-        margin-left: 8px;
-      }
-      .icon {
-        margin-top: -3px;
-      }
-    }
-  }
-  .head-menu {
-    float: left;
-  }
-  .head-user {
-    float: right;
-    padding-right: 10px;
-    li {
-      padding: 10px;
-    }
-    .menu-item-account {
-      white-space: nowrap;
-      padding: 10px;
-      span {
-        max-width: 156px;
-        overflow: hidden;
-        text-overflow: ellipsis;
-      }
-    }
-  }
-  // .head-menu-btn
-  .head-menu-btn {
-    display: none;
-    float: right;
-    line-height: 36px;
-    padding: 12px 15px;
-    text-align: center;
-    > span {
-      display: block;
-      height: 36px;
-      width: 36px;
-      border-radius: 5px;
-      background-color: rgba($color: #fff, $alpha: 0.3);
-    }
-    i {
-      font-size: 22px;
-      vertical-align: middle;
-    }
-  }
-}
-// menu-dialog
-.menu-dialog {
-  .el-dialog.is-fullscreen {
-    border-radius: 0;
-    box-shadow: none;
-
-    .el-dialog__body {
-      padding: 10px;
-      &::after {
-        display: none;
-      }
-    }
-  }
-
-  .menu-logout {
-    padding: 10px;
-    width: 52px;
-    height: 52px;
-    margin: 0 auto;
-    border: 1px solid $--color-text-gray-3;
-    border-radius: 50%;
-    font-size: 30px;
-    text-align: center;
-    color: $--color-text-gray-3;
-    cursor: pointer;
-
-    &:hover {
-      border-color: $--color-danger;
-      color: $--color-danger;
-    }
-  }
-}
-
-// home-breadcrumb
-.home-breadcrumb {
-  margin-bottom: 18px;
-  font-size: 12px;
-  font-weight: 500;
-  color: $--color-text-gray-2;
-
-  .breadcrumb-tips {
-    display: inline-block;
-    vertical-align: middle;
-    > i {
-      margin-top: -2px;
-      margin-right: 8px;
-    }
-  }
-  .el-breadcrumb {
-    line-height: 16px;
-    display: inline-block;
-    vertical-align: middle;
-    font-size: 12px;
-
-    .el-breadcrumb__item {
-      .el-breadcrumb__inner {
-        color: $--color-text-gray-2;
-      }
-    }
-    .el-breadcrumb__separator {
-      margin: 0 5px;
-    }
-  }
-}
-
-// home-view
-
-/* view-footer */
-.home-footer {
-  position: absolute;
-  width: 100%;
-  height: 60px;
-  bottom: 0;
-  left: 0;
-  z-index: auto;
-  padding: 20px 0;
-  line-height: 20px;
-  color: $--color-text-gray-3;
-  text-align: center;
-  font-size: 13px;
-  a {
-    color: $--color-text-gray-3;
-  }
-  a:hover {
-    color: $--color-text-gray;
-  }
-}
+/* home */
+.home {
+  position: absolute;
+  width: 100%;
+  height: 100%;
+  z-index: auto;
+}
+.home-body {
+  position: absolute;
+  left: 0;
+  top: 50px;
+  right: 0;
+  bottom: 0;
+  overflow: auto;
+  background: $--color-background;
+  z-index: 98;
+}
+.home-main {
+  position: relative;
+  padding: 20px 30px 50px 250px;
+  min-height: 100%;
+}
+
+/* navs */
+.home-navs {
+  position: absolute;
+  width: 220px;
+  top: 0;
+  left: 0;
+  bottom: 0;
+  z-index: 100;
+  overflow: auto;
+  font-size: 14px;
+  background: $--color-white;
+  border-top-right-radius: $--border-radius-huge;
+  border-bottom-right-radius: $--border-radius-huge;
+
+  &::before {
+    content: "";
+    display: block;
+    position: absolute;
+    height: 100%;
+    width: 1px;
+    right: 0;
+    bottom: 0;
+    z-index: 9;
+    background: rgba(229, 229, 229, 1);
+  }
+
+  .head-logo {
+    padding: 0 40px;
+    font-size: 20px;
+    line-height: 40px;
+    text-align: center;
+    &-content {
+      display: block;
+      padding: 30px 0;
+      border-bottom: 1px solid #eff0f5;
+    }
+    img {
+      display: block;
+      max-width: 160px;
+      height: 40px;
+    }
+  }
+
+  .nav-part {
+    padding: 20px 0;
+    border-top: 1px solid $--color-border;
+  }
+
+  .nav-head {
+    padding: 10px 0;
+    color: $--color-text-gray-2;
+    font-size: $--font-size-base;
+    line-height: 20px;
+    position: relative;
+    font-weight: 500;
+    > span {
+      display: inline-block;
+      vertical-align: top;
+      font-weight: 600;
+    }
+    &-right-icon {
+      position: absolute;
+      right: 0;
+      top: 50%;
+      transform: translateY(-50%);
+      color: #d3d5e0;
+      font-size: 12px;
+    }
+  }
+
+  // .nav-list {
+  //   padding: 0 0 0 23px;
+  // }
+  .nav-item {
+    overflow: hidden;
+    color: $--color-text-dark-1;
+    &-main {
+      padding: 10px 0;
+      line-height: 20px;
+      position: relative;
+      font-weight: 500;
+      cursor: pointer;
+      &-act,
+      &:hover {
+        font-weight: 600;
+        color: $--color-primary;
+      }
+    }
+    &-icon {
+      display: block;
+      position: absolute;
+      width: 20px;
+      height: 20px;
+      top: 50%;
+      margin-top: -10px;
+      text-align: center;
+      line-height: 20px;
+    }
+    &-icon-right {
+      right: 5px;
+    }
+    &-info {
+      display: block;
+      position: absolute;
+      padding: 0 3px;
+      min-width: 16px;
+      height: 16px;
+      font-size: 12px;
+      line-height: 16px;
+      top: 12px;
+      right: 40px;
+      background-color: $--color-warning;
+      color: #fff;
+      text-align: center;
+      border-radius: 3px;
+    }
+  }
+}
+.el-menu-home {
+  padding-top: 20px;
+  .el-submenu {
+    margin-bottom: 20px;
+  }
+  .el-submenu__title {
+    padding: 0 40px !important;
+    height: 50px;
+    line-height: 50px;
+    font-weight: 600;
+
+    > .icon {
+      margin-right: 12px;
+    }
+  }
+  .el-menu-item {
+    height: auto;
+    min-height: 40px;
+    line-height: 20px;
+    padding: 10px 40px !important;
+    white-space: normal;
+  }
+  .el-menu-item.is-active {
+    font-weight: 600;
+  }
+  .el-submenu__icon-arrow {
+    right: 40px;
+  }
+}
+
+/* head */
+.home-header {
+  position: absolute;
+  width: 100%;
+  height: 50px;
+  top: 0;
+  left: 0;
+  z-index: 99;
+  color: #fff;
+  padding-left: 220px;
+  background-color: $--color-text-dark;
+  overflow: hidden;
+
+  .menu-list {
+    li {
+      display: inline-block;
+      vertical-align: top;
+      padding: 10px 15px;
+      height: 50px;
+      line-height: 30px;
+      opacity: 0.4;
+      font-size: 16px;
+      position: relative;
+      text-align: center;
+      cursor: pointer;
+
+      &:hover {
+        opacity: 1;
+      }
+
+      &.menu-item-act {
+        opacity: 1;
+      }
+
+      span {
+        display: inline-block;
+        vertical-align: top;
+        margin-left: 6px;
+      }
+      .icon {
+        margin-top: -3px;
+      }
+    }
+  }
+  .head-menu {
+    float: left;
+  }
+  .head-user {
+    float: right;
+    padding-right: 10px;
+    li {
+      padding: 10px;
+    }
+    .menu-item-account {
+      white-space: nowrap;
+      padding: 10px;
+      span {
+        max-width: 156px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+      }
+    }
+  }
+  // .head-menu-btn
+  .head-menu-btn {
+    display: none;
+    float: right;
+    line-height: 36px;
+    padding: 12px 15px;
+    text-align: center;
+    > span {
+      display: block;
+      height: 36px;
+      width: 36px;
+      border-radius: 5px;
+      background-color: rgba($color: #fff, $alpha: 0.3);
+    }
+    i {
+      font-size: 22px;
+      vertical-align: middle;
+    }
+  }
+}
+// menu-dialog
+.menu-dialog {
+  .el-dialog.is-fullscreen {
+    border-radius: 0;
+    box-shadow: none;
+
+    .el-dialog__body {
+      padding: 10px;
+      &::after {
+        display: none;
+      }
+    }
+  }
+
+  .menu-logout {
+    padding: 10px;
+    width: 52px;
+    height: 52px;
+    margin: 0 auto;
+    border: 1px solid $--color-text-gray-3;
+    border-radius: 50%;
+    font-size: 30px;
+    text-align: center;
+    color: $--color-text-gray-3;
+    cursor: pointer;
+
+    &:hover {
+      border-color: $--color-danger;
+      color: $--color-danger;
+    }
+  }
+}
+
+// home-breadcrumb
+.home-breadcrumb {
+  margin-bottom: 18px;
+  font-size: 12px;
+  font-weight: 500;
+  color: $--color-text-gray-2;
+
+  .breadcrumb-tips {
+    display: inline-block;
+    vertical-align: middle;
+    > i {
+      margin-top: -2px;
+      margin-right: 8px;
+    }
+  }
+  .el-breadcrumb {
+    line-height: 16px;
+    display: inline-block;
+    vertical-align: middle;
+    font-size: 12px;
+
+    .el-breadcrumb__item {
+      .el-breadcrumb__inner {
+        color: $--color-text-gray-2;
+      }
+    }
+    .el-breadcrumb__separator {
+      margin: 0 5px;
+    }
+  }
+}
+
+// home-view
+
+/* view-footer */
+.home-footer {
+  position: absolute;
+  width: 100%;
+  height: 60px;
+  bottom: 0;
+  left: 0;
+  z-index: auto;
+  padding: 20px 0;
+  line-height: 20px;
+  color: $--color-text-gray-3;
+  text-align: center;
+  font-size: 13px;
+  a {
+    color: $--color-text-gray-3;
+  }
+  a:hover {
+    color: $--color-text-gray;
+  }
+}

+ 5 - 3
src/components/ImportFile.vue

@@ -61,6 +61,9 @@
 </template>
 
 <script>
+import { fileMD5 } from "@/plugins/md5";
+import { $post } from "@/plugins/axios";
+
 const prefixCls = "cc-import-file";
 
 export default {
@@ -141,9 +144,9 @@ export default {
       const _file_format = fileType
         .split(".")
         .pop()
-        .toLocaleLowerCase();
+        .toLowerCase();
       return this.format.length
-        ? this.format.some(item => item.toLocaleLowerCase() === _file_format)
+        ? this.format.some(item => item.toLowerCase() === _file_format)
         : true;
     },
     async handleBeforeUpload(file) {
@@ -156,7 +159,6 @@ export default {
         this.handleExceededSize();
         return Promise.reject();
       }
-
       if (!this.checkFileFormat(file.name)) {
         this.handleFormatError();
         return Promise.reject();

+ 257 - 247
src/constants/enumerate.js

@@ -1,247 +1,257 @@
-export const SYS_ADMIN_NAME = "sysadmin";
-
-// 通用 -------------->
-// 启用/禁用
-export const ABLE_TYPE = {
-  0: "禁用",
-  1: "启用"
-};
-
-// 是 / 否
-export const BOOLEAN_TYPE = {
-  0: "否",
-  1: "是"
-};
-
-// 审核状态
-export const AUDITING_STATUS = {
-  START: "待审核",
-  AUDITING: "审核中",
-  REJECT: "已驳回",
-  CANCEL: "已撤回",
-  END: "已终止",
-  FINISH: "已结束"
-};
-
-// 审核结果
-export const AUDITING_RESULT = {
-  NOT_PASS: "未通过",
-  PASS: "通过"
-};
-export const TASK_AUDIT_RESULT = {
-  REJECT: "驳回",
-  PASS: "通过"
-};
-
-// 权限类型
-export const PRIVILEGE_TYPE = {
-  MENU: "菜单",
-  URL: "操作"
-};
-
-// 基础 -------------->
-// 机构
-export const ORG_TYPE = {
-  COLLEGE: "学院",
-  FACULTY: "院系",
-  TEACHING_ROOM: "教研室",
-  PRINTING_HOUSE: "印刷室"
-};
-// 角色
-export const ROLE_TYPE = {
-  SCHOOL_ADMIN: "管理员",
-  EXAM_TEACHER: "考务老师",
-  QUESTION_TEACHER: "命题老师",
-  CUSTOMER: "客服人员",
-  PRINT: "印刷人员",
-  CUSTOM: "自定义"
-};
-
-export const SMS_TYPE = {
-  SCHOOL_ADMIN: "管理员",
-  EXAM_TEACHER: "考务老师"
-};
-
-// 通用题卡规则id
-export const COMMON_CARD_RULE_ID = "-1";
-
-export const CARD_CREATE_METHOD_TYPE = {
-  UPLOAD: "上传文件",
-  STANDARD: "标准模式",
-  FREE: "自由模式"
-};
-export const CARD_TYPE = {
-  GENERIC: "通卡",
-  CUSTOM: "自定义专卡"
-};
-
-// 模板类型
-export const TEMPLATE_TYPE = {
-  GENERIC: "通卡模板",
-  VARIABLE: "变量印品模板",
-  ORDINARY: "普通印品模板"
-};
-
-// 提交印刷方式
-export const CONFIRM_PRINT_TYPE = {
-  MANUAL: "手动",
-  AUTO: "自动"
-};
-
-// 印刷计划推送状态
-export const SYNC_PRINT_STATUS = {
-  INIT: "未开始",
-  START_SYNC: "同步中", // 开始同步
-  EXAM_FINISH: "同步中", // 考试同步成功
-  STUDENT_FINISH: "同步中", // 考生同步成功
-  FINISH: "已结束"
-};
-
-// 考试
-export const EXAM_TYPE = {
-  OFFLINE: "线下考试",
-  ONLINE: "线上考试"
-};
-
-export const EXAM_MODE_TYPE = {
-  MODEL1: "模式1:电子交卷环节需要提交考务数据",
-  MODEL2: "模式2:电子交卷环节不需要提交考务数据,只输入印刷份数即可",
-  MODEL3: "模式3:电子交卷环节不需要提交考务数据"
-};
-
-export const FLOW_TYPE = {
-  ELECTRON_FLOW: "电子交卷审核"
-  // QUESTION_ELECTRON_FLOW: "题库试题提交审核",
-  // PAPER_ELECTRON_FLOW: "题库试卷审核"
-};
-export const FLOW_MODEL_TYPE = {
-  USER_FIXED: "管理员指定",
-  APPROVE_SET: "发起人自选"
-};
-
-export const FLOW_APPROVE_OPERATION_TYPE = {
-  SUBMIT: "提交",
-  APPROVE: "审批",
-  EXCHANGE: "转他人审批",
-  REJECT: "驳回",
-  END: "终止"
-};
-
-// 命题 -------------->
-// 待办任务警告时间
-export const TASK_WARNING_TIME = 3 * 24 * 60 * 60 * 1000;
-
-// 题卡
-// 条码类型
-export const EXAM_NUMBER_STYLE = {
-  PRINT: "印刷条码",
-  PASTE: "粘贴条码",
-  FILL: "考号填涂"
-};
-// 试卷类型方式
-export const PAPER_TYPE = {
-  PRINT: "印刷"
-  // FILL: "填涂"
-};
-
-// 命题任务状态
-export const EXAM_TASK_STATUS = {
-  DRAFT: "新建",
-  STAGE: "待命题",
-  AUDITING: "审核中",
-  REJECT: "驳回",
-  FINISH: "已完成"
-};
-
-// 题卡创建方式
-export const CARD_SOURCE_TYPE = {
-  SELECT: "选择已有答题卡",
-  SELF: "自助创建",
-  CUST: "申请客服制卡"
-};
-
-// 模板类型
-export const TEMPLATE_CLASSIFY = {
-  SIGN: "签到表",
-  PACKAGE: "卷袋贴",
-  CHECK_IN: "考试情况登记表"
-};
-
-// 数据管理
-export const DATA_TASK_STATUS = {
-  INIT: "未开始",
-  RUNNING: "进行中",
-  FINISH: "已完成"
-};
-export const DATA_TASK_TYPE = {
-  QUESTION_MISSION_BATCH_CREATE: "批量新建命题任务",
-  SAMPLE_EXPORT: "导出审核样本",
-  EXAMINATION_IMPORT: "考务数据导入",
-  EXAMINATION_EXPORT: "考务数据导出",
-  PRINT_PDF_DOWNLOAD: "批量下载pdf",
-  CREATE_PDF: "生成pdf",
-  USER_IMPORT: "用户导入",
-  STUDENT_IMPORT: "学生导入",
-  COURSE_IMPORT: "课程导入",
-  PAPER_AND_CARD_PDF_DOWNLOAD: "卷库查询管理试卷、空白题卡批量下载pdf",
-  STATISTICS_IMPORT: "命题统计导入",
-  SCORE_EXPORT: "成绩导出",
-  SCORE_DOWNLOAD: "成绩轨迹下载"
-};
-export const DATA_TASK_RESULT = {
-  SUCCESS: "成功",
-  ERROR: "失败"
-};
-
-// 印刷 -------------->
-// 印刷计划状态
-export const PRINT_PLAN_STATUS = {
-  NEW: "新建",
-  READY: "就绪",
-  PRINTING: "印刷中",
-  PRINT_FINISH: "印刷完成",
-  END: "已结束"
-};
-// 印刷计划相关
-export const DRAW_RULE_TYPE = {
-  ONE: "只抽取一次",
-  CIRCLE: "可反复抽取"
-};
-export const PRINT_BACKUP_TYPE = {
-  ROOM: "每考场"
-  // STUDENT: "每考生"
-};
-export const PAPER_BACKUP_TYPE = {
-  ROOM: "每考场"
-  // PLACE: "每考点"
-};
-export const PRINT_CONTENT_TYPE = {
-  PAPER: "试卷",
-  CARD: "题卡"
-};
-
-// 印刷任务状态
-export const PRINT_TASK_STATUS = {
-  NEW: "新建",
-  READY: "就绪",
-  WAITING: "待印刷",
-  PRINTING: "印刷中",
-  FINISH: "已完成"
-};
-// pdf文件类型
-export const PRINT_PDF_TYPE = {
-  ALL_A3: "试卷题卡合并文件",
-  CARD_A3: "题卡合并文件"
-};
-
-// stmms
-export const MARK_TASK_SYNC_STATUS = {
-  INIT: "未同步",
-  FINISH: "已同步"
-};
-export const STMMS_SYNC_TYPE = {
-  USER_PUSH: "用户推送",
-  EXAM_PUSH: "考试、考生、题卡推送",
-  STRUCTURE_PUSH: "试卷结构推送",
-  SCORE_PUSH: "成绩推送"
-};
+export const SYS_ADMIN_NAME = "sysadmin";
+
+// 通用 -------------->
+// 启用/禁用
+export const ABLE_TYPE = {
+  0: "禁用",
+  1: "启用"
+};
+
+// 是 / 否
+export const BOOLEAN_TYPE = {
+  0: "否",
+  1: "是"
+};
+
+// 审核状态
+export const AUDITING_STATUS = {
+  START: "待审核",
+  AUDITING: "审核中",
+  REJECT: "已驳回",
+  CANCEL: "已撤回",
+  END: "已终止",
+  FINISH: "已结束"
+};
+
+// 审核结果
+export const AUDITING_RESULT = {
+  NOT_PASS: "未通过",
+  PASS: "通过"
+};
+export const TASK_AUDIT_RESULT = {
+  REJECT: "驳回",
+  PASS: "通过"
+};
+
+// 权限类型
+export const PRIVILEGE_TYPE = {
+  MENU: "菜单",
+  URL: "操作"
+};
+
+// 基础 -------------->
+// 机构
+export const ORG_TYPE = {
+  COLLEGE: "学院",
+  FACULTY: "院系",
+  TEACHING_ROOM: "教研室",
+  PRINTING_HOUSE: "印刷室"
+};
+// 角色
+export const ROLE_TYPE = {
+  SCHOOL_ADMIN: "管理员",
+  EXAM_TEACHER: "考务老师",
+  QUESTION_TEACHER: "命题老师",
+  CUSTOMER: "客服人员",
+  PRINT: "印刷人员",
+  CUSTOM: "自定义"
+};
+
+export const SMS_TYPE = {
+  SCHOOL_ADMIN: "管理员",
+  EXAM_TEACHER: "考务老师"
+};
+
+// 通用题卡规则id
+export const COMMON_CARD_RULE_ID = "-1";
+
+export const CARD_CREATE_METHOD_TYPE = {
+  UPLOAD: "上传文件",
+  STANDARD: "标准模式",
+  FREE: "自由模式"
+};
+export const CARD_TYPE = {
+  GENERIC: "通卡",
+  CUSTOM: "自定义专卡"
+};
+
+// 模板类型
+export const TEMPLATE_TYPE = {
+  GENERIC: "通卡模板",
+  VARIABLE: "变量印品模板",
+  ORDINARY: "普通印品模板"
+};
+
+// 提交印刷方式
+export const CONFIRM_PRINT_TYPE = {
+  MANUAL: "手动",
+  AUTO: "自动"
+};
+
+// 印刷计划推送状态
+export const SYNC_PRINT_STATUS = {
+  INIT: "未开始",
+  START_SYNC: "同步中", // 开始同步
+  EXAM_FINISH: "同步中", // 考试同步成功
+  STUDENT_FINISH: "同步中", // 考生同步成功
+  FINISH: "已结束"
+};
+
+// 考试
+export const EXAM_TYPE = {
+  OFFLINE: "线下考试",
+  ONLINE: "线上考试"
+};
+
+export const EXAM_MODE_TYPE = {
+  MODEL1: "模式1:电子交卷环节需要提交考务数据",
+  MODEL2: "模式2:电子交卷环节不需要提交考务数据,只输入印刷份数即可",
+  MODEL3: "模式3:电子交卷环节不需要提交考务数据"
+};
+
+export const FLOW_TYPE = {
+  ELECTRON_FLOW: "电子交卷审核"
+  // QUESTION_ELECTRON_FLOW: "题库试题提交审核",
+  // PAPER_ELECTRON_FLOW: "题库试卷审核"
+};
+export const FLOW_MODEL_TYPE = {
+  USER_FIXED: "管理员指定",
+  APPROVE_SET: "发起人自选"
+};
+
+export const FLOW_APPROVE_OPERATION_TYPE = {
+  SUBMIT: "提交",
+  APPROVE: "审批",
+  EXCHANGE: "转他人审批",
+  REJECT: "驳回",
+  END: "终止"
+};
+
+// 命题 -------------->
+// 待办任务警告时间
+export const TASK_WARNING_TIME = 3 * 24 * 60 * 60 * 1000;
+
+// 题卡
+// 条码类型
+export const EXAM_NUMBER_STYLE = {
+  PRINT: "印刷条码",
+  PASTE: "粘贴条码",
+  FILL: "考号填涂"
+};
+// 试卷类型方式
+export const PAPER_TYPE = {
+  PRINT: "印刷"
+  // FILL: "填涂"
+};
+
+// 命题任务状态
+export const EXAM_TASK_STATUS = {
+  DRAFT: "新建",
+  STAGE: "待命题",
+  AUDITING: "审核中",
+  REJECT: "驳回",
+  FINISH: "已完成"
+};
+
+// 题卡创建方式
+export const CARD_SOURCE_TYPE = {
+  SELECT: "选择已有答题卡",
+  SELF: "自助创建",
+  CUST: "申请客服制卡"
+};
+
+// 模板类型
+export const TEMPLATE_CLASSIFY = {
+  SIGN: "签到表",
+  PACKAGE: "卷袋贴",
+  CHECK_IN: "考试情况登记表"
+};
+
+// 数据管理
+export const DATA_TASK_STATUS = {
+  INIT: "未开始",
+  RUNNING: "进行中",
+  FINISH: "已完成"
+};
+export const DATA_TASK_TYPE = {
+  QUESTION_MISSION_BATCH_CREATE: "批量新建命题任务",
+  SAMPLE_EXPORT: "导出审核样本",
+  EXAMINATION_IMPORT: "考务数据导入",
+  EXAMINATION_EXPORT: "考务数据导出",
+  PRINT_PDF_DOWNLOAD: "批量下载pdf",
+  CREATE_PDF: "生成pdf",
+  USER_IMPORT: "用户导入",
+  STUDENT_IMPORT: "学生导入",
+  COURSE_IMPORT: "课程导入",
+  PAPER_AND_CARD_PDF_DOWNLOAD: "卷库查询管理试卷、空白题卡批量下载pdf",
+  STATISTICS_IMPORT: "命题统计导入",
+  SCORE_EXPORT: "成绩导出",
+  SCORE_DOWNLOAD: "成绩轨迹下载"
+};
+export const DATA_TASK_RESULT = {
+  SUCCESS: "成功",
+  ERROR: "失败"
+};
+
+// 印刷 -------------->
+// 印刷计划状态
+export const PRINT_PLAN_STATUS = {
+  NEW: "新建",
+  READY: "就绪",
+  PRINTING: "印刷中",
+  PRINT_FINISH: "印刷完成",
+  END: "已结束"
+};
+// 印刷计划相关
+export const DRAW_RULE_TYPE = {
+  ONE: "只抽取一次",
+  CIRCLE: "可反复抽取"
+};
+export const PRINT_BACKUP_TYPE = {
+  ROOM: "每考场"
+  // STUDENT: "每考生"
+};
+export const PAPER_BACKUP_TYPE = {
+  ROOM: "每考场"
+  // PLACE: "每考点"
+};
+export const PRINT_CONTENT_TYPE = {
+  PAPER: "试卷",
+  CARD: "题卡"
+};
+
+// 印刷任务状态
+export const PRINT_TASK_STATUS = {
+  NEW: "新建",
+  READY: "就绪",
+  WAITING: "待印刷",
+  PRINTING: "印刷中",
+  FINISH: "已完成"
+};
+// pdf文件类型
+export const PRINT_PDF_TYPE = {
+  ALL_A3: "试卷题卡合并文件",
+  CARD_A3: "题卡合并文件"
+};
+
+// stmms
+export const MARK_TASK_SYNC_STATUS = {
+  INIT: "未同步",
+  FINISH: "已同步"
+};
+export const STMMS_SYNC_TYPE = {
+  USER_PUSH: "用户推送",
+  EXAM_PUSH: "考试、考生、题卡推送",
+  STRUCTURE_PUSH: "试卷结构推送",
+  SCORE_PUSH: "成绩推送"
+};
+
+// analysis
+export const ANALYSIS_BATCH_STATUS = {
+  SETTING_GRADE_PAPER: "数据准备中",
+  PUSH_GRADE_BATCH: "提交分析数据",
+  SETTING_GRADE_PAPER_PARAM: "蓝图数据准备中",
+  READY_TO_CALCULATE: "待计算",
+  CALCULATING: "计算中",
+  FINISH_CALCULATE: "已完成"
+};

+ 8 - 0
src/modules/analysis/api.js

@@ -57,6 +57,14 @@ export const deleteAnalysisBatchPaper = idList => {
 export const analysisPaperList = datas => {
   return $postParam("/api/admin/grade/batch/paper/able", datas);
 };
+export const analysisBatchTemplateExport = datas => {
+  return $postParam("/api/admin/grade/batch/download", datas, {
+    responseType: "blob"
+  });
+};
+export const analysisDataImport = datas => {
+  return $postParam("/api/admin/grade/batch/push", datas);
+};
 
 // analysis-report-view
 export const ssoAnalysisLogin = datas => {

+ 6 - 1
src/modules/analysis/components/ModifyBaseConfig.vue

@@ -138,8 +138,13 @@ export default {
       const result = await Promise.all(funcs).catch(() => {});
       if (!result) return;
 
+      console.log(result);
+
       result.forEach((item, index) => {
-        if (item) this.steps[index].status = "success";
+        if (index === 1) {
+        } else {
+          if (item && item.length) this.steps[index].status = "success";
+        }
       });
       this.steps.forEach(item => {
         item.disabled = item.status === "wait";

+ 93 - 7
src/modules/analysis/views/AnalysisBatchManage.vue

@@ -41,11 +41,15 @@
         ></el-table-column>
         <el-table-column prop="batchName" label="分析批次"></el-table-column>
         <el-table-column prop="semesterName" label="学期"></el-table-column>
-        <el-table-column prop="status" label="状态"> </el-table-column>
+        <el-table-column prop="status" label="状态">
+          <span slot-scope="scope">
+            {{ scope.row.status | analysisBatchStatusFilter }}
+          </span>
+        </el-table-column>
         <el-table-column
           class-name="action-column"
           label="操作"
-          width="240px"
+          width="300"
           align="center"
         >
           <template slot-scope="scope">
@@ -57,12 +61,32 @@
               >添加分析试卷</el-button
             >
             <el-button
+              v-if="scope.row.status === 'READY_TO_CALCULATE'"
               class="btn-primary"
               type="text"
               :disabled="loading"
               @click="toCalc(scope.row)"
               >开始计算</el-button
             >
+            <el-button
+              v-if="scope.row.status === 'PUSH_GRADE_BATCH'"
+              class="btn-primary"
+              type="text"
+              :disabled="loading"
+              @click="toImportAnalysisData(scope.row)"
+              >提交分析数据</el-button
+            >
+            <el-button
+              v-if="
+                scope.row.status === 'PUSH_GRADE_BATCH' ||
+                  scope.row.status === 'SETTING_GRADE_PAPER_PARAM'
+              "
+              class="btn-primary"
+              type="text"
+              :disabled="loading"
+              @click="toImport(scope.row)"
+              >导入</el-button
+            >
             <el-button
               class="btn-danger"
               type="text"
@@ -97,18 +121,36 @@
       ref="ModifyAnalysisBatchPaper"
       :instance="curRow"
     ></modify-analysis-batch-paper>
+    <!-- 数据导入 -->
+    <import-file
+      ref="ImportFile"
+      title="上传文件"
+      :upload-url="uploadUrl"
+      :upload-data="uploadData"
+      :download-handle="downloadHandle"
+      download-filename="考务数据模板"
+      :format="['xls', 'xlsx']"
+      @upload-success="fileUploaded"
+    >
+    </import-file>
   </div>
 </template>
 
 <script>
-import { analysisBatchList, deleteAnalysisBatch } from "../api";
-
+import {
+  analysisBatchList,
+  deleteAnalysisBatch,
+  analysisBatchTemplateExport,
+  analysisDataImport
+} from "../api";
 import ModifyAnalysisBatch from "../components/ModifyAnalysisBatch.vue";
 import ModifyAnalysisBatchPaper from "../components/ModifyAnalysisBatchPaper.vue";
+import ImportFile from "@/components/ImportFile";
+import { downloadByApi } from "@/plugins/download";
 
 export default {
   name: "analysis-batch-manage",
-  components: { ModifyAnalysisBatch, ModifyAnalysisBatchPaper },
+  components: { ModifyAnalysisBatch, ModifyAnalysisBatchPaper, ImportFile },
   data() {
     return {
       filter: {
@@ -121,7 +163,11 @@ export default {
       curRow: {},
       batchs: [],
       loading: false,
-      multipleSelection: []
+      multipleSelection: [],
+      // upload
+      uploadUrl: "/api/admin/grade/batch/upload",
+      uploadData: {},
+      downloading: false
     };
   },
   mounted() {
@@ -137,7 +183,10 @@ export default {
         pageSize: this.size
       };
       const data = await analysisBatchList(datas);
-      this.dataList = data.records;
+      this.dataList = data.records.map(item => {
+        item.loading = false;
+        return item;
+      });
       this.total = data.total;
     },
     toPage(page) {
@@ -174,6 +223,43 @@ export default {
     toCalc(row) {
       console.log(row);
     },
+    async toImportAnalysisData(row) {
+      if (row.loading) return;
+      row.loading = true;
+
+      const res = await analysisDataImport({ batchId: row.id }).catch(() => {});
+      row.loading = false;
+      if (!res) return;
+
+      this.$message.success("操作成功!");
+      this.getList();
+    },
+    toImport(row) {
+      this.curRow = row;
+      this.uploadData = {
+        batchId: row.id
+      };
+      this.$refs.ImportFile.open();
+    },
+    fileUploaded() {
+      this.getList();
+    },
+    async downloadHandle() {
+      if (this.downloading) return;
+      this.downloading = true;
+
+      const res = await downloadByApi(() => {
+        return analysisBatchTemplateExport({
+          batchId: this.curRow.id
+        });
+      }).catch(e => {
+        this.$message.error(e || "下载失败,请重新尝试!");
+      });
+      this.downloading = false;
+
+      if (!res) return;
+      this.$message.success("下载成功!");
+    },
     async toDelete(row) {
       const confirm = await this.$confirm(
         `确定要删除批次【${row.batchName}】吗?`,

+ 4 - 0
src/plugins/filters.js

@@ -19,6 +19,7 @@ import {
   CARD_TYPE,
   CARD_CREATE_METHOD_TYPE,
   FLOW_APPROVE_OPERATION_TYPE,
+  ANALYSIS_BATCH_STATUS,
   FLOW_TYPE
 } from "../constants/enumerate";
 import { formatDate } from "../plugins/utils";
@@ -108,3 +109,6 @@ Vue.filter("flowApproveOperationTypeFilter", function(val) {
 Vue.filter("flowTypeFilter", function(val) {
   return FLOW_TYPE[val] || "";
 });
+Vue.filter("analysisBatchStatusFilter", function(val) {
+  return ANALYSIS_BATCH_STATUS[val] || DEFAULT_FIELD;
+});