Переглянути джерело

format & fix lint errors and warnings

Michael Wang 4 роки тому
батько
коміт
7028044f2e
100 змінених файлів з 4413 додано та 4359 видалено
  1. 1 0
      .eslintrc.js
  2. 2 2
      postbuild.js
  3. 1 1
      src/App.vue
  4. 7 7
      src/components/EcsFormSearch.vue
  5. 9 9
      src/components/ExamTypeSelect.vue
  6. 9 9
      src/components/LevelTypeSelect.vue
  7. 8 3
      src/components/LinkTitlesCustom.vue
  8. 16 15
      src/components/ckeditor.vue
  9. 1 1
      src/components/registerComponents.js
  10. 11 11
      src/constants/constants.js
  11. 1 1
      src/filters/filters.js
  12. 2 2
      src/main.js
  13. 3 3
      src/modules/basic/constants/constants.js
  14. 23 23
      src/modules/basic/routes/routes.js
  15. 17 17
      src/modules/basic/view/admin_operate.vue
  16. 11 11
      src/modules/basic/view/app_list.vue
  17. 112 110
      src/modules/basic/view/campus.vue
  18. 189 184
      src/modules/basic/view/clientConfig.vue
  19. 109 109
      src/modules/basic/view/course.vue
  20. 60 62
      src/modules/basic/view/data_previllege.vue
  21. 14 14
      src/modules/basic/view/data_previllege_add_course.vue
  22. 14 14
      src/modules/basic/view/data_previllege_add_exam.vue
  23. 15 15
      src/modules/basic/view/data_previllege_add_org.vue
  24. 21 21
      src/modules/basic/view/index.vue
  25. 6 6
      src/modules/basic/view/privilege_group_list.vue
  26. 12 12
      src/modules/basic/view/privilege_tree.vue
  27. 68 77
      src/modules/basic/view/resource_list.vue
  28. 33 33
      src/modules/basic/view/role_privilege_settings.vue
  29. 54 54
      src/modules/basic/view/school.vue
  30. 86 84
      src/modules/basic/view/school_config.vue
  31. 31 31
      src/modules/basic/view/school_privilege_settings.vue
  32. 80 80
      src/modules/basic/view/specially.vue
  33. 58 58
      src/modules/basic/view/sys_login_rule_list.vue
  34. 24 25
      src/modules/basic/view/sys_notice.vue
  35. 45 45
      src/modules/basic/view/sys_prop_list.vue
  36. 68 66
      src/modules/basic/view/unimportant_school_config.vue
  37. 104 104
      src/modules/basic/view/user.vue
  38. 15 15
      src/modules/basic/view/user_copy_previllege_dialog.vue
  39. 20 20
      src/modules/examwork/routes/routes.js
  40. 61 61
      src/modules/examwork/view/examInfo.vue
  41. 134 131
      src/modules/examwork/view/examStudent.vue
  42. 40 40
      src/modules/examwork/view/examStudentImport.vue
  43. 98 98
      src/modules/examwork/view/notice.vue
  44. 39 39
      src/modules/examwork/view/offlineExam.vue
  45. 39 39
      src/modules/examwork/view/offlineExamOrgSettings.vue
  46. 119 119
      src/modules/examwork/view/onlineExam.vue
  47. 76 76
      src/modules/examwork/view/onlineExamOrgSettings.vue
  48. 81 80
      src/modules/examwork/view/onlineHomework.vue
  49. 76 76
      src/modules/examwork/view/onlineHomeworkOrgSettings.vue
  50. 56 56
      src/modules/examwork/view/practiceExam.vue
  51. 29 29
      src/modules/examwork/view/printExam.vue
  52. 110 110
      src/modules/examwork/view/stageSpecialSettings.vue
  53. 132 132
      src/modules/examwork/view/student.vue
  54. 23 29
      src/modules/examwork/view/studentSpecialSettings.vue
  55. 27 27
      src/modules/examwork/view/traditionExam.vue
  56. 22 22
      src/modules/marking/canvas/mark_sign.js
  57. 1 1
      src/modules/marking/constants/constants.js
  58. 4 4
      src/modules/marking/filters/filters.js
  59. 15 15
      src/modules/marking/routes/routes.js
  60. 21 21
      src/modules/marking/views/CourseDetail.vue
  61. 73 73
      src/modules/marking/views/MarkPaperCheck.vue
  62. 45 45
      src/modules/marking/views/MarkSettingFast.vue
  63. 62 60
      src/modules/marking/views/MarkSettingMain.vue
  64. 22 22
      src/modules/marking/views/MarkSettingWork.vue
  65. 90 88
      src/modules/marking/views/MarkWork.vue
  66. 128 128
      src/modules/marking/views/MarkWorkOverview.vue
  67. 39 39
      src/modules/marking/views/Marker.vue
  68. 24 24
      src/modules/marking/views/MarkerDetail.vue
  69. 94 99
      src/modules/marking/views/Marking.vue
  70. 125 129
      src/modules/marking/views/TpMain.vue
  71. 175 174
      src/modules/marking/views/TpScoreBoard.vue
  72. 24 24
      src/modules/marking/views/ViewPaper.vue
  73. 27 14
      src/modules/oe/component/commonExport.vue
  74. 65 58
      src/modules/oe/component/commonForm.vue
  75. 3 3
      src/modules/oe/constants/constants.js
  76. 2 2
      src/modules/oe/mixin/pagePrivilege.js
  77. 17 17
      src/modules/oe/routes/routes.js
  78. 15 15
      src/modules/oe/views/absent.vue
  79. 51 51
      src/modules/oe/views/alreadyAudited.vue
  80. 59 59
      src/modules/oe/views/awaitingAudit.vue
  81. 46 46
      src/modules/oe/views/captureDetail.vue
  82. 66 66
      src/modules/oe/views/examDetail.vue
  83. 57 43
      src/modules/oe/views/examPaperDetail.vue
  84. 97 97
      src/modules/oe/views/examScheduling.vue
  85. 90 92
      src/modules/oe/views/examSummary.vue
  86. 27 27
      src/modules/oe/views/export_task_list.vue
  87. 32 32
      src/modules/oe/views/illegalityNameList.vue
  88. 55 55
      src/modules/oe/views/illegalityType.vue
  89. 26 26
      src/modules/oe/views/reexamine.vue
  90. 38 38
      src/modules/oe/views/scoreStatistics.vue
  91. 10 10
      src/modules/portal/routes/routes.js
  92. 2 2
      src/modules/portal/store/currentPaths.js
  93. 2 2
      src/modules/portal/store/menuList.js
  94. 4 4
      src/modules/portal/store/user.js
  95. 8 8
      src/modules/portal/views/Access.vue
  96. 37 37
      src/modules/portal/views/Login.vue
  97. 48 38
      src/modules/portal/views/home/Home.vue
  98. 37 37
      src/modules/portal/views/home/HomeSide.vue
  99. 3 3
      src/modules/portal/views/home/LinkTitles.vue
  100. 25 13
      src/modules/portal/views/home/SiteMessageDetail.vue

+ 1 - 0
.eslintrc.js

@@ -10,6 +10,7 @@ module.exports = {
   rules: {
     "no-console": process.env.NODE_ENV === "production" ? "off" : "off",
     "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
+    "vue/no-v-html": "off",
   },
   overrides: [
     {

+ 2 - 2
postbuild.js

@@ -14,8 +14,8 @@ if (process.env.IS_PROD === "true") {
   const DIR = "./dist/js/";
   const sourcemaps = fs
     .readdirSync(DIR)
-    .filter(v => v.endsWith(".map"))
-    .map(v => DIR + v);
+    .filter((v) => v.endsWith(".map"))
+    .map((v) => DIR + v);
   for (const s of sourcemaps) {
     fs.renameSync(s, s.replace(".js.map", "-" + revision + ".js.map"));
     console.log(

+ 1 - 1
src/App.vue

@@ -4,7 +4,7 @@
 
 <script>
 export default {
-  name: "App"
+  name: "App",
 };
 </script>
 

+ 7 - 7
src/components/EcsFormSearch.vue

@@ -13,7 +13,7 @@
     </el-form>
 
     <div
-      style="width: 100%; border-bottom: 1px solid #ddd; margin: 10px 0;"
+      style="width: 100%; border-bottom: 1px solid #ddd; margin: 10px 0"
     ></div>
   </section>
 </template>
@@ -21,26 +21,26 @@
 export default {
   name: "EcsFormSearch",
   props: {
-    model: Object,
+    model: { type: Object, default: () => {} },
     advanceSearch: {
       type: Boolean,
-      default: false
+      default: false,
     },
     labelPosition: {
       type: String,
-      default: "left"
+      default: "left",
     },
     labelWidth: {
       type: String,
-      default: "100px"
-    }
+      default: "100px",
+    },
   },
   data() {
     return {
       // inline: true,
       // formLabelWidth: ""
     };
-  }
+  },
 };
 </script>
 

+ 9 - 9
src/components/ExamTypeSelect.vue

@@ -3,9 +3,9 @@
     v-model="selected"
     class="size-select"
     placeholder="请选择"
-    @change="select"
     :style="styles"
     clearable
+    @change="select"
   >
     <el-option
       v-for="item in optionList"
@@ -25,32 +25,32 @@ export default {
   props: {
     value: {
       type: String,
-      default: ""
+      default: "",
     },
     options: { type: Array, default: () => null },
-    styles: { type: String }
+    styles: { type: String, default: "" },
   },
   data() {
     return {
       optionList: this.options || EXAM_TYPE_SELECT,
-      selected: ""
+      selected: "",
     };
   },
-  async created() {},
   watch: {
     value: {
       immediate: true,
       handler(val) {
         this.selected = val;
-      }
-    }
+      },
+    },
   },
+  async created() {},
   methods: {
     select() {
       this.$emit("input", this.selected);
       this.$emit("change", this.selected);
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 9 - 9
src/components/LevelTypeSelect.vue

@@ -3,9 +3,9 @@
     v-model="selected"
     class="size-select"
     placeholder="请选择"
-    @change="select"
     :style="styles"
     clearable
+    @change="select"
   >
     <el-option
       v-for="item in optionList"
@@ -25,32 +25,32 @@ export default {
   props: {
     value: {
       type: String,
-      default: ""
+      default: "",
     },
     options: { type: Array, default: () => null },
-    styles: { type: String }
+    styles: { type: String, default: "" },
   },
   data() {
     return {
       optionList: this.options || LEVEL_TYPE_SELECT,
-      selected: ""
+      selected: "",
     };
   },
-  async created() {},
   watch: {
     value: {
       immediate: true,
       handler(val) {
         this.selected = val;
-      }
-    }
+      },
+    },
   },
+  async created() {},
   methods: {
     select() {
       this.$emit("input", this.selected);
       this.$emit("change", this.selected);
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 8 - 3
src/components/LinkTitlesCustom.vue

@@ -2,7 +2,12 @@
   <el-breadcrumb
     v-if="currentPaths.length > 0"
     separator-class="el-icon-arrow-right"
-    style="border-bottom: 1px solid #ddd; padding-bottom: 5px; margin-top: -20px; margin-bottom: 20px"
+    style="
+      border-bottom: 1px solid #ddd;
+      padding-bottom: 5px;
+      margin-top: -20px;
+      margin-bottom: 20px;
+    "
   >
     <el-breadcrumb-item :to="{ path: '/home/overview' }">
       首页
@@ -17,7 +22,7 @@
 export default {
   name: "LinkTitlesCustom",
   props: {
-    currentPaths: Array
-  }
+    currentPaths: { type: Array, default: () => [] },
+  },
 };
 </script>

+ 16 - 15
src/components/ckeditor.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="ckeditor" style="margin-bottom: 10px;">
+  <div class="ckeditor" style="margin-bottom: 10px">
     <textarea :id="id" :value="value"></textarea>
   </div>
 </template>
@@ -9,44 +9,45 @@ let inc = 0;
 export default {
   props: {
     value: {
-      type: String
+      type: String,
+      default: "",
     },
     id: {
       type: String,
-      default: () => `editor-${++inc}`
+      default: () => `editor-${++inc}`,
     },
     height: {
       type: String,
-      default: "200px"
+      default: "200px",
     },
     width: {
       type: String,
-      default: "980px"
+      default: "980px",
     },
     toolbar: {
       type: [String, Array],
-      default: null
+      default: null,
     },
     language: {
       type: String,
-      default: "zh-cn"
+      default: "zh-cn",
     },
     extraplugins: {
       type: String,
-      default: ""
+      default: "",
     },
     extrabuttons: {
       type: String,
-      default: ""
+      default: "",
     },
     readonly: {
-      type: Boolean
-    }
+      type: Boolean,
+    },
   },
   computed: {
     instance() {
       return window.CKEDITOR.instances[this.id];
-    }
+    },
   },
   beforeUpdate() {
     if (this.value !== this.instance.getData()) {
@@ -74,10 +75,10 @@ export default {
       width: this.width,
       extraPlugins: this.extraplugins + ",image2,base64image,pastebase64",
       removeButtons: removeButtonStr,
-      removePlugins: removePluginStr
+      removePlugins: removePluginStr,
     };
     window.CKEDITOR.replace(this.id, config);
-    this.instance.on("instanceReady", ev => {
+    this.instance.on("instanceReady", (ev) => {
       ev.editor.setReadOnly(this.readonly);
     });
     this.instance.on("change", () => {
@@ -92,7 +93,7 @@ export default {
       this.instance.focusManager.blur(true);
       this.instance.destroy();
     }
-  }
+  },
 };
 </script>
 <style>

+ 1 - 1
src/components/registerComponents.js

@@ -11,7 +11,7 @@ const requireComponent = require.context(
   /[A-Z]\w+\.(vue|js)$/
 );
 
-requireComponent.keys().forEach(fileName => {
+requireComponent.keys().forEach((fileName) => {
   // Get component config
   const componentConfig = requireComponent(fileName);
 

+ 11 - 11
src/constants/constants.js

@@ -16,7 +16,7 @@ export const EXAM_TYPE = [
   { label: "练习", value: "PRACTICE" },
   { label: "离线", value: "OFFLINE" },
   { label: "在线作业", value: "ONLINE_HOMEWORK" },
-  { label: "印刷", value: "PRINT_EXAM" }
+  { label: "印刷", value: "PRINT_EXAM" },
 ];
 
 // for exam type select
@@ -26,7 +26,7 @@ export const EXAM_TYPE_SELECT = [
   { code: "PRACTICE", name: "练习" },
   { code: "OFFLINE", name: "离线" },
   { code: "ONLINE_HOMEWORK", name: "在线作业" },
-  { code: "PRINT_EXAM", name: "印刷" }
+  { code: "PRINT_EXAM", name: "印刷" },
 ];
 
 // for level type select
@@ -34,7 +34,7 @@ export const LEVEL_TYPE_SELECT = [
   { code: "ZSB", name: "专升本" },
   { code: "GQZ", name: "高起专" },
   { code: "GQB", name: "高起本" },
-  { code: "ALL", name: "不限" }
+  { code: "ALL", name: "不限" },
 ];
 
 //试卷类型
@@ -64,7 +64,7 @@ export const PAPER_TYPE = [
   "W",
   "X",
   "Y",
-  "Z"
+  "Z",
 ];
 
 //数据类型
@@ -73,26 +73,26 @@ export const BASIC_DATA_TYPE = [
   { code: "INTEGER", name: "INTEGER" },
   { code: "BOOLEAN", name: "BOOLEAN" },
   { code: "LONG", name: "LONG" },
-  { code: "DATE", name: "DATE" }
+  { code: "DATE", name: "DATE" },
 ];
 //发布状态
 export const PUBLISH_STATUS = [
   { code: "DRAFT", name: "未发布" },
   { code: "TO_BE_PUBLISHED", name: "待发布" },
   { code: "PUBLISHING", name: "发布中" },
-  { code: "PUBLISHED", name: "已发布" }
+  { code: "PUBLISHED", name: "已发布" },
 ];
 //公告接受规则类型
 export const NOTICE_RECEIVER_RULE_TYPE = [
   { code: "STUDENTS_OF_EXAM", name: "学生-按考试选择" },
   { code: "ALL_STUDENTS_OF_ROOT_ORG", name: "学生-学校中所有学生" },
   { code: "TEACHER_OF_MARK_WORK", name: "老师-按评卷老师选择" },
-  { code: "COMMON_USERS_OF_ROLE", name: "老师-学习中心老师" }
+  { code: "COMMON_USERS_OF_ROLE", name: "老师-学习中心老师" },
 ];
 //登录帐号类型
 export const LOGIN_TYPE = [
   { code: "STUDENT_CODE", name: "学号登录" },
-  { code: "IDENTITY_NUMBER", name: "身份证号登录" }
+  { code: "IDENTITY_NUMBER", name: "身份证号登录" },
 ];
 //防作弊配置
 export const PREVENT_CHEATING_CONFIG = [
@@ -100,15 +100,15 @@ export const PREVENT_CHEATING_CONFIG = [
   { code: "DISABLE_VIRTUAL_CAMERA", name: "禁用虚拟摄像头" },
   // { code: "DISABLE_VIRTUAL_MACHINE", name: "禁用虚拟机" },
   { code: "FULL_SCREEN_TOP", name: "强制全屏置顶" },
-  { code: "DISABLE_MULTISCREEN", name: "禁用双屏" }
+  { code: "DISABLE_MULTISCREEN", name: "禁用双屏" },
 ];
 //学生端版本
 export const STUDENT_CLIENT_VERSION = [
   { code: "1.0.0", name: "1.0.0" },
-  { code: "2.0.0", name: "2.0.0" }
+  { code: "2.0.0", name: "2.0.0" },
 ];
 //考生端支持的登录方
 export const LOGIN_SUPPORT = [
   { code: "NATIVE", name: "考生端登录" },
-  { code: "BROWSER", name: "浏览器登录" }
+  { code: "BROWSER", name: "浏览器登录" },
 ];

+ 1 - 1
src/filters/filters.js

@@ -4,7 +4,7 @@ import Vue from "vue";
 import { LEVEL_TYPE_SELECT } from "@/constants/constants";
 
 // 课程层次过滤器
-Vue.filter("levelTypeFilter", function(val) {
+Vue.filter("levelTypeFilter", function (val) {
   for (let examType of LEVEL_TYPE_SELECT) {
     if (examType.code === val) {
       return examType.name;

+ 2 - 2
src/main.js

@@ -23,12 +23,12 @@ if (
   vueLifecylceLogs({});
 }
 
-Vue.component("ecs-form-search", EcsFormSearch);
+Vue.component("EcsFormSearch", EcsFormSearch);
 
 Vue.prototype.$eventHub = new Vue();
 
 new Vue({
   router,
   store,
-  render: h => h(App)
+  render: (h) => h(App),
 }).$mount("#app");

+ 3 - 3
src/modules/basic/constants/constants.js

@@ -2,11 +2,11 @@ export const LEVEL_TYPE = [
   { label: "专升本", value: "ZSB" },
   { label: "高起专", value: "GQZ" },
   { label: "高起本", value: "GQB" },
-  { label: "不限", value: "ALL" }
+  { label: "不限", value: "ALL" },
 ];
 export const ENABLE_TYPE = [
   { label: "启用", value: true },
-  { label: "禁用", value: false }
+  { label: "禁用", value: false },
 ];
 export const ROLE_TYPE = [
   { code: "ECS_QUES_INPUTER", name: "题库录入员" },
@@ -16,6 +16,6 @@ export const ROLE_TYPE = [
   { code: "ECS_MARKING_MARKER", name: "阅卷评卷员" },
   { code: "ECS_MARKING_ADMIN", name: "阅卷管理员" },
   { code: "ECS_OE_STUDENT", name: "网考考生" },
-  { code: "ECS_OE_ADMIN", name: "网考管理员" }
+  { code: "ECS_OE_ADMIN", name: "网考管理员" },
 ];
 export const PERMISSION_TYPE = { MENU: "MENU", PAGE: "PAGE" };

+ 23 - 23
src/modules/basic/routes/routes.js

@@ -27,103 +27,103 @@ export default [
     children: [
       {
         path: "tips", //模块说明
-        component: Tips
+        component: Tips,
       },
       {
         path: "course", //课程管理
         meta: { privilegeCodes: "index_course" },
-        component: course
+        component: course,
       },
       {
         path: "specially", //专业管理
         meta: { privilegeCodes: "index_specially" },
-        component: specially
+        component: specially,
       },
       {
         path: "school", //学校管理
         meta: { privilegeCodes: "index_school" },
-        component: school
+        component: school,
       },
       {
         path: "campus", //学习中心管理
         meta: { privilegeCodes: "index_campus" },
-        component: campus
+        component: campus,
       },
       {
         path: "user", //用户管理
         meta: { privilegeCodes: "index_user" },
-        component: user
+        component: user,
       },
       {
         path: "user/data_previllege/:userId", //用户管理
         meta: { privilegeCodes: "index_user" },
-        component: data_previllege
+        component: data_previllege,
       },
       {
         path: "admin_operate", //操作日志
         meta: { privilegeCodes: "index_admin_operate" },
-        component: admin_operate
+        component: admin_operate,
       },
       {
         path: "app_list", //应用列表
         meta: { pageName: "应用列表" },
-        component: app_list
+        component: app_list,
       },
       {
         path: "privilege_group_list", //权限组列表
         meta: { pageName: "权限组列表" },
-        component: privilege_group_list
+        component: privilege_group_list,
       },
       {
         path: "privilege_tree/:privilegeGroupId", //权限树
         meta: { pageName: "权限树" },
-        component: privilege_tree
+        component: privilege_tree,
       },
       {
         path: "role_privilege_settings", //角色权限设置
         meta: { privilegeCodes: "index_role_privilege_settings" },
-        component: role_privilege_settings
+        component: role_privilege_settings,
       },
       {
         path: "school_privilege_settings", //学校权限设置
         meta: { privilegeCodes: "index_school_privilege_settings" },
-        component: school_privilege_settings
+        component: school_privilege_settings,
       },
       {
         path: "resource_list", //资源列表
         meta: { privilegeCodes: "index_resource_list" },
-        component: resource_list
+        component: resource_list,
       },
       {
         path: "sys_prop_list", //参数配置列表
         meta: { privilegeCodes: "sys_pop_list" },
-        component: sys_prop_list
+        component: sys_prop_list,
       },
       {
         path: "client_config",
         meta: { privilegeCodes: "client_config" },
-        component: client_config
+        component: client_config,
       },
       {
         path: "school_config", //学校设置
         meta: { privilegeCodes: "school_config" },
-        component: school_config
+        component: school_config,
       },
       {
         path: "unimportant_school_config", //学校设置
         meta: { privilegeCodes: "unimportant_school_config" },
-        component: unimportant_school_config
+        component: unimportant_school_config,
       },
       {
         path: "sys_notice", //系统通知
         meta: { privilegeCodes: "sys_notice" },
-        component: sys_notice
+        component: sys_notice,
       },
       {
         path: "sysLoginRuleList",
         meta: { privilegeCodes: "sys_login_rule_list" },
-        component: sysLoginRuleList //登录规则列表
-      }
-    ]
-  }
+        component: sysLoginRuleList, //登录规则列表
+      },
+    ],
+  },
 ];

+ 17 - 17
src/modules/basic/view/admin_operate.vue

@@ -2,39 +2,39 @@
   <section class="content">
     <div class="box box-info">
       <div
-        class="box-body"
         v-loading.body="loading"
         v-loading.fullscreen="loading"
+        class="box-body"
         element-loading-text="请稍后..."
       >
         <!-- 表单 -->
         <el-form inline :model="searchForm">
           <el-form-item label="登录名">
             <el-input
-              placeholder="请输入登录名"
               v-model="searchForm.loginName"
+              placeholder="请输入登录名"
               style="width: 180px"
             />
           </el-form-item>
           <el-form-item label="角色">
             <el-select
-              clearable
               v-model="searchForm.roleId"
+              clearable
               placeholder="请选择"
               class="input_width"
             >
               <el-option
                 v-for="item in roleList4Search"
+                :key="item.roleId"
                 :label="item.roleName"
                 :value="item.roleId"
-                :key="item.roleId"
               />
             </el-select>
           </el-form-item>
           <el-form-item label="操作时间">
             <el-date-picker
-              class="input"
               v-model="timeRange"
+              class="input"
               type="datetimerange"
               start-placeholder="开始日期"
               range-separator="至"
@@ -75,13 +75,13 @@
         <div class="page pull-right">
           <el-pagination
             v-if="paginationShow"
-            @current-change="handleCurrentChange"
             :current-page="currentPage"
             :page-size="pageSize"
             :page-sizes="[10, 20, 50, 100, 200, 300]"
-            @size-change="handleSizeChange"
             layout="total, sizes, prev, pager, next, jumper"
             :total="total"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
           />
         </div>
       </div>
@@ -105,16 +105,20 @@ export default {
         startTime: null,
         endTime: null,
         loginName: "",
-        roleId: ""
+        roleId: "",
       },
       tableData: [],
       currentPage: 1,
       pageSize: 10,
-      total: 10
+      total: 10,
     };
   },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: (state) => state.user }),
+  },
+  //初始化查询
+  created() {
+    this.init();
   },
   methods: {
     changeTimeRange(e) {
@@ -150,12 +154,12 @@ export default {
         this.pageSize;
       this.$httpWithMsg
         .get(url, { params: this.searchForm })
-        .then(response => {
+        .then((response) => {
           this.tableData = response.data.list;
           this.total = response.data.total;
           this.loading = false;
 
-          this.$nextTick(function() {
+          this.$nextTick(function () {
             this.paginationShow = true;
           });
         })
@@ -172,12 +176,8 @@ export default {
       Promise.all([this.$httpWithMsg.post(url)]).then(([resp]) => {
         this.roleList4Search = resp.data;
       });
-    }
+    },
   },
-  //初始化查询
-  created() {
-    this.init();
-  }
 };
 </script>
 

+ 11 - 11
src/modules/basic/view/app_list.vue

@@ -7,7 +7,7 @@
           border
           resizable
           stripe
-          style="width: 800px;text-align:center;"
+          style="width: 800px; text-align: center"
         >
           <el-table-column prop="id" label="ID" width="100" />
           <el-table-column prop="code" label="应用编码" />
@@ -27,36 +27,36 @@ export default {
   name: "AppList",
   data() {
     return {
-      appList: []
+      appList: [],
     };
   },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    this.queryAppList();
   },
   methods: {
     ...mapActions([USER_SIGNIN]),
 
-    queryAppList: function() {
+    queryAppList: function () {
       var url = CORE_API + "/app/getAllApp";
       this.$http
         .get(url)
-        .then(response => {
+        .then((response) => {
           console.log(response);
           this.appList = response.data;
         })
-        .catch(response => {
+        .catch((response) => {
           if (response.status == 500) {
             this.$notify({
               showClose: true,
               message: response.data.desc,
-              type: "error"
+              type: "error",
             });
           }
         });
-    }
+    },
   },
-  created() {
-    this.queryAppList();
-  }
 };
 </script>

+ 112 - 110
src/modules/basic/view/campus.vue

@@ -2,9 +2,9 @@
   <section class="content">
     <div class="box box-info">
       <div
-        class="box-body"
         v-loading.body="fileLoading"
         v-loading.fullscreen="fileLoading"
+        class="box-body"
         element-loading-text="请稍后..."
       >
         <!-- 表单 -->
@@ -19,23 +19,23 @@
             >
               <el-option
                 v-for="item in rootSchoolSelect"
+                :key="item.id"
                 :label="item.name"
                 :value="item.id"
-                :key="item.id"
               />
             </el-select>
           </el-form-item>
           <el-form-item label="中心代码">
             <el-input
-              placeholder="请输入学习中心代码"
               v-model="formSearch.code"
+              placeholder="请输入学习中心代码"
               style="width: 180px"
             />
           </el-form-item>
           <el-form-item label="中心名称">
             <el-input
-              placeholder="请输入学习中心名称"
               v-model="formSearch.name"
+              placeholder="请输入学习中心名称"
               style="width: 180px"
             />
           </el-form-item>
@@ -96,7 +96,7 @@
           导入
         </el-button>
 
-        <div style="width: 100%; margin-bottom: 10px;"></div>
+        <div style="width: 100%; margin-bottom: 10px"></div>
 
         <!-- 添加或修改学习中心弹出框 -->
         <el-dialog
@@ -106,10 +106,10 @@
           @close="dialogBeforeClose"
         >
           <el-form
+            ref="campusForm"
             :inline="true"
             inline-message
             :model="campusForm"
-            ref="campusForm"
             :rules="rules"
             label-position="right"
             label-width="120px"
@@ -117,9 +117,9 @@
             <el-row>
               <el-form-item label="中心代码" prop="code">
                 <el-input
+                  v-model="campusForm.code"
                   :disabled="null != campusForm.id"
                   class="pull_length"
-                  v-model="campusForm.code"
                   auto-complete="off"
                   placeholder="中心代码"
                 />
@@ -128,8 +128,8 @@
             <el-row>
               <el-form-item label="中心名称" prop="name">
                 <el-input
-                  class="pull_length"
                   v-model="campusForm.name"
+                  class="pull_length"
                   auto-complete="off"
                   placeholder="中心名称"
                 />
@@ -138,8 +138,8 @@
             <el-row>
               <el-form-item label="中心负责人" prop="contacts">
                 <el-input
-                  class="pull_length"
                   v-model="campusForm.contacts"
+                  class="pull_length"
                   auto-complete="off"
                   placeholder="中心负责人"
                 />
@@ -148,8 +148,8 @@
             <el-row>
               <el-form-item label="联系方式" prop="telephone">
                 <el-input
-                  class="pull_length"
                   v-model="campusForm.telephone"
+                  class="pull_length"
                   auto-complete="off"
                   placeholder="联系方式"
                 />
@@ -158,8 +158,8 @@
             <el-row>
               <el-form-item label="状态" prop="enable">
                 <el-radio-group
-                  class="pull_right_sm"
                   v-model="campusForm.enable"
+                  class="pull_right_sm"
                 >
                   <el-radio label="true">启用</el-radio>
                   <el-radio label="false">禁用</el-radio>
@@ -177,10 +177,10 @@
         <el-dialog title="导入窗口" width="520px" :visible.sync="impDialog">
           <el-form>
             <el-row>
-              <el-form-item style="margin-left:20px">
+              <el-form-item style="margin-left: 20px">
                 <el-upload
-                  class="form_left"
                   ref="upload"
+                  class="form_left"
                   accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
                   :action="uploadAction"
                   :headers="uploadHeaders"
@@ -194,9 +194,9 @@
                   :multiple="false"
                 >
                   <el-button
+                    slot="trigger"
                     icon="el-icon-search"
                     size="small"
-                    slot="trigger"
                     type="primary"
                   >
                     选择文件
@@ -236,9 +236,9 @@
         <!-- 导入错误信息列表 -->
         <el-dialog title="错误提示" :visible.sync="errDialog">
           <div
-            class="text-danger"
             v-for="errMessage in errMessages"
             :key="errMessage.lineNum"
+            class="text-danger"
           >
             第{{ errMessage.lineNum }}行:{{ errMessage.msg }}
           </div>
@@ -253,7 +253,7 @@
           border
           resizable
           stripe
-          style="width: 100%;"
+          style="width: 100%"
           @selection-change="selectChange"
         >
           <el-table-column type="selection" width="40" />
@@ -288,7 +288,7 @@
                   content="启用"
                   placement="left"
                 >
-                  <i class="el-icon-success" style="color:green;"></i>
+                  <i class="el-icon-success" style="color: green"></i>
                 </el-tooltip>
               </span>
               <span v-else>
@@ -298,7 +298,7 @@
                   content="禁用"
                   placement="left"
                 >
-                  <i class="el-icon-error" style="color:red;"></i>
+                  <i class="el-icon-error" style="color: red"></i>
                 </el-tooltip>
               </span>
             </span>
@@ -319,13 +319,13 @@
         <div class="page pull-right">
           <el-pagination
             v-if="paginationShow"
-            @current-change="handleCurrentChange"
             :current-page="currentPage"
             :page-size="pageSize"
             :page-sizes="[10, 20, 50, 100, 200, 300]"
-            @size-change="handleSizeChange"
             layout="total, sizes, prev, pager, next, jumper"
             :total="total"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
           />
         </div>
       </div>
@@ -345,7 +345,7 @@ export default {
       formSearch: {
         parentId: null,
         code: "",
-        name: ""
+        name: "",
       },
       campusForm: {
         id: null,
@@ -356,7 +356,7 @@ export default {
         telephone: "",
         enable: "true",
         remark: "",
-        properties: {}
+        properties: {},
       },
       campusDialog: false,
       selectedOrgIds: [],
@@ -379,17 +379,17 @@ export default {
         code: [{ required: true, message: "请输入代码", trigger: "blur" }],
         name: [{ required: true, message: "请输入名称", trigger: "blur" }],
         contacts: [
-          { required: true, message: "请输入负责人", trigger: "blur" }
+          { required: true, message: "请输入负责人", trigger: "blur" },
         ],
         telephone: [
-          { required: true, message: "请输入联系方式", trigger: "blur" }
+          { required: true, message: "请输入联系方式", trigger: "blur" },
         ],
-        enable: [{ required: true, message: "状态", trigger: "change" }]
-      }
+        enable: [{ required: true, message: "状态", trigger: "change" }],
+      },
     };
   },
   computed: {
-    ...mapState({ user: state => state.user }),
+    ...mapState({ user: (state) => state.user }),
     orgIds() {
       var orgIds = "";
       for (let orgId of this.selectedOrgIds) {
@@ -405,25 +405,79 @@ export default {
       return this.selectedOrgIds.length === 0;
     },
     isSuperAdmin() {
-      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
+      return this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN");
     },
     rootSchoolSelect() {
       let rootSchools = [];
       for (let i = 0; i < this.rootOrgList.length; i++) {
         let info = {
           name: this.rootOrgList[i].name + "(" + this.rootOrgList[i].id + ")",
-          id: this.rootOrgList[i].id
+          id: this.rootOrgList[i].id,
         };
         rootSchools.push(info);
       }
       return rootSchools;
+    },
+  },
+  // beforeRouteEnter(to, from, next) {
+  //   next(vm => {
+  //     console.log("beforeRouteEnter: formSearch", vm.formSearch);
+  //     vm.formSearch.parentId = to.$route.query.parentId || "";
+  //     vm.formSearch.code = to.$route.query.code || "";
+  //     vm.formSearch.name = to.$route.query.name || "";
+  //     vm.currentPage = parseInt(to.$route.query.currentPage) || vm.currentPage;
+  //     vm.pageSize = parseInt(to.$route.query.pageSize) || vm.pageSize;
+  //   });
+  // },
+  // beforeRouteLeave(to, from, next) {
+  //   // this.$router.push(to);
+  //   // next();
+  //   // this.$route.query = {
+  //   //   parentId: this.formSearch.parentId,
+  //   //   code: this.formSearch.code,
+  //   //   name: this.formSearch.name,
+  //   //   currentPage: this.currentPage,
+  //   //   pageSize: this.pageSize
+  //   // };
+  //   // next();
+  //   this.$router.push({
+  //     path: "/basic/campus",
+  //     query: {
+  //       parentId: this.formSearch.parentId,
+  //       code: this.formSearch.code,
+  //       name: this.formSearch.name,
+  //       currentPage: this.currentPage,
+  //       pageSize: this.pageSize
+  //     }
+  //   });
+  //   setTimeout(() => {
+  //     console.log("settimeout next");
+  //     next();
+  //   }, 500);
+  // },
+  //初始化查询
+  created() {
+    this.formSearch.parentId = parseInt(this.$route.query.parentId);
+    if (isNaN(this.formSearch.parentId)) {
+      this.formSearch.parentId = null;
     }
+    this.formSearch.code = this.$route.query.code || "";
+    this.formSearch.name = this.$route.query.name || "";
+    this.currentPage =
+      parseInt(this.$route.query.currentPage) || this.currentPage;
+    this.pageSize = parseInt(this.$route.query.pageSize) || this.pageSize;
+
+    this.init();
+    this.uploadHeaders = {
+      key: this.user.key,
+      token: this.user.token,
+    };
   },
   methods: {
     resetEcsFormSearch() {
       this.formSearch = Object.assign(this.formSearch, {
         code: "",
-        name: ""
+        name: "",
       });
     },
     handleSizeChange(val) {
@@ -465,7 +519,7 @@ export default {
         param;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           this.tableData = response.data.list;
           this.total = response.data.total;
           this.loading = false;
@@ -477,10 +531,10 @@ export default {
               code: this.formSearch.code,
               name: this.formSearch.name,
               currentPage: this.currentPage,
-              pageSize: this.pageSize
-            }
+              pageSize: this.pageSize,
+            },
           });
-          this.$nextTick(function() {
+          this.$nextTick(function () {
             this.paginationShow = true;
           });
         })
@@ -498,19 +552,19 @@ export default {
       if (this.selectedOrgIds.length === 0) {
         this.$notify({
           type: "warning",
-          message: "请选择要启用的机构"
+          message: "请选择要启用的机构",
         });
       } else {
         this.$confirm("是否启用这些机构?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "warning"
+          type: "warning",
         }).then(() => {
           var url = CORE_API + "/org/enable/" + this.orgIds;
           this.$httpWithMsg.put(url).then(() => {
             this.$notify({
               type: "success",
-              message: "启用成功!"
+              message: "启用成功!",
             });
             this.searchForm();
           });
@@ -521,19 +575,19 @@ export default {
       if (this.selectedOrgIds.length === 0) {
         this.$notify({
           type: "warning",
-          message: "请选择要禁用的机构"
+          message: "请选择要禁用的机构",
         });
       } else {
         this.$confirm("是否禁用这些机构?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "warning"
+          type: "warning",
         }).then(() => {
           var url = CORE_API + "/org/disable/" + this.orgIds;
           this.$httpWithMsg.put(url, {}).then(() => {
             this.$notify({
               type: "success",
-              message: "禁用成功!"
+              message: "禁用成功!",
             });
             this.searchForm();
           });
@@ -542,7 +596,7 @@ export default {
     },
     selectChange(row) {
       this.selectedOrgIds = [];
-      row.forEach(element => {
+      row.forEach((element) => {
         this.selectedOrgIds.push(element.id);
       });
       console.log(this.selectedOrgIds);
@@ -553,14 +607,14 @@ export default {
     },
     //提交
     submitForm() {
-      this.$refs.campusForm.validate(valid => {
+      this.$refs.campusForm.validate((valid) => {
         if (valid) {
           if (null != this.campusForm.id) {
             url = CORE_API + "/org/updateSubOrg";
             this.$httpWithMsg.put(url, this.campusForm).then(() => {
               this.$notify({
                 type: "success",
-                message: "修改成功!"
+                message: "修改成功!",
               });
               this.searchForm();
               this.resetForm();
@@ -572,7 +626,7 @@ export default {
             this.$httpWithMsg.post(url, this.campusForm).then(() => {
               this.$notify({
                 type: "success",
-                message: "新增成功!"
+                message: "新增成功!",
               });
               this.searchForm();
               this.resetForm();
@@ -630,7 +684,7 @@ export default {
       if (!response.hasError) {
         this.$notify({
           message: "上传成功",
-          type: "success"
+          type: "success",
         });
         this.fileLoading = false;
         this.impDialog = false;
@@ -647,7 +701,7 @@ export default {
       if (response.status == 500) {
         this.$notify({
           message: json.desc,
-          type: "error"
+          type: "error",
         });
       }
       this.fileLoading = false;
@@ -665,14 +719,14 @@ export default {
       if (fileList.length == 0) {
         this.$notify({
           message: "上传文件不能为空",
-          type: "error"
+          type: "error",
         });
         return false;
       }
       if (fileList.length > 1) {
         this.$notify({
           message: "每次只能上传一个文件",
-          type: "error"
+          type: "error",
         });
         return false;
       }
@@ -680,7 +734,7 @@ export default {
         if (!file.name.endsWith(".xlsx")) {
           this.$notify({
             message: "上传文件必须为xlsx格式",
-            type: "error"
+            type: "error",
           });
           this.initUpload();
           return false;
@@ -703,68 +757,16 @@ export default {
         this.user.token;
     },
     init() {
-      this.$httpWithMsg.get(CORE_API + "/org/getRootOrgList").then(response => {
-        this.rootOrgList = response.data;
-        if (this.formSearch.parentId === null)
-          this.formSearch.parentId = this.user.rootOrgId;
-        this.searchForm();
-      });
-    }
+      this.$httpWithMsg
+        .get(CORE_API + "/org/getRootOrgList")
+        .then((response) => {
+          this.rootOrgList = response.data;
+          if (this.formSearch.parentId === null)
+            this.formSearch.parentId = this.user.rootOrgId;
+          this.searchForm();
+        });
+    },
   },
-  // beforeRouteEnter(to, from, next) {
-  //   next(vm => {
-  //     console.log("beforeRouteEnter: formSearch", vm.formSearch);
-  //     vm.formSearch.parentId = to.$route.query.parentId || "";
-  //     vm.formSearch.code = to.$route.query.code || "";
-  //     vm.formSearch.name = to.$route.query.name || "";
-  //     vm.currentPage = parseInt(to.$route.query.currentPage) || vm.currentPage;
-  //     vm.pageSize = parseInt(to.$route.query.pageSize) || vm.pageSize;
-  //   });
-  // },
-  // beforeRouteLeave(to, from, next) {
-  //   // this.$router.push(to);
-  //   // next();
-  //   // this.$route.query = {
-  //   //   parentId: this.formSearch.parentId,
-  //   //   code: this.formSearch.code,
-  //   //   name: this.formSearch.name,
-  //   //   currentPage: this.currentPage,
-  //   //   pageSize: this.pageSize
-  //   // };
-  //   // next();
-  //   this.$router.push({
-  //     path: "/basic/campus",
-  //     query: {
-  //       parentId: this.formSearch.parentId,
-  //       code: this.formSearch.code,
-  //       name: this.formSearch.name,
-  //       currentPage: this.currentPage,
-  //       pageSize: this.pageSize
-  //     }
-  //   });
-  //   setTimeout(() => {
-  //     console.log("settimeout next");
-  //     next();
-  //   }, 500);
-  // },
-  //初始化查询
-  created() {
-    this.formSearch.parentId = parseInt(this.$route.query.parentId);
-    if (isNaN(this.formSearch.parentId)) {
-      this.formSearch.parentId = null;
-    }
-    this.formSearch.code = this.$route.query.code || "";
-    this.formSearch.name = this.$route.query.name || "";
-    this.currentPage =
-      parseInt(this.$route.query.currentPage) || this.currentPage;
-    this.pageSize = parseInt(this.$route.query.pageSize) || this.pageSize;
-
-    this.init();
-    this.uploadHeaders = {
-      key: this.user.key,
-      token: this.user.token
-    };
-  }
 };
 </script>
 

+ 189 - 184
src/modules/basic/view/clientConfig.vue

@@ -2,30 +2,30 @@
   <el-container>
     <el-main class="el-main-padding">
       <el-form
+        ref="ruleForm"
         :model="ruleForm"
         :rules="rules"
-        ref="ruleForm"
         label-width="136px"
         class="demo-ruleForm"
         :inline-message="true"
       >
-        <div style="margin-bottom: 10px;">
+        <div style="margin-bottom: 10px">
           <el-select
             v-if="isSuperAdmin"
             v-model="ruleForm.orgId"
             placeholder="请选择"
-            style="width: 180px;"
+            style="width: 180px"
             filterable
           >
             <el-option
               v-for="item in rootSchoolSelect"
+              :key="item.id"
               :label="item.name"
               :value="item.id"
-              :key="item.id"
             />
           </el-select>
           <el-button
-            style="margin-left: 10px;"
+            style="margin-left: 10px"
             :disabled="btnSaveDiabled"
             type="primary"
             @click="submitForm('ruleForm')"
@@ -43,8 +43,8 @@
             </el-form-item>
             <el-form-item label="学校logo" prop="LOGO_FILE_URL">
               <el-upload
-                class="upload-width"
                 ref="upload"
+                class="upload-width"
                 accept=".png"
                 :action="uploadAction"
                 :headers="uploadHeaders"
@@ -61,7 +61,7 @@
                 :on-exceed="handleExceed"
                 list-type="picture"
               >
-                <el-button size="small" slot="trigger" type="primary"
+                <el-button slot="trigger" size="small" type="primary"
                   >选择文件</el-button
                 >&nbsp;
                 <el-button size="small" type="success" @click="submitUpload"
@@ -84,10 +84,10 @@
               <el-checkbox-group v-model="ruleForm.loginType">
                 <el-checkbox
                   v-for="lt in loginTypes"
+                  :key="lt.code"
+                  v-model="lt.code"
                   name="loginType"
                   :label="lt.code"
-                  v-model="lt.code"
-                  :key="lt.code"
                   >{{ lt.name }}</el-checkbox
                 >
               </el-checkbox-group>
@@ -113,10 +113,10 @@
               <el-checkbox-group v-model="ruleForm.loginSupport">
                 <el-checkbox
                   v-for="lt in loginSupports"
+                  :key="lt.code"
+                  v-model="lt.code"
                   name="loginSupport"
                   :label="lt.code"
-                  v-model="lt.code"
-                  :key="lt.code"
                   >{{ lt.name }}</el-checkbox
                 >
               </el-checkbox-group>
@@ -138,10 +138,10 @@
               <el-checkbox-group v-model="ruleForm.preventCheatingConfig">
                 <el-checkbox
                   v-for="pcc in preventCheatingConfigs"
+                  :key="pcc.code"
+                  v-model="pcc.code"
                   name="preventCheatingConfig"
                   :label="pcc.code"
-                  v-model="pcc.code"
-                  :key="pcc.code"
                   >{{ pcc.name }}</el-checkbox
                 >
               </el-checkbox-group>
@@ -161,10 +161,10 @@
               <el-checkbox-group v-model="ruleForm.studentClientVersion">
                 <el-checkbox
                   v-for="pcc in studentClientVersions"
+                  :key="pcc.code"
+                  v-model="pcc.code"
                   name="studentClientVersion"
                   :label="pcc.code"
-                  v-model="pcc.code"
-                  :key="pcc.code"
                   >{{ pcc.name }}</el-checkbox
                 >
               </el-checkbox-group>
@@ -173,22 +173,22 @@
           <el-tab-pane label="自定义菜单配置" name="third">
             <el-form-item label="自定义菜单logo">
               <el-radio-group
-                @change="csutomMenuLogoChange"
                 v-model="ruleForm.IS_CUSTOM_MENU_LOGO"
                 class="input"
+                @change="csutomMenuLogoChange"
               >
                 <el-radio label="true">是</el-radio>
                 <el-radio label="false">否</el-radio>
               </el-radio-group>
             </el-form-item>
             <el-form-item
+              v-if="ruleForm.IS_CUSTOM_MENU_LOGO == 'true'"
               label="菜单logo"
               prop="CUS_MENU_LOGO_FILE_URL"
-              v-if="ruleForm.IS_CUSTOM_MENU_LOGO == 'true'"
             >
               <el-upload
-                class="upload-width"
                 ref="menuLogUpload"
+                class="upload-width"
                 accept=".png"
                 :action="uploadMenuLogoAction"
                 :headers="uploadMenuLogoHeaders"
@@ -205,7 +205,7 @@
                 :on-exceed="handleMenuLogoExceed"
                 list-type="picture"
               >
-                <el-button size="small" slot="trigger" type="primary"
+                <el-button slot="trigger" size="small" type="primary"
                   >选择文件</el-button
                 >&nbsp;
                 <el-button
@@ -232,19 +232,19 @@
 
             <el-form-item label="菜单自定义">
               <!-- 权限树 -->
-              <div style="width: 80%;">
+              <div style="width: 80%">
                 <el-tree
+                  ref="tree"
                   :data="treeData"
                   :props="defaultProps"
                   node-key="id"
-                  ref="tree"
                   highlight-current
                   :default-expanded-keys="[-1]"
                   :expand-on-click-node="false"
                   :render-content="renderMenuTreeContent"
                   :show-checkbox="true"
+                  style="padding: 10px"
                   @check-change="treeCheckeChange"
-                  style="padding: 10px;"
                 />
               </div>
             </el-form-item>
@@ -260,10 +260,10 @@
         :close-on-click-modal="false"
       >
         <el-form
+          ref="updateForm"
           :model="cusMenuTreeDialog.privilege"
           inline
           inline-message
-          ref="updateForm"
           label-width="100px"
           :rules="menuRules"
         >
@@ -290,42 +290,42 @@
               class="input_width"
             />
           </el-form-item>
-          <el-form-item label="权重" prop="weight" v-if="false">
+          <el-form-item v-if="false" label="权重" prop="weight">
             <el-input
               v-model="cusMenuTreeDialog.privilege.weight"
               :disabled="cusMenuTreeDialog.optType == 'view'"
               class="input_width"
             />
           </el-form-item>
-          <el-form-item label="属性1" v-if="false">
+          <el-form-item v-if="false" label="属性1">
             <el-input
               v-model="cusMenuTreeDialog.privilege.ext1"
               :disabled="cusMenuTreeDialog.optType == 'view'"
               class="input_width"
             />
           </el-form-item>
-          <el-form-item label="属性2" v-if="false">
+          <el-form-item v-if="false" label="属性2">
             <el-input
               v-model="cusMenuTreeDialog.privilege.ext2"
               :disabled="cusMenuTreeDialog.optType == 'view'"
               class="input_width"
             />
           </el-form-item>
-          <el-form-item label="属性3" v-if="false">
+          <el-form-item v-if="false" label="属性3">
             <el-input
               v-model="cusMenuTreeDialog.privilege.ext3"
               :disabled="cusMenuTreeDialog.optType == 'view'"
               class="input_width"
             />
           </el-form-item>
-          <el-form-item label="属性4" v-if="false">
+          <el-form-item v-if="false" label="属性4">
             <el-input
               v-model="cusMenuTreeDialog.privilege.ext4"
               :disabled="cusMenuTreeDialog.optType == 'view'"
               class="input_width"
             />
           </el-form-item>
-          <el-form-item label="属性5" v-if="false">
+          <el-form-item v-if="false" label="属性5">
             <el-input
               v-model="cusMenuTreeDialog.privilege.ext5"
               :disabled="cusMenuTreeDialog.optType == 'view'"
@@ -362,7 +362,7 @@ import {
   PREVENT_CHEATING_CONFIG,
   STUDENT_CLIENT_VERSION,
   CORE_API,
-  LOGIN_SUPPORT
+  LOGIN_SUPPORT,
 } from "@/constants/constants.js";
 let checkWeight = (rule, value, callback) => {
   if ("0" != value && !value) {
@@ -425,12 +425,12 @@ export default {
           IDENTITY_NUMBER_LOGIN_ALIAS: "身份证号登录",
           LOGIN_SUPPORT: "",
           IS_CUSTOM_MENU_LOGO: "false",
-          CUS_MENU_LOGO_FILE_URL: ""
+          CUS_MENU_LOGO_FILE_URL: "",
         },
         loginType: [],
         preventCheatingConfig: [],
         studentClientVersion: [],
-        loginSupport: []
+        loginSupport: [],
       },
       logoDialog: false,
       uploadAction: "",
@@ -442,31 +442,31 @@ export default {
           {
             required: true,
             message: "请输入权限名称",
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         code: [
           {
             required: true,
             message: "请输入权限编码",
-            trigger: "blur"
+            trigger: "blur",
           },
           {
             validator: checkCode,
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         weight: [
           {
             required: true,
             message: "请输入权重",
-            trigger: "blur"
+            trigger: "blur",
           },
           {
             validator: checkWeight,
-            trigger: "blur"
-          }
-        ]
+            trigger: "blur",
+          },
+        ],
       },
       rules: {
         OE_STUDENT_SYS_NAME: [
@@ -475,30 +475,30 @@ export default {
             min: 1,
             max: 50,
             message: "长度在 1 到 50 个字符",
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         LOGO_FILE_URL: [
-          { required: true, message: "请上传学校logo", trigger: "change" }
+          { required: true, message: "请上传学校logo", trigger: "change" },
         ],
         loginType: [
           {
             type: "array",
             required: true,
             message: "请至少选择一个登录账号选择",
-            trigger: "change"
-          }
+            trigger: "change",
+          },
         ],
         loginSupport: [
           {
             type: "array",
             required: true,
             message: "请至少选择一个考生端登录方式",
-            trigger: "change"
-          }
+            trigger: "change",
+          },
         ],
         STUDENT_CLIENT_DEFAULT_SIZE: [
-          { required: true, message: "请输入客户端默认大小", trigger: "blur" }
+          { required: true, message: "请输入客户端默认大小", trigger: "blur" },
         ],
         STUDENT_CODE_LOGIN_ALIAS: [
           { required: true, message: "请输入学号登录别名", trigger: "blur" },
@@ -506,33 +506,37 @@ export default {
             min: 1,
             max: 10,
             message: "长度在 1 到 10 个字符",
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         IDENTITY_NUMBER_LOGIN_ALIAS: [
           {
             required: true,
             message: "请输入身份证号登录别名",
-            trigger: "blur"
+            trigger: "blur",
           },
           {
             min: 1,
             max: 10,
             message: "长度在 1 到 10 个字符",
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         studentClientVersion: [
           {
             type: "array",
             required: true,
             message: "请至少选择一个学生端版本",
-            trigger: "change"
-          }
+            trigger: "change",
+          },
         ],
         CUS_MENU_LOGO_FILE_URL: [
-          { required: true, message: "请上传自定义菜单logo", trigger: "change" }
-        ]
+          {
+            required: true,
+            message: "请上传自定义菜单logo",
+            trigger: "change",
+          },
+        ],
       },
       tabActiveName: "first",
       uploadMenuLogoAction: "",
@@ -556,25 +560,123 @@ export default {
           ext2: null,
           ext3: null,
           ext4: null,
-          ext5: null
-        }
+          ext5: null,
+        },
       },
       treeData: [],
       data: null,
       defaultProps: {
         children: "children",
-        label: "label"
+        label: "label",
       },
       privilegeGroupId: null,
       checkedKeys: [],
       originalCheckedKeys: [],
-      treeCheckedChanged: false
+      treeCheckedChanged: false,
     };
   },
 
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+    btnSaveDiabled() {
+      // console.log(this.formDataChanged);
+      return !this.formDataChanged && !this.treeCheckedChanged;
+    },
+    isSuperAdmin() {
+      return this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN");
+    },
+    rootSchoolSelect() {
+      let rootSchools = [];
+      for (let i = 0; i < this.rootOrgList.length; i++) {
+        let info = {
+          name: this.rootOrgList[i].name + "(" + this.rootOrgList[i].id + ")",
+          id: this.rootOrgList[i].id,
+        };
+        rootSchools.push(info);
+      }
+      return rootSchools;
+    },
+  },
+  watch: {
+    "ruleForm.orgId": {
+      handler: function () {
+        this.initForm();
+      },
+    },
+    checkedKeys: {
+      handler: function (newVal) {
+        this.treeCheckedChanged = !this.equalArrayIgnoreSequence(
+          this.originalCheckedKeys,
+          newVal
+        );
+      },
+    },
+    ruleForm: {
+      deep: true,
+      handler: function (newForm) {
+        if (Object.keys(this.originalRuleForm).length > 0) {
+          this.formDataChanged = !(
+            newForm.OE_STUDENT_SYS_NAME ==
+              this.originalRuleForm.OE_STUDENT_SYS_NAME &&
+            newForm.LOGO_FILE_URL == this.originalRuleForm.LOGO_FILE_URL &&
+            this.equalArrayIgnoreSequence(
+              newForm.loginType,
+              this.originalRuleForm.loginType
+            ) &&
+            this.equalArrayIgnoreSequence(
+              newForm.loginSupport,
+              this.originalRuleForm.loginSupport
+            ) &&
+            this.equalArrayIgnoreSequence(
+              newForm.preventCheatingConfig,
+              this.originalRuleForm.preventCheatingConfig
+            ) &&
+            this.equalArrayIgnoreSequence(
+              newForm.studentClientVersion,
+              this.originalRuleForm.studentClientVersion
+            ) &&
+            newForm.STUDENT_CLIENT_CONSOLE_CONFIG ==
+              this.originalRuleForm.STUDENT_CLIENT_CONSOLE_CONFIG &&
+            newForm.STUDENT_CODE_LOGIN_ALIAS ==
+              this.originalRuleForm.STUDENT_CODE_LOGIN_ALIAS &&
+            newForm.IDENTITY_NUMBER_LOGIN_ALIAS ==
+              this.originalRuleForm.IDENTITY_NUMBER_LOGIN_ALIAS &&
+            newForm.IS_CUSTOM_MENU_LOGO ==
+              this.originalRuleForm.IS_CUSTOM_MENU_LOGO &&
+            newForm.CUS_MENU_LOGO_FILE_URL ==
+              this.originalRuleForm.CUS_MENU_LOGO_FILE_URL
+          );
+        } else {
+          this.formDataChanged = false;
+        }
+      },
+    },
+  },
+
+  created() {
+    this.ruleForm.orgId = this.user.rootOrgId;
+    this.propertyGroupId = "config4Edit3";
+    this.uploadHeaders = {
+      key: this.user.key,
+      token: this.user.token,
+    };
+    this.uploadMenuLogoHeaders = {
+      key: this.user.key,
+      token: this.user.token,
+    };
+    if (this.isSuperAdmin) {
+      this.$httpWithMsg
+        .get(CORE_API + "/org/getRootOrgList")
+        .then((response) => {
+          this.rootOrgList = response.data;
+        });
+    }
+    this.initForm();
+  },
+
   methods: {
     submitForm(formName) {
-      this.$refs[formName].validate(valid => {
+      this.$refs[formName].validate((valid) => {
         if (valid) {
           if (
             this.$refs.tree.getCheckedKeys() == null ||
@@ -582,7 +684,7 @@ export default {
           ) {
             this.$notify({
               message: "请至少选择一个菜单功能",
-              type: "error"
+              type: "error",
             });
             return;
           }
@@ -678,15 +780,15 @@ export default {
               {
                 rootOrgId: this.ruleForm.orgId,
                 privilegeGroupId: this.privilegeGroupId,
-                privilegeIdSet: this.checkedKeys
+                privilegeIdSet: this.checkedKeys,
               }
-            )
+            ),
           ]).then(([resp1, resp2]) => {
             console.log("resp1:" + resp1);
             console.log("resp1:" + resp2);
             this.$notify({
               message: "保存成功",
-              type: "success"
+              type: "success",
             });
             this.originalRuleForm = Object.assign({}, this.ruleForm);
             this.formDataChanged = false;
@@ -724,7 +826,7 @@ export default {
       if (response && response.length > 0) {
         this.$notify({
           message: "上传成功",
-          type: "success"
+          type: "success",
         });
         let fileUrl = response;
 
@@ -741,7 +843,7 @@ export default {
       if (response.status == 500) {
         this.$notify({
           message: json.desc,
-          type: "error"
+          type: "error",
         });
       }
       this.fileLoading = false;
@@ -759,14 +861,14 @@ export default {
       if (fileList.length == 0) {
         this.$notify({
           message: "上传文件不能为空",
-          type: "error"
+          type: "error",
         });
         return false;
       }
       if (fileList.length > 1) {
         this.$notify({
           message: "每次只能上传一个文件",
-          type: "error"
+          type: "error",
         });
         return false;
       }
@@ -779,7 +881,7 @@ export default {
         ) {
           this.$notify({
             message: "上传文件格式必须为[png]",
-            type: "error"
+            type: "error",
           });
           this.fileList = [];
           return false;
@@ -802,7 +904,7 @@ export default {
     handleExceed() {
       this.$notify({
         message: "当前限制选择 1 个文件,请先清空文件再试",
-        type: "error"
+        type: "error",
       });
     },
     equalArrayIgnoreSequence(arr1, arr2) {
@@ -833,7 +935,7 @@ export default {
         "/" +
         this.propertyGroupId;
 
-      await this.$httpWithMsg.get(url).then(response => {
+      await this.$httpWithMsg.get(url).then((response) => {
         console.log(response);
 
         if (response) {
@@ -953,7 +1055,7 @@ export default {
               let len = fileUrl2.length;
               fname2 = fileUrl2.substr(lastIndex + 1, len - lastIndex);
               this.menuLogoFileList = [
-                { name: fname2, url: this.ruleForm.CUS_MENU_LOGO_FILE_URL }
+                { name: fname2, url: this.ruleForm.CUS_MENU_LOGO_FILE_URL },
               ];
             } else {
               this.menuLogoFileList = [];
@@ -964,7 +1066,7 @@ export default {
         } else {
           this.$notify({
             message: "学生客户端信息暂未初始化,请立即初始化",
-            type: "warning"
+            type: "warning",
           });
         }
       });
@@ -977,7 +1079,7 @@ export default {
         "/rolePrivilege/getStudentClientMenuTree/" +
         this.ruleForm.orgId +
         "?includeDisabledCodes=false";
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         if (response) {
           this.treeData = [];
           this.treeData.push(response.data.treeData);
@@ -989,7 +1091,7 @@ export default {
         } else {
           this.$notify({
             message: "自定义菜单权限树初始化失败",
-            type: "warning"
+            type: "warning",
           });
         }
       });
@@ -1045,7 +1147,7 @@ export default {
 
     getPrivilege(id, type) {
       var url = CORE_API + "/rolePrivilege/getPrivilege/" + id;
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         var resp = response.data;
 
         this.cusMenuTreeDialog.show = true;
@@ -1081,7 +1183,7 @@ export default {
       if (response && response.length > 0) {
         this.$notify({
           message: "上传成功",
-          type: "success"
+          type: "success",
         });
         let fileUrl = response;
 
@@ -1098,7 +1200,7 @@ export default {
       if (response.status == 500) {
         this.$notify({
           message: json.desc,
-          type: "error"
+          type: "error",
         });
       }
       this.fileLoading = false;
@@ -1116,14 +1218,14 @@ export default {
       if (fileList.length == 0) {
         this.$notify({
           message: "上传文件不能为空",
-          type: "error"
+          type: "error",
         });
         return false;
       }
       if (fileList.length > 1) {
         this.$notify({
           message: "每次只能上传一个文件",
-          type: "error"
+          type: "error",
         });
         return false;
       }
@@ -1136,7 +1238,7 @@ export default {
         ) {
           this.$notify({
             message: "上传文件格式必须为[png]",
-            type: "error"
+            type: "error",
           });
           this.menuLogoFileList = [];
           return false;
@@ -1160,12 +1262,12 @@ export default {
     handleMenuLogoExceed() {
       this.$notify({
         message: "当前限制选择 1 个文件,请先清空文件再试",
-        type: "error"
+        type: "error",
       });
     },
 
     updatePrivilege() {
-      this.$refs.updateForm.validate(valid => {
+      this.$refs.updateForm.validate((valid) => {
         if (!valid) {
           return;
         }
@@ -1175,7 +1277,7 @@ export default {
           .then(() => {
             this.$notify({
               message: "修改成功",
-              type: "success"
+              type: "success",
             });
             this.data.label = this.cusMenuTreeDialog.privilege.name;
           });
@@ -1186,105 +1288,8 @@ export default {
       if (val == "false") {
         this.removeMenuLogoFile();
       }
-    }
-  },
-
-  created() {
-    this.ruleForm.orgId = this.user.rootOrgId;
-    this.propertyGroupId = "config4Edit3";
-    this.uploadHeaders = {
-      key: this.user.key,
-      token: this.user.token
-    };
-    this.uploadMenuLogoHeaders = {
-      key: this.user.key,
-      token: this.user.token
-    };
-    if (this.isSuperAdmin) {
-      this.$httpWithMsg.get(CORE_API + "/org/getRootOrgList").then(response => {
-        this.rootOrgList = response.data;
-      });
-    }
-    this.initForm();
-  },
-
-  watch: {
-    "ruleForm.orgId": {
-      handler: function() {
-        this.initForm();
-      }
-    },
-    checkedKeys: {
-      handler: function(newVal) {
-        this.treeCheckedChanged = !this.equalArrayIgnoreSequence(
-          this.originalCheckedKeys,
-          newVal
-        );
-      }
     },
-    ruleForm: {
-      deep: true,
-      handler: function(newForm) {
-        if (Object.keys(this.originalRuleForm).length > 0) {
-          this.formDataChanged = !(
-            newForm.OE_STUDENT_SYS_NAME ==
-              this.originalRuleForm.OE_STUDENT_SYS_NAME &&
-            newForm.LOGO_FILE_URL == this.originalRuleForm.LOGO_FILE_URL &&
-            this.equalArrayIgnoreSequence(
-              newForm.loginType,
-              this.originalRuleForm.loginType
-            ) &&
-            this.equalArrayIgnoreSequence(
-              newForm.loginSupport,
-              this.originalRuleForm.loginSupport
-            ) &&
-            this.equalArrayIgnoreSequence(
-              newForm.preventCheatingConfig,
-              this.originalRuleForm.preventCheatingConfig
-            ) &&
-            this.equalArrayIgnoreSequence(
-              newForm.studentClientVersion,
-              this.originalRuleForm.studentClientVersion
-            ) &&
-            newForm.STUDENT_CLIENT_CONSOLE_CONFIG ==
-              this.originalRuleForm.STUDENT_CLIENT_CONSOLE_CONFIG &&
-            newForm.STUDENT_CODE_LOGIN_ALIAS ==
-              this.originalRuleForm.STUDENT_CODE_LOGIN_ALIAS &&
-            newForm.IDENTITY_NUMBER_LOGIN_ALIAS ==
-              this.originalRuleForm.IDENTITY_NUMBER_LOGIN_ALIAS &&
-            newForm.IS_CUSTOM_MENU_LOGO ==
-              this.originalRuleForm.IS_CUSTOM_MENU_LOGO &&
-            newForm.CUS_MENU_LOGO_FILE_URL ==
-              this.originalRuleForm.CUS_MENU_LOGO_FILE_URL
-          );
-        } else {
-          this.formDataChanged = false;
-        }
-      }
-    }
   },
-
-  computed: {
-    ...mapState({ user: state => state.user }),
-    btnSaveDiabled() {
-      // console.log(this.formDataChanged);
-      return !this.formDataChanged && !this.treeCheckedChanged;
-    },
-    isSuperAdmin() {
-      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
-    },
-    rootSchoolSelect() {
-      let rootSchools = [];
-      for (let i = 0; i < this.rootOrgList.length; i++) {
-        let info = {
-          name: this.rootOrgList[i].name + "(" + this.rootOrgList[i].id + ")",
-          id: this.rootOrgList[i].id
-        };
-        rootSchools.push(info);
-      }
-      return rootSchools;
-    }
-  }
 };
 </script>
 

+ 109 - 109
src/modules/basic/view/course.vue

@@ -7,72 +7,72 @@
         element-loading-text="请稍后..."
       >
         <el-form
+          ref="primaryForm"
           inline
           :model="formSearch"
           label-width="70px"
-          ref="primaryForm"
         >
           <el-form-item label="课程名称">
             <el-input
+              v-model="formSearch.name"
               class="input_width_lg"
               placeholder="请输入课程名称"
-              v-model="formSearch.name"
             />
           </el-form-item>
           <el-form-item label="课程代码">
             <el-input
+              v-model="formSearch.code"
               class="input_width_lg"
               placeholder="请输入课程代码"
-              v-model="formSearch.code"
             />
           </el-form-item>
           <el-form-item label="课程状态">
             <el-select
-              class="input_width_lg"
               v-model="formSearch.enable"
+              class="input_width_lg"
               placeholder="请选择"
               clearable
             >
               <el-option
                 v-for="item in statusList"
+                :key="item.value"
                 :label="item.label"
                 :value="item.value"
-                :key="item.value"
               />
             </el-select>
           </el-form-item>
           <el-form-item label="层次">
             <el-select
-              class="input_width_lg"
               v-model="formSearch.level"
+              class="input_width_lg"
               placeholder="请选择"
               clearable
             >
               <el-option
                 v-for="item in levelList"
+                :key="item.value"
                 :label="item.label"
                 :value="item.value"
-                :key="item.value"
               />
             </el-select>
           </el-form-item>
           <el-form-item label="专业" prop="specialtyId">
             <el-select
+              v-model="formSearch.specialtyId"
               class="input_width_lg"
               remote
               :remote-method="getSpecialtyList4Search"
-              @focus="e => getSpecialtyList4Search(e.target.value)"
               :loading="specialtyLoading4Search"
               filterable
               clearable
-              v-model="formSearch.specialtyId"
               placeholder="请选择"
+              @focus="(e) => getSpecialtyList4Search(e.target.value)"
             >
               <el-option
                 v-for="item in specialtyList4SearchWrapper"
+                :key="item.id"
                 :label="item.name"
                 :value="item.id"
-                :key="item.id"
               />
             </el-select>
           </el-form-item>
@@ -87,8 +87,8 @@
             >
             <el-button
               size="small"
-              @click="resetPrimaryForm"
               icon="el-icon-refresh"
+              @click="resetPrimaryForm"
             >
               重置
             </el-button>
@@ -108,39 +108,39 @@
         <el-button
           size="small"
           type="success"
-          @click="enableByIds"
           :disabled="noBatchSelected"
           icon="el-icon-check"
+          @click="enableByIds"
         >
           启用
         </el-button>
         <el-button
           size="small"
           type="danger"
-          @click="disableByIds"
           :disabled="noBatchSelected"
           icon="el-icon-close"
+          @click="disableByIds"
         >
           禁用
         </el-button>
         <el-button
           size="small"
           type="primary"
-          @click="impCourse"
           icon="el-icon-upload2"
+          @click="impCourse"
         >
           导入
         </el-button>
         <el-button
           size="small"
           type="primary"
-          @click="exportCourse"
           icon="el-icon-download"
+          @click="exportCourse"
         >
           导出
         </el-button>
 
-        <div style="width: 100%;margin-bottom: 10px;"></div>
+        <div style="width: 100%; margin-bottom: 10px"></div>
 
         <!-- 添加或新增课程弹出框 -->
         <el-dialog
@@ -150,19 +150,19 @@
           @close="dialogBeforeClose"
         >
           <el-form
+            ref="courseForm"
             :inline="true"
             inline-message
             :model="courseForm"
-            ref="courseForm"
             :rules="rules"
             label-width="90px"
           >
             <el-row>
               <el-form-item label="课程代码" prop="code">
                 <el-input
+                  v-model="courseForm.code"
                   :disabled="null != courseForm.id"
                   class="pull_length"
-                  v-model="courseForm.code"
                   auto-complete="off"
                   placeholder="请输入课程代码"
                 />
@@ -171,8 +171,8 @@
             <el-row>
               <el-form-item label="课程名称" prop="name">
                 <el-input
-                  class="pull_length"
                   v-model="courseForm.name"
+                  class="pull_length"
                   auto-complete="off"
                   placeholder="请输入课程名称"
                 />
@@ -181,22 +181,22 @@
             <el-row>
               <el-form-item label="层次" prop="level">
                 <el-select
-                  class="pull_length"
                   v-model="courseForm.level"
+                  class="pull_length"
                   placeholder="请选择"
                 >
                   <el-option
                     v-for="item in levelList"
+                    :key="item.value"
                     :label="item.label"
                     :value="item.value"
-                    :key="item.value"
                   />
                 </el-select>
               </el-form-item>
             </el-row>
             <el-row>
               <el-form-item label="课程状态" prop="enable">
-                <el-radio-group class="pull_length" v-model="courseForm.enable">
+                <el-radio-group v-model="courseForm.enable" class="pull_length">
                   <el-radio label="true">启用</el-radio>
                   <el-radio label="false">禁用</el-radio>
                 </el-radio-group>
@@ -213,10 +213,10 @@
         <el-dialog title="导入窗口" width="520px" :visible.sync="impDialog">
           <el-form>
             <el-row>
-              <el-form-item style="margin-left:20px">
+              <el-form-item style="margin-left: 20px">
                 <el-upload
-                  class="form_left"
                   ref="upload"
+                  class="form_left"
                   accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
                   :action="uploadAction"
                   :headers="uploadHeaders"
@@ -230,8 +230,8 @@
                   :multiple="false"
                 >
                   <el-button
-                    size="small"
                     slot="trigger"
+                    size="small"
                     type="primary"
                     icon="el-icon-search"
                   >
@@ -241,24 +241,24 @@
                   <el-button
                     size="small"
                     type="primary"
-                    @click="submitUpload"
                     icon="el-icon-check"
+                    @click="submitUpload"
                   >
                     确认上传
                   </el-button>
                   <el-button
                     size="small"
                     type="primary"
-                    @click="removeFile"
                     icon="el-icon-refresh"
+                    @click="removeFile"
                   >
                     清空文件
                   </el-button>
                   <el-button
                     size="small"
                     type="primary"
-                    @click="exportFile"
                     icon="el-icon-download"
+                    @click="exportFile"
                   >
                     下载模板
                   </el-button>
@@ -272,9 +272,9 @@
         <!-- 导入错误信息列表 -->
         <el-dialog title="错误提示" :visible.sync="errDialog">
           <div
-            class="text-danger"
             v-for="errMessage in errMessages"
             :key="errMessage.lineNum"
+            class="text-danger"
           >
             第{{ errMessage.lineNum }}行:{{ errMessage.msg }}
           </div>
@@ -293,16 +293,16 @@
           <el-form :inline="true" :model="specialtySearchForm">
             <el-form-item label="专业名称">
               <el-input
+                v-model="specialtySearchForm.name"
                 class="input_width_lg"
                 placeholder="请输入专业名称"
-                v-model="specialtySearchForm.name"
               />
             </el-form-item>
             <el-form-item label="专业代码">
               <el-input
+                v-model="specialtySearchForm.code"
                 class="input_width_lg"
                 placeholder="请输入专业代码"
-                v-model="specialtySearchForm.code"
               />
             </el-form-item>
             <el-form-item>
@@ -342,9 +342,9 @@
                   <el-button
                     size="mini"
                     type="primary"
-                    @click="deleteRelation(scope.row)"
                     icon="el-icon-edit"
                     plain
+                    @click="deleteRelation(scope.row)"
                   >
                     取消关联
                   </el-button>
@@ -354,10 +354,10 @@
           </el-table>
           <div class="page pull-right">
             <el-pagination
-              @current-change="handleSpecialtyCurrentChange"
               :current-page="currentSpecialtyPage"
               :page-size="10"
               :total="specialtyTotal"
+              @current-change="handleSpecialtyCurrentChange"
             />
           </div>
           <div style="margin-bottom: 20px"></div>
@@ -371,31 +371,31 @@
           @close="() => this.$refs.addRelationForm.clearValidate()"
         >
           <el-form
+            ref="addRelationForm"
             :inline="true"
             inline-message
             :model="addRelationForm"
-            ref="addRelationForm"
             :rules="addRelationRules"
           >
             <el-row>
               <el-form-item label="专业" prop="specialtyId">
                 <el-select
+                  v-model="addRelationForm.specialtyId"
                   class="input"
                   style="width: 200px"
                   remote
                   :remote-method="getSpecialtyList4AddRelation"
-                  @focus="e => getSpecialtyList4AddRelation(e.target.value)"
                   :loading="specialtyLoading4AddRelation"
                   filterable
                   clearable
-                  v-model="addRelationForm.specialtyId"
                   placeholder="请选择"
+                  @focus="(e) => getSpecialtyList4AddRelation(e.target.value)"
                 >
                   <el-option
                     v-for="item in specialtyList4AddRelationWrapper"
+                    :key="item.id"
                     :label="item.name"
                     :value="item.id"
-                    :key="item.id"
                   />
                 </el-select>
               </el-form-item>
@@ -416,8 +416,8 @@
           border
           resizable
           stripe
+          style="width: 99.99% !important"
           @selection-change="selectChange"
-          style="width: 99.99% !important;"
         >
           <el-table-column type="selection" width="40" />
           <el-table-column prop="id" label="课程ID" width="80" />
@@ -435,7 +435,7 @@
                   content="启用"
                   placement="left"
                 >
-                  <i class="el-icon-success" style="color:green;"></i>
+                  <i class="el-icon-success" style="color: green"></i>
                 </el-tooltip>
               </span>
               <span v-else>
@@ -445,7 +445,7 @@
                   content="禁用"
                   placement="left"
                 >
-                  <i class="el-icon-error" style="color:red;"></i>
+                  <i class="el-icon-error" style="color: red"></i>
                 </el-tooltip>
               </span>
             </span>
@@ -476,21 +476,21 @@
                 <i class="el-icon-edit"></i> 编辑
               </el-button>
               <el-button
-                size="mini"
                 v-if="!scope.row.enable"
+                size="mini"
                 plain
                 type="primary"
-                @click="enableById(scope.row)"
                 icon="el-icon-check"
+                @click="enableById(scope.row)"
               >
                 启用
               </el-button>
               <el-button
-                size="mini"
                 v-if="scope.row.enable"
+                size="mini"
                 type="danger"
-                @click="disableById(scope.row)"
                 icon="el-icon-close"
+                @click="disableById(scope.row)"
               >
                 禁用
               </el-button>
@@ -499,13 +499,13 @@
         </el-table>
         <div class="page pull-right">
           <el-pagination
-            @current-change="handleCurrentChange"
             :current-page="currentPage"
             :page-size="10"
             :page-sizes="[10, 20, 50, 100, 200, 300]"
-            @size-change="handleSizeChange"
             layout="total, sizes, prev, pager, next, jumper"
             :total="total"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
           >
           </el-pagination>
         </div>
@@ -530,14 +530,14 @@ export default {
         code: "",
         enable: "",
         level: "",
-        specialtyId: ""
+        specialtyId: "",
       },
       courseForm: {
         id: null,
         name: "",
         code: "",
         level: "ALL",
-        enable: "true"
+        enable: "true",
       },
       statusList: ENABLE_TYPE,
       levelList: LEVEL_TYPE,
@@ -570,37 +570,37 @@ export default {
           {
             required: true,
             message: "请输入课程名称",
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         code: [
           {
             required: true,
             message: "请输入课程代码",
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         level: [
           {
             required: true,
             message: "请选择层次",
-            trigger: "change"
-          }
+            trigger: "change",
+          },
         ],
         status: [
           {
             required: true,
             message: "请选择状态",
-            trigger: "change"
-          }
-        ]
+            trigger: "change",
+          },
+        ],
       },
       specialtyDialog: false,
       specialtyDialogTitle: null,
       specialtySearchForm: {
         courseId: null,
         code: "",
-        name: ""
+        name: "",
       },
       specialtyTableData: [],
       currentSpecialtyPage: 1,
@@ -610,7 +610,7 @@ export default {
       addRelationDialog: false,
       addRelationForm: {
         specialtyId: null,
-        courseId: null
+        courseId: null,
       },
       specialtyLoading4AddRelation: false,
       specialtyList4AddRelation: [],
@@ -620,15 +620,15 @@ export default {
             required: true,
             type: "number",
             message: "请选择专业",
-            trigger: "change"
-          }
-        ]
-      }
+            trigger: "change",
+          },
+        ],
+      },
     };
   },
   computed: {
     ...mapState({
-      user: state => state.user
+      user: (state) => state.user,
     }),
     noBatchSelected() {
       return this.selectedCourseIds.length === 0;
@@ -658,7 +658,7 @@ export default {
         let specialtyInfo = specialty.name + "(" + specialty.code + ")";
         specialtyList4Search.push({
           id: specialty.id,
-          specialtyInfo: specialtyInfo
+          specialtyInfo: specialtyInfo,
         });
       }
       return specialtyList4Search;
@@ -680,7 +680,15 @@ export default {
         specialtyList.push({ id: id, name: name });
       }
       return specialtyList;
-    }
+    },
+  },
+  //初始化查询
+  created() {
+    this.searchForm();
+    this.uploadHeaders = {
+      key: this.user.key,
+      token: this.user.token,
+    };
   },
   methods: {
     handleSizeChange(val) {
@@ -696,26 +704,26 @@ export default {
       var courseId = this.specialtySearchForm.courseId;
       var param = new URLSearchParams({
         courseId: courseId,
-        specialtyId: specialtyId
+        specialtyId: specialtyId,
       });
       var url = CORE_API + "/courseSpeciatlyRelation/delete?" + param;
       this.$httpWithMsg.delete(url).then(() => {
         this.$notify({
           type: "success",
-          message: "取消关联成功!"
+          message: "取消关联成功!",
         });
         this.searchSpecialtyPage();
       });
     },
     submitAddRelationForm() {
-      this.$refs.addRelationForm.validate(valid => {
+      this.$refs.addRelationForm.validate((valid) => {
         if (valid) {
           var param = new URLSearchParams(this.addRelationForm);
           var url = CORE_API + "/courseSpeciatlyRelation/add?" + param;
           this.$httpWithMsg.post(url, this.speciallyForm).then(() => {
             this.$notify({
               type: "success",
-              message: "添加成功!"
+              message: "添加成功!",
             });
             this.searchSpecialtyPage();
             this.addRelationDialog = false;
@@ -730,7 +738,7 @@ export default {
       this.specialtyLoading4AddRelation = true;
       this.$httpWithMsg
         .get(CORE_API + "/specialty/query?name=" + query)
-        .then(response => {
+        .then((response) => {
           this.specialtyList4AddRelation = response.data;
           this.specialtyLoading4AddRelation = false;
         });
@@ -759,7 +767,7 @@ export default {
         param;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           this.specialtyTableData = response.data.content;
           this.specialtyTotal = response.data.totalElements;
         })
@@ -793,7 +801,7 @@ export default {
       this.specialtyLoading4Search = true;
       this.$httpWithMsg
         .get(CORE_API + "/specialty/query?name=" + query)
-        .then(response => {
+        .then((response) => {
           this.specialtyList4Search = response.data;
           this.specialtyLoading4Search = false;
         });
@@ -820,7 +828,7 @@ export default {
         param;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           this.tableData = response.data.content;
           this.total = response.data.totalElements;
         })
@@ -835,7 +843,7 @@ export default {
     },
     selectChange(row) {
       this.selectedCourseIds = [];
-      row.forEach(element => {
+      row.forEach((element) => {
         this.selectedCourseIds.push(element.id);
       });
       console.log(this.selectedCourseIds);
@@ -895,12 +903,12 @@ export default {
       var url = CORE_API + "/course";
       if (null != this.courseForm.id) {
         //修改
-        this.$refs.courseForm.validate(valid => {
+        this.$refs.courseForm.validate((valid) => {
           if (valid) {
             this.$httpWithMsg.put(url, this.courseForm).then(() => {
               this.$notify({
                 type: "success",
-                message: "修改成功!"
+                message: "修改成功!",
               });
               this.searchForm();
               this.resetForm();
@@ -912,12 +920,12 @@ export default {
           }
         });
       } else {
-        this.$refs.courseForm.validate(valid => {
+        this.$refs.courseForm.validate((valid) => {
           if (valid) {
             this.$httpWithMsg.post(url, this.courseForm).then(() => {
               this.$notify({
                 type: "success",
-                message: "添加成功"
+                message: "添加成功",
               });
               this.searchForm();
               this.resetForm();
@@ -940,7 +948,7 @@ export default {
         code: "",
         enable: "",
         level: "",
-        specialtyId: ""
+        specialtyId: "",
       };
       this.$refs.primaryForm.resetFields();
     },
@@ -949,13 +957,13 @@ export default {
       this.$confirm("是否删除该课程?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         var url = CORE_API + "/course/" + row.id;
         this.$httpWithMsg.delete(url).then(() => {
           this.$notify({
             type: "success",
-            message: "删除成功!"
+            message: "删除成功!",
           });
           this.searchForm();
         });
@@ -966,19 +974,19 @@ export default {
       if (this.selectedCourseIds.length === 0) {
         this.$notify({
           type: "warning",
-          message: "请选择要删除的课程"
+          message: "请选择要删除的课程",
         });
       } else {
         this.$confirm("是否删除这些课程?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "error"
+          type: "error",
         }).then(() => {
           var url = CORE_API + "/course/" + this.courseIds;
           this.$httpWithMsg.delete(url).then(() => {
             this.$notify({
               type: "success",
-              message: "删除成功!"
+              message: "删除成功!",
             });
             this.searchForm();
           });
@@ -990,19 +998,19 @@ export default {
       if (this.selectedCourseIds.length === 0) {
         this.$notify({
           type: "warning",
-          message: "请选择要启用的课程"
+          message: "请选择要启用的课程",
         });
       } else {
         this.$confirm("是否启用这些课程?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "warning"
+          type: "warning",
         }).then(() => {
           var url = CORE_API + "/course/enable/" + this.courseIds;
           this.$httpWithMsg.put(url, {}).then(() => {
             this.$notify({
               type: "success",
-              message: "启用成功!"
+              message: "启用成功!",
             });
             this.searchForm();
           });
@@ -1013,13 +1021,13 @@ export default {
       this.$confirm("是否启用该课程?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         var url = CORE_API + "/course/enable/" + row.id;
         this.$httpWithMsg.put(url, {}).then(() => {
           this.$notify({
             type: "success",
-            message: "启用成功!"
+            message: "启用成功!",
           });
           this.searchForm();
         });
@@ -1030,19 +1038,19 @@ export default {
       if (this.selectedCourseIds.length === 0) {
         this.$notify({
           type: "warning",
-          message: "请选择要禁用的课程"
+          message: "请选择要禁用的课程",
         });
       } else {
         this.$confirm("是否禁用这些课程?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "error"
+          type: "error",
         }).then(() => {
           var url = CORE_API + "/course/disable/" + this.courseIds;
           this.$httpWithMsg.put(url, {}).then(() => {
             this.$notify({
               type: "success",
-              message: "禁用成功!"
+              message: "禁用成功!",
             });
             this.searchForm();
           });
@@ -1054,13 +1062,13 @@ export default {
       this.$confirm("是否禁用该课程?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "error"
+        type: "error",
       }).then(() => {
         var url = CORE_API + "/course/disable/" + row.id;
         return this.$httpWithMsg.put(url, {}).then(() => {
           this.$notify({
             type: "success",
-            message: "禁用成功!"
+            message: "禁用成功!",
           });
           return this.searchForm();
         });
@@ -1084,7 +1092,7 @@ export default {
       if (!response.hasError) {
         this.$notify({
           message: "上传成功",
-          type: "success"
+          type: "success",
         });
         this.fileLoading = false;
         this.impDialog = false;
@@ -1101,7 +1109,7 @@ export default {
       if (response.status == 500) {
         this.$notify({
           message: json.desc,
-          type: "error"
+          type: "error",
         });
       }
       this.fileLoading = false;
@@ -1119,14 +1127,14 @@ export default {
       if (fileList.length == 0) {
         this.$notify({
           message: "上传文件不能为空",
-          type: "error"
+          type: "error",
         });
         return false;
       }
       if (fileList.length > 1) {
         this.$notify({
           message: "每次只能上传一个文件",
-          type: "error"
+          type: "error",
         });
         return false;
       }
@@ -1134,7 +1142,7 @@ export default {
         if (!file.name.endsWith(".xlsx")) {
           this.$notify({
             message: "上传文件必须为xlsx格式",
-            type: "error"
+            type: "error",
           });
           this.initUpload();
           return false;
@@ -1155,16 +1163,8 @@ export default {
         this.user.key +
         "&$token=" +
         this.user.token;
-    }
+    },
   },
-  //初始化查询
-  created() {
-    this.searchForm();
-    this.uploadHeaders = {
-      key: this.user.key,
-      token: this.user.token
-    };
-  }
 };
 </script>
 

+ 60 - 62
src/modules/basic/view/data_previllege.vue

@@ -1,42 +1,42 @@
 <template>
   <div>
-    <LinkTitlesCustom :currentPaths="['用户管理', '数据权限']" />
+    <LinkTitlesCustom :current-paths="['用户管理', '数据权限']" />
     <section class="content">
-      <div class="box box-info" v-loading.body="loading">
+      <div v-loading.body="loading" class="box box-info">
         <!-- 正文信息 -->
         <div class="box-body">
           <el-form
-            :inline="true"
             ref="form"
+            :inline="true"
             :model="form"
             inline-message
             label-position="right"
           >
-            <div style="margin-bottom: 10px;">
+            <div style="margin-bottom: 10px">
               <el-button type="primary" size="small">保 存</el-button>
               <el-button
                 type="primary"
                 size="small"
-                @click="back"
                 icon="el-icon-arrow-left"
+                @click="back"
                 >返 回</el-button
               >
             </div>
-            <el-tabs type="border-card" v-model="activeName">
+            <el-tabs v-model="activeName" type="border-card">
               <el-tab-pane label="考试权限" name="tab1">
                 <el-row class="mb-2">
                   <el-switch
                     v-model="form.defaultStatusExam"
-                    @change="enabled => saveDefaultStatus('Exam', enabled)"
                     active-text="全部考试"
+                    @change="(enabled) => saveDefaultStatus('Exam', enabled)"
                   ></el-switch>
-                  <div class="float-right" v-if="!form.defaultStatusExam">
+                  <div v-if="!form.defaultStatusExam" class="float-right">
                     <el-button
                       size="small"
                       type="danger"
                       icon="el-icon-delete"
-                      @click="deleteBatch('Exam')"
                       :disabled="noBatchSelectedExam"
+                      @click="deleteBatch('Exam')"
                       >删除</el-button
                     >
                     <el-button
@@ -56,7 +56,7 @@
                       border
                       resizable
                       stripe
-                      style="width: 100%;"
+                      style="width: 100%"
                       @selection-change="selectChange"
                     >
                       <el-table-column type="selection" width="40" />
@@ -78,13 +78,13 @@
                     <div class="page pull-right">
                       <el-pagination
                         v-if="paginationShow"
-                        @current-change="handleCurrentChangeExam"
                         :current-page="currentPageExam"
                         :page-size="pageSizeExam"
                         :page-sizes="[10, 20, 50, 100, 200, 300]"
-                        @size-change="handleSizeChangeExam"
                         layout="total, sizes, prev, pager, next, jumper"
                         :total="totalExam"
+                        @current-change="handleCurrentChangeExam"
+                        @size-change="handleSizeChangeExam"
                       />
                     </div>
                   </div>
@@ -94,16 +94,16 @@
                 <el-row class="mb-2">
                   <el-switch
                     v-model="form.defaultStatusCourse"
-                    @change="enabled => saveDefaultStatus('Course', enabled)"
                     active-text="全部课程"
+                    @change="(enabled) => saveDefaultStatus('Course', enabled)"
                   ></el-switch>
-                  <div class="float-right" v-if="!form.defaultStatusCourse">
+                  <div v-if="!form.defaultStatusCourse" class="float-right">
                     <el-button
                       size="small"
                       type="danger"
                       icon="el-icon-delete"
-                      @click="deleteBatch('Course')"
                       :disabled="noBatchSelectedCourse"
+                      @click="deleteBatch('Course')"
                       >删除</el-button
                     >
                     <el-button
@@ -123,7 +123,7 @@
                       border
                       resizable
                       stripe
-                      style="width: 100%;"
+                      style="width: 100%"
                       @selection-change="selectChange"
                     >
                       <el-table-column type="selection" width="40" />
@@ -150,13 +150,13 @@
                     <div class="page pull-right">
                       <el-pagination
                         v-if="paginationShow"
-                        @current-change="handleCurrentChangeCourse"
                         :current-page="currentPageCourse"
                         :page-size="pageSizeCourse"
                         :page-sizes="[10, 20, 50, 100, 200, 300]"
-                        @size-change="handleSizeChangeCourse"
                         layout="total, sizes, prev, pager, next, jumper"
                         :total="totalCourse"
+                        @current-change="handleCurrentChangeCourse"
+                        @size-change="handleSizeChangeCourse"
                       />
                     </div>
                   </div>
@@ -166,16 +166,16 @@
                 <el-row class="mb-2">
                   <el-switch
                     v-model="form.defaultStatusOrg"
-                    @change="enabled => saveDefaultStatus('Org', enabled)"
                     active-text="全部学习中心"
+                    @change="(enabled) => saveDefaultStatus('Org', enabled)"
                   ></el-switch>
-                  <div class="float-right" v-if="!form.defaultStatusOrg">
+                  <div v-if="!form.defaultStatusOrg" class="float-right">
                     <el-button
                       size="small"
                       type="danger"
                       icon="el-icon-delete"
-                      @click="deleteBatch('Org')"
                       :disabled="noBatchSelectedOrg"
+                      @click="deleteBatch('Org')"
                       >删除</el-button
                     >
                     <el-button
@@ -195,7 +195,7 @@
                       border
                       resizable
                       stripe
-                      style="width: 100%;"
+                      style="width: 100%"
                       @selection-change="selectChange"
                     >
                       <el-table-column type="selection" width="40" />
@@ -216,13 +216,13 @@
                     <div class="page pull-right">
                       <el-pagination
                         v-if="paginationShow"
-                        @current-change="handleCurrentChangeOrg"
                         :current-page="currentPageOrg"
                         :page-size="pageSizeOrg"
                         :page-sizes="[10, 20, 50, 100, 200, 300]"
-                        @size-change="handleSizeChangeOrg"
                         layout="total, sizes, prev, pager, next, jumper"
                         :total="totalOrg"
+                        @current-change="handleCurrentChangeOrg"
+                        @size-change="handleSizeChangeOrg"
                       />
                     </div>
                   </div>
@@ -235,17 +235,17 @@
     </section>
     <DataPrevillegeAddExamDialog
       ref="addExamDialog"
-      :userId="userId"
+      :user-id="userId"
       @reload="init"
     />
     <DataPrevillegeAddCourseDialog
       ref="addCourseDialog"
-      :userId="userId"
+      :user-id="userId"
       @reload="init"
     />
     <DataPrevillegeAddOrgDialog
       ref="addOrgDialog"
-      :userId="userId"
+      :user-id="userId"
       @reload="init"
     />
   </div>
@@ -266,25 +266,25 @@ export default {
     LinkTitlesCustom,
     DataPrevillegeAddExamDialog,
     DataPrevillegeAddCourseDialog,
-    DataPrevillegeAddOrgDialog
+    DataPrevillegeAddOrgDialog,
   },
   data() {
     return {
       rolePrivileges: {
-        user_data_rule_setting: false
+        user_data_rule_setting: false,
       },
       loading: false,
       style: {
         label_width_tab1: "160px",
         label_width_tab2: "160px",
-        label_width_tab3: "160px"
+        label_width_tab3: "160px",
       },
       activeName: "tab1",
       toActiveName: null,
       form: {
         defaultStatusExam: false,
         defaultStatusCourse: false,
-        defaultStatusOrg: false
+        defaultStatusOrg: false,
       },
       userId: "",
       paginationShow: false,
@@ -303,10 +303,30 @@ export default {
       noBatchSelectedOrg: true,
       currentPageOrg: 1,
       pageSizeOrg: 10,
-      totalOrg: 10
+      totalOrg: 10,
     };
   },
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+  },
+  async created() {
+    await this.initPrivileges();
+    if (!this.rolePrivileges.user_data_rule_setting) {
+      this.$alert("没有权限访问!", "提示", {
+        confirmButtonText: "确定",
+        callback: () => {
+          this.back();
+        },
+      });
+      return;
+    }
 
+    this.userId = this.$route.params.userId;
+    await this.init();
+    this.$nextTick(function () {
+      this.paginationShow = true;
+    });
+  },
   methods: {
     async init() {
       const reqs = [];
@@ -329,7 +349,7 @@ export default {
           this.$httpWithMsg.post(url, {
             userId: this.userId,
             pageNo,
-            pageSize
+            pageSize,
           })
         );
       }
@@ -400,12 +420,12 @@ export default {
             object2QueryString({
               enabled,
               type: type.toUpperCase(),
-              userId: this.userId
+              userId: this.userId,
             })
         );
         this.$notify({
           type: "success",
-          message: "更新成功"
+          message: "更新成功",
         });
       } catch (error) {
         this.form["defaultStatus" + type] = !enabled;
@@ -415,18 +435,18 @@ export default {
       this.$refs.addExamDialog.openDialog();
     },
     async deleteBatch(type) {
-      const refIds = this.$refs["table" + type].selection.map(v => v.refId);
+      const refIds = this.$refs["table" + type].selection.map((v) => v.refId);
 
       try {
         await this.$httpWithMsg.post(CORE_API + "/user/data/rule/delete", {
           refIds,
           type: type.toUpperCase(),
-          userId: this.userId
+          userId: this.userId,
         });
 
         this.$notify({
           type: "success",
-          message: "删除成功"
+          message: "删除成功",
         });
         await this.init();
       } catch (error) {
@@ -446,33 +466,11 @@ export default {
         Object.keys(this.rolePrivileges).toString()
       );
       var url = CORE_API + "/rolePrivilege/checkPrivileges?" + params;
-      await this.$httpWithMsg.post(url).then(response => {
+      await this.$httpWithMsg.post(url).then((response) => {
         this.rolePrivileges = response.data;
       });
-    }
-  },
-  async created() {
-    await this.initPrivileges();
-    if (!this.rolePrivileges.user_data_rule_setting) {
-      this.$alert("没有权限访问!", "提示", {
-        confirmButtonText: "确定",
-        callback: () => {
-          this.back();
-        }
-      });
-      return;
-    }
-
-    this.userId = this.$route.params.userId;
-    await this.init();
-    this.$nextTick(function() {
-      this.paginationShow = true;
-    });
+    },
   },
-  mounted() {},
-  computed: {
-    ...mapState({ user: state => state.user })
-  }
 };
 </script>
 <style scoped>

+ 14 - 14
src/modules/basic/view/data_previllege_add_course.vue

@@ -7,8 +7,8 @@
     @close="closeDialog"
   >
     <el-form
-      :model="form"
       ref="form"
+      :model="form"
       :rules="rules"
       :inline="true"
       label-position="right"
@@ -16,7 +16,7 @@
     >
       <el-row>
         <el-form-item label="课程名称">
-          <el-input placeholder="请输入课程名称" v-model="form.name" />
+          <el-input v-model="form.name" placeholder="请输入课程名称" />
         </el-form-item>
         <el-form-item label="课程层次">
           <LevelTypeSelect v-model="form.levelType"></LevelTypeSelect>
@@ -41,7 +41,7 @@
             border
             resizable
             stripe
-            style="width: 100%;"
+            style="width: 100%"
           >
             <el-table-column type="selection" width="40" />
             <el-table-column width="85" label="课程ID">
@@ -62,13 +62,13 @@
           <div class="page pull-right">
             <el-pagination
               v-if="paginationShow"
-              @current-change="handleCurrentChange"
               :current-page="currentPage"
               :page-size="pageSize"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
-              @size-change="handleSizeChange"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @current-change="handleCurrentChange"
+              @size-change="handleSizeChange"
             />
           </div>
         </div>
@@ -76,7 +76,7 @@
       </el-row>
 
       <el-row class="d-flex justify-content-center mt-2">
-        <el-button type="primary" @click="submitForm" :loading="loading"
+        <el-button type="primary" :loading="loading" @click="submitForm"
           >确 定</el-button
         >
         <el-button @click="closeDialog">取 消</el-button>
@@ -90,14 +90,14 @@ import { CORE_API } from "@/constants/constants";
 export default {
   name: "DataPrevillegeAddCourseDialog",
   props: {
-    userId: String
+    userId: { type: String, default: "" },
   },
   data() {
     return {
       visible: false,
       form: {
         name: "",
-        levelType: ""
+        levelType: "",
       },
       rules: {},
       loading: false,
@@ -106,7 +106,7 @@ export default {
       noBatchSelected: true,
       currentPage: 1,
       pageSize: 10,
-      total: 10
+      total: 10,
     };
   },
   methods: {
@@ -121,7 +121,7 @@ export default {
         "?" +
         param;
       this.loading = true;
-      return this.$httpWithMsg.get(url).then(response => {
+      return this.$httpWithMsg.get(url).then((response) => {
         this.tableData = response.data.content;
         this.total = response.data.total;
         this.loading = false;
@@ -157,7 +157,7 @@ export default {
         return;
       }
 
-      const refIds = this.$refs.table.selection.map(v => v.id);
+      const refIds = this.$refs.table.selection.map((v) => v.id);
       console.log(refIds);
       if (refIds.length === 0) {
         this.$notify({ type: "warning", message: "请先选择一行或多行" });
@@ -170,7 +170,7 @@ export default {
         await this.$httpWithMsg.post(CORE_API + "/user/data/rule/add", {
           refIds,
           type: "COURSE",
-          userId: this.userId
+          userId: this.userId,
         });
         this.$emit("reload");
         this.$notify({ title: "保存成功", type: "success" });
@@ -178,8 +178,8 @@ export default {
       } finally {
         this.loading = false;
       }
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 14 - 14
src/modules/basic/view/data_previllege_add_exam.vue

@@ -7,8 +7,8 @@
     @close="closeDialog"
   >
     <el-form
-      :model="form"
       ref="form"
+      :model="form"
       :rules="rules"
       :inline="true"
       label-position="right"
@@ -16,7 +16,7 @@
     >
       <el-row>
         <el-form-item label="考试名称">
-          <el-input placeholder="请输入考试名称" v-model="form.name" />
+          <el-input v-model="form.name" placeholder="请输入考试名称" />
         </el-form-item>
         <el-form-item label="考试类型">
           <ExamTypeSelect v-model="form.examType"></ExamTypeSelect>
@@ -41,7 +41,7 @@
             border
             resizable
             stripe
-            style="width: 100%;"
+            style="width: 100%"
           >
             <el-table-column type="selection" width="40" />
             <el-table-column width="85" label="考试ID">
@@ -62,13 +62,13 @@
           <div class="page pull-right">
             <el-pagination
               v-if="paginationShow"
-              @current-change="handleCurrentChange"
               :current-page="currentPage"
               :page-size="pageSize"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
-              @size-change="handleSizeChange"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @current-change="handleCurrentChange"
+              @size-change="handleSizeChange"
             />
           </div>
         </div>
@@ -76,7 +76,7 @@
       </el-row>
 
       <el-row class="d-flex justify-content-center mt-2">
-        <el-button type="primary" @click="submitForm" :loading="loading"
+        <el-button type="primary" :loading="loading" @click="submitForm"
           >确 定</el-button
         >
         <el-button @click="closeDialog">取 消</el-button>
@@ -90,14 +90,14 @@ import { CORE_API, EXAM_WORK_API } from "@/constants/constants";
 export default {
   name: "DataPrevillegeAddExamDialog",
   props: {
-    userId: String
+    userId: { type: String, default: "" },
   },
   data() {
     return {
       visible: false,
       form: {
         name: "",
-        examType: ""
+        examType: "",
       },
       rules: {},
       loading: false,
@@ -106,7 +106,7 @@ export default {
       noBatchSelected: true,
       currentPage: 1,
       pageSize: 10,
-      total: 10
+      total: 10,
     };
   },
   methods: {
@@ -121,7 +121,7 @@ export default {
         "?" +
         param;
       this.loading = true;
-      return this.$httpWithMsg.get(url).then(response => {
+      return this.$httpWithMsg.get(url).then((response) => {
         this.tableData = response.data.list;
         this.total = response.data.total;
         this.loading = false;
@@ -157,7 +157,7 @@ export default {
         return;
       }
 
-      const refIds = this.$refs.table.selection.map(v => v.id);
+      const refIds = this.$refs.table.selection.map((v) => v.id);
       console.log(refIds);
       if (refIds.length === 0) {
         this.$notify({ type: "warning", message: "请先选择一行或多行" });
@@ -170,7 +170,7 @@ export default {
         await this.$httpWithMsg.post(CORE_API + "/user/data/rule/add", {
           refIds,
           type: "EXAM",
-          userId: this.userId
+          userId: this.userId,
         });
         this.$emit("reload");
         this.$notify({ title: "保存成功", type: "success" });
@@ -178,8 +178,8 @@ export default {
       } finally {
         this.loading = false;
       }
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 15 - 15
src/modules/basic/view/data_previllege_add_org.vue

@@ -7,8 +7,8 @@
     @close="closeDialog"
   >
     <el-form
-      :model="form"
       ref="form"
+      :model="form"
       :rules="rules"
       :inline="true"
       label-position="right"
@@ -16,10 +16,10 @@
     >
       <el-row>
         <el-form-item label="中心名称">
-          <el-input placeholder="请输入中心名称" v-model="form.name" />
+          <el-input v-model="form.name" placeholder="请输入中心名称" />
         </el-form-item>
         <el-form-item label="中心代码">
-          <el-input placeholder="请输入中心代码" v-model="form.code" />
+          <el-input v-model="form.code" placeholder="请输入中心代码" />
         </el-form-item>
         <!-- <el-form-item label="负责人">
           <el-input placeholder="请输入中心名称" v-model="form.contact" />
@@ -44,7 +44,7 @@
             border
             resizable
             stripe
-            style="width: 100%;"
+            style="width: 100%"
           >
             <el-table-column type="selection" width="40" />
             <el-table-column width="85" label="中心ID">
@@ -63,13 +63,13 @@
           <div class="page pull-right">
             <el-pagination
               v-if="paginationShow"
-              @current-change="handleCurrentChange"
               :current-page="currentPage"
               :page-size="pageSize"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
-              @size-change="handleSizeChange"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @current-change="handleCurrentChange"
+              @size-change="handleSizeChange"
             />
           </div>
         </div>
@@ -77,7 +77,7 @@
       </el-row>
 
       <el-row class="d-flex justify-content-center mt-2">
-        <el-button type="primary" @click="submitForm" :loading="loading"
+        <el-button type="primary" :loading="loading" @click="submitForm"
           >确 定</el-button
         >
         <el-button @click="closeDialog">取 消</el-button>
@@ -91,7 +91,7 @@ import { CORE_API } from "@/constants/constants";
 export default {
   name: "DataPrevillegeAddOrgDialog",
   props: {
-    userId: String
+    userId: { type: String, default: "" },
   },
   data() {
     return {
@@ -99,7 +99,7 @@ export default {
       form: {
         parentId: this.$store.state.user.rootOrgId,
         name: "",
-        code: ""
+        code: "",
       },
       rules: {},
       loading: false,
@@ -108,7 +108,7 @@ export default {
       noBatchSelected: true,
       currentPage: 1,
       pageSize: 10,
-      total: 10
+      total: 10,
     };
   },
   methods: {
@@ -123,7 +123,7 @@ export default {
         "?" +
         param;
       this.loading = true;
-      return this.$httpWithMsg.get(url).then(response => {
+      return this.$httpWithMsg.get(url).then((response) => {
         this.tableData = response.data.list;
         this.total = response.data.total;
         this.loading = false;
@@ -159,7 +159,7 @@ export default {
         return;
       }
 
-      const refIds = this.$refs.table.selection.map(v => v.id);
+      const refIds = this.$refs.table.selection.map((v) => v.id);
       console.log(refIds);
       if (refIds.length === 0) {
         this.$notify({ type: "warning", message: "请先选择一行或多行" });
@@ -172,7 +172,7 @@ export default {
         await this.$httpWithMsg.post(CORE_API + "/user/data/rule/add", {
           refIds,
           type: "ORG",
-          userId: this.userId
+          userId: this.userId,
         });
         this.$emit("reload");
         this.$notify({ title: "保存成功", type: "success" });
@@ -180,8 +180,8 @@ export default {
       } finally {
         this.loading = false;
       }
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 21 - 21
src/modules/basic/view/index.vue

@@ -88,14 +88,29 @@ import { mapState } from "vuex";
 import { CORE_API } from "@/constants/constants.js";
 
 export default {
+  components: {},
   data() {
     return {
-      menuList: []
+      menuList: [],
     };
   },
-  components: {},
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    var url = CORE_API + "/rolePrivilege/getUserPrivileges";
+    this.$httpWithMsg
+      .post(
+        url,
+        {
+          groupCode: "BASIC_MENUS",
+          full: false,
+        },
+        { emulateJSON: true }
+      )
+      .then((response) => {
+        this.menuList = response.data;
+      });
   },
   methods: {
     logout() {
@@ -104,12 +119,12 @@ export default {
         .then(() => {
           window.location.href = sessionStorage.getItem("loginUrl");
         })
-        .catch(response => {
+        .catch((response) => {
           if (response.status == 500) {
             this.$notify({
               showClose: true,
               message: response.data.desc,
-              type: "error"
+              type: "error",
             });
           }
           window.location.href = sessionStorage.getItem("loginUrl");
@@ -117,23 +132,8 @@ export default {
     },
     backIndex() {
       window.location.href = sessionStorage.getItem("indexUrl");
-    }
+    },
   },
-  created() {
-    var url = CORE_API + "/rolePrivilege/getUserPrivileges";
-    this.$httpWithMsg
-      .post(
-        url,
-        {
-          groupCode: "BASIC_MENUS",
-          full: false
-        },
-        { emulateJSON: true }
-      )
-      .then(response => {
-        this.menuList = response.data;
-      });
-  }
 };
 </script>
 

+ 6 - 6
src/modules/basic/view/privilege_group_list.vue

@@ -31,11 +31,14 @@ export default {
   name: "PrivilegeGroupList",
   data() {
     return {
-      privilegeGroupList: []
+      privilegeGroupList: [],
     };
   },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    this.queryAppList();
   },
   methods: {
     async queryAppList() {
@@ -45,11 +48,8 @@ export default {
     },
     editPrivilege(row) {
       this.$router.push({ path: "/basic/privilege_tree/" + row.id });
-    }
+    },
   },
-  created() {
-    this.queryAppList();
-  }
 };
 </script>
 

+ 12 - 12
src/modules/basic/view/privilege_tree.vue

@@ -1,17 +1,17 @@
 <template>
   <div>
-    <LinkTitlesCustom :currentPaths="['鉴权管理', '权限组列表', '权限配置']" />
+    <LinkTitlesCustom :current-paths="['鉴权管理', '权限组列表', '权限配置']" />
 
     <section class="content">
       <div class="box box-info">
         <div class="box-body">
           <!-- 权限树 -->
-          <div style="width: 80%;">
+          <div style="width: 80%">
             <el-tree
+              ref="tree"
               :data="treeData"
               :props="defaultProps"
               node-key="id"
-              ref="tree"
               highlight-current
               :default-expanded-keys="[-1]"
               :expand-on-click-node="false"
@@ -28,10 +28,10 @@
             :visible.sync="addingDialog.show"
           >
             <el-form
+              ref="addingForm"
               :model="addingDialog.privilege"
               inline
               inline-message
-              ref="addingForm"
               label-width="100px"
               :rules="rules"
             >
@@ -111,10 +111,10 @@
             :close-on-click-modal="false"
           >
             <el-form
+              ref="updateForm"
               :model="updateDialog.privilege"
               inline
               inline-message
-              ref="updateForm"
               label-width="100px"
               :rules="rules"
             >
@@ -278,6 +278,9 @@ let checkCode = (rule, value, callback) => {
 
 export default {
   name: "PrivilegeTree",
+    components: {
+      LinkTitlesCustom
+    },
     data() {
         return {
             privilegeGroupId: null,
@@ -368,6 +371,10 @@ export default {
             }
         }
     },
+    created() {
+        this.privilegeGroupId = this.$route.params.privilegeGroupId;
+        this.initTree();
+    },
 
     methods: {
         openAddingDialog(store, data) {
@@ -540,13 +547,6 @@ export default {
             this.treeData = [];
             this.treeData.push(response.data);
         }
-    },
-    created() {
-        this.privilegeGroupId = this.$route.params.privilegeGroupId;
-        this.initTree();
-    },
-    components: {
-      LinkTitlesCustom
     }
 };
 </script>

+ 68 - 77
src/modules/basic/view/resource_list.vue

@@ -2,9 +2,9 @@
   <section class="content">
     <div class="box box-info">
       <div
-        class="box-body"
         v-loading.body="fileLoading"
         v-loading.fullscreen="fileLoading"
+        class="box-body"
         element-loading-text="请稍后..."
       >
         <!-- 表单 -->
@@ -13,22 +13,22 @@
             <el-select
               v-model="formSearch.rootOrgId"
               placeholder="请选择"
-              style="width: 180px;"
+              style="width: 180px"
               filterable
             >
               <el-option
                 v-for="item in rootSchoolSelect"
+                :key="item.id"
                 :label="item.name"
                 :value="item.id"
-                :key="item.id"
               />
             </el-select>
           </el-form-item>
           <el-form-item label="名称">
             <el-input
-              placeholder="请输入名称"
               v-model="formSearch.name"
-              style="width: 180px;"
+              placeholder="请输入名称"
+              style="width: 180px"
             />
           </el-form-item>
           <el-form-item>
@@ -45,13 +45,13 @@
 
         <div class="block-seperator"></div>
 
-        <span>当前目录:{{ this.curDir }}</span>
-        <span style="float: right;">
+        <span>当前目录:{{ curDir }}</span>
+        <span style="float: right">
           <el-button
             size="small"
             type="primary"
+            :disabled="parentDirBtn()"
             @click="parentDir"
-            :disabled="this.parentDirBtn()"
           >
             上一级
           </el-button>
@@ -72,28 +72,22 @@
             新增文件
           </el-button>
         </span>
-        <div style="width: 100%; margin-bottom: 10px;"></div>
+        <div style="width: 100%; margin-bottom: 10px"></div>
 
         <!-- 页面列表 -->
-        <el-table
-          :data="tableData"
-          border
-          resizable
-          stripe
-          style="width: 100%;"
-        >
+        <el-table :data="tableData" border resizable stripe style="width: 100%">
           <el-table-column width="50" label="ID">
             <span slot-scope="scope">{{ scope.row.id }}</span>
           </el-table-column>
           <el-table-column width="250" label="名称">
             <span slot-scope="scope">
               <span
-                style="width: 30px; height: 20px; display: block; float: left;"
+                style="width: 30px; height: 20px; display: block; float: left"
               >
                 <img
                   v-if="scope.row.isFile == 0"
                   src="../assets/img/dir.png"
-                  style="height: 20px; width: 20px;"
+                  style="height: 20px; width: 20px"
                 />
               </span>
               <span
@@ -133,13 +127,13 @@
         <div class="page pull-right">
           <el-pagination
             v-if="paginationShow"
-            @current-change="handleCurrentChange"
             :current-page="currentPage"
             :page-size="pageSize"
             :page-sizes="[10, 20, 50, 100, 200, 300]"
-            @size-change="handleSizeChange"
             layout="total, sizes, prev, pager, next, jumper"
             :total="total"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
           />
         </div>
       </div>
@@ -151,28 +145,25 @@
         @close="closeDirModel"
       >
         <el-form
+          ref="dirForm"
+          :key="dirModelKey"
           :inline="true"
           :model="dirForm"
-          ref="dirForm"
           :rules="dirRules"
           label-width="90px"
-          :key="dirModelKey"
         >
           <el-row>
             <el-form-item label="目录名称" prop="dirName">
               <el-input
-                class="pull-length"
                 v-model="dirForm.dirName"
+                class="pull-length"
                 maxlength="50"
                 placeholder="可输入字母,数字,-,_"
               />
             </el-form-item>
           </el-row>
           <el-row class="pull-center">
-            <el-button
-              type="primary"
-              @click="subDir"
-              :loading="this.dirForm.loading"
+            <el-button type="primary" :loading="dirForm.loading" @click="subDir"
               >确定</el-button
             >
             <el-button @click="closeDirModel">取消</el-button>
@@ -187,18 +178,18 @@
         @close="closeFileModel"
       >
         <el-form
+          ref="fileForm"
+          :key="fileModelKey"
           :inline="true"
           :model="fileForm"
-          ref="fileForm"
           :rules="fileRules"
           label-width="90px"
-          :key="fileModelKey"
         >
           <el-row>
             <el-form-item label="文件" prop="dataFile">
               <el-input
-                class="pull-length"
                 v-model="fileForm.fileName"
+                class="pull-length"
                 :readonly="true"
                 placeholder="文件最大限制10M"
               />
@@ -217,8 +208,8 @@
           <el-row class="pull-center">
             <el-button
               type="primary"
+              :loading="fileForm.loading"
               @click="subFile"
-              :loading="this.fileForm.loading"
               >确定</el-button
             >
             <el-button @click="closeFileModel">取消</el-button>
@@ -235,7 +226,7 @@ import { mapState } from "vuex";
 export default {
   name: "ResourceList",
   data() {
-    var validateFile = function(rule, value, callback) {
+    var validateFile = function (rule, value, callback) {
       if (value) {
         var upFileName = value.name;
         var reg = /^[a-zA-Z\\-_0-9\\.]{1,50}$/;
@@ -266,16 +257,16 @@ export default {
         parentId: -1,
         rootOrgId: null,
         code: "",
-        name: ""
+        name: "",
       },
       dirForm: {
         dirName: "",
-        loading: false
+        loading: false,
       },
       fileForm: {
         fileName: null,
         dataFile: null,
-        loading: false
+        loading: false,
       },
       loading: true,
       tableData: [],
@@ -289,9 +280,9 @@ export default {
           {
             pattern: /^[a-zA-Z\\-_0-9]{1,50}$/,
             message: "目录名称必须为1-50位字母,数字,'-','_'组合",
-            trigger: "blur"
-          }
-        ]
+            trigger: "blur",
+          },
+        ],
       },
       fileRules: {
         dataFile: [
@@ -299,33 +290,51 @@ export default {
             required: true,
             type: "object",
             message: "请选择文件",
-            trigger: "change"
+            trigger: "change",
           },
           {
             validator: validateFile,
             type: "object",
-            trigger: "change"
-          }
-        ]
-      }
+            trigger: "change",
+          },
+        ],
+      },
     };
   },
   computed: {
-    ...mapState({ user: state => state.user }),
+    ...mapState({ user: (state) => state.user }),
     isSuperAdmin() {
-      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
+      return this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN");
     },
     rootSchoolSelect() {
       let rootSchools = [];
       for (let i = 0; i < this.rootOrgList.length; i++) {
         let info = {
           name: this.rootOrgList[i].name + "(" + this.rootOrgList[i].id + ")",
-          id: this.rootOrgList[i].id
+          id: this.rootOrgList[i].id,
         };
         rootSchools.push(info);
       }
       return rootSchools;
-    }
+    },
+  },
+  watch: {
+    "formSearch.rootOrgId": {
+      immediate: false,
+      handler(val) {
+        if (val == null) {
+          this.curDir = "";
+        } else {
+          this.curDir = "/";
+          this.formSearch.parentId = -1;
+          this.handleSearchBtn();
+        }
+      },
+    },
+  },
+  //初始化查询
+  created() {
+    this.init();
   },
   methods: {
     handleUploadFile(file) {
@@ -353,7 +362,7 @@ export default {
         .then(() => {
           this.$notify({
             type: "success",
-            message: "上传成功!"
+            message: "上传成功!",
           });
           this.closeFileModel();
           this.searchForm();
@@ -383,12 +392,12 @@ export default {
         .post(url, {
           parentId: this.formSearch.parentId,
           rootOrgId: this.formSearch.rootOrgId,
-          name: this.dirForm.dirName
+          name: this.dirForm.dirName,
         })
         .then(() => {
           this.$notify({
             type: "success",
-            message: "新增成功!"
+            message: "新增成功!",
           });
           this.closeDirModel();
           this.searchForm();
@@ -418,13 +427,13 @@ export default {
       this.$confirm("确定删除?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         var url = CORE_API + "/resource/" + row.id;
         this.$httpWithMsg.delete(url).then(() => {
           this.$notify({
             type: "success",
-            message: "删除成功!"
+            message: "删除成功!",
           });
           this.searchForm();
         });
@@ -440,7 +449,7 @@ export default {
       if (this.formSearch.rootOrgId == null) {
         this.$notify({
           type: "warning",
-          message: "请选择学校"
+          message: "请选择学校",
         });
         return;
       }
@@ -450,7 +459,7 @@ export default {
       if (this.formSearch.rootOrgId == null) {
         this.$notify({
           type: "warning",
-          message: "请选择学校"
+          message: "请选择学校",
         });
         return;
       }
@@ -474,7 +483,7 @@ export default {
       if (this.formSearch.rootOrgId == null) {
         this.$notify({
           type: "warning",
-          message: "请选择学校"
+          message: "请选择学校",
         });
         return;
       }
@@ -491,12 +500,12 @@ export default {
         param;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           this.tableData = response.data.list;
           this.total = response.data.total;
           this.loading = false;
 
-          this.$nextTick(function() {
+          this.$nextTick(function () {
             this.paginationShow = true;
           });
         })
@@ -506,33 +515,15 @@ export default {
       if (this.isSuperAdmin) {
         this.$httpWithMsg
           .get(CORE_API + "/org/getRootOrgList")
-          .then(response => {
+          .then((response) => {
             this.rootOrgList = response.data;
           });
       } else {
         this.formSearch.rootOrgId = this.user.rootOrgId;
         this.searchForm();
       }
-    }
-  },
-  watch: {
-    "formSearch.rootOrgId": {
-      immediate: false,
-      handler(val) {
-        if (val == null) {
-          this.curDir = "";
-        } else {
-          this.curDir = "/";
-          this.formSearch.parentId = -1;
-          this.handleSearchBtn();
-        }
-      }
-    }
+    },
   },
-  //初始化查询
-  created() {
-    this.init();
-  }
 };
 </script>
 

+ 33 - 33
src/modules/basic/view/role_privilege_settings.vue

@@ -7,75 +7,75 @@
           <el-row>
             <el-form-item label="学校" class="pull-left">
               <el-select
-                class="input_width_lg"
                 v-model="form.orgId"
+                class="input_width_lg"
                 placeholder="请选择"
-                @change="rootOrgChanged"
                 :disabled="!isSuperAdmin"
                 filterable
+                @change="rootOrgChanged"
               >
                 <el-option
                   v-for="item in rootSchoolSelect"
+                  :key="item.id"
                   :label="item.name"
                   :value="item.id"
-                  :key="item.id"
                 />
               </el-select>
             </el-form-item>
             <el-form-item label="角色" class="pull-left">
               <el-select
-                class="input_width_lg"
                 v-model="form.roleId"
+                class="input_width_lg"
                 placeholder="请选择"
                 @change="change"
               >
                 <el-option
                   v-for="item in roleList"
+                  :key="item.roleId"
                   :label="item.roleName"
                   :value="item.roleId"
-                  :key="item.roleId"
                 />
               </el-select>
             </el-form-item>
             <el-form-item label="权限组" class="pull-left">
               <el-select
-                class="input_width_lg"
                 v-model="form.privilegeGroupId"
+                class="input_width_lg"
                 placeholder="请选择"
                 @change="change"
               >
                 <el-option
                   v-for="item in privilegeGroupList"
+                  :key="item.id"
                   :label="item.name"
                   :value="item.id"
-                  :key="item.id"
                 />
               </el-select>
             </el-form-item>
           </el-row>
         </el-form>
 
-        <div style="margin-bottom:10px;">
+        <div style="margin-bottom: 10px">
           <el-button type="primary" :disabled="!treeChanged" @click="save">
             保 存
           </el-button>
         </div>
 
         <!-- 权限树 -->
-        <div style="width: 50%;">
+        <div style="width: 50%">
           <el-tree
+            ref="tree"
             class="el-tree"
             :data="treeData"
             :props="defaultProps"
             show-checkbox
             node-key="id"
-            ref="tree"
             highlight-current
             :check-strictly="true"
             :default-expanded-keys="checkedKeys"
             :default-checked-keys="checkedKeys"
-            @check="nodeCheck"
             :expand-on-click-node="true"
+            @check="nodeCheck"
           />
         </div>
       </div>
@@ -94,7 +94,7 @@ export default {
       form: {
         orgId: null,
         roleId: null,
-        privilegeGroupId: null
+        privilegeGroupId: null,
       },
       rootOrgList: [],
       roleList: [],
@@ -105,26 +105,29 @@ export default {
       uncheckChildren_nodeId: null,
       defaultProps: {
         children: "children",
-        label: "label"
-      }
+        label: "label",
+      },
     };
   },
   computed: {
-    ...mapState({ user: state => state.user }),
+    ...mapState({ user: (state) => state.user }),
     isSuperAdmin() {
-      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
+      return this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN");
     },
     rootSchoolSelect() {
       let rootSchools = [];
       for (let i = 0; i < this.rootOrgList.length; i++) {
         let info = {
           name: this.rootOrgList[i].name + "(" + this.rootOrgList[i].id + ")",
-          id: this.rootOrgList[i].id
+          id: this.rootOrgList[i].id,
         };
         rootSchools.push(info);
       }
       return rootSchools;
-    }
+    },
+  },
+  created() {
+    this.init();
   },
   methods: {
     /*初始化*/
@@ -137,7 +140,7 @@ export default {
       Promise.all([
         this.$httpWithMsg.get(url1),
         this.$httpWithMsg.post(url2),
-        this.$httpWithMsg.get(url3)
+        this.$httpWithMsg.get(url3),
       ]).then(([resp1, resp2, resp3]) => {
         this.rootOrgList = resp1.data;
 
@@ -146,7 +149,7 @@ export default {
         if (0 < this.roleList.length) {
           this.form.roleId = this.roleList[0].roleId;
         }
-        this.privilegeGroupList = resp3.data.filter(function(item) {
+        this.privilegeGroupList = resp3.data.filter(function (item) {
           if (item.ext1 != "function") {
             return item;
           }
@@ -177,7 +180,7 @@ export default {
 
       Promise.all([
         this.$httpWithMsg.get(url1),
-        this.$httpWithMsg.get(url2)
+        this.$httpWithMsg.get(url2),
       ]).then(([resp1, resp2]) => {
         // console.log("initTree(). treeData:", resp1.data.children);
         // console.log("initTree(). checkedKeys:", resp2.data);
@@ -198,7 +201,7 @@ export default {
         CORE_API +
         "/rolePrivilege/getRoles?includeSuperAdmin=false&rootOrgId=" +
         this.form.orgId;
-      this.$httpWithMsg.post(url).then(response => {
+      this.$httpWithMsg.post(url).then((response) => {
         this.roleList = response.data;
         if (0 < this.roleList.length) {
           this.form.roleId = this.roleList[0].roleId;
@@ -219,11 +222,11 @@ export default {
       if (checked) {
         this.checkedKeys = [...this.checkedKeys, id];
       } else {
-        this.checkedKeys = this.checkedKeys.filter(id0 => id0 !== id);
+        this.checkedKeys = this.checkedKeys.filter((id0) => id0 !== id);
       }
       // 选中状态下对子节点的影响:递归选中所有子孙节点
       if (checked && children) {
-        this.checkedKeys = [...this.checkedKeys, ...children.map(v => v.id)];
+        this.checkedKeys = [...this.checkedKeys, ...children.map((v) => v.id)];
         for (const child of children) {
           this.checkedKeys = [...this.checkedKeys, child.id];
           for (const child of child.children || []) {
@@ -247,14 +250,14 @@ export default {
 
       // 取消选中状态下对子节点的影响:递归取消选中所有子孙节点
       if (!checked && children) {
-        this.checkedKeys = this.checkedKeys.filter(id0 => id0 !== id);
+        this.checkedKeys = this.checkedKeys.filter((id0) => id0 !== id);
         // console.log(this.checkedKeys);
         for (const child of children) {
-          this.checkedKeys = this.checkedKeys.filter(id => id !== child.id);
+          this.checkedKeys = this.checkedKeys.filter((id) => id !== child.id);
           // console.log(this.checkedKeys);
           for (const child of child.children || []) {
             // 树最多只有三个层级,这里就不写递归了
-            this.checkedKeys = this.checkedKeys.filter(id => id !== child.id);
+            this.checkedKeys = this.checkedKeys.filter((id) => id !== child.id);
           }
         }
       }
@@ -303,20 +306,17 @@ export default {
           rootOrgId: this.form.orgId,
           roleId: this.form.roleId,
           privilegeGroupId: this.form.privilegeGroupId,
-          privilegeIdSet: this.checkedKeys
+          privilegeIdSet: this.checkedKeys,
         })
         .then(() => {
           this.$notify({
             message: "更新成功",
-            type: "success"
+            type: "success",
           });
           this.treeChanged = false;
         });
-    }
+    },
   },
-  created() {
-    this.init();
-  }
 };
 </script>
 

+ 54 - 54
src/modules/basic/view/school.vue

@@ -1,22 +1,22 @@
 <template>
   <section class="content">
     <div
-      class="box-body"
       v-loading.fullscreen="loading"
+      class="box-body"
       element-loading-text="请稍后..."
     >
       <!-- 表单 -->
       <el-form :inline="true" :model="formSearch">
         <el-form-item label="学校名称">
-          <el-input placeholder="请输入学校名称" v-model="formSearch.name" />
+          <el-input v-model="formSearch.name" placeholder="请输入学校名称" />
         </el-form-item>
         <el-form-item label="学校代码">
-          <el-input placeholder="请输入学校代码" v-model="formSearch.code" />
+          <el-input v-model="formSearch.code" placeholder="请输入学校代码" />
         </el-form-item>
         <el-form-item label="学校域名">
           <el-input
-            placeholder="请输入学校域名"
             v-model="formSearch.domainName"
+            placeholder="请输入学校域名"
           />
         </el-form-item>
         <el-form-item>
@@ -50,20 +50,20 @@
         size="small"
         type="success"
         :disabled="noBatchSelected"
-        @click="enableOrg"
         icon="el-icon-check"
+        @click="enableOrg"
         >启用</el-button
       >
       <el-button
         size="small"
         type="danger"
         :disabled="noBatchSelected"
-        @click="disableOrg"
         icon="el-icon-close"
+        @click="disableOrg"
         >禁用</el-button
       >
 
-      <div style="width: 100%;margin-bottom: 10px;"></div>
+      <div style="width: 100%; margin-bottom: 10px"></div>
 
       <!-- 添加或修改学校弹出框 -->
       <el-dialog
@@ -73,10 +73,10 @@
         @close="dialogBeforeClose"
       >
         <el-form
+          ref="schoolForm"
           :inline="true"
           inline-message
           :model="schoolForm"
-          ref="schoolForm"
           :rules="rules"
           label-position="right"
           label-width="90px"
@@ -85,8 +85,8 @@
           <el-row>
             <el-form-item label="学校代码" label-width="120px" prop="code">
               <el-input
-                class="pull_length"
                 v-model="schoolForm.code"
+                class="pull_length"
                 auto-complete="off"
                 placeholder="学校域名"
                 :disabled="null != schoolForm.id"
@@ -96,8 +96,8 @@
           <el-row>
             <el-form-item label="学校名称" label-width="120px" prop="name">
               <el-input
-                class="pull_length"
                 v-model="schoolForm.name"
+                class="pull_length"
                 auto-complete="off"
                 placeholder="学校名称"
               />
@@ -110,8 +110,8 @@
               prop="domainName"
             >
               <el-input
-                class="pull_length"
                 v-model="schoolForm.domainName"
+                class="pull_length"
                 auto-complete="off"
                 placeholder="学校域名"
               />
@@ -120,8 +120,8 @@
           <el-row>
             <el-form-item label="负责人" label-width="120px" prop="contacts">
               <el-input
-                class="pull_length"
                 v-model="schoolForm.contacts"
+                class="pull_length"
                 auto-complete="off"
                 placeholder="负责人"
               />
@@ -130,8 +130,8 @@
           <el-row>
             <el-form-item label="联系方式" label-width="120px" prop="telephone">
               <el-input
-                class="pull_length"
                 v-model="schoolForm.telephone"
+                class="pull_length"
                 auto-complete="off"
                 placeholder="联系方式"
               />
@@ -139,7 +139,7 @@
           </el-row>
           <el-row>
             <el-form-item label="状态" label-width="120px" prop="enable">
-              <el-radio-group class="pull_right_sm" v-model="schoolForm.enable">
+              <el-radio-group v-model="schoolForm.enable" class="pull_right_sm">
                 <el-radio label="true">启用</el-radio>
                 <el-radio label="false">禁用</el-radio>
               </el-radio-group>
@@ -165,28 +165,28 @@
         <el-table-column label="学校名称">
           <template slot-scope="scope">
             <el-popover trigger="hover" placement="left">
-              <div style="font-size: 18px;font-family: 新宋体">
+              <div style="font-size: 18px; font-family: 新宋体">
                 <tr>
                   <td style="color: green">学校名称</td>
-                  <td style="color:purple;padding-left: 20px;">
+                  <td style="color: purple; padding-left: 20px">
                     {{ scope.row.name }}
                   </td>
                 </tr>
                 <tr>
                   <td style="color: green">学校代码</td>
-                  <td style="color:purple;padding-left: 20px;">
+                  <td style="color: purple; padding-left: 20px">
                     {{ scope.row.code }}
                   </td>
                 </tr>
                 <tr>
                   <td style="color: green">负责人</td>
-                  <td style="color:purple;padding-left: 20px;">
+                  <td style="color: purple; padding-left: 20px">
                     {{ scope.row.contacts }}
                   </td>
                 </tr>
                 <tr>
                   <td style="color: green">联系方式</td>
-                  <td style="color:purple;padding-left: 20px;">
+                  <td style="color: purple; padding-left: 20px">
                     {{ scope.row.telephone }}
                   </td>
                 </tr>
@@ -215,7 +215,7 @@
                 content="启用"
                 placement="left"
               >
-                <i class="el-icon-success" style="color:green;"></i>
+                <i class="el-icon-success" style="color: green"></i>
               </el-tooltip>
             </span>
             <span v-else>
@@ -225,7 +225,7 @@
                 content="禁用"
                 placement="left"
               >
-                <i class="el-icon-error" style="color:red;"></i>
+                <i class="el-icon-error" style="color: red"></i>
               </el-tooltip>
             </span>
           </span>
@@ -245,13 +245,13 @@
       </el-table>
       <div class="page pull-right">
         <el-pagination
-          @current-change="handleCurrentChange"
           :current-page="currentPage"
           :page-size="pageSize"
           :page-sizes="[10, 20, 50, 100, 200, 300]"
-          @size-change="handleSizeChange"
           layout="total, sizes, prev, pager, next, jumper"
           :total="total"
+          @current-change="handleCurrentChange"
+          @size-change="handleSizeChange"
         />
       </div>
     </div>
@@ -269,7 +269,7 @@ export default {
       formSearch: {
         code: "",
         name: "",
-        domainName: ""
+        domainName: "",
       },
       schoolForm: {
         id: null,
@@ -279,13 +279,13 @@ export default {
         contacts: "",
         telephone: "",
         enable: "true",
-        remark: ""
+        remark: "",
       },
       schoolDialog: false,
       logoDialog: false,
       curSchool: {
         name: null,
-        code: null
+        code: null,
       },
       uploadAction: "",
       uploadHeaders: {},
@@ -301,21 +301,21 @@ export default {
       rules: {
         code: [{ required: true, message: "请输入学校代码", trigger: "blur" }],
         domainName: [
-          { required: true, message: "请输入学校域名", trigger: "blur" }
+          { required: true, message: "请输入学校域名", trigger: "blur" },
         ],
         name: [{ required: true, message: "请输入学校名称", trigger: "blur" }],
         contacts: [
-          { required: true, message: "请输入负责人", trigger: "blur" }
+          { required: true, message: "请输入负责人", trigger: "blur" },
         ],
         telephone: [
-          { required: true, message: "请输入联系方式", trigger: "blur" }
+          { required: true, message: "请输入联系方式", trigger: "blur" },
         ],
-        enable: [{ required: true, message: "请选择状态", trigger: "change" }]
-      }
+        enable: [{ required: true, message: "请选择状态", trigger: "change" }],
+      },
     };
   },
   computed: {
-    ...mapState({ user: state => state.user }),
+    ...mapState({ user: (state) => state.user }),
     noBatchSelected() {
       return this.selectedOrgIds.length === 0;
     },
@@ -329,7 +329,16 @@ export default {
         }
       }
       return orgIds;
-    }
+    },
+  },
+  //初始化查询
+  created() {
+    this.searchForm();
+
+    this.uploadHeaders = {
+      key: this.user.key,
+      token: this.user.token,
+    };
   },
   methods: {
     resetSearchForm() {
@@ -380,7 +389,7 @@ export default {
         param;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           this.tableData = response.data.list;
           this.total = response.data.total;
           this.loading = false;
@@ -395,19 +404,19 @@ export default {
       if (this.selectedOrgIds.length === 0) {
         this.$notify({
           type: "warning",
-          message: "请选择要启用的机构"
+          message: "请选择要启用的机构",
         });
       } else {
         this.$confirm("是否启用这些机构?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "warning"
+          type: "warning",
         }).then(() => {
           var url = CORE_API + "/org/enable/" + this.orgIds;
           this.$httpWithMsg.put(url).then(() => {
             this.$notify({
               type: "success",
-              message: "启用成功!"
+              message: "启用成功!",
             });
             this.searchForm();
           });
@@ -418,19 +427,19 @@ export default {
       if (this.selectedOrgIds.length === 0) {
         this.$notify({
           type: "warning",
-          message: "请选择要禁用的机构"
+          message: "请选择要禁用的机构",
         });
       } else {
         this.$confirm("是否禁用这些机构?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "warning"
+          type: "warning",
         }).then(() => {
           var url = CORE_API + "/org/disable/" + this.orgIds;
           this.$$httpWithMsg.put(url, {}).then(() => {
             this.$notify({
               type: "success",
-              message: "禁用成功!"
+              message: "禁用成功!",
             });
             this.searchForm();
           });
@@ -439,7 +448,7 @@ export default {
     },
     selectChange(row) {
       this.selectedOrgIds = [];
-      row.forEach(element => {
+      row.forEach((element) => {
         this.selectedOrgIds.push(element.id);
       });
       console.log(this.selectedOrgIds);
@@ -450,7 +459,7 @@ export default {
     },
     //提交
     submitForm() {
-      this.$refs.schoolForm.validate(valid => {
+      this.$refs.schoolForm.validate((valid) => {
         if (valid) {
           if (null != this.schoolForm.id) {
             //修改
@@ -458,7 +467,7 @@ export default {
             this.$httpWithMsg.put(url, this.schoolForm).then(() => {
               this.$notify({
                 type: "success",
-                message: "修改成功!"
+                message: "修改成功!",
               });
               this.searchForm();
               this.schoolDialog = false;
@@ -469,7 +478,7 @@ export default {
             this.$httpWithMsg.post(url, this.schoolForm).then(() => {
               this.$notify({
                 type: "success",
-                message: "新增成功!"
+                message: "新增成功!",
               });
               this.searchForm();
               this.schoolDialog = false;
@@ -504,17 +513,8 @@ export default {
       this.schoolForm.enable = row.enable ? "true" : "false";
 
       this.schoolDialog = true;
-    }
+    },
   },
-  //初始化查询
-  created() {
-    this.searchForm();
-
-    this.uploadHeaders = {
-      key: this.user.key,
-      token: this.user.token
-    };
-  }
 };
 </script>
 

+ 86 - 84
src/modules/basic/view/school_config.vue

@@ -2,9 +2,9 @@
   <el-container>
     <el-main class="el-main-padding">
       <el-form
+        ref="ruleForm"
         :model="ruleForm"
         :rules="rules"
-        ref="ruleForm"
         label-width="200px"
         class="demo-ruleForm"
         :inline-message="true"
@@ -18,9 +18,9 @@
           >
             <el-option
               v-for="item in rootSchoolSelect"
+              :key="item.id"
               :label="item.name"
               :value="item.id"
-              :key="item.id"
             />
           </el-select>
         </el-form-item>
@@ -39,8 +39,8 @@
           prop="STUDENT_CLIENT_THIRD_PARTY_LOGIN_URL"
         >
           <el-input
-            :disabled="!ruleForm.STUDENT_CLIENT_ACCESS_FROM_THIRD_PARTY"
             v-model="ruleForm.STUDENT_CLIENT_THIRD_PARTY_LOGIN_URL"
+            :disabled="!ruleForm.STUDENT_CLIENT_ACCESS_FROM_THIRD_PARTY"
             placeholder="请输入第三方登录页地址,以http://或https://开头"
             class="input-width"
           ></el-input>
@@ -148,22 +148,95 @@ export default {
           ID_NUMBER_PRIVATE_MODE: false,
           APP_ENABLED: false,
           WEIXIN_ANSWER_ENABLED: false,
-          IDENTIFICATION_OF_LIVING_BODY_SCHEME: ""
-        }
+          IDENTIFICATION_OF_LIVING_BODY_SCHEME: "",
+        },
       },
       rules: {
         STUDENT_CLIENT_THIRD_PARTY_LOGIN_URL: [
           {
             validator: validateUrl,
-            trigger: "change"
-          }
-        ]
-      }
+            trigger: "change",
+          },
+        ],
+      },
     };
   },
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+    btnSaveDiabled() {
+      console.log(this.formDataChanged);
+      return !this.formDataChanged;
+    },
+    isSuperAdmin() {
+      return this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN");
+    },
+    rootSchoolSelect() {
+      let rootSchools = [];
+      for (let i = 0; i < this.rootOrgList.length; i++) {
+        let info = {
+          name: this.rootOrgList[i].name + "(" + this.rootOrgList[i].id + ")",
+          id: this.rootOrgList[i].id,
+        };
+        rootSchools.push(info);
+      }
+      return rootSchools;
+    },
+  },
+  watch: {
+    "ruleForm.orgId": {
+      handler: function () {
+        this.initForm();
+      },
+    },
+    "ruleForm.STUDENT_CLIENT_ACCESS_FROM_THIRD_PARTY": {
+      handler: function (val) {
+        this.$refs["ruleForm"].validate();
+        if (!val) {
+          this.ruleForm.STUDENT_CLIENT_THIRD_PARTY_LOGIN_URL = "";
+        }
+      },
+    },
+    ruleForm: {
+      deep: true,
+      handler: function (newForm) {
+        if (Object.keys(this.originalRuleForm).length > 0) {
+          this.formDataChanged = !(
+            newForm.STUDENT_CLIENT_ACCESS_FROM_THIRD_PARTY ==
+              this.originalRuleForm.STUDENT_CLIENT_ACCESS_FROM_THIRD_PARTY &&
+            newForm.STUDENT_CLIENT_THIRD_PARTY_LOGIN_URL ==
+              this.originalRuleForm.STUDENT_CLIENT_THIRD_PARTY_LOGIN_URL &&
+            newForm.SHOW_QMTH_LOGO == this.originalRuleForm.SHOW_QMTH_LOGO &&
+            newForm.ID_NUMBER_PRIVATE_MODE ==
+              this.originalRuleForm.ID_NUMBER_PRIVATE_MODE &&
+            newForm.APP_ENABLED == this.originalRuleForm.APP_ENABLED &&
+            newForm.WEIXIN_ANSWER_ENABLED ==
+              this.originalRuleForm.WEIXIN_ANSWER_ENABLED &&
+            newForm.SHOW_STUDENT_CLIENT_APP_QRCODE ==
+              this.originalRuleForm.SHOW_STUDENT_CLIENT_APP_QRCODE &&
+            newForm.IDENTIFICATION_OF_LIVING_BODY_SCHEME ==
+              this.originalRuleForm.IDENTIFICATION_OF_LIVING_BODY_SCHEME
+          );
+        } else {
+          this.formDataChanged = false;
+        }
+      },
+    },
+  },
+  created() {
+    this.ruleForm.orgId = this.user.rootOrgId;
+    this.propertyGroupId = "config4Edit1";
+    if (this.isSuperAdmin) {
+      this.$httpWithMsg
+        .get(CORE_API + "/org/getRootOrgList")
+        .then((response) => {
+          this.rootOrgList = response.data;
+        });
+    }
+    this.initForm();
+  },
   methods: {
     submitForm(formName) {
-      this.$refs[formName].validate(valid => {
+      this.$refs[formName].validate((valid) => {
         if (valid) {
           this.ruleForm.properties.STUDENT_CLIENT_ACCESS_FROM_THIRD_PARTY = this.ruleForm.STUDENT_CLIENT_ACCESS_FROM_THIRD_PARTY;
           this.ruleForm.properties.STUDENT_CLIENT_THIRD_PARTY_LOGIN_URL = this.ruleForm.STUDENT_CLIENT_THIRD_PARTY_LOGIN_URL;
@@ -180,7 +253,7 @@ export default {
               () => {
                 this.$notify({
                   message: "保存成功",
-                  type: "success"
+                  type: "success",
                 });
                 this.originalRuleForm = Object.assign({}, this.ruleForm);
                 this.formDataChanged = false;
@@ -201,7 +274,7 @@ export default {
         this.ruleForm.orgId +
         "/" +
         this.propertyGroupId;
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         if (response) {
           this.ruleForm.STUDENT_CLIENT_ACCESS_FROM_THIRD_PARTY =
             response.data.STUDENT_CLIENT_ACCESS_FROM_THIRD_PARTY == "true";
@@ -223,83 +296,12 @@ export default {
         } else {
           this.$notify({
             message: "学校设置信息暂未初始化,请立即初始化",
-            type: "warning"
+            type: "warning",
           });
         }
       });
-    }
-  },
-  created() {
-    this.ruleForm.orgId = this.user.rootOrgId;
-    this.propertyGroupId = "config4Edit1";
-    if (this.isSuperAdmin) {
-      this.$httpWithMsg.get(CORE_API + "/org/getRootOrgList").then(response => {
-        this.rootOrgList = response.data;
-      });
-    }
-    this.initForm();
-  },
-  watch: {
-    "ruleForm.orgId": {
-      handler: function() {
-        this.initForm();
-      }
-    },
-    "ruleForm.STUDENT_CLIENT_ACCESS_FROM_THIRD_PARTY": {
-      handler: function(val) {
-        this.$refs["ruleForm"].validate();
-        if (!val) {
-          this.ruleForm.STUDENT_CLIENT_THIRD_PARTY_LOGIN_URL = "";
-        }
-      }
     },
-    ruleForm: {
-      deep: true,
-      handler: function(newForm) {
-        if (Object.keys(this.originalRuleForm).length > 0) {
-          this.formDataChanged = !(
-            newForm.STUDENT_CLIENT_ACCESS_FROM_THIRD_PARTY ==
-              this.originalRuleForm.STUDENT_CLIENT_ACCESS_FROM_THIRD_PARTY &&
-            newForm.STUDENT_CLIENT_THIRD_PARTY_LOGIN_URL ==
-              this.originalRuleForm.STUDENT_CLIENT_THIRD_PARTY_LOGIN_URL &&
-            newForm.SHOW_QMTH_LOGO == this.originalRuleForm.SHOW_QMTH_LOGO &&
-            newForm.ID_NUMBER_PRIVATE_MODE ==
-              this.originalRuleForm.ID_NUMBER_PRIVATE_MODE &&
-            newForm.APP_ENABLED == this.originalRuleForm.APP_ENABLED &&
-            newForm.WEIXIN_ANSWER_ENABLED ==
-              this.originalRuleForm.WEIXIN_ANSWER_ENABLED &&
-            newForm.SHOW_STUDENT_CLIENT_APP_QRCODE ==
-              this.originalRuleForm.SHOW_STUDENT_CLIENT_APP_QRCODE &&
-            newForm.IDENTIFICATION_OF_LIVING_BODY_SCHEME ==
-              this.originalRuleForm.IDENTIFICATION_OF_LIVING_BODY_SCHEME
-          );
-        } else {
-          this.formDataChanged = false;
-        }
-      }
-    }
   },
-  computed: {
-    ...mapState({ user: state => state.user }),
-    btnSaveDiabled() {
-      console.log(this.formDataChanged);
-      return !this.formDataChanged;
-    },
-    isSuperAdmin() {
-      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
-    },
-    rootSchoolSelect() {
-      let rootSchools = [];
-      for (let i = 0; i < this.rootOrgList.length; i++) {
-        let info = {
-          name: this.rootOrgList[i].name + "(" + this.rootOrgList[i].id + ")",
-          id: this.rootOrgList[i].id
-        };
-        rootSchools.push(info);
-      }
-      return rootSchools;
-    }
-  }
 };
 </script>
 <style scoped>

+ 31 - 31
src/modules/basic/view/school_privilege_settings.vue

@@ -7,60 +7,60 @@
           <el-row>
             <el-form-item label="学校" class="pull-left">
               <el-select
-                class="input_width_lg"
                 v-model="form.orgId"
+                class="input_width_lg"
                 placeholder="请选择"
-                @change="rootOrgChanged"
                 :disabled="!isSuperAdmin"
                 filterable
+                @change="rootOrgChanged"
               >
                 <el-option
                   v-for="item in rootSchoolSelect"
+                  :key="item.id"
                   :label="item.name"
                   :value="item.id"
-                  :key="item.id"
                 />
               </el-select>
             </el-form-item>
             <el-form-item label="权限组" class="pull-left">
               <el-select
-                class="input_width_lg"
                 v-model="form.privilegeGroupId"
+                class="input_width_lg"
                 placeholder="请选择"
                 @change="change"
               >
                 <el-option
                   v-for="item in privilegeGroupList"
+                  :key="item.id"
                   :label="item.name"
                   :value="item.id"
-                  :key="item.id"
                 />
               </el-select>
             </el-form-item>
           </el-row>
         </el-form>
 
-        <div style="margin-bottom:10px;">
+        <div style="margin-bottom: 10px">
           <el-button type="primary" :disabled="!treeChanged" @click="save">
             保 存
           </el-button>
         </div>
 
         <!-- 权限树 -->
-        <div style="width: 50%;">
+        <div style="width: 50%">
           <el-tree
+            ref="tree"
             class="el-tree"
             :data="treeData"
             :props="defaultProps"
             show-checkbox
             node-key="id"
-            ref="tree"
             highlight-current
             :check-strictly="true"
             :default-expanded-keys="checkedKeys"
             :default-checked-keys="checkedKeys"
-            @check="nodeCheck"
             :expand-on-click-node="true"
+            @check="nodeCheck"
           />
         </div>
       </div>
@@ -78,7 +78,7 @@ export default {
     return {
       form: {
         orgId: null,
-        privilegeGroupId: null
+        privilegeGroupId: null,
       },
       rootOrgList: [],
       privilegeGroupList: [],
@@ -88,26 +88,29 @@ export default {
       uncheckChildren_nodeId: null,
       defaultProps: {
         children: "children",
-        label: "label"
-      }
+        label: "label",
+      },
     };
   },
   computed: {
-    ...mapState({ user: state => state.user }),
+    ...mapState({ user: (state) => state.user }),
     isSuperAdmin() {
-      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
+      return this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN");
     },
     rootSchoolSelect() {
       let rootSchools = [];
       for (let i = 0; i < this.rootOrgList.length; i++) {
         let info = {
           name: this.rootOrgList[i].name + "(" + this.rootOrgList[i].id + ")",
-          id: this.rootOrgList[i].id
+          id: this.rootOrgList[i].id,
         };
         rootSchools.push(info);
       }
       return rootSchools;
-    }
+    },
+  },
+  created() {
+    this.init();
   },
   methods: {
     /*初始化*/
@@ -120,7 +123,7 @@ export default {
       Promise.all([
         this.$httpWithMsg.get(url1),
         this.$httpWithMsg.post(url2),
-        this.$httpWithMsg.get(url3)
+        this.$httpWithMsg.get(url3),
       ]).then(([resp1, resp2, resp3]) => {
         this.rootOrgList = resp1.data;
 
@@ -129,7 +132,7 @@ export default {
         if (0 < this.roleList.length) {
           this.form.roleId = this.roleList[0].roleId;
         }
-        this.privilegeGroupList = resp3.data.filter(function(item) {
+        this.privilegeGroupList = resp3.data.filter(function (item) {
           if (item.ext1 == "function") {
             return item;
           }
@@ -154,7 +157,7 @@ export default {
 
       Promise.all([
         this.$httpWithMsg.get(url1),
-        this.$httpWithMsg.get(url2)
+        this.$httpWithMsg.get(url2),
       ]).then(([resp1, resp2]) => {
         console.log("initTree(). treeData:", resp1.data.children);
         console.log("initTree(). checkedKeys:", resp2.data);
@@ -171,7 +174,7 @@ export default {
         CORE_API +
         "/rolePrivilege/getRoles?includeSuperAdmin=false&rootOrgId=" +
         this.form.orgId;
-      this.$httpWithMsg.post(url).then(response => {
+      this.$httpWithMsg.post(url).then((response) => {
         this.roleList = response.data;
         if (0 < this.roleList.length) {
           this.form.roleId = this.roleList[0].roleId;
@@ -188,11 +191,11 @@ export default {
       if (checked) {
         this.checkedKeys = [...this.checkedKeys, id];
       } else {
-        this.checkedKeys = this.checkedKeys.filter(id0 => id0 !== id);
+        this.checkedKeys = this.checkedKeys.filter((id0) => id0 !== id);
       }
       // 选中状态下对子节点的影响:递归选中所有子孙节点
       if (checked && children) {
-        this.checkedKeys = [...this.checkedKeys, ...children.map(v => v.id)];
+        this.checkedKeys = [...this.checkedKeys, ...children.map((v) => v.id)];
         for (const child of children) {
           this.checkedKeys = [...this.checkedKeys, child.id];
           for (const child of child.children || []) {
@@ -216,14 +219,14 @@ export default {
 
       // 取消选中状态下对子节点的影响:递归取消选中所有子孙节点
       if (!checked && children) {
-        this.checkedKeys = this.checkedKeys.filter(id0 => id0 !== id);
+        this.checkedKeys = this.checkedKeys.filter((id0) => id0 !== id);
         // console.log(this.checkedKeys);
         for (const child of children) {
-          this.checkedKeys = this.checkedKeys.filter(id => id !== child.id);
+          this.checkedKeys = this.checkedKeys.filter((id) => id !== child.id);
           // console.log(this.checkedKeys);
           for (const child of child.children || []) {
             // 树最多只有三个层级,这里就不写递归了
-            this.checkedKeys = this.checkedKeys.filter(id => id !== child.id);
+            this.checkedKeys = this.checkedKeys.filter((id) => id !== child.id);
           }
         }
       }
@@ -240,20 +243,17 @@ export default {
         .post(url, {
           rootOrgId: this.form.orgId,
           privilegeGroupId: this.form.privilegeGroupId,
-          privilegeIdSet: this.checkedKeys
+          privilegeIdSet: this.checkedKeys,
         })
         .then(() => {
           this.$notify({
             message: "更新成功",
-            type: "success"
+            type: "success",
           });
           this.treeChanged = false;
         });
-    }
+    },
   },
-  created() {
-    this.init();
-  }
 };
 </script>
 

+ 80 - 80
src/modules/basic/view/specially.vue

@@ -1,44 +1,44 @@
 <template>
   <section class="content">
     <div
-      class="box-body"
       v-loading.body="fileLoading"
       v-loading.fullscreen="loading"
+      class="box-body"
       element-loading-text="请稍后..."
     >
-      <el-form :inline="true" :model="formSearch" ref="primaryForm">
+      <el-form ref="primaryForm" :inline="true" :model="formSearch">
         <el-row>
           <el-form-item label="专业名称">
             <el-input
+              v-model="formSearch.name"
               class="input_width_lg"
               placeholder="请输入专业名称"
-              v-model="formSearch.name"
             />
           </el-form-item>
           <el-form-item label="专业代码">
             <el-input
+              v-model="formSearch.code"
               class="input_width_lg"
               placeholder="请输入专业代码"
-              v-model="formSearch.code"
             />
           </el-form-item>
           <el-form-item label="课程">
             <el-select
+              v-model="formSearch.courseId"
               class="input"
               :remote-method="getCourses"
-              @focus="e => getCourses(e.target.value)"
               :loading="courseLoading"
               remote
               filterable
               clearable
-              v-model="formSearch.courseId"
               placeholder="请选择"
+              @focus="(e) => getCourses(e.target.value)"
             >
               <el-option
                 v-for="item in courseList4SearchWrapper"
+                :key="item.id"
                 :label="item.name"
                 :value="item.id"
-                :key="item.id"
               />
             </el-select>
           </el-form-item>
@@ -53,8 +53,8 @@
             </el-button>
             <el-button
               size="small"
-              @click="resetPrimaryForm"
               icon="el-icon-refresh"
+              @click="resetPrimaryForm"
             >
               重置
             </el-button>
@@ -76,30 +76,30 @@
       <el-button
         size="small"
         type="danger"
-        @click="deleteIds"
         :disabled="noBatchSelected"
         icon="el-icon-delete"
+        @click="deleteIds"
       >
         删除
       </el-button>
       <el-button
         size="small"
         type="primary"
-        @click="impSpecialty"
         icon="el-icon-upload2"
+        @click="impSpecialty"
       >
         导入
       </el-button>
       <el-button
         size="small"
         type="primary"
-        @click="exportSpeciatly"
         icon="el-icon-download"
+        @click="exportSpeciatly"
       >
         导出
       </el-button>
 
-      <div style="width: 100%;margin-bottom: 10px;"></div>
+      <div style="width: 100%; margin-bottom: 10px"></div>
 
       <!-- 新增或修改弹出框 -->
       <el-dialog
@@ -109,19 +109,19 @@
         @close="dialogBeforeClose"
       >
         <el-form
+          ref="speciallyForm"
           :inline="true"
           inline-message
           :model="speciallyForm"
-          ref="speciallyForm"
           :rules="rules"
           label-position="right"
           label-width="90px"
         >
           <el-form-item label="专业代码" prop="code">
             <el-input
+              v-model="speciallyForm.code"
               :disabled="null != speciallyForm.id"
               class="pull_length"
-              v-model="speciallyForm.code"
               auto-complete="off"
               placeholder="专业代码"
               maxlength="100"
@@ -129,8 +129,8 @@
           </el-form-item>
           <el-form-item label="专业名称" prop="name">
             <el-input
-              class="pull_length"
               v-model="speciallyForm.name"
+              class="pull_length"
               auto-complete="off"
               placeholder="专业名称"
               maxlength="100"
@@ -156,16 +156,16 @@
           <el-row>
             <el-form-item label="课程名称" class="pull-left">
               <el-input
+                v-model="courseSearchForm.name"
                 class="input_width_lg"
                 placeholder="请输入课程名称"
-                v-model="courseSearchForm.name"
               />
             </el-form-item>
             <el-form-item label="课程代码" class="pull-left">
               <el-input
+                v-model="courseSearchForm.code"
                 class="input_width_lg"
                 placeholder="请输入课程代码"
-                v-model="courseSearchForm.code"
               />
             </el-form-item>
             <el-form-item class="pull-right">
@@ -205,8 +205,8 @@
               <el-button
                 size="mini"
                 type="primary"
-                @click="deleteRelation(scope.row)"
                 icon="el-icon-edit"
+                @click="deleteRelation(scope.row)"
               >
                 取消关联
               </el-button>
@@ -215,11 +215,11 @@
         </el-table>
         <div class="pull-right">
           <el-pagination
-            @current-change="handleCourseCurrentChange"
             :current-page="currentCoursePage"
             :page-size="10"
             layout="total, prev, pager, next, jumper"
             :total="courseTotal"
+            @current-change="handleCourseCurrentChange"
           />
         </div>
       </el-dialog>
@@ -232,31 +232,31 @@
         @close="() => this.$refs.addRelationForm.clearValidate()"
       >
         <el-form
+          ref="addRelationForm"
           :inline="true"
           inline-message
           :model="addRelationForm"
-          ref="addRelationForm"
           :rules="addRelationRules"
         >
           <el-row>
             <el-form-item label="课程" class="pull-left" prop="courseId">
               <el-select
+                v-model="addRelationForm.courseId"
                 class="input"
                 style="width: 200px"
                 :remote-method="getCourses4AddRelation"
-                @focus="e => getCourses4AddRelation(e.target.value)"
                 :loading="courseLoading4AddRelation"
                 remote
                 filterable
                 clearable
-                v-model="addRelationForm.courseId"
                 placeholder="请选择"
+                @focus="(e) => getCourses4AddRelation(e.target.value)"
               >
                 <el-option
                   v-for="item in courseList4AddRelationWrapper"
+                  :key="item.id"
                   :label="item.name"
                   :value="item.id"
-                  :key="item.id"
                 />
               </el-select>
             </el-form-item>
@@ -293,9 +293,9 @@
               <el-button
                 size="mini"
                 type="primary"
-                @click="relation(scope.row)"
                 plain
                 icon="el-icon-share"
+                @click="relation(scope.row)"
               >
                 关联课程
               </el-button>
@@ -303,8 +303,8 @@
                 size="mini"
                 type="primary"
                 icon="el-icon-edit"
-                @click="edit(scope.row)"
                 plain
+                @click="edit(scope.row)"
               >
                 编辑
               </el-button>
@@ -322,13 +322,13 @@
       </el-table>
       <div class="page pull-right">
         <el-pagination
-          @current-change="handleCurrentChange"
           :current-page="currentPage"
           :page-size="pageSize"
           :page-sizes="[10, 20, 50, 100, 200, 300]"
-          @size-change="handleSizeChange"
           layout="total, sizes, prev, pager, next, jumper"
           :total="total"
+          @current-change="handleCurrentChange"
+          @size-change="handleSizeChange"
         />
       </div>
 
@@ -336,10 +336,10 @@
       <el-dialog title="导入窗口" width="520px" :visible.sync="impDialog">
         <el-form>
           <el-row>
-            <el-form-item style="margin-left:20px">
+            <el-form-item style="margin-left: 20px">
               <el-upload
-                class="form_left"
                 ref="upload"
+                class="form_left"
                 accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
                 :action="uploadAction"
                 :headers="uploadHeaders"
@@ -353,8 +353,8 @@
                 :multiple="false"
               >
                 <el-button
-                  size="small"
                   slot="trigger"
+                  size="small"
                   type="primary"
                   icon="el-icon-search"
                 >
@@ -364,24 +364,24 @@
                 <el-button
                   size="small"
                   type="primary"
-                  @click="submitUpload"
                   icon="el-icon-check"
+                  @click="submitUpload"
                 >
                   确认上传
                 </el-button>
                 <el-button
                   size="small"
                   type="primary"
-                  @click="removeFile"
                   icon="el-icon-refresh"
+                  @click="removeFile"
                 >
                   清空文件
                 </el-button>
                 <el-button
                   size="small"
                   type="primary"
-                  @click="exportFile"
                   icon="el-icon-download"
+                  @click="exportFile"
                 >
                   下载模板
                 </el-button>
@@ -395,9 +395,9 @@
       <!-- 导入错误信息列表 -->
       <el-dialog title="错误提示" :visible.sync="errDialog">
         <div
-          class="text-danger"
           v-for="errMessage in errMessages"
           :key="errMessage.lineNum"
+          class="text-danger"
         >
           第{{ errMessage.lineNum }}行:{{ errMessage.msg }}
         </div>
@@ -421,12 +421,12 @@ export default {
       formSearch: {
         name: "",
         code: "",
-        courseId: ""
+        courseId: "",
       },
       speciallyForm: {
         id: null,
         name: "",
-        code: ""
+        code: "",
       },
       speciatlyId: "",
       speciallyDialog: false,
@@ -452,13 +452,13 @@ export default {
       fileList: [],
       rules: {
         name: [{ required: true, message: "请输入专业名称", trigger: "blur" }],
-        code: [{ required: true, message: "请输入专业代码", trigger: "blur" }]
+        code: [{ required: true, message: "请输入专业代码", trigger: "blur" }],
       },
       courseDialogTitle: null,
       courseSearchForm: {
         specialtyId: null,
         code: "",
-        name: ""
+        name: "",
       },
       courseTableData: [],
       currentCoursePage: 1,
@@ -468,7 +468,7 @@ export default {
       addRelationDialog: false,
       addRelationForm: {
         specialtyId: null,
-        courseId: null
+        courseId: null,
       },
       courseLoading4AddRelation: false,
       courseList4AddRelation: [],
@@ -478,15 +478,15 @@ export default {
             required: true,
             type: "number",
             message: "请选择课程",
-            trigger: "change"
-          }
-        ]
-      }
+            trigger: "change",
+          },
+        ],
+      },
     };
   },
   computed: {
     ...mapState({
-      user: state => state.user
+      user: (state) => state.user,
     }),
     noBatchSelected() {
       return this.multipleSelection.length === 0;
@@ -516,7 +516,15 @@ export default {
         courseList.push({ id: id, name: name, enable: course.enable });
       }
       return courseList;
-    }
+    },
+  },
+  //初始化查询
+  created() {
+    this.searchForm();
+    this.uploadHeaders = {
+      key: this.user.key,
+      token: this.user.token,
+    };
   },
   methods: {
     dialogBeforeClose() {
@@ -532,7 +540,7 @@ export default {
         code: "",
         enable: "",
         level: "",
-        specialtyId: ""
+        specialtyId: "",
       };
       this.$refs.primaryForm.resetFields();
     },
@@ -541,19 +549,19 @@ export default {
       var specialtyId = this.courseSearchForm.specialtyId;
       var param = new URLSearchParams({
         courseId: courseId,
-        specialtyId: specialtyId
+        specialtyId: specialtyId,
       });
       var url = CORE_API + "/courseSpeciatlyRelation/delete?" + param;
       this.$httpWithMsg.delete(url).then(() => {
         this.$notify({
           type: "success",
-          message: "取消关联成功!"
+          message: "取消关联成功!",
         });
         return this.searchCoursePage();
       });
     },
     submitAddRelationForm() {
-      this.$refs.addRelationForm.validate(valid => {
+      this.$refs.addRelationForm.validate((valid) => {
         if (valid) {
           var param = new URLSearchParams(this.addRelationForm);
           var url = CORE_API + "/courseSpeciatlyRelation/add?" + param;
@@ -561,7 +569,7 @@ export default {
             () => {
               this.$notify({
                 type: "success",
-                message: "添加成功!"
+                message: "添加成功!",
               });
               this.searchCoursePage();
               this.addRelationDialog = false;
@@ -592,7 +600,7 @@ export default {
         param;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           console.log(response);
           this.courseTableData = response.data.content;
           this.courseTotal = response.data.totalElements;
@@ -608,7 +616,7 @@ export default {
       this.courseLoading = true;
       this.$httpWithMsg
         .get(CORE_API + "/course/query?name=" + query)
-        .then(response => {
+        .then((response) => {
           this.courseList4Search = response.data;
           this.courseLoading = false;
         });
@@ -617,7 +625,7 @@ export default {
       this.courseLoading4AddRelation = true;
       this.$httpWithMsg
         .get(CORE_API + "/course/query?name=" + query)
-        .then(response => {
+        .then((response) => {
           this.courseList4AddRelation = response.data;
           this.courseLoading4AddRelation = false;
         });
@@ -645,7 +653,7 @@ export default {
         param;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           console.log("response :", response);
           this.tableData = response.data.content;
           this.total = response.data.totalElements;
@@ -672,7 +680,7 @@ export default {
       this.$confirm("是否删除学校信息?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "error"
+        type: "error",
       }).then(() => {
         this.loading = true;
         var vm = this;
@@ -681,7 +689,7 @@ export default {
           this.loading = false;
           this.$notify({
             type: "success",
-            message: "删除成功!"
+            message: "删除成功!",
           });
           //this.searchForm()
         });
@@ -689,7 +697,7 @@ export default {
     },
     //保存
     submitForm(formData) {
-      this.$refs[formData].validate(valid => {
+      this.$refs[formData].validate((valid) => {
         if (valid) {
           var url = CORE_API + "/specialty";
           //修改
@@ -698,7 +706,7 @@ export default {
               () => {
                 this.$notify({
                   type: "success",
-                  message: "修改成功!"
+                  message: "修改成功!",
                 });
                 this.searchForm();
                 this.speciallyDialog = false;
@@ -715,7 +723,7 @@ export default {
               () => {
                 this.$notify({
                   type: "success",
-                  message: "新增成功!"
+                  message: "新增成功!",
                 });
                 this.speciallyDialog = false;
                 this.searchForm();
@@ -759,13 +767,13 @@ export default {
       this.$confirm("是否删除该条课程信息?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "error"
+        type: "error",
       }).then(() => {
         var url = CORE_API + "/specialty/" + row.id;
         this.$httpWithMsg.delete(url).then(() => {
           this.$notify({
             type: "success",
-            message: "删除成功!"
+            message: "删除成功!",
           });
           this.searchForm();
         });
@@ -776,13 +784,13 @@ export default {
       if (this.multipleSelection.length === 0) {
         this.$notify({
           type: "warning",
-          message: "请选择要删除的专业"
+          message: "请选择要删除的专业",
         });
       } else {
         this.$confirm("是否删除这些课程信息?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "error"
+          type: "error",
         }).then(() => {
           var ids = [];
           for (var i = 0; i < this.multipleSelection.length; i++) {
@@ -792,7 +800,7 @@ export default {
           this.$httpWithMsg.delete(url).then(() => {
             this.$notify({
               type: "success",
-              message: "删除成功!"
+              message: "删除成功!",
             });
             this.searchForm();
           });
@@ -824,7 +832,7 @@ export default {
         () => {
           this.$notify({
             type: "success",
-            message: "课程关联成功!"
+            message: "课程关联成功!",
           });
           this.courseDialog = false;
           this.searchForm();
@@ -832,7 +840,7 @@ export default {
         () => {
           this.$notify({
             type: "error",
-            message: "课程关联失败!"
+            message: "课程关联失败!",
           });
           this.courseDialog = false;
           this.searchForm();
@@ -869,7 +877,7 @@ export default {
       if (!response.hasError) {
         this.$notify({
           message: "上传成功",
-          type: "success"
+          type: "success",
         });
         this.fileLoading = false;
         this.impDialog = false;
@@ -886,7 +894,7 @@ export default {
       if (response.status == 500) {
         this.$notify({
           message: json.desc,
-          type: "error"
+          type: "error",
         });
       }
       this.fileLoading = false;
@@ -904,14 +912,14 @@ export default {
       if (fileList.length == 0) {
         this.$notify({
           message: "上传文件不能为空",
-          type: "error"
+          type: "error",
         });
         return false;
       }
       if (fileList.length > 1) {
         this.$notify({
           message: "每次只能上传一个文件",
-          type: "error"
+          type: "error",
         });
         return false;
       }
@@ -919,7 +927,7 @@ export default {
         if (!file.name.endsWith(".xlsx")) {
           this.$notify({
             message: "上传文件必须为xlsx格式",
-            type: "error"
+            type: "error",
           });
           this.initUpload();
           return false;
@@ -940,16 +948,8 @@ export default {
         this.user.key +
         "&$token=" +
         this.user.token;
-    }
+    },
   },
-  //初始化查询
-  created() {
-    this.searchForm();
-    this.uploadHeaders = {
-      key: this.user.key,
-      token: this.user.token
-    };
-  }
 };
 </script>
 

+ 58 - 58
src/modules/basic/view/sys_login_rule_list.vue

@@ -1,9 +1,9 @@
 <template>
-  <section style="margin-top: 0px;">
+  <section style="margin-top: 0px">
     <el-form
       :model="searchForm"
       :inline="true"
-      style="border-bottom: 1px solid rgb(221, 221, 221);margin-bottom: 10px;"
+      style="border-bottom: 1px solid rgb(221, 221, 221); margin-bottom: 10px"
     >
       <el-form-item label="学校">
         <el-select
@@ -16,9 +16,9 @@
         >
           <el-option
             v-for="item in rootSchoolSelect"
+            :key="item.id"
             :label="item.name"
             :value="item.id"
-            :key="item.id"
           />
         </el-select>
       </el-form-item>
@@ -29,14 +29,14 @@
           size="small"
           class="w180"
           placeholder="请选择"
-          @clear="clearTypeValue"
           clearable
+          @clear="clearTypeValue"
         >
           <el-option
             v-for="item in loginRuleTypes"
+            :key="item.value"
             :label="item.label"
             :value="item.value"
-            :key="item.value"
           ></el-option>
         </el-select>
       </el-form-item>
@@ -56,7 +56,7 @@
       </el-form-item>
     </el-form>
 
-    <div style="margin-bottom: 5px;">
+    <div style="margin-bottom: 5px">
       操作:
       <el-button
         size="small"
@@ -67,10 +67,10 @@
       </el-button>
 
       <el-button
+        v-show="false"
         size="small"
         type="primary"
         icon="el-icon-refresh"
-        v-show="false"
         @click="doRefreshRule"
         >刷新
       </el-button>
@@ -97,7 +97,7 @@
       v-loading="loading"
       :data="tableData"
       element-loading-text="数据加载中"
-      style="width:100%;"
+      style="width: 100%"
       border
       stripe
     >
@@ -135,8 +135,8 @@
             size="mini"
             type="primary"
             icon="el-icon-edit"
-            @click="loginRuleDialogOpen(scope.row)"
             plain
+            @click="loginRuleDialogOpen(scope.row)"
             >修改
           </el-button>
 
@@ -144,8 +144,8 @@
             size="mini"
             type="danger"
             icon="el-icon-delete"
-            @click="doDeleteRule(scope.row)"
             plain
+            @click="doDeleteRule(scope.row)"
             >删除
           </el-button>
         </template>
@@ -154,25 +154,25 @@
 
     <div class="page pull-right">
       <el-pagination
-        @current-change="handlePagerNo"
         :current-page="searchForm.pageNo"
-        @size-change="handlePagerSize"
         :page-size="searchForm.pageSize"
         :page-sizes="[10, 20, 50, 100, 200, 300]"
         :total="totalElements"
         layout="total, sizes, prev, pager, next, jumper"
+        @current-change="handlePagerNo"
+        @size-change="handlePagerSize"
       ></el-pagination>
     </div>
 
     <el-dialog
-      :title="this.isCreate ? '规则新增' : '规则修改'"
+      :title="isCreate ? '规则新增' : '规则修改'"
       width="390px"
       :visible.sync="loginRuleDialog"
       @close="loginRuleDialogClose"
     >
       <el-form
-        :model="loginRuleForm"
         ref="loginRuleForm"
+        :model="loginRuleForm"
         :rules="formRules"
         label-position="right"
         label-width="110px"
@@ -190,9 +190,9 @@
           >
             <el-option
               v-for="item in rootSchoolSelect"
+              :key="item.id"
               :label="item.name"
               :value="item.id"
-              :key="item.id"
             />
           </el-select>
         </el-form-item>
@@ -208,9 +208,9 @@
           >
             <el-option
               v-for="item in loginRuleTypes"
+              :key="item.value"
               :label="item.label"
               :value="item.value"
-              :key="item.value"
             ></el-option>
           </el-select>
         </el-form-item>
@@ -243,7 +243,7 @@ export default {
         type: null,
         allow: null,
         pageNo: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       loading: false,
       tableData: [],
@@ -252,40 +252,62 @@ export default {
       loginRuleTypes: [
         { label: "WAP登录", value: "STUDENT_LOGIN" },
         { label: "考生端登录", value: "STUDENT_CLIENT_LOGIN" },
-        { label: "极验验证码登录", value: "GEETEST_LOGIN" }
+        { label: "极验验证码登录", value: "GEETEST_LOGIN" },
       ],
       isCreate: true,
       loginRuleDialog: false,
       loginRuleForm: {
         rootOrgId: null,
         type: null,
-        allow: false
+        allow: false,
       },
       formRules: {
         rootOrgId: [
-          { required: true, message: "请选择学校!", trigger: "change" }
+          { required: true, message: "请选择学校!", trigger: "change" },
         ],
         type: [
-          { required: true, message: "请选择规则类型!", trigger: "change" }
+          { required: true, message: "请选择规则类型!", trigger: "change" },
         ],
         allow: [
           {
             required: true,
             message: "请选择是否开放!",
-            trigger: "change"
-          }
-        ]
+            trigger: "change",
+          },
+        ],
       },
       topLoginRuleList: [],
-      switchModels: []
+      switchModels: [],
     };
   },
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+    isSuperAdmin() {
+      return this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN");
+    },
+    rootSchoolSelect() {
+      let rootSchools = [];
+      for (let i = 0; i < this.rootOrgList.length; i++) {
+        let info = {
+          name: this.rootOrgList[i].name + "(" + this.rootOrgList[i].id + ")",
+          id: this.rootOrgList[i].id,
+        };
+        rootSchools.push(info);
+      }
+      return rootSchools;
+    },
+  },
+  created() {
+    this.getRootOrgList();
+    this.getTopLoginRuleList();
+    this.doSearch(1);
+  },
   methods: {
     getRootOrgList() {
       if (this.isSuperAdmin) {
         this.$httpWithMsg
           .get(CORE_API + "/org/getRootOrgList")
-          .then(response => {
+          .then((response) => {
             this.rootOrgList = response.data;
           });
       }
@@ -293,7 +315,7 @@ export default {
     getTopLoginRuleList() {
       this.$httpWithMsg
         .post(CORE_API + "/sys/xlogin/rule/top/list")
-        .then(response => {
+        .then((response) => {
           this.topLoginRuleList = response.data;
 
           for (let n = 0; n < this.topLoginRuleList.length; n++) {
@@ -308,12 +330,12 @@ export default {
       this.loading = true;
       let url = CORE_API + "/sys/xlogin/rule/list";
       this.$http.post(url, this.searchForm).then(
-        response => {
+        (response) => {
           this.tableData = response.data.content;
           this.totalElements = response.data.totalElements;
           this.loading = false;
         },
-        error => {
+        (error) => {
           console.log(error);
           this.loading = false;
         }
@@ -337,7 +359,7 @@ export default {
       this.loginRuleDialog = false;
     },
     doSaveRule() {
-      this.$refs.loginRuleForm.validate(valid => {
+      this.$refs.loginRuleForm.validate((valid) => {
         if (!valid) {
           return false;
         }
@@ -346,7 +368,7 @@ export default {
         this.$http.post(url, this.loginRuleForm).then(() => {
           this.$notify({
             type: "success",
-            message: "保存成功"
+            message: "保存成功",
           });
           this.doSearch();
           this.loginRuleDialogClose();
@@ -360,7 +382,7 @@ export default {
       this.$http.post(url, params).then(() => {
         this.$notify({
           type: "success",
-          message: "更新成功"
+          message: "更新成功",
         });
       });
     },
@@ -368,13 +390,13 @@ export default {
       this.$confirm("确认删除?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         let url = CORE_API + "/sys/xlogin/rule/delete?ruleId=" + row.id;
         this.$http.post(url).then(() => {
           this.$notify({
             type: "success",
-            message: "删除成功"
+            message: "删除成功",
           });
           this.doSearch();
         });
@@ -384,13 +406,13 @@ export default {
       this.$confirm("确认刷新?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         let url = CORE_API + "/sys/xlogin/rule/refresh";
         this.$http.post(url).then(() => {
           this.$notify({
             type: "success",
-            message: "刷新成功"
+            message: "刷新成功",
           });
         });
       });
@@ -418,30 +440,8 @@ export default {
       this.searchForm.type = null;
       this.searchForm.allow = null;
       this.doSearch(1);
-    }
-  },
-  computed: {
-    ...mapState({ user: state => state.user }),
-    isSuperAdmin() {
-      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
     },
-    rootSchoolSelect() {
-      let rootSchools = [];
-      for (let i = 0; i < this.rootOrgList.length; i++) {
-        let info = {
-          name: this.rootOrgList[i].name + "(" + this.rootOrgList[i].id + ")",
-          id: this.rootOrgList[i].id
-        };
-        rootSchools.push(info);
-      }
-      return rootSchools;
-    }
   },
-  created() {
-    this.getRootOrgList();
-    this.getTopLoginRuleList();
-    this.doSearch(1);
-  }
 };
 </script>
 

+ 24 - 25
src/modules/basic/view/sys_notice.vue

@@ -3,17 +3,17 @@
   <el-container>
     <el-main class="el-main-padding">
       <el-form
+        ref="ruleForm"
         :model="ruleForm"
         :rules="rules"
-        ref="ruleForm"
         label-width="200px"
         class="demo-ruleForm"
         :inline-message="true"
       >
         <el-form-item label="有效期" prop="examDatetimeRange">
           <el-date-picker
-            class="input"
             v-model="examDatetimeRange"
+            class="input"
             type="datetimerange"
             range-separator="至"
             start-placeholder="开始日期"
@@ -24,29 +24,29 @@
         </el-form-item>
         <el-form-item label="标题" prop="title">
           <el-input
+            v-model="ruleForm.title"
             type="text"
             placeholder="请输入标题"
-            v-model="ruleForm.title"
             maxlength="20"
             show-word-limit
           ></el-input>
         </el-form-item>
         <el-form-item label="通知内容" prop="content">
           <el-input
+            v-model="ruleForm.content"
             type="textarea"
             placeholder="请输入内容"
-            v-model="ruleForm.content"
             maxlength="200"
             show-word-limit
           ></el-input>
         </el-form-item>
         <el-form-item label="状态" prop="enable">
-          <el-radio-group class="pull_right_sm" v-model="ruleForm.enable">
+          <el-radio-group v-model="ruleForm.enable" class="pull_right_sm">
             <el-radio :label="true">启用</el-radio>
             <el-radio :label="false">禁用</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item style="margin-top:10px;">
+        <el-form-item style="margin-top: 10px">
           <el-button type="primary" @click="submitForm('ruleForm')"
             >保 存</el-button
           >
@@ -61,7 +61,7 @@ import moment from "moment";
 import { CORE_API } from "@/constants/constants.js";
 let _this = null;
 export default {
-  name: "sys_notice",
+  name: "SysNotice",
   data() {
     let validateExamDatetimeRange = (rule, value, callback) => {
       let examDatetimeRange = _this.examDatetimeRange;
@@ -80,7 +80,7 @@ export default {
         startTime: null,
         endTime: null,
         enable: true,
-        title: ""
+        title: "",
       },
       rules: {
         title: [{ required: true, trigger: "blur" }],
@@ -90,15 +90,22 @@ export default {
           {
             required: true,
             validator: validateExamDatetimeRange,
-            trigger: "blur"
-          }
-        ]
-      }
+            trigger: "blur",
+          },
+        ],
+      },
     };
   },
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    _this = this;
+    this.initForm();
+  },
   methods: {
     submitForm(formName) {
-      this.$refs[formName].validate(valid => {
+      this.$refs[formName].validate((valid) => {
         if (valid) {
           this.ruleForm.startTime = this.examDatetimeRange[0];
           this.ruleForm.endTime = this.examDatetimeRange[1];
@@ -108,7 +115,7 @@ export default {
               () => {
                 this.$notify({
                   message: "保存成功",
-                  type: "success"
+                  type: "success",
                 });
               },
               () => {}
@@ -121,7 +128,7 @@ export default {
 
     initForm() {
       var url = CORE_API + "/sys/notice/getSysNotice/?rootOrgId=-1";
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         if (response && response.data) {
           let data = response.data;
           (this.ruleForm.rootOrgId = data.rootOrgId),
@@ -134,23 +141,15 @@ export default {
 
           this.examDatetimeRange = [
             this.ruleForm.startTime,
-            this.ruleForm.endTime
+            this.ruleForm.endTime,
           ];
         } else {
           let now = moment().format("YYYY-MM-DD HH:mm:ss");
           this.examDatetimeRange = [now, now];
         }
       });
-    }
-  },
-  created() {
-    _this = this;
-    this.initForm();
+    },
   },
-  watch: {},
-  computed: {
-    ...mapState({ user: state => state.user })
-  }
 };
 </script>
 <style scoped>

+ 45 - 45
src/modules/basic/view/sys_prop_list.vue

@@ -1,24 +1,24 @@
 <template>
   <section class="content">
     <div
-      class="box-body"
       v-loading.fullscreen="loading"
+      class="box-body"
       element-loading-text="请稍后..."
     >
-      <el-form :inline="true" :model="formSearch" ref="primaryForm">
+      <el-form ref="primaryForm" :inline="true" :model="formSearch">
         <el-row>
           <el-form-item label="名称">
             <el-input
+              v-model="formSearch.propKey"
               class="input_width_lg"
               placeholder="请输入参数名称"
-              v-model="formSearch.propKey"
             />
           </el-form-item>
           <el-form-item label="描述">
             <el-input
+              v-model="formSearch.description"
               class="input_width_lg"
               placeholder="请输入参数描述"
-              v-model="formSearch.description"
             />
           </el-form-item>
           <!-- <el-form-item label="类型">
@@ -43,9 +43,9 @@
           </el-form-item>-->
           <el-form-item label="参数值">
             <el-input
+              v-model="formSearch.propValue"
               class="input_width_lg"
               placeholder="请输入参数值"
-              v-model="formSearch.propValue"
             />
           </el-form-item>
 
@@ -59,8 +59,8 @@
             >
             <el-button
               size="small"
-              @click="resetPrimaryForm"
               icon="el-icon-refresh"
+              @click="resetPrimaryForm"
               >重置</el-button
             >
             <el-button
@@ -80,13 +80,13 @@
       <el-button
         size="small"
         type="danger"
-        @click="deleteIds"
         :disabled="noBatchSelected"
         icon="el-icon-delete"
+        @click="deleteIds"
         >删除</el-button
       >
 
-      <div style="width: 100%;margin-bottom: 10px;"></div>
+      <div style="width: 100%; margin-bottom: 10px"></div>
 
       <!-- 新增或修改弹出框 -->
       <el-dialog
@@ -97,19 +97,19 @@
         @close="dialogBeforeClose"
       >
         <el-form
+          ref="sysPropForm"
           :inline="true"
           inline-message
           :model="sysPropForm"
-          ref="sysPropForm"
           :rules="rules"
           label-position="right"
           label-width="90px"
         >
           <el-form-item label="名称" prop="propKey">
             <el-input
+              v-model="sysPropForm.propKey"
               :disabled="'modify' == operateType"
               class="pull_length"
-              v-model="sysPropForm.propKey"
               auto-complete="off"
               placeholder="请输入参数名称"
               maxlength="100"
@@ -117,30 +117,30 @@
           </el-form-item>
           <el-form-item label="类型" prop="propValueType">
             <el-select
+              v-model="sysPropForm.propValueType"
               :disabled="'modify' == operateType"
               class="pull_length"
               :remote-method="getBasicDataTypes"
-              @focus="e => getBasicDataTypes(e.target.value)"
               :loading="basicDataTypeLoading"
               remote
               filterable
               clearable
-              v-model="sysPropForm.propValueType"
               placeholder="请选择参数类型"
+              @focus="(e) => getBasicDataTypes(e.target.value)"
             >
               <el-option
                 v-for="item in basicDataTypeList4Search"
+                :key="item.code"
                 :label="item.name"
                 :value="item.code"
-                :key="item.code"
               />
             </el-select>
           </el-form-item>
           <el-form-item label="参数值" prop="propValue">
             <el-input
+              v-model="sysPropForm.propValue"
               class="pull_length text_area"
               type="textarea"
-              v-model="sysPropForm.propValue"
               auto-complete="off"
               placeholder="请输入参数值"
               maxlength="1000"
@@ -148,9 +148,9 @@
           </el-form-item>
           <el-form-item label="描述" prop="description">
             <el-input
+              v-model="sysPropForm.description"
               type="textarea"
               class="pull_length text_area"
-              v-model="sysPropForm.description"
               auto-complete="off"
               placeholder="请输入参数描述"
               maxlength="1000"
@@ -193,8 +193,8 @@
                 size="mini"
                 type="primary"
                 icon="el-icon-edit"
-                @click="edit(scope.row)"
                 plain
+                @click="edit(scope.row)"
                 >编辑</el-button
               >
               <el-button
@@ -210,13 +210,13 @@
       </el-table>
       <div class="page pull-right">
         <el-pagination
-          @current-change="handleCurrentChange"
           :current-page="currentPage"
           :page-size="pageSize"
           :page-sizes="[10, 20, 50, 100, 200, 300]"
-          @size-change="handleSizeChange"
           layout="total, sizes, prev, pager, next, jumper"
           :total="total"
+          @current-change="handleCurrentChange"
+          @size-change="handleSizeChange"
         />
       </div>
     </div>
@@ -229,7 +229,7 @@ import { mapState } from "vuex";
 import { BASIC_DATA_TYPE } from "@/constants/constants.js";
 
 export default {
-  name: "sys_prop_list",
+  name: "SysPropList",
   data() {
     return {
       courseLoading: false,
@@ -237,13 +237,13 @@ export default {
         propKey: "",
         propValueType: "",
         propValue: "",
-        description: ""
+        description: "",
       },
       sysPropForm: {
         propKey: "",
         propValueType: "",
         propValue: "",
-        description: ""
+        description: "",
       },
       sysPropDialog: false,
       loading: false,
@@ -257,27 +257,32 @@ export default {
       multipleSelection: [],
       rules: {
         propKey: [
-          { required: true, message: "请输入参数名称", trigger: "blur" }
+          { required: true, message: "请输入参数名称", trigger: "blur" },
         ],
         propValueType: [
-          { required: true, message: "请选择参数类型", trigger: "change" }
+          { required: true, message: "请选择参数类型", trigger: "change" },
         ],
         propValue: [
-          { required: true, message: "请输入参数值", trigger: "blur" }
+          { required: true, message: "请输入参数值", trigger: "blur" },
         ],
         description: [
-          { required: true, message: "请输入参数描述", trigger: "blur" }
-        ]
-      }
+          { required: true, message: "请输入参数描述", trigger: "blur" },
+        ],
+      },
     };
   },
   computed: {
     ...mapState({
-      user: state => state.user
+      user: (state) => state.user,
     }),
     noBatchSelected() {
       return this.multipleSelection.length === 0;
-    }
+    },
+  },
+
+  //初始化查询
+  created() {
+    this.searchForm();
   },
   methods: {
     dialogBeforeClose() {
@@ -292,7 +297,7 @@ export default {
         propKey: "",
         propValueType: "",
         propValue: "",
-        description: ""
+        description: "",
       };
       this.$refs.primaryForm.resetFields();
     },
@@ -330,7 +335,7 @@ export default {
         param;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           // console.log("response :", response);
           this.tableData = response.data.content;
           this.total = response.data.totalElements;
@@ -354,7 +359,7 @@ export default {
     },
     //保存
     submitForm(formData) {
-      this.$refs[formData].validate(valid => {
+      this.$refs[formData].validate((valid) => {
         if (valid) {
           var url = CORE_API + "/systemProperty";
           //修改
@@ -363,7 +368,7 @@ export default {
               () => {
                 this.$notify({
                   type: "success",
-                  message: "修改成功!"
+                  message: "修改成功!",
                 });
                 this.searchForm();
                 this.sysPropDialog = false;
@@ -380,7 +385,7 @@ export default {
               () => {
                 this.$notify({
                   type: "success",
-                  message: "新增成功!"
+                  message: "新增成功!",
                 });
                 this.sysPropDialog = false;
                 this.searchForm();
@@ -427,13 +432,13 @@ export default {
       this.$confirm("是否删除该条配置信息?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "error"
+        type: "error",
       }).then(() => {
         var url = CORE_API + "/systemProperty/" + row.propKey;
         this.$httpWithMsg.delete(url).then(() => {
           this.$notify({
             type: "success",
-            message: "删除成功!"
+            message: "删除成功!",
           });
           this.searchForm();
         });
@@ -444,13 +449,13 @@ export default {
       if (this.multipleSelection.length === 0) {
         this.$notify({
           type: "warning",
-          message: "请选择要删除的配置"
+          message: "请选择要删除的配置",
         });
       } else {
         this.$confirm("是否删除这些配置信息?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "error"
+          type: "error",
         }).then(() => {
           var ids = [];
           for (var i = 0; i < this.multipleSelection.length; i++) {
@@ -460,19 +465,14 @@ export default {
           this.$httpWithMsg.delete(url).then(() => {
             this.$notify({
               type: "success",
-              message: "删除成功!"
+              message: "删除成功!",
             });
             this.searchForm();
           });
         });
       }
-    }
+    },
   },
-
-  //初始化查询
-  created() {
-    this.searchForm();
-  }
 };
 </script>
 

+ 68 - 66
src/modules/basic/view/unimportant_school_config.vue

@@ -2,9 +2,9 @@
   <el-container>
     <el-main class="el-main-padding">
       <el-form
+        ref="ruleForm"
         :model="ruleForm"
         :rules="rules"
-        ref="ruleForm"
         label-width="200px"
         class="demo-ruleForm"
         :inline-message="true"
@@ -18,27 +18,27 @@
           >
             <el-option
               v-for="item in rootSchoolSelect"
+              :key="item.id"
               :label="item.name"
               :value="item.id"
-              :key="item.id"
             />
           </el-select>
         </el-form-item>
         <el-form-item label="服务接口默认考试">
           <el-select
+            v-model="ruleForm.THIRD_PARTY_API_DEFAULT_EXAM_ID"
             class="input"
             :remote-method="queryExams4Select"
             remote
             :loading="queryExams4ThirdPartyApiDefaultExamId"
             filterable
-            v-model="ruleForm.THIRD_PARTY_API_DEFAULT_EXAM_ID"
             placeholder="请选择"
           >
             <el-option
               v-for="item in examList4ThirdPartyApiDefaultExamId"
+              :key="item.id"
               :label="item.name"
               :value="item.id"
-              :key="item.id"
             >
             </el-option>
           </el-select>
@@ -72,14 +72,67 @@ export default {
         orgId: null,
         THIRD_PARTY_API_DEFAULT_EXAM_ID: null,
         properties: {
-          THIRD_PARTY_API_DEFAULT_EXAM_ID: null
-        }
+          THIRD_PARTY_API_DEFAULT_EXAM_ID: null,
+        },
       },
       queryExams4ThirdPartyApiDefaultExamId: false,
       examList4ThirdPartyApiDefaultExamId: [],
-      rules: {}
+      rules: {},
     };
   },
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+    btnSaveDiabled() {
+      console.log(this.formDataChanged);
+      return !this.formDataChanged;
+    },
+    isSuperAdmin() {
+      return this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN");
+    },
+    rootSchoolSelect() {
+      let rootSchools = [];
+      for (let i = 0; i < this.rootOrgList.length; i++) {
+        let info = {
+          name: this.rootOrgList[i].name + "(" + this.rootOrgList[i].id + ")",
+          id: this.rootOrgList[i].id,
+        };
+        rootSchools.push(info);
+      }
+      return rootSchools;
+    },
+  },
+  watch: {
+    "ruleForm.orgId": {
+      handler: function () {
+        this.initForm();
+      },
+    },
+    ruleForm: {
+      deep: true,
+      handler: function (newForm) {
+        if (Object.keys(this.originalRuleForm).length > 0) {
+          this.formDataChanged = !(
+            newForm.THIRD_PARTY_API_DEFAULT_EXAM_ID ==
+            this.originalRuleForm.THIRD_PARTY_API_DEFAULT_EXAM_ID
+          );
+        } else {
+          this.formDataChanged = false;
+        }
+      },
+    },
+  },
+  created() {
+    this.ruleForm.orgId = this.user.rootOrgId;
+    this.propertyGroupId = "config4Edit2";
+    if (this.isSuperAdmin) {
+      this.$httpWithMsg
+        .get(CORE_API + "/org/getRootOrgList")
+        .then((response) => {
+          this.rootOrgList = response.data;
+        });
+    }
+    this.initForm();
+  },
   methods: {
     queryExams4Select(name) {
       console.log("queryExams; name: " + name);
@@ -92,17 +145,17 @@ export default {
             "&name=" +
             name
         )
-        .then(response => {
+        .then((response) => {
           this.queryExams4ThirdPartyApiDefaultExamId = false;
           this.examList4ThirdPartyApiDefaultExamId = response.data;
         })
-        .catch(response => {
+        .catch((response) => {
           console.log(response);
           this.queryExams4ThirdPartyApiDefaultExamId = false;
         });
     },
     submitForm(formName) {
-      this.$refs[formName].validate(valid => {
+      this.$refs[formName].validate((valid) => {
         if (valid) {
           this.ruleForm.properties.THIRD_PARTY_API_DEFAULT_EXAM_ID = this.ruleForm.THIRD_PARTY_API_DEFAULT_EXAM_ID;
 
@@ -112,7 +165,7 @@ export default {
               () => {
                 this.$notify({
                   message: "保存成功",
-                  type: "success"
+                  type: "success",
                 });
                 this.originalRuleForm = Object.assign({}, this.ruleForm);
                 this.formDataChanged = false;
@@ -133,7 +186,7 @@ export default {
         this.ruleForm.orgId +
         "/" +
         this.propertyGroupId;
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         if (response) {
           let examId = response.data.THIRD_PARTY_API_DEFAULT_EXAM_ID;
           this.ruleForm.THIRD_PARTY_API_DEFAULT_EXAM_ID == examId;
@@ -143,9 +196,9 @@ export default {
             this.ruleForm.THIRD_PARTY_API_DEFAULT_EXAM_ID = parseInt(examId);
             this.$httpWithMsg
               .get(EXAM_WORK_API + "/exam/" + examId)
-              .then(response => {
+              .then((response) => {
                 this.examList4ThirdPartyApiDefaultExamId = [
-                  { id: response.data.id, name: response.data.name }
+                  { id: response.data.id, name: response.data.name },
                 ];
               });
           }
@@ -154,63 +207,12 @@ export default {
         } else {
           this.$notify({
             message: "学校设置信息暂未初始化,请立即初始化",
-            type: "warning"
+            type: "warning",
           });
         }
       });
-    }
-  },
-  created() {
-    this.ruleForm.orgId = this.user.rootOrgId;
-    this.propertyGroupId = "config4Edit2";
-    if (this.isSuperAdmin) {
-      this.$httpWithMsg.get(CORE_API + "/org/getRootOrgList").then(response => {
-        this.rootOrgList = response.data;
-      });
-    }
-    this.initForm();
-  },
-  watch: {
-    "ruleForm.orgId": {
-      handler: function() {
-        this.initForm();
-      }
     },
-    ruleForm: {
-      deep: true,
-      handler: function(newForm) {
-        if (Object.keys(this.originalRuleForm).length > 0) {
-          this.formDataChanged = !(
-            newForm.THIRD_PARTY_API_DEFAULT_EXAM_ID ==
-            this.originalRuleForm.THIRD_PARTY_API_DEFAULT_EXAM_ID
-          );
-        } else {
-          this.formDataChanged = false;
-        }
-      }
-    }
   },
-  computed: {
-    ...mapState({ user: state => state.user }),
-    btnSaveDiabled() {
-      console.log(this.formDataChanged);
-      return !this.formDataChanged;
-    },
-    isSuperAdmin() {
-      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
-    },
-    rootSchoolSelect() {
-      let rootSchools = [];
-      for (let i = 0; i < this.rootOrgList.length; i++) {
-        let info = {
-          name: this.rootOrgList[i].name + "(" + this.rootOrgList[i].id + ")",
-          id: this.rootOrgList[i].id
-        };
-        rootSchools.push(info);
-      }
-      return rootSchools;
-    }
-  }
 };
 </script>
 <style scoped>

+ 104 - 104
src/modules/basic/view/user.vue

@@ -2,8 +2,8 @@
   <section class="content">
     <div class="box box-info">
       <div
-        class="box-body"
         v-loading.fullscreen="loading"
+        class="box-body"
         element-loading-text="请稍后..."
       >
         <!-- 搜索 -->
@@ -13,44 +13,44 @@
               v-model="searchForm.rootOrgId"
               placeholder="请选择"
               :disabled="!isSuperAdmin"
-              @change="rootOrgChanged4Search"
               class="input_width"
               filterable
+              @change="rootOrgChanged4Search"
             >
               <el-option
                 v-for="item in rootSchoolSelect"
+                :key="item.id"
                 :label="item.name"
                 :value="item.id"
-                :key="item.id"
               />
             </el-select>
           </el-form-item>
           <el-form-item label="角色">
             <el-select
-              clearable
               v-model="searchForm.roleId"
+              clearable
               placeholder="请选择"
               class="input_width"
             >
               <el-option
                 v-for="item in roleList4Search"
+                :key="item.roleId"
                 :label="item.roleName"
                 :value="item.roleId"
-                :key="item.roleId"
               />
             </el-select>
           </el-form-item>
           <el-form-item label="登录名">
             <el-input
-              placeholder="请输入登录名"
               v-model="searchForm.loginName"
+              placeholder="请输入登录名"
               class="input_width"
             />
           </el-form-item>
           <el-form-item label="姓名">
             <el-input
-              placeholder="请输入姓名"
               v-model="searchForm.name"
+              placeholder="请输入姓名"
               class="input_width"
             />
           </el-form-item>
@@ -125,10 +125,10 @@
         <!-- 添加用户信息弹出框 -->
         <el-dialog title="新增用户" width="450px" :visible.sync="addingDialog">
           <el-form
+            ref="addingForm"
             :inline="true"
             inline-message
             :model="userForm"
-            ref="addingForm"
             :rules="rules"
             label-position="right"
             label-width="120px"
@@ -136,8 +136,8 @@
             <el-row>
               <el-form-item label="姓名" prop="name">
                 <el-input
-                  class="input_width_lg"
                   v-model="userForm.name"
+                  class="input_width_lg"
                   auto-complete="off"
                   placeholder="请输入姓名"
                 />
@@ -146,8 +146,8 @@
             <el-row>
               <el-form-item label="登录名" prop="loginName">
                 <el-input
-                  class="input_width_lg"
                   v-model="userForm.loginName"
+                  class="input_width_lg"
                   auto-complete="off"
                   placeholder="请输入登录名"
                 />
@@ -156,8 +156,8 @@
             <el-row>
               <el-form-item label="密码" prop="password">
                 <el-input
-                  class="input_width_lg"
                   v-model="userForm.password"
+                  class="input_width_lg"
                   auto-complete="off"
                   placeholder="请输入密码"
                 />
@@ -166,8 +166,8 @@
             <el-row>
               <el-form-item label="联系方式" prop="phoneNumber">
                 <el-input
-                  class="input_width_lg"
                   v-model="userForm.phoneNumber"
+                  class="input_width_lg"
                   auto-complete="off"
                   placeholder="请输入联系方式"
                 />
@@ -176,18 +176,18 @@
             <el-row>
               <el-form-item v-if="isSuperAdmin" label="学校" prop="rootOrgId">
                 <el-select
-                  class="input_width_lg"
                   v-model="userForm.rootOrgId"
+                  class="input_width_lg"
                   placeholder="请选择"
                   :disabled="!isSuperAdmin"
-                  @change="rootOrgChanged4InsertOrUpdate"
                   filterable
+                  @change="rootOrgChanged4InsertOrUpdate"
                 >
                   <el-option
                     v-for="item in rootSchoolSelect"
+                    :key="item.id"
                     :label="item.name"
                     :value="item.id"
-                    :key="item.id"
                   >
                   </el-option>
                 </el-select>
@@ -196,17 +196,17 @@
             <el-row>
               <el-form-item label="角色" prop="roleIds">
                 <el-select
+                  v-model="userForm.roleIds"
                   class="input_width_lg"
                   multiple
-                  v-model="userForm.roleIds"
                   placeholder="请选择"
                   @change="rolesChanged"
                 >
                   <el-option
                     v-for="item in roleList4InsertOrUpdateWithoutSuperAdmin"
+                    :key="item.roleId"
                     :label="item.roleName"
                     :value="item.roleId"
-                    :key="item.roleId"
                   >
                   </el-option>
                 </el-select>
@@ -215,21 +215,21 @@
             <el-row>
               <el-form-item label="子机构" prop="orgId">
                 <el-select
+                  v-model="userForm.orgId"
                   class="input_width_lg"
                   :remote-method="getOrgList4InsertOrUpdate"
-                  @focus="e => getOrgList4InsertOrUpdate(e.target.value)"
                   :loading="orgLoading4InsertOrUpdate"
                   remote
                   filterable
                   clearable
-                  v-model="userForm.orgId"
                   placeholder="请选择"
+                  @focus="(e) => getOrgList4InsertOrUpdate(e.target.value)"
                 >
                   <el-option
                     v-for="item in orgList4InsertOrUpdate"
+                    :key="item.id"
                     :label="item.name"
                     :value="item.id"
-                    :key="item.id"
                   >
                   </el-option>
                 </el-select>
@@ -237,7 +237,7 @@
             </el-row>
             <el-row>
               <el-form-item label="状态">
-                <el-radio-group class="pull_right_sm" v-model="enableStr">
+                <el-radio-group v-model="enableStr" class="pull_right_sm">
                   <el-radio label="true">启用</el-radio>
                   <el-radio label="false">禁用</el-radio>
                 </el-radio-group>
@@ -253,10 +253,10 @@
         <!-- 修改用户信息弹出框 -->
         <el-dialog title="编辑用户" width="450px" :visible.sync="updateDialog">
           <el-form
+            ref="updateForm"
             :inline="true"
             inline-message
             :model="userForm"
-            ref="updateForm"
             :rules="rules"
             label-position="right"
             label-width="120px"
@@ -264,8 +264,8 @@
             <el-row>
               <el-form-item label="ID">
                 <el-input
-                  class="input_width_lg"
                   v-model="userForm.id"
+                  class="input_width_lg"
                   :disabled="true"
                 />
               </el-form-item>
@@ -273,8 +273,8 @@
             <el-row>
               <el-form-item label="姓名" prop="name">
                 <el-input
-                  class="input_width_lg"
                   v-model="userForm.name"
+                  class="input_width_lg"
                   auto-complete="off"
                   placeholder="请输入姓名"
                 />
@@ -283,8 +283,8 @@
             <el-row>
               <el-form-item label="登录名" prop="loginName">
                 <el-input
-                  class="input_width_lg"
                   v-model="userForm.loginName"
+                  class="input_width_lg"
                   auto-complete="off"
                   placeholder="请输入登录名"
                 />
@@ -293,8 +293,8 @@
             <el-row>
               <el-form-item label="联系方式" prop="phoneNumber">
                 <el-input
-                  class="input_width_lg"
                   v-model="userForm.phoneNumber"
+                  class="input_width_lg"
                   auto-complete="off"
                   placeholder="请输入联系方式"
                 />
@@ -303,16 +303,16 @@
             <el-row>
               <el-form-item v-if="isSuperAdmin" label="学校" prop="rootOrgId">
                 <el-select
-                  class="input_width_lg"
                   v-model="userForm.rootOrgId"
+                  class="input_width_lg"
                   placeholder="请选择"
                   :disabled="true"
                 >
                   <el-option
                     v-for="item in rootSchoolSelect"
+                    :key="item.id"
                     :label="item.name"
                     :value="item.id"
-                    :key="item.id"
                   >
                   </el-option>
                 </el-select>
@@ -321,19 +321,19 @@
             <el-row>
               <el-form-item label="角色" prop="roleIds">
                 <el-select
+                  v-model="userForm.roleIds"
                   class="input_width_lg"
                   multiple
-                  v-model="userForm.roleIds"
                   placeholder="请选择"
                   :disabled="rowIsSuperAdmin"
                   @change="rolesChanged"
                 >
                   <el-option
                     v-for="item in roleList4InsertOrUpdate"
+                    :key="item.roleId"
                     :label="item.roleName"
                     :disabled="item.roleCode == 'SUPER_ADMIN'"
                     :value="item.roleId"
-                    :key="item.roleId"
                   >
                   </el-option>
                 </el-select>
@@ -342,21 +342,21 @@
             <el-row>
               <el-form-item label="子机构" prop="orgId">
                 <el-select
+                  v-model="userForm.orgId"
                   class="input_width_lg"
                   :remote-method="getOrgList4InsertOrUpdate"
-                  @focus="e => getOrgList4InsertOrUpdate(e.target.value)"
                   :loading="orgLoading4InsertOrUpdate"
                   remote
                   filterable
                   clearable
-                  v-model="userForm.orgId"
                   placeholder="请选择"
+                  @focus="(e) => getOrgList4InsertOrUpdate(e.target.value)"
                 >
                   <el-option
                     v-for="item in orgList4InsertOrUpdate"
+                    :key="item.id"
                     :label="item.name"
                     :value="item.id"
-                    :key="item.id"
                   >
                   </el-option>
                 </el-select>
@@ -365,8 +365,8 @@
             <el-row>
               <el-form-item label="状态">
                 <el-radio-group
-                  class="pull_right_sm"
                   v-model="enableStr"
+                  class="pull_right_sm"
                   :disabled="rowIsSuperAdmin"
                 >
                   <el-radio label="true">启用</el-radio>
@@ -388,7 +388,7 @@
           border
           resizable
           stripe
-          style="width: 100%;"
+          style="width: 100%"
           @selection-change="selectChange"
         >
           <el-table-column type="selection" width="50"></el-table-column>
@@ -419,7 +419,7 @@
                   content="启用"
                   placement="left"
                 >
-                  <i class="el-icon-success" style="color:green;"></i>
+                  <i class="el-icon-success" style="color: green"></i>
                 </el-tooltip>
               </span>
               <span v-else>
@@ -429,7 +429,7 @@
                   content="禁用"
                   placement="left"
                 >
-                  <i class="el-icon-error" style="color:red;"></i>
+                  <i class="el-icon-error" style="color: red"></i>
                 </el-tooltip>
               </span>
             </span>
@@ -441,8 +441,8 @@
                 size="mini"
                 type="primary"
                 plain
-                @click="enableById(scope.row)"
                 icon="el-icon-check"
+                @click="enableById(scope.row)"
               >
                 启用
               </el-button>
@@ -450,8 +450,8 @@
                 v-if="scope.row.enable"
                 size="mini"
                 type="danger"
-                @click="disableById(scope.row)"
                 icon="el-icon-close"
+                @click="disableById(scope.row)"
               >
                 禁用
               </el-button>
@@ -467,11 +467,11 @@
                       size="mini"
                       type="primary"
                       plain
+                      icon="el-icon-edit"
                       @click="
                         () =>
                           $router.push(`./user/data_previllege/${scope.row.id}`)
                       "
-                      icon="el-icon-edit"
                       >数据权限
                     </el-button>
                   </el-dropdown-item>
@@ -480,8 +480,8 @@
                       size="mini"
                       type="primary"
                       plain
-                      @click="openUpdateDialog(scope.row)"
                       icon="el-icon-edit"
+                      @click="openUpdateDialog(scope.row)"
                       >编辑
                     </el-button>
                   </el-dropdown-item>
@@ -490,8 +490,8 @@
                       v-if="false"
                       size="mini"
                       type="danger"
-                      @click="deleteById(scope.row)"
                       icon="el-icon-delete"
+                      @click="deleteById(scope.row)"
                       >删除
                     </el-button>
                   </el-dropdown-item>
@@ -511,13 +511,13 @@
         </el-table>
         <div class="page pull-right">
           <el-pagination
-            @current-change="handleCurrentChange"
             :current-page="currentPage"
             :page-size="10"
             :page-sizes="[10, 20, 50, 100, 200, 300]"
-            @size-change="handleSizeChange"
             layout="total, sizes, prev, pager, next, jumper"
             :total="total"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
           />
         </div>
       </div>
@@ -525,7 +525,7 @@
 
     <UserCopyPrevillegeDialog
       ref="copyPrevillegeDialog"
-      :sourceUser="selectedUserToCopy"
+      :source-user="selectedUserToCopy"
       @reload="init"
     />
   </section>
@@ -556,7 +556,7 @@ export default {
     };
     return {
       rolePrivileges: {
-        user_data_rule_setting: false
+        user_data_rule_setting: false,
       },
       loading: false,
       orgLoading4InsertOrUpdate: false,
@@ -569,7 +569,7 @@ export default {
         loginName: "",
         enable: "",
         rootOrgId: "",
-        roleId: ""
+        roleId: "",
       },
       userForm: {
         id: null,
@@ -580,7 +580,7 @@ export default {
         enable: true,
         rootOrgId: null,
         orgId: null,
-        roleIds: []
+        roleIds: [],
       },
       enableStr: "true",
 
@@ -600,22 +600,22 @@ export default {
           {
             required: true,
             message: "请输入姓名",
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         loginName: [
           {
             required: true,
             message: "请输入登录名",
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         password: [
           {
             required: true,
             message: "请输入密码",
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         phoneNumber: [
           // {
@@ -626,23 +626,23 @@ export default {
         rootOrgId: [
           {
             validator: validateRootOrg,
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         orgId: [],
         roleIds: [
           {
             required: true,
             validator: validateRoles,
-            trigger: ["blur", "change"]
-          }
-        ]
-      }
+            trigger: ["blur", "change"],
+          },
+        ],
+      },
     };
   },
   computed: {
     ...mapState({
-      user: state => state.user
+      user: (state) => state.user,
     }),
     userIds() {
       var userIds = "";
@@ -660,23 +660,28 @@ export default {
     },
     roleList4InsertOrUpdateWithoutSuperAdmin() {
       return this.roleList4InsertOrUpdate.filter(
-        item => item.roleCode != "SUPER_ADMIN"
+        (item) => item.roleCode != "SUPER_ADMIN"
       );
     },
     isSuperAdmin() {
-      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
+      return this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN");
     },
     rootSchoolSelect() {
       let rootSchools = [];
       for (let i = 0; i < this.rootOrgList.length; i++) {
         let info = {
           name: this.rootOrgList[i].name + "(" + this.rootOrgList[i].id + ")",
-          id: this.rootOrgList[i].id
+          id: this.rootOrgList[i].id,
         };
         rootSchools.push(info);
       }
       return rootSchools;
-    }
+    },
+  },
+  //初始化查询
+  created() {
+    this.initPrivileges();
+    this.init();
   },
   methods: {
     resetEcsFormSearch() {
@@ -684,7 +689,7 @@ export default {
         roleId: "",
         loginName: "",
         name: "",
-        enable: ""
+        enable: "",
       });
     },
     handleSizeChange(val) {
@@ -715,8 +720,8 @@ export default {
         this.rules.orgId = [
           {
             validator: this.validateOrg,
-            trigger: ["blur", "change"]
-          }
+            trigger: ["blur", "change"],
+          },
         ];
       } else {
         this.rules.orgId = [];
@@ -739,7 +744,7 @@ export default {
         true +
         "&rootOrgId=" +
         this.searchForm.rootOrgId;
-      this.$httpWithMsg.post(url).then(response => {
+      this.$httpWithMsg.post(url).then((response) => {
         this.roleList4Search = response.data;
       });
     },
@@ -752,7 +757,7 @@ export default {
         true +
         "&rootOrgId=" +
         this.userForm.rootOrgId;
-      this.$httpWithMsg.post(url).then(response => {
+      this.$httpWithMsg.post(url).then((response) => {
         this.roleList4InsertOrUpdate = response.data;
         this.rolesChanged();
       });
@@ -764,11 +769,11 @@ export default {
         "/org/query?" +
         new URLSearchParams({
           name: query,
-          rootOrgId: this.userForm.rootOrgId
+          rootOrgId: this.userForm.rootOrgId,
         });
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           this.orgList4InsertOrUpdate = response.data;
           this.orgLoading4InsertOrUpdate = false;
         })
@@ -814,7 +819,7 @@ export default {
         param;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           // console.log(response);
           this.tableData = response.data.list;
           this.total = response.data.total;
@@ -831,7 +836,7 @@ export default {
     },
     selectChange(row) {
       this.selectedUserIds = [];
-      row.forEach(element => {
+      row.forEach((element) => {
         this.selectedUserIds.push(element.id);
       });
     },
@@ -891,13 +896,13 @@ export default {
     //保存
     add() {
       var url = CORE_API + "/user";
-      this.$refs.addingForm.validate(valid => {
+      this.$refs.addingForm.validate((valid) => {
         if (valid) {
           this.userForm.enable = this.enableStr == "true";
           this.$httpWithMsg.post(url, this.userForm).then(() => {
             this.$notify({
               type: "success",
-              message: "添加成功"
+              message: "添加成功",
             });
             this.search();
             this.addingDialog = false;
@@ -910,13 +915,13 @@ export default {
     //保存
     update() {
       var url = CORE_API + "/user";
-      this.$refs.updateForm.validate(valid => {
+      this.$refs.updateForm.validate((valid) => {
         if (valid) {
           this.userForm.enable = this.enableStr == "true";
           this.$httpWithMsg.put(url, this.userForm).then(() => {
             this.$notify({
               type: "success",
-              message: "添加成功"
+              message: "添加成功",
             });
             this.search();
             this.updateDialog = false;
@@ -931,32 +936,32 @@ export default {
       this.$confirm("是否重置密码?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       })
         .then(() => {
           var url = CORE_API + "/user/resetPass/" + row.id;
           this.$httpWithMsg.put(url).then(() => {
             this.$notify({
               type: "success",
-              message: "重置成功!"
+              message: "重置成功!",
             });
             return this.search();
           });
         })
-        .catch(e => console.log(e));
+        .catch((e) => console.log(e));
     },
     //删除单个数据
     deleteById(row) {
       this.$confirm("是否删除该用户?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         var url = CORE_API + "/user/" + row.id;
         this.$httpWithMsg.delete(url).then(() => {
           this.$notify({
             type: "success",
-            message: "删除成功!"
+            message: "删除成功!",
           });
           return this.search();
         });
@@ -967,19 +972,19 @@ export default {
       if (this.selectedUserIds.length === 0) {
         this.$notify({
           type: "warning",
-          message: "请选择要删除的用户"
+          message: "请选择要删除的用户",
         });
       } else {
         this.$confirm("是否删除这些用户?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "error"
+          type: "error",
         }).then(() => {
           var url = CORE_API + "/user/" + this.userIds;
           this.$httpWithMsg.delete(url).then(() => {
             this.$notify({
               type: "success",
-              message: "删除成功!"
+              message: "删除成功!",
             });
             this.search();
           });
@@ -991,19 +996,19 @@ export default {
       if (this.selectedUserIds.length === 0) {
         this.$notify({
           type: "warning",
-          message: "请选择要启用的用户"
+          message: "请选择要启用的用户",
         });
       } else {
         this.$confirm("是否启用这些用户?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "warning"
+          type: "warning",
         }).then(() => {
           var url = CORE_API + "/user/enable/" + this.userIds;
           this.$httpWithMsg.put(url, {}).then(() => {
             this.$notify({
               type: "success",
-              message: "启用成功!"
+              message: "启用成功!",
             });
             return this.search();
           });
@@ -1014,13 +1019,13 @@ export default {
       this.$confirm("是否启用该用户?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         var url = CORE_API + "/user/enable/" + row.id;
         this.$httpWithMsg.put(url, {}).then(() => {
           this.$notify({
             type: "success",
-            message: "启用成功!"
+            message: "启用成功!",
           });
           this.search();
         });
@@ -1031,19 +1036,19 @@ export default {
       if (this.selectedUserIds.length === 0) {
         this.$notify({
           type: "warning",
-          message: "请选择要禁用的用户"
+          message: "请选择要禁用的用户",
         });
       } else {
         this.$confirm("是否禁用这些用户?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "error"
+          type: "error",
         }).then(() => {
           var url = CORE_API + "/user/disable/" + this.userIds;
           this.$httpWithMsg.put(url, {}).then(() => {
             this.$notify({
               type: "success",
-              message: "禁用成功!"
+              message: "禁用成功!",
             });
             this.search();
           });
@@ -1055,13 +1060,13 @@ export default {
       this.$confirm("是否禁用该用户?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "error"
+        type: "error",
       }).then(() => {
         var url = CORE_API + "/user/disable/" + row.id;
         this.$httpWithMsg.put(url, {}).then(() => {
           this.$notify({
             type: "success",
-            message: "禁用成功!"
+            message: "禁用成功!",
           });
           this.search();
         });
@@ -1080,7 +1085,7 @@ export default {
 
       Promise.all([
         this.$httpWithMsg.get(url1),
-        this.$httpWithMsg.post(url2)
+        this.$httpWithMsg.post(url2),
       ]).then(([resp1, resp2]) => {
         this.rootOrgList = resp1.data;
         this.roleList4Search = resp2.data;
@@ -1095,7 +1100,7 @@ export default {
         Object.keys(this.rolePrivileges).toString()
       );
       var url = CORE_API + "/rolePrivilege/checkPrivileges?" + params;
-      this.$httpWithMsg.post(url).then(response => {
+      this.$httpWithMsg.post(url).then((response) => {
         this.rolePrivileges = response.data;
       });
     },
@@ -1124,13 +1129,8 @@ export default {
       }
       this.selectedUserToCopy = refIds[0];
       this.$refs.copyPrevillegeDialog.openDialog();
-    }
+    },
   },
-  //初始化查询
-  created() {
-    this.initPrivileges();
-    this.init();
-  }
 };
 </script>
 

+ 15 - 15
src/modules/basic/view/user_copy_previllege_dialog.vue

@@ -1,11 +1,11 @@
 <template>
   <el-dialog
+    v-if="sourceUser"
     ref="dialog"
     title="数据权限复制"
     width="700px"
     :visible.sync="visible"
     @close="closeDialog"
-    v-if="sourceUser"
   >
     <div>
       <div>
@@ -19,8 +19,8 @@
       </div>
     </div>
     <el-form
-      :model="form"
       ref="form"
+      :model="form"
       :rules="rules"
       :inline="true"
       label-position="right"
@@ -30,8 +30,8 @@
         <div class="float-right">
           <el-form-item label="姓名">
             <el-input
-              placeholder="请输入姓名"
               v-model="form.name"
+              placeholder="请输入姓名"
               class="input_width"
             />
           </el-form-item>
@@ -56,7 +56,7 @@
             border
             resizable
             stripe
-            style="width: 100%;"
+            style="width: 100%"
             @selection-change="selectChange"
           >
             <el-table-column type="selection" width="40" />
@@ -80,13 +80,13 @@
           <div class="page pull-right">
             <el-pagination
               v-if="paginationShow"
-              @current-change="handleCurrentChange"
               :current-page="currentPage"
               :page-size="pageSize"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
-              @size-change="handleSizeChange"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @current-change="handleCurrentChange"
+              @size-change="handleSizeChange"
             />
           </div>
         </div>
@@ -94,7 +94,7 @@
       </el-row>
 
       <el-row class="d-flex justify-content-center mt-2">
-        <el-button type="primary" @click="submitForm" :loading="loading"
+        <el-button type="primary" :loading="loading" @click="submitForm"
           >确 定</el-button
         >
         <el-button @click="closeDialog">取 消</el-button>
@@ -108,13 +108,13 @@ import { CORE_API } from "@/constants/constants";
 export default {
   name: "UserCopyPrevillegeDialog",
   props: {
-    sourceUser: Object
+    sourceUser: { type: Object, default: () => {} },
   },
   data() {
     return {
       visible: false,
       form: {
-        name: ""
+        name: "",
       },
       rules: {},
       targetUsers: [],
@@ -124,7 +124,7 @@ export default {
       noBatchSelected: true,
       currentPage: 1,
       pageSize: 10,
-      total: 10
+      total: 10,
     };
   },
   methods: {
@@ -139,7 +139,7 @@ export default {
         "?" +
         param;
       this.loading = true;
-      return this.$httpWithMsg.get(url).then(response => {
+      return this.$httpWithMsg.get(url).then((response) => {
         this.tableData = response.data.list;
         this.total = response.data.total;
         this.loading = false;
@@ -182,7 +182,7 @@ export default {
         return;
       }
 
-      const refIds = this.$refs.table.selection.map(v => v.id);
+      const refIds = this.$refs.table.selection.map((v) => v.id);
       console.log(refIds);
       if (refIds.length === 0) {
         this.$notify({ type: "warning", message: "请先选择一行或多行" });
@@ -194,7 +194,7 @@ export default {
         // await saveActivity(data);
         await this.$httpWithMsg.post(CORE_API + "/user/data/rule/copy", {
           sourceUserId: this.sourceUser.id,
-          targetUserIds: refIds
+          targetUserIds: refIds,
         });
         this.$emit("reload");
         this.$notify({ title: "保存成功", type: "success" });
@@ -202,8 +202,8 @@ export default {
       } finally {
         this.loading = false;
       }
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 20 - 20
src/modules/examwork/routes/routes.js

@@ -25,76 +25,76 @@ export default [
     children: [
       {
         path: "tips", //学生管理
-        component: Tips
+        component: Tips,
       },
       {
         path: "student", //学生管理
         meta: { pageName: "学生管理" },
-        component: student
+        component: student,
       },
       {
         path: "examStudentImport", //考生导入
         meta: { pageName: "考生导入" },
-        component: examStudentImport
+        component: examStudentImport,
       },
       {
         path: "examStudent", //考生管理
         meta: { pageName: "考生管理" },
-        component: examStudent
+        component: examStudent,
       },
       {
         path: "examInfo", //考试管理
         meta: { pageName: "考试管理" },
-        component: examInfo
+        component: examInfo,
       },
       {
         path: "traditionExam/:id",
-        component: traditionExam
+        component: traditionExam,
       },
       {
         path: "onlineExam/:id",
-        component: onlineExam
+        component: onlineExam,
       },
       {
         path: "onlineHomework/:id",
-        component: onlineHomework
+        component: onlineHomework,
       },
       {
         path: "practiceExam/:id",
-        component: practiceExam
+        component: practiceExam,
       },
       {
         path: "printExam/:id",
-        component: printExam
+        component: printExam,
       },
       {
         path: "offlineExam/:id",
-        component: offlineExam
+        component: offlineExam,
       },
       {
         path: "offlineExamOrgSettings/:id",
-        component: offlineExamOrgSettings
+        component: offlineExamOrgSettings,
       },
       {
         path: "onlineExamOrgSettings/:id",
-        component: onlineExamOrgSettings
+        component: onlineExamOrgSettings,
       },
       {
         path: "onlineHomeworkOrgSettings/:id",
-        component: onlineHomeworkOrgSettings
+        component: onlineHomeworkOrgSettings,
       },
       {
         path: "studentSpecialSettings/:id",
-        component: studentSpecialSettings
+        component: studentSpecialSettings,
       },
       {
         path: "stageSpecialSettings/:id/:examName/:examTypeName", //场次特殊设置
-        component: stageSpecialSettings
+        component: stageSpecialSettings,
       },
       {
         path: "notice",
-        component: notice
-      }
-    ]
-  }
+        component: notice,
+      },
+    ],
+  },
 ];

+ 61 - 61
src/modules/examwork/view/examInfo.vue

@@ -25,9 +25,9 @@
             >
               <el-option
                 v-for="item in examTypeList"
+                :key="item.value"
                 :label="item.label"
                 :value="item.value"
-                :key="item.value"
               ></el-option>
             </el-select>
           </el-form-item>
@@ -72,7 +72,7 @@
             <el-button @click="toOnlineHomework">在线作业</el-button>
             <el-button @click="toPrint">分布式印刷考试</el-button>
           </div>
-          <div style="margin-top: 10px;text-align: center;">
+          <div style="margin-top: 10px; text-align: center">
             <el-button type="primary" @click="examInfoDialog = false"
               >取 消</el-button
             >
@@ -85,7 +85,7 @@
           element-loading-text="拼命加载中"
           :data="tableData"
           border
-          style="width: 100%;text-align:center;"
+          style="width: 100%; text-align: center"
           @selection-change="selectChange"
         >
           <el-table-column type="selection" width="40"></el-table-column>
@@ -131,7 +131,7 @@
                   content="启用"
                   placement="left"
                 >
-                  <i class="el-icon-success" style="color:green;"></i>
+                  <i class="el-icon-success" style="color: green"></i>
                 </el-tooltip>
               </span>
               <span v-else>
@@ -141,7 +141,7 @@
                   content="禁用"
                   placement="left"
                 >
-                  <i class="el-icon-error" style="color:red;"></i>
+                  <i class="el-icon-error" style="color: red"></i>
                 </el-tooltip>
               </span>
             </span>
@@ -160,11 +160,11 @@
                 >
 
                 <el-dropdown
-                  style="margin-left: 10px;"
                   v-if="
                     rolePrivileges.change_exam_availability ||
-                      rolePrivileges.update_exam
+                    rolePrivileges.update_exam
                   "
+                  style="margin-left: 10px"
                 >
                   <el-button type="primary" plain size="mini">
                     更多
@@ -175,7 +175,7 @@
                       <el-button
                         v-if="
                           !scope.row.enable &&
-                            rolePrivileges.change_exam_availability
+                          rolePrivileges.change_exam_availability
                         "
                         size="mini"
                         plain
@@ -241,13 +241,13 @@
         <div class="page pull-right">
           <el-pagination
             v-if="paginationShow"
-            @current-change="handleCurrentChange"
             :current-page="currentPage"
             :page-size="pageSize"
             :page-sizes="[10, 20, 50, 100, 200, 300]"
-            @size-change="handleSizeChange"
             layout="total, sizes, prev, pager, next, jumper"
             :total="total"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
           ></el-pagination>
         </div>
 
@@ -259,11 +259,11 @@
           @close="doBeforedialogClose"
         >
           <el-form
+            ref="examCopyForm"
             :inline="true"
             inline-message
             :model="examCopyForm"
             :rules="examCopyFormRules"
-            ref="examCopyForm"
             label-width="120px"
           >
             <el-row>
@@ -290,7 +290,7 @@
               </el-form-item>
             </el-row>
 
-            <div style="text-align: center;">
+            <div style="text-align: center">
               <el-button type="primary" @click="copyExam">确 定</el-button>
               <el-button @click="copyExamDialog = false">取 消</el-button>
             </div>
@@ -325,11 +325,11 @@ export default {
         update_exam: false,
         change_exam_availability: false,
         exam_course_setting: false,
-        exam_org_setting: false
+        exam_org_setting: false,
       },
       formSearch: {
         name: "",
-        examType: ""
+        examType: "",
       },
       loading: false,
       examTypeList: EXAM_TYPE,
@@ -349,17 +349,17 @@ export default {
       examCopyForm: {
         srcExamId: null,
         destExamCode: "",
-        destExamName: ""
+        destExamName: "",
       },
       examCopyFormRules: {
         destExamName: [
-          { required: true, validator: validateDestExamName, trigger: "blur" }
-        ]
-      }
+          { required: true, validator: validateDestExamName, trigger: "blur" },
+        ],
+      },
     };
   },
   computed: {
-    ...mapState({ user: state => state.user }),
+    ...mapState({ user: (state) => state.user }),
     examIds() {
       var examIds = "";
       for (let examId of this.selectedExamIds) {
@@ -370,7 +370,30 @@ export default {
         }
       }
       return examIds;
+    },
+  },
+  //初始化查询
+  created() {
+    _this = this;
+
+    let sessionData = sessionStorage.getItem("E_EAXM_SEARCH_PARAMS");
+    let pageSize = sessionStorage.getItem("E_EAXM_SEARCH_PAGE_SIZE");
+    let currentPage = sessionStorage.getItem("E_EAXM_SEARCH_CUR_PAGE");
+    sessionStorage.removeItem("E_EAXM_SEARCH_PARAMS");
+    sessionStorage.removeItem("E_EAXM_SEARCH_PAGE_SIZE");
+    sessionStorage.removeItem("E_EAXM_SEARCH_CUR_PAGE");
+    if (sessionData) {
+      this.formSearch = JSON.parse(sessionData);
+    }
+    if (pageSize) {
+      this.pageSize = parseInt(pageSize);
+    }
+    if (currentPage) {
+      this.currentPage = parseInt(currentPage);
     }
+
+    this.initPrivileges();
+    this.searchForm();
   },
 
   methods: {
@@ -378,19 +401,19 @@ export default {
       if (this.selectedExamIds.length == 0) {
         this.$notify({
           type: "warning",
-          message: "请勾选一个考试"
+          message: "请勾选一个考试",
         });
         return;
       }
       if (this.selectedExamIds.length > 1) {
         this.$notify({
           type: "warning",
-          message: "只能勾选一个考试"
+          message: "只能勾选一个考试",
         });
         return;
       }
       this.showCopyExam(
-        this.tableData.filter(v => v.id === this.selectedExamIds[0])[0]
+        this.tableData.filter((v) => v.id === this.selectedExamIds[0])[0]
       );
     },
     showCopyExam(row) {
@@ -406,13 +429,13 @@ export default {
     copyExam() {
       this.examCopyForm.destExamCode = this.examCopyForm.destExamName;
       var url = EXAM_WORK_API + "/exam/copyExam";
-      this.$refs.examCopyForm.validate(valid => {
+      this.$refs.examCopyForm.validate((valid) => {
         if (valid) {
-          this.$httpWithMsg.post(url, this.examCopyForm).then(response => {
+          this.$httpWithMsg.post(url, this.examCopyForm).then((response) => {
             console.log(response);
             this.$notify({
               type: "success",
-              message: "复制成功"
+              message: "复制成功",
             });
             this.copyExamDialog = false;
             this.searchForm();
@@ -434,14 +457,14 @@ export default {
       this.$confirm("是否启用该考试?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         let url = EXAM_WORK_API + "/exam/enable/" + row.id;
-        this.$httpWithMsg.put(url, {}).then(response => {
+        this.$httpWithMsg.put(url, {}).then((response) => {
           console.log(response);
           this.$notify({
             type: "success",
-            message: "开启成功!"
+            message: "开启成功!",
           });
           this.searchForm();
         });
@@ -451,14 +474,14 @@ export default {
       this.$confirm("是否禁用该考试?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "error"
+        type: "error",
       }).then(() => {
         var url = EXAM_WORK_API + "/exam/disable/" + row.id;
-        this.$httpWithMsg.put(url, {}).then(response => {
+        this.$httpWithMsg.put(url, {}).then((response) => {
           console.log(response);
           this.$notify({
             type: "success",
-            message: "禁用成功!"
+            message: "禁用成功!",
           });
           this.searchForm();
         });
@@ -488,7 +511,7 @@ export default {
         "?" +
         param;
       this.loading = true;
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         console.log(response);
         this.tableData = response.data.list;
         this.total = response.data.total;
@@ -520,15 +543,15 @@ export default {
       this.setSearchParams();
       if (row.examType == "OFFLINE") {
         this.$router.push({
-          path: "/examwork/offlineExamOrgSettings/" + row.id
+          path: "/examwork/offlineExamOrgSettings/" + row.id,
         });
       } else if (row.examType == "ONLINE") {
         this.$router.push({
-          path: "/examwork/onlineExamOrgSettings/" + row.id
+          path: "/examwork/onlineExamOrgSettings/" + row.id,
         });
       } else if (row.examType == "ONLINE_HOMEWORK") {
         this.$router.push({
-          path: "/examwork/onlineHomeworkOrgSettings/" + row.id
+          path: "/examwork/onlineHomeworkOrgSettings/" + row.id,
         });
       }
     },
@@ -541,7 +564,7 @@ export default {
           "/" +
           row.name +
           "/" +
-          this.getExamType(row.examType)
+          this.getExamType(row.examType),
       });
     },
     showExamCourseSettingsDialog(row) {
@@ -599,34 +622,11 @@ export default {
         Object.keys(this.rolePrivileges).toString()
       );
       let url = CORE_API + "/rolePrivilege/checkPrivileges?" + params;
-      this.$httpWithMsg.post(url).then(response => {
+      this.$httpWithMsg.post(url).then((response) => {
         this.rolePrivileges = response.data;
       });
-    }
+    },
   },
-  //初始化查询
-  created() {
-    _this = this;
-
-    let sessionData = sessionStorage.getItem("E_EAXM_SEARCH_PARAMS");
-    let pageSize = sessionStorage.getItem("E_EAXM_SEARCH_PAGE_SIZE");
-    let currentPage = sessionStorage.getItem("E_EAXM_SEARCH_CUR_PAGE");
-    sessionStorage.removeItem("E_EAXM_SEARCH_PARAMS");
-    sessionStorage.removeItem("E_EAXM_SEARCH_PAGE_SIZE");
-    sessionStorage.removeItem("E_EAXM_SEARCH_CUR_PAGE");
-    if (sessionData) {
-      this.formSearch = JSON.parse(sessionData);
-    }
-    if (pageSize) {
-      this.pageSize = parseInt(pageSize);
-    }
-    if (currentPage) {
-      this.currentPage = parseInt(currentPage);
-    }
-
-    this.initPrivileges();
-    this.searchForm();
-  }
 };
 </script>
 <style scoped>

Різницю між файлами не показано, бо вона завелика
+ 134 - 131
src/modules/examwork/view/examStudent.vue


+ 40 - 40
src/modules/examwork/view/examStudentImport.vue

@@ -1,9 +1,9 @@
 <template>
-  <section class="content" style="margin-top: -10px;">
+  <section class="content" style="margin-top: -10px">
     <div class="box box-info">
       <!-- 正文信息 -->
       <div class="box-body">
-        <div style="margin-top: 20px;">
+        <div style="margin-top: 20px">
           <el-button
             size="small"
             type="primary"
@@ -12,7 +12,7 @@
             >导入
           </el-button>
         </div>
-        <div style="width: 100%;margin-bottom: 10px;"></div>
+        <div style="width: 100%; margin-bottom: 10px"></div>
 
         <!-- 导入弹窗 -->
         <el-dialog
@@ -20,24 +20,24 @@
           size="tiny"
           :visible.sync="studentImportDialog"
         >
-          <el-form :model="studentImportForm" ref="studentImportForm">
+          <el-form ref="studentImportForm" :model="studentImportForm">
             <el-row>
-              <el-form-item style="margin-left:30px" label="考试" prop="value">
+              <el-form-item style="margin-left: 30px" label="考试" prop="value">
                 <el-select
+                  v-model="studentImportForm.examId"
                   class="input"
                   :remote-method="queryExams"
                   remote
                   :loading="queryExamsLoading"
                   filterable
                   clearable
-                  v-model="studentImportForm.examId"
                   placeholder="请选择"
                 >
                   <el-option
                     v-for="item in examList"
+                    :key="item.id"
                     :label="item.name"
                     :value="item.id"
-                    :key="item.id"
                     :disabled="!item.enable"
                   >
                   </el-option>
@@ -45,10 +45,10 @@
               </el-form-item>
             </el-row>
             <el-row>
-              <el-form-item style="margin-left:30px">
+              <el-form-item style="margin-left: 30px">
                 <el-upload
-                  class="form_left"
                   ref="upload"
+                  class="form_left"
                   accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
                   :action="uploadAction"
                   :headers="uploadHeaders"
@@ -62,33 +62,33 @@
                   :multiple="false"
                 >
                   <el-button
-                    size="small"
                     slot="trigger"
+                    size="small"
                     type="primary"
                     icon="el-icon-search"
                     >选择文件</el-button
                   >
                   <el-button
                     size="small"
-                    style="margin-left:10px;"
+                    style="margin-left: 10px"
                     type="primary"
-                    @click="submitUpload"
                     icon="el-icon-check"
+                    @click="submitUpload"
                     >确认上传
                   </el-button>
                   <el-button
                     size="small"
-                    style="margin-left: 10px;"
+                    style="margin-left: 10px"
                     type="primary"
-                    @click="removeFile"
                     icon="el-icon-refresh"
+                    @click="removeFile"
                     >清空文件
                   </el-button>
                   <el-button
                     size="small"
                     type="primary"
-                    @click="exportFile"
                     icon="el-icon-download"
+                    @click="exportFile"
                     >下载模板
                   </el-button>
                   <div slot="tip" class="el-upload__tip">只能上传xlsx文件</div>
@@ -102,7 +102,7 @@
         <el-table
           :data="tableData"
           border
-          style="width: 100%;text-align:center;"
+          style="width: 100%; text-align: center"
         >
           <el-table-column
             prop="id"
@@ -157,13 +157,13 @@
         </el-table>
         <div class="page pull-right">
           <el-pagination
-            @current-change="handleCurrentChange"
             :current-page="currentPage"
             :page-size="pageSize"
             :page-sizes="[10, 20, 50, 100, 200, 300]"
-            @size-change="handleSizeChange"
             layout="total, sizes, prev, pager, next, jumper"
             :total="total"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
           >
           </el-pagination>
         </div>
@@ -171,7 +171,7 @@
     </div>
   </section>
 </template>
-<style scoped></style>
+
 <script>
 import { TASK_API, EXAM_WORK_API } from "@/constants/constants.js";
 import { mapState } from "vuex";
@@ -191,17 +191,25 @@ export default {
       fileLoading: false,
       queryExamsLoading: false,
       studentImportForm: {
-        examId: null
+        examId: null,
       },
 
       tableData: [],
       currentPage: 1,
       pageSize: 10,
-      total: 0
+      total: 0,
     };
   },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    _this = this;
+    this.queryTableDatas();
+    this.uploadHeaders = {
+      key: this.user.key,
+      token: this.user.token,
+    };
   },
   methods: {
     handleCurrentChange(val) {
@@ -241,7 +249,7 @@ export default {
       console.log(fileList);
       this.$notify({
         message: "上传成功",
-        type: "success"
+        type: "success",
       });
       this.fileLoading = false;
       this.studentImportDialog = false;
@@ -256,7 +264,7 @@ export default {
       if (response.status == 500) {
         this.$notify({
           message: json.desc,
-          type: "error"
+          type: "error",
         });
       }
       this.fileLoading = false;
@@ -273,7 +281,7 @@ export default {
       if (!this.studentImportForm.examId) {
         this.$notify({
           message: "请选择考试",
-          type: "error"
+          type: "error",
         });
         return false;
       } else {
@@ -283,14 +291,14 @@ export default {
       if (fileList.length == 0) {
         this.$notify({
           message: "上传文件不能为空",
-          type: "error"
+          type: "error",
         });
         return false;
       }
       if (fileList.length > 1) {
         this.$notify({
           message: "每次只能上传一个文件",
-          type: "error"
+          type: "error",
         });
         return false;
       }
@@ -298,7 +306,7 @@ export default {
         if (!file.name.endsWith(".xlsx")) {
           this.$notify({
             message: "上传文件必须为xlsx格式",
-            type: "error"
+            type: "error",
           });
           this.initUpload();
           return false;
@@ -345,7 +353,7 @@ export default {
       this.queryExamsLoading = true;
       this.$httpWithMsg
         .get(EXAM_WORK_API + "/exam/queryByNameLike?enable=true&name=" + name)
-        .then(response => {
+        .then((response) => {
           this.queryExamsLoading = false;
           this.examList = response.data;
         })
@@ -353,27 +361,19 @@ export default {
           this.queryExamsLoading = false;
         });
     },
-    queryTableDatas: function() {
+    queryTableDatas: function () {
       var url =
         TASK_API +
         "/examStudentImport/all/" +
         (this.currentPage - 1) +
         "/" +
         this.pageSize;
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         console.log(response);
         _this.tableData = response.data.list;
         _this.total = response.data.total;
       });
-    }
+    },
   },
-  created() {
-    _this = this;
-    this.queryTableDatas();
-    this.uploadHeaders = {
-      key: this.user.key,
-      token: this.user.token
-    };
-  }
 };
 </script>

+ 98 - 98
src/modules/examwork/view/notice.vue

@@ -43,14 +43,14 @@
           >删除</el-button
         >
 
-        <div style="width: 100%;margin-bottom: 10px;"></div>
+        <div style="width: 100%; margin-bottom: 10px"></div>
         <!-- 页面列表 -->
         <el-table
           v-loading="loading"
           element-loading-text="拼命加载中"
           :data="tableData"
           border
-          style="width: 100%;text-align:center;"
+          style="width: 100%; text-align: center"
           @selection-change="selectChange"
         >
           <el-table-column type="selection" width="40"></el-table-column>
@@ -70,11 +70,11 @@
                 placement="top-start"
                 width="200px"
               >
-                <div style="max-width:450px;">
+                <div style="max-width: 450px">
                   <el-tag
-                    style="margin-right:5px;margin-top:5px;"
                     v-for="item in scope.row.publishObject"
                     :key="'po' + item.id"
+                    style="margin-right: 5px; margin-top: 5px"
                     type="info"
                     effect="plain"
                     >{{ item.name }}</el-tag
@@ -82,7 +82,7 @@
                 </div>
 
                 <!-- <p v-html="getPublishObject(scope.row.publishObject)"></p> -->
-                <div slot="reference" style="text-align:left">
+                <div slot="reference" style="text-align: left">
                   <!-- <el-tag size="medium"> -->
                   {{ getPublishObject(scope.row.publishObject) }}
                   <!-- </el-tag> -->
@@ -119,7 +119,7 @@
                 >详情</el-button
               >
               <el-dropdown
-                style="margin-left: 10px;"
+                style="margin-left: 10px"
                 :disabled="scope.row.publishStatus != 'DRAFT'"
               >
                 <el-button type="primary" plain size="mini">
@@ -142,8 +142,8 @@
                       :disabled="scope.row.publishStatus != 'DRAFT'"
                       size="mini"
                       type="danger"
-                      @click="deleteById(scope.row)"
                       icon="el-icon-delete"
+                      @click="deleteById(scope.row)"
                       >删除</el-button
                     >
                   </el-dropdown-item>
@@ -155,67 +155,67 @@
         <div class="page pull-right">
           <el-pagination
             v-if="paginationShow"
-            @current-change="handleCurrentChange"
             :current-page="currentPage"
             :page-size="pageSize"
             :page-sizes="[10, 20, 50, 100, 200, 300]"
-            @size-change="handleSizeChange"
             layout="total, sizes, prev, pager, next, jumper"
             :total="total"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
           ></el-pagination>
         </div>
 
         <!-- 弹出窗口 -->
         <el-dialog
+          v-if="editNoticeDialogVisible"
           width="700px"
           :title="
-            this.operateType == 'add'
+            operateType == 'add'
               ? '新增公告'
-              : this.operateType == 'edit'
+              : operateType == 'edit'
               ? '编辑公告'
               : '公告详情'
           "
-          v-if="editNoticeDialogVisible"
           :visible.sync="editNoticeDialogVisible"
           :before-close="handleClose"
           :close-on-click-modal="false"
           @close="cancel"
         >
           <el-form
+            ref="noticeForm"
             :model="noticeForm"
             inline-message
             size="large"
             :rules="rules"
             :inline="true"
-            ref="noticeForm"
             label-width="85px"
             class="editForm"
           >
             <el-form-item label="标题" prop="title">
               <el-input
-                class="input"
-                :readonly="this.operateType == 'view'"
                 v-model="noticeForm.title"
+                class="input"
+                :readonly="operateType == 'view'"
                 auto-complete="off"
                 maxlength="50"
               ></el-input>
             </el-form-item>
             <el-form-item label="发布人" prop="publisher">
               <el-input
-                class="input"
-                :readonly="this.operateType == 'view'"
                 v-model="noticeForm.publisher"
+                class="input"
+                :readonly="operateType == 'view'"
                 maxlength="50"
               ></el-input>
             </el-form-item>
             <el-form-item label="发送对象" prop="ruleType">
               <el-select
-                :disabled="this.operateType == 'view'"
+                v-model="noticeForm.ruleType"
+                :disabled="operateType == 'view'"
                 class="input"
                 clearable
-                v-model="noticeForm.ruleType"
-                @change="showSelectReceiver"
                 placeholder="请选择"
+                @change="showSelectReceiver"
               >
                 <el-option
                   v-for="item in receiverRuleTypes"
@@ -225,43 +225,43 @@
                 ></el-option>
               </el-select>
               <el-button
-                style="margin-left:5px;"
                 v-show="
-                  (this.noticeForm.ruleType == 'TEACHER_OF_MARK_WORK' ||
-                    this.noticeForm.ruleType == 'STUDENTS_OF_EXAM') &&
-                    this.operateType != 'view'
+                  (noticeForm.ruleType == 'TEACHER_OF_MARK_WORK' ||
+                    noticeForm.ruleType == 'STUDENTS_OF_EXAM') &&
+                  operateType != 'view'
                 "
+                style="margin-left: 5px"
                 @click="showSelectReceiver"
                 >选 择</el-button
               >
             </el-form-item>
-            <el-row :gutter="10" v-if="selectedExam.length != 0">
+            <el-row v-if="selectedExam.length != 0" :gutter="10">
               <el-col :xs="30" :sm="30" :md="30" :lg="30">
                 <el-form-item label="已选">
                   <el-tag
-                    style="margin-left:5px;margin-top:5px;"
                     v-for="tag in selectedExam"
+                    :key="'res-exam' + tag.id"
+                    style="margin-left: 5px; margin-top: 5px"
                     :closable="false"
                     :close-transition="false"
-                    @close="examTagClose(tag)"
                     type="info"
-                    :key="'res-exam' + tag.id"
+                    @close="examTagClose(tag)"
                     >{{ tag.name }}</el-tag
                   >
                 </el-form-item>
               </el-col>
             </el-row>
-            <el-row :gutter="10" v-if="selectedMark.length != 0">
+            <el-row v-if="selectedMark.length != 0" :gutter="10">
               <el-col :xs="30" :sm="30" :md="30" :lg="30">
                 <el-form-item label="已选">
                   <el-tag
-                    style="margin-left:5px;margin-top:5px;"
                     v-for="tag in selectedMark"
+                    :key="'res-mark' + tag.id"
+                    style="margin-left: 5px; margin-top: 5px"
                     :closable="false"
                     :close-transition="false"
-                    @close="markTagClose(tag)"
                     type="info"
-                    :key="'res-mark' + tag.id"
+                    @close="markTagClose(tag)"
                     >{{ tag.name }}</el-tag
                   >
                 </el-form-item>
@@ -270,27 +270,27 @@
             <el-form-item label="公告内容" prop="content">
               <div>
                 <ckeditor
+                  v-model="noticeForm.content"
                   extrabuttons="Font,FontSize,TextColor"
-                  :readonly="this.operateType == 'view'"
+                  :readonly="operateType == 'view'"
                   width="650px"
-                  v-model="noticeForm.content"
                 ></ckeditor>
               </div>
             </el-form-item>
           </el-form>
-          <div style="text-align: center;">
+          <div style="text-align: center">
             <el-button
-              v-show="this.operateType != 'view'"
+              v-show="operateType != 'view'"
               type="primary"
+              :loading="noticeFormLoading"
               @click="saveNotice(2)"
-              :loading="this.noticeFormLoading"
               >确认发送</el-button
             >
             <el-button
-              v-show="this.operateType != 'view'"
+              v-show="operateType != 'view'"
               type="primary"
+              :loading="noticeFormLoading"
               @click="saveNotice(1)"
-              :loading="this.noticeFormLoading"
               >保 存</el-button
             >
             <el-button @click="cancel">关 闭</el-button>
@@ -312,16 +312,16 @@
               label-position="right"
               label-width="70px"
             >
-              <el-row :gutter="10" v-if="selectedExam.length != 0">
+              <el-row v-if="selectedExam.length != 0" :gutter="10">
                 <el-col :xs="30" :sm="30" :md="30" :lg="30">
                   <el-form-item label="已选">
                     <el-tag
                       v-for="tag in selectedExam"
+                      :key="'exam' + tag.id"
                       :closable="true"
                       :close-transition="false"
-                      @close="examTagClose(tag)"
                       type="info"
-                      :key="'exam' + tag.id"
+                      @close="examTagClose(tag)"
                       >{{ tag.name }}</el-tag
                     >
                   </el-form-item>
@@ -344,13 +344,13 @@
                 >
               </el-form-item>
             </el-form>
-            <div class="table-native" style="height:400px;">
+            <div class="table-native" style="height: 400px">
               <el-table
-                stripe
+                ref="examTable"
                 v-loading="loading"
+                stripe
                 element-loading-text="拼命加载中"
                 :data="examTableData"
-                ref="examTable"
                 border
                 @selection-change="examSelectChange"
               >
@@ -367,19 +367,19 @@
               </el-table>
               <div class="page pull-right">
                 <el-pagination
-                  small
                   v-if="examPaginationShow"
-                  @current-change="handleExamCurrentChange"
-                  @size-change="handleExamSizeChange"
+                  small
                   :current-page="examCurrentPage"
                   :page-size="examPageSize"
                   :page-sizes="[10]"
                   layout="total, sizes, prev, pager, next, jumper"
                   :total="examTotal"
+                  @current-change="handleExamCurrentChange"
+                  @size-change="handleExamSizeChange"
                 ></el-pagination>
               </div>
             </div>
-            <div style="margin-top: 20px;text-align: center;">
+            <div style="margin-top: 20px; text-align: center">
               <el-button @click="examConfirm">确 定</el-button>
               <el-button @click="examCancel">取消</el-button>
             </div>
@@ -402,16 +402,16 @@
               label-position="right"
               label-width="110px"
             >
-              <el-row :gutter="10" v-if="selectedMark.length != 0">
+              <el-row v-if="selectedMark.length != 0" :gutter="10">
                 <el-col :xs="30" :sm="30" :md="30" :lg="30">
                   <el-form-item label="已选">
                     <el-tag
                       v-for="tag in selectedMark"
+                      :key="'mark' + tag.id"
                       :closable="true"
                       :close-transition="false"
-                      @close="markTagClose(tag)"
                       type="info"
-                      :key="'mark' + tag.id"
+                      @close="markTagClose(tag)"
                       >{{ tag.name }}</el-tag
                     >
                   </el-form-item>
@@ -434,13 +434,13 @@
                 >
               </el-form-item>
             </el-form>
-            <div class="table-native" style="height:400px;">
+            <div class="table-native" style="height: 400px">
               <el-table
-                stripe
+                ref="markTable"
                 v-loading="loading"
+                stripe
                 element-loading-text="拼命加载中"
                 :data="markTableData"
-                ref="markTable"
                 border
                 @selection-change="markSelectChange"
               >
@@ -454,9 +454,9 @@
                   <template slot-scope="scope"
                     ><div>
                       <span
-                        style="display: block;"
                         v-for="item in scope.row.examNameAndType"
                         :key="item.index"
+                        style="display: block"
                         >{{ item }}</span
                       >
                     </div></template
@@ -465,19 +465,19 @@
               </el-table>
               <div class="page pull-right">
                 <el-pagination
-                  small
                   v-if="markPaginationShow"
-                  @current-change="handleMarkCurrentChange"
-                  @size-change="handleMarkSizeChange"
+                  small
                   :current-page="markCurrentPage"
                   :page-size="markPageSize"
                   :page-sizes="[10]"
                   layout="total, sizes, prev, pager, next, jumper"
                   :total="markTotal"
+                  @current-change="handleMarkCurrentChange"
+                  @size-change="handleMarkSizeChange"
                 ></el-pagination>
               </div>
             </div>
-            <div style="margin-top: 20px;text-align: center;">
+            <div style="margin-top: 20px; text-align: center">
               <el-button @click="markConfirm">确 定</el-button>
               <el-button @click="markCancel">取消</el-button>
             </div>
@@ -494,7 +494,7 @@ import {
   EXAM_TYPE,
   PUBLISH_STATUS,
   NOTICE_RECEIVER_RULE_TYPE,
-  MARKING_API
+  MARKING_API,
 } from "@/constants/constants.js";
 import { mapState } from "vuex";
 import ckeditor from "@/components/ckeditor.vue";
@@ -505,14 +505,14 @@ export default {
     return {
       noticeFormLoading: false,
       formSearch: {
-        title: ""
+        title: "",
       },
       examFormSearch: {
         enable: true,
-        name: ""
+        name: "",
       },
       markFormSearch: {
-        workName: ""
+        workName: "",
       },
       selectedExam: [],
       tempSelectedExam: [],
@@ -529,13 +529,13 @@ export default {
         publisher: "",
         ruleType: "", //规则类型
         publishObjectId: "", //发送对象id
-        noticeStatus: ""
+        noticeStatus: "",
       },
       receiverForm: {
         receiverObjectType: null,
         receiverObject: "",
         ruleType: "", //规则类型
-        publishObjectId: "" //发送对象id
+        publishObjectId: "", //发送对象id
       },
       receiverRuleTypes: NOTICE_RECEIVER_RULE_TYPE,
       loading: false,
@@ -562,16 +562,16 @@ export default {
         title: [{ required: true, message: "请输入标题", trigger: "blur" }],
         content: [{ required: true, message: "请输入内容", trigger: "blur" }],
         ruleType: [
-          { required: true, message: "请选择接收人", trigger: "change" }
+          { required: true, message: "请选择接收人", trigger: "change" },
         ],
         publisher: [
-          { required: true, message: "请输入发布人", trigger: "blur" }
-        ]
-      }
+          { required: true, message: "请输入发布人", trigger: "blur" },
+        ],
+      },
     };
   },
   computed: {
-    ...mapState({ user: state => state.user }),
+    ...mapState({ user: (state) => state.user }),
     noticeIds() {
       var strNoticeIds = "";
       for (let nid of this.selectedNoticeIds) {
@@ -604,7 +604,11 @@ export default {
         }
       }
       return selectedIds;
-    }
+    },
+  },
+  //初始化查询
+  created() {
+    this.searchForm();
   },
 
   methods: {
@@ -639,9 +643,9 @@ export default {
       }
       this.tempSelectedExam = row;
       var selectedExams = this.selectedExam;
-      row.forEach(element => {
+      row.forEach((element) => {
         if (
-          !selectedExams.some(se => se.id == element.id) &&
+          !selectedExams.some((se) => se.id == element.id) &&
           selectedExams.length < 10
         ) {
           selectedExams.push(element);
@@ -656,9 +660,9 @@ export default {
       }
       this.tempSelectedMark = row;
       var selectedMarks = this.selectedMark;
-      row.forEach(element => {
+      row.forEach((element) => {
         if (
-          !selectedMarks.some(sm => sm.id == element.id) &&
+          !selectedMarks.some((sm) => sm.id == element.id) &&
           selectedMarks.length < 10
         ) {
           selectedMarks.push(element);
@@ -667,9 +671,9 @@ export default {
       this.selectedMark = selectedMarks;
     },
     getAfterAddCount(selecteds, row) {
-      const selectedids = selecteds.map(x => x.id);
+      const selectedids = selecteds.map((x) => x.id);
       const temcount =
-        row.filter(key => selectedids.includes(key.id) === false).length +
+        row.filter((key) => selectedids.includes(key.id) === false).length +
         selectedids.length;
       return temcount;
     },
@@ -709,7 +713,7 @@ export default {
         "?" +
         param;
       this.loading = true;
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         console.log(response);
         this.tableData = response.data.list;
         this.total = response.data.total;
@@ -728,7 +732,7 @@ export default {
         "?" +
         param;
       this.loading = true;
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         console.log(response);
         this.examTableData = response.data.list;
         this.examTotal = response.data.total;
@@ -747,7 +751,7 @@ export default {
         "?" +
         param;
       this.loading = true;
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         console.log(response);
         this.markTableData = response.data.list;
         this.markTotal = response.data.total;
@@ -849,13 +853,13 @@ export default {
       this.$confirm("是否删除该通知?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         var url = EXAM_WORK_API + "/notice/" + row.id;
         this.$httpWithMsg.delete(url).then(() => {
           this.$notify({
             type: "success",
-            message: "删除成功!"
+            message: "删除成功!",
           });
           this.searchForm();
         });
@@ -869,7 +873,7 @@ export default {
         this.$confirm("是否删除这些通知?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "error"
+          type: "error",
         }).then(() => {
           var url = EXAM_WORK_API + "/notice/" + this.noticeIds;
           this.$httpWithMsg.delete(url).then(() => {
@@ -886,7 +890,7 @@ export default {
         this.noticeForm.noticeStatus = "TO_BE_PUBLISHED";
       }
 
-      this.$refs["noticeForm"].validate(valid => {
+      this.$refs["noticeForm"].validate((valid) => {
         if (valid) {
           if (
             this.noticeForm.ruleType == "STUDENTS_OF_EXAM" ||
@@ -967,10 +971,10 @@ export default {
       for (let [index, exam] of this.selectedExam.entries()) {
         if (tag.id == exam.id) {
           this.toggleExamSelection(
-            this.examTableData.find(p => p.id == exam.id)
+            this.examTableData.find((p) => p.id == exam.id)
           );
           this.examTableData.splice(
-            this.examTableData.findIndex(p => p.id == exam.id),
+            this.examTableData.findIndex((p) => p.id == exam.id),
             1
           );
           this.selectedExam.splice(index, 1);
@@ -981,10 +985,10 @@ export default {
       for (let [index, mark] of this.selectedMark.entries()) {
         if (tag.id == mark.id) {
           this.toggleMarkSelection(
-            this.markTableData.find(p => p.id == mark.id)
+            this.markTableData.find((p) => p.id == mark.id)
           );
           this.markTableData.splice(
-            this.markTableData.findIndex(p => p.id == mark.id),
+            this.markTableData.findIndex((p) => p.id == mark.id),
             1
           );
           this.selectedMark.splice(index, 1);
@@ -995,7 +999,7 @@ export default {
       if (
         this.tempSelectedExam &&
         this.tempSelectedExam.length > 0 &&
-        this.tempSelectedExam.some(p => p.id == row.id)
+        this.tempSelectedExam.some((p) => p.id == row.id)
       ) {
         this.$refs.examTable.toggleRowSelection(row);
       }
@@ -1004,7 +1008,7 @@ export default {
       if (
         this.tempSelectedMark &&
         this.tempSelectedMark.length > 0 &&
-        this.tempSelectedMark.some(p => p.id == row.id)
+        this.tempSelectedMark.some((p) => p.id == row.id)
       ) {
         this.$refs.markTable.toggleRowSelection(row);
       }
@@ -1034,13 +1038,13 @@ export default {
     warn(msg) {
       this.$notify({
         type: "warning",
-        message: msg
+        message: msg,
       });
     },
     success(msg) {
       this.$notify({
         type: "success",
-        message: msg
+        message: msg,
       });
     },
     handleClose(done) {
@@ -1050,12 +1054,8 @@ export default {
       //     done();
       //   })
       //   .catch(() => {});
-    }
+    },
   },
-  //初始化查询
-  created() {
-    this.searchForm();
-  }
 };
 </script>
 <style scoped>

+ 39 - 39
src/modules/examwork/view/offlineExam.vue

@@ -1,16 +1,16 @@
 <template>
   <div>
     <LinkTitlesCustom
-      :currentPaths="['考试管理', '考试信息', '离线考试设置']"
+      :current-paths="['考试管理', '考试信息', '离线考试设置']"
     />
     <section class="content">
       <div class="box box-info">
         <!-- 正文信息 -->
         <div class="box-body">
           <el-form
+            ref="form"
             :inline="true"
             :rules="rules"
-            ref="form"
             :model="form"
             label-position="right"
             inline-message
@@ -22,12 +22,12 @@
               <el-button
                 type="primary"
                 size="small"
-                @click="back"
                 icon="el-icon-arrow-left"
+                @click="back"
                 >返 回</el-button
               >
             </div>
-            <el-tabs type="border-card" v-model="activeName">
+            <el-tabs v-model="activeName" type="border-card">
               <!-- 基础信息 -->
               <el-tab-pane label="基础信息" name="tab1">
                 <el-row v-if="examId != 'add'">
@@ -82,8 +82,8 @@
                     :label-width="style.label_width_tab1"
                   >
                     <el-input
-                      maxlength="20"
                       v-model="form.name"
+                      maxlength="20"
                       class="input"
                     ></el-input>
                   </el-form-item>
@@ -94,9 +94,9 @@
                     :label-width="style.label_width_tab1"
                   >
                     <el-select
+                      v-model="form.examType"
                       class="input"
                       :disabled="true"
-                      v-model="form.examType"
                       placeholder="请选择"
                     >
                       <el-option
@@ -126,8 +126,8 @@
                     :label-width="style.label_width_tab1"
                   >
                     <el-date-picker
-                      class="input"
                       v-model="examDatetimeRange"
+                      class="input"
                       type="datetimerange"
                       range-separator="至"
                       start-placeholder="开始日期"
@@ -151,9 +151,9 @@
                 </el-row>
                 <el-row>
                   <el-form-item
+                    v-show="form.specialSettingsEnabled"
                     label="特殊设置方式"
                     :label-width="style.label_width_tab1"
-                    v-show="form.specialSettingsEnabled"
                   >
                     <el-radio-group
                       v-model="form.specialSettingsType"
@@ -166,9 +166,9 @@
                 </el-row>
                 <el-row>
                   <el-form-item
+                    v-show="form.specialSettingsEnabled"
                     label="无特殊设置时禁止考试"
                     :label-width="style.label_width_tab1"
-                    v-show="form.specialSettingsEnabled"
                   >
                     <el-switch
                       v-model="form.properties.LIMITED_IF_NO_SPECIAL_SETTINGS"
@@ -193,15 +193,15 @@
                 </el-row>
                 <el-row>
                   <el-form-item
-                    prop="uploadFileType"
                     ref="uploadFileType"
+                    prop="uploadFileType"
                     label="附件类型"
                     :label-width="style.label_width_tab1"
                   >
                     <el-checkbox-group v-model="uploadFileType" class="input">
-                      <el-checkbox label="ZIP" key="ZIP">ZIP</el-checkbox>
-                      <el-checkbox label="PDF" key="PDF">PDF</el-checkbox>
-                      <el-checkbox label="IMAGE" key="IMAGE"
+                      <el-checkbox key="ZIP" label="ZIP">ZIP</el-checkbox>
+                      <el-checkbox key="PDF" label="PDF">PDF</el-checkbox>
+                      <el-checkbox key="IMAGE" label="IMAGE"
                         >图片(JPG/JPEG/PNG)</el-checkbox
                       >
                     </el-checkbox-group>
@@ -270,7 +270,7 @@ export default {
   data() {
     return {
       style: {
-        label_width_tab1: "160px"
+        label_width_tab1: "160px",
       },
       activeName: "tab1",
       examDatetimeRange: [],
@@ -290,8 +290,8 @@ export default {
         properties: {
           CAN_UPLOAD_ATTACHMENT: "true",
           OFFLINE_UPLOAD_FILE_TYPE: "",
-          LIMITED_IF_NO_SPECIAL_SETTINGS: "false"
-        }
+          LIMITED_IF_NO_SPECIAL_SETTINGS: "false",
+        },
       },
       examTypeList: EXAM_TYPE,
       examId: "",
@@ -302,19 +302,25 @@ export default {
           {
             required: true,
             validator: validateExamDatetimeRange,
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         uploadFileType: [
           {
             required: true,
             validator: validateUploadFileType,
-            trigger: "change"
-          }
-        ]
-      }
+            trigger: "change",
+          },
+        ],
+      },
     };
   },
+  watch: {},
+  created() {
+    _this = this;
+    this.examId = this.$route.params.id;
+    this.init();
+  },
 
   methods: {
     uploadFileTypeDis() {
@@ -327,7 +333,7 @@ export default {
     init() {
       if (this.examId != "add") {
         let url = EXAM_WORK_API + "/exam/" + this.examId;
-        this.$httpWithMsg.get(url).then(response => {
+        this.$httpWithMsg.get(url).then((response) => {
           let body = response.data;
           body.properties = this.form.properties;
           this.form = Object.assign(this.form, response.data);
@@ -337,7 +343,7 @@ export default {
           console.log("getOnlineExam(); form: ", this.form);
 
           let url = EXAM_WORK_API + "/exam/allProperties/" + this.examId;
-          this.$httpWithMsg.get(url).then(response => {
+          this.$httpWithMsg.get(url).then((response) => {
             this.form.properties = Object.assign(
               this.form.properties,
               response.data
@@ -362,7 +368,7 @@ export default {
         this.show_ckeditor = true;
       }
     },
-    saveExam: function() {
+    saveExam: function () {
       this.form.beginTime = this.examDatetimeRange[0];
       this.form.endTime = this.examDatetimeRange[1];
       this.form.properties.OFFLINE_UPLOAD_FILE_TYPE = JSON.stringify(
@@ -370,34 +376,34 @@ export default {
       );
       console.log(this.uploadFileType);
       let url = EXAM_WORK_API + "/exam";
-      this.$refs.form.validate(valid => {
+      this.$refs.form.validate((valid) => {
         if (valid) {
           if (this.examId != "add") {
-            this.$httpWithMsg.put(url, this.form).then(response => {
+            this.$httpWithMsg.put(url, this.form).then((response) => {
               if (200 != response.status) {
                 this.$notify({
                   type: "error",
-                  message: response.body.desc
+                  message: response.body.desc,
                 });
                 return;
               }
               this.$notify({
                 type: "success",
-                message: "保存成功"
+                message: "保存成功",
               });
             });
           } else {
             this.form.code = this.form.name;
-            this.$httpWithMsg.post(url, this.form).then(response => {
+            this.$httpWithMsg.post(url, this.form).then((response) => {
               console.log(response);
               this.$notify({
                 type: "success",
-                message: "新增成功"
+                message: "新增成功",
               });
               this.examId = response.data.id;
               this.form.id = this.examId;
               this.$router.push({
-                path: "/examwork/offlineExam/" + response.data.id
+                path: "/examwork/offlineExam/" + response.data.id,
               });
             });
           }
@@ -408,14 +414,8 @@ export default {
     },
     back() {
       this.$router.push({ path: "/examwork/examInfo" });
-    }
-  },
-  created() {
-    _this = this;
-    this.examId = this.$route.params.id;
-    this.init();
+    },
   },
-  watch: {}
 };
 </script>
 <style scoped>

+ 39 - 39
src/modules/examwork/view/offlineExamOrgSettings.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <LinkTitlesCustom
-      :currentPaths="['考试管理', '考试信息', '学习中心设置']"
+      :current-paths="['考试管理', '考试信息', '学习中心设置']"
     />
     <section class="content">
       <div class="box-body">
@@ -13,20 +13,20 @@
         >
           <el-form-item label="学习中心">
             <el-select
+              v-model="formSearch.orgId"
               class="select"
               :remote-method="getOrgList4Search"
               :loading="loadingOrg4Search"
               remote
               filterable
               clearable
-              v-model="formSearch.orgId"
               placeholder="请选择"
             >
               <el-option
                 v-for="item in orgList4Search"
+                :key="item.id"
                 :label="item.name"
                 :value="item.id"
-                :key="item.id"
               >
               </el-option>
             </el-select>
@@ -54,10 +54,10 @@
 
         <!-- 页面列表 -->
         <el-table
+          v-loading="loading4FormSearch"
           :data="tableData"
           border
-          style="width: 100%;text-align:center;"
-          v-loading="loading4FormSearch"
+          style="width: 100%; text-align: center"
         >
           <el-table-column prop="id" width="80" label="ID"></el-table-column>
           <el-table-column
@@ -95,13 +95,13 @@
         </el-table>
         <div class="page pull-right">
           <el-pagination
-            @current-change="handleCurrentChange"
             :current-page="currentPage"
             :page-size="pageSize"
             :page-sizes="[10, 20, 50, 100, 200, 300]"
-            @size-change="handleSizeChange"
             layout="total, sizes, prev, pager, next, jumper"
             :total="total"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
           >
           </el-pagination>
         </div>
@@ -113,9 +113,9 @@
           :visible.sync="addOrgSettingDialog"
         >
           <el-form
+            ref="addOrgSettingForm"
             :model="orgSetting"
             :rules="orgSettingRules"
-            ref="addOrgSettingForm"
             label-position="right"
             :inline="true"
             inline-message
@@ -123,20 +123,20 @@
             <el-row>
               <el-form-item label="学习中心" prop="orgId" label-width="120px">
                 <el-select
+                  v-model="orgSetting.orgId"
                   class="select"
                   :remote-method="getOrgList4InsertOrUpdate"
                   :loading="loadingOrg4InsertOrUpdate"
                   remote
                   filterable
                   clearable
-                  v-model="orgSetting.orgId"
                   placeholder="请选择"
                 >
                   <el-option
                     v-for="item in orgList4InsertOrUpdate"
+                    :key="item.id"
                     :label="item.name"
                     :value="item.id"
-                    :key="item.id"
                   >
                   </el-option>
                 </el-select>
@@ -170,7 +170,7 @@
               </el-form-item>
             </el-row>
             <el-row>
-              <div style="text-align:center;">
+              <div style="text-align: center">
                 <el-button type="primary" @click="addOrgSetting"
                   >确 定</el-button
                 >
@@ -189,9 +189,9 @@
           :visible.sync="updateOrgSettingDialog"
         >
           <el-form
+            ref="updateOrgSettingForm"
             :model="orgSetting"
             :rules="orgSettingRules"
-            ref="updateOrgSettingForm"
             label-position="right"
             :inline="true"
             inline-message
@@ -199,6 +199,7 @@
             <el-row>
               <el-form-item label="学习中心" prop="orgId" label-width="120px">
                 <el-select
+                  v-model="orgSetting.orgId"
                   class="select"
                   :remote-method="getOrgList4InsertOrUpdate"
                   :loading="loadingOrg4InsertOrUpdate"
@@ -206,14 +207,13 @@
                   filterable
                   clearable
                   :disabled="true"
-                  v-model="orgSetting.orgId"
                   placeholder="请选择"
                 >
                   <el-option
                     v-for="item in orgList4InsertOrUpdate"
+                    :key="item.id"
                     :label="item.name"
                     :value="item.id"
-                    :key="item.id"
                   >
                   </el-option>
                 </el-select>
@@ -247,7 +247,7 @@
               </el-form-item>
             </el-row>
             <el-row>
-              <div style="margin-left:30%">
+              <div style="margin-left: 30%">
                 <el-button type="primary" @click="updateOrgSetting"
                   >确 定</el-button
                 >
@@ -275,7 +275,7 @@ export default {
       loading4FormSearch: false,
       formSearch: {
         examId: null,
-        orgId: ""
+        orgId: "",
       },
       loadingOrg4Search: false,
       orgList4Search: [],
@@ -291,8 +291,8 @@ export default {
         beginTime: null,
         endTime: null,
         properties: {
-          CAN_UPLOAD_ATTACHMENT: "true"
-        }
+          CAN_UPLOAD_ATTACHMENT: "true",
+        },
       },
       orgSettingDatetimeRange: [],
       addOrgSettingDialog: false,
@@ -301,22 +301,27 @@ export default {
       loadingOrg4InsertOrUpdate: false,
       orgSettingRules: {
         orgId: [
-          { required: true, message: "请选择学习中心", trigger: "blur,change" }
-        ]
-      }
+          { required: true, message: "请选择学习中心", trigger: "blur,change" },
+        ],
+      },
     };
   },
+  created() {
+    this.examId = this.$route.params.id;
+    this.formSearch.examId = this.examId;
+    this.init();
+  },
   methods: {
     getOrgList4Search(name) {
       this.loadingOrg4Search = true;
       var url = CORE_API + "/org/query?" + new URLSearchParams({ name: name });
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           this.orgList4Search = response.data;
           this.loadingOrg4Search = false;
         })
-        .catch(response => {
+        .catch((response) => {
           console.log(response);
           this.loadingOrg4Search = false;
         });
@@ -326,11 +331,11 @@ export default {
       var url = CORE_API + "/org/query?" + new URLSearchParams({ name: name });
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           this.orgList4InsertOrUpdate = response.data;
           this.loadingOrg4InsertOrUpdate = false;
         })
-        .catch(response => {
+        .catch((response) => {
           console.log(response);
           this.loadingOrg4InsertOrUpdate = false;
         });
@@ -344,14 +349,14 @@ export default {
         this.orgSetting.endTime = this.orgSettingDatetimeRange[1];
       }
 
-      this.$refs.updateOrgSettingForm.validate(valid => {
+      this.$refs.updateOrgSettingForm.validate((valid) => {
         if (valid) {
           let url = EXAM_WORK_API + "/exam/examOrgSettings";
-          this.$httpWithMsg.post(url, this.orgSetting).then(response => {
+          this.$httpWithMsg.post(url, this.orgSetting).then((response) => {
             console.log(response);
             this.$notify({
               type: "success",
-              message: "保存成功"
+              message: "保存成功",
             });
             this.search();
             this.updateOrgSettingDialog = false;
@@ -369,14 +374,14 @@ export default {
         this.orgSetting.beginTime = this.orgSettingDatetimeRange[0];
         this.orgSetting.endTime = this.orgSettingDatetimeRange[1];
       }
-      this.$refs.addOrgSettingForm.validate(valid => {
+      this.$refs.addOrgSettingForm.validate((valid) => {
         if (valid) {
           let url = EXAM_WORK_API + "/exam/examOrgSettings";
-          this.$httpWithMsg.put(url, this.orgSetting).then(response => {
+          this.$httpWithMsg.put(url, this.orgSetting).then((response) => {
             console.log(response);
             this.$notify({
               type: "success",
-              message: "保存成功"
+              message: "保存成功",
             });
             this.search();
             this.addOrgSettingDialog = false;
@@ -453,26 +458,21 @@ export default {
       this.loading4FormSearch = true;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           console.log(response);
           this.tableData = response.data.list;
           this.total = response.data.total;
           this.loading4FormSearch = false;
         })
-        .catch(response => {
+        .catch((response) => {
           console.log(response);
           this.loading4FormSearch = false;
         });
     },
     init() {
       this.search();
-    }
+    },
   },
-  created() {
-    this.examId = this.$route.params.id;
-    this.formSearch.examId = this.examId;
-    this.init();
-  }
 };
 </script>
 <style scoped></style>

+ 119 - 119
src/modules/examwork/view/onlineExam.vue

@@ -1,33 +1,33 @@
 <template>
   <div>
     <LinkTitlesCustom
-      :currentPaths="['考试管理', '考试信息', '网络考试设置']"
+      :current-paths="['考试管理', '考试信息', '网络考试设置']"
     />
     <section class="content">
       <div class="box box-info">
         <!-- 正文信息 -->
         <div class="box-body">
           <el-form
+            ref="form"
             :inline="true"
             :rules="rules"
-            ref="form"
             :model="form"
             inline-message
             label-position="right"
           >
-            <div style="margin-bottom: 10px;">
+            <div style="margin-bottom: 10px">
               <el-button type="primary" size="small" @click="saveExam"
                 >保 存</el-button
               >
               <el-button
                 type="primary"
                 size="small"
-                @click="back"
                 icon="el-icon-arrow-left"
+                @click="back"
                 >返 回</el-button
               >
             </div>
-            <el-tabs type="border-card" v-model="activeName">
+            <el-tabs v-model="activeName" type="border-card">
               <!-- 基础信息 -->
               <el-tab-pane label="基础信息" name="tab1">
                 <el-row v-if="examId != 'add'">
@@ -94,9 +94,9 @@
                     :label-width="style.label_width_tab1"
                   >
                     <el-select
+                      v-model="form.examType"
                       class="input"
                       :disabled="true"
-                      v-model="form.examType"
                       placeholder="请选择"
                     >
                       <el-option
@@ -137,8 +137,8 @@
                     :label-width="style.label_width_tab1"
                   >
                     <el-date-picker
-                      class="input"
                       v-model="examDatetimeRange"
+                      class="input"
                       type="datetimerange"
                       range-separator="至"
                       start-placeholder="开始日期"
@@ -166,8 +166,8 @@
                     :label-width="style.label_width_tab1"
                   >
                     <el-switch
-                      :disabled="!this.rootOrgWenXinAnswerEnabled"
                       v-model="form.properties.WEIXIN_ANSWER_ENABLED"
+                      :disabled="!rootOrgWenXinAnswerEnabled"
                       on-text="是"
                       off-text="否"
                     ></el-switch>
@@ -187,9 +187,9 @@
                 </el-row>
                 <el-row>
                   <el-form-item
+                    v-show="form.specialSettingsEnabled"
                     label="特殊设置方式"
                     :label-width="style.label_width_tab1"
-                    v-show="form.specialSettingsEnabled"
                   >
                     <el-radio-group
                       v-model="form.specialSettingsType"
@@ -202,9 +202,9 @@
                 </el-row>
                 <el-row>
                   <el-form-item
+                    v-show="form.specialSettingsEnabled"
                     label="无特殊设置时禁止考试"
                     :label-width="style.label_width_tab1"
-                    v-show="form.specialSettingsEnabled"
                   >
                     <el-switch
                       v-model="form.properties.LIMITED_IF_NO_SPECIAL_SETTINGS"
@@ -213,20 +213,20 @@
                     ></el-switch>
                   </el-form-item>
                 </el-row>
-                <el-row v-if="this.APP_ENABLED">
+                <el-row v-if="APP_ENABLED">
                   <el-form-item
                     label="开启手机app考试"
                     :label-width="style.label_width_tab1"
                   >
                     <el-switch
                       v-model="form.properties.APP_EXAM_ENABLED"
-                      @change="appExamEnabledChanged"
                       on-text="是"
                       off-text="否"
+                      @change="appExamEnabledChanged"
                     ></el-switch>
                   </el-form-item>
                   <span
-                    style="color: #f56c6c; font-size: 12px; line-height: 44px;"
+                    style="color: #f56c6c; font-size: 12px; line-height: 44px"
                     >开启手机app考试,将不能开启人脸身份检测</span
                   >
                 </el-row>
@@ -256,14 +256,14 @@
                 >
                   <el-col :span="24">
                     <el-form-item
-                      style="width:100%"
+                      style="width: 100%"
                       label="日期循环设置"
                       prop="examCycleWeekArr"
                       :label-width="style.label_width_tab4"
                     >
                       <el-checkbox-group
-                        style="width:100%"
                         v-model="examCycleWeekArr"
+                        style="width: 100%"
                         class="input"
                       >
                         <el-checkbox :label="1">星期一</el-checkbox>
@@ -287,10 +287,10 @@
                       >
                       </el-form-item>
                     </el-col>
-                    <el-col :span="10" style="line-height: 48px;height: 40px;">
+                    <el-col :span="10" style="line-height: 48px; height: 40px">
                       <i
                         class="el-icon-circle-plus"
-                        style="color:#00A4FF;font-size:24px;"
+                        style="color: #00a4ff; font-size: 24px"
                         @click="addCycleTimeRange"
                       ></i>
                     </el-col>
@@ -306,9 +306,9 @@
                         :label="index + 1 + '.'"
                       >
                         <el-time-picker
-                          class="input"
-                          style="width:100%"
                           v-model="item.timeRange"
+                          class="input"
+                          style="width: 100%"
                           is-range
                           start-placeholder="开始时间"
                           range-separator="至"
@@ -320,10 +320,10 @@
                         ></el-time-picker>
                       </el-form-item>
                     </el-col>
-                    <el-col :span="10" style="line-height: 48px;height: 40px;">
+                    <el-col :span="10" style="line-height: 48px; height: 40px">
                       <i
                         class="el-icon-remove"
-                        style="color:#00A4FF;font-size:24px;"
+                        style="color: #00a4ff; font-size: 24px"
                         @click="removeExamCycleTimeRange(index)"
                       ></i>
                     </el-col>
@@ -339,8 +339,8 @@
                     :label-width="style.label_width_tab2"
                   >
                     <el-input
-                      maxlength="5"
                       v-model.trim.number="form.duration"
+                      maxlength="5"
                       auto-complete="off"
                       class="input"
                     >
@@ -355,8 +355,8 @@
                     :label-width="style.label_width_tab2"
                   >
                     <el-input
-                      maxlength="5"
                       v-model.trim.number="form.examTimes"
+                      maxlength="5"
                       auto-complete="off"
                       class="input"
                     >
@@ -371,8 +371,8 @@
                     :label-width="style.label_width_tab2"
                   >
                     <el-input
-                      maxlength="5"
                       v-model.trim.number="form.properties.FREEZE_TIME"
+                      maxlength="5"
                       auto-complete="off"
                       class="input"
                     >
@@ -387,8 +387,8 @@
                     :label-width="style.label_width_tab2"
                   >
                     <el-input
-                      maxlength="5"
                       v-model.trim.number="form.properties.EXAM_RECONNECT_TIME"
+                      maxlength="5"
                       auto-complete="off"
                       class="input"
                     >
@@ -403,8 +403,8 @@
                     :label-width="style.label_width_tab2"
                   >
                     <el-input
-                      maxlength="5"
                       v-model.trim.number="form.properties.MAX_INTERRUPT_NUM"
+                      maxlength="5"
                       auto-complete="off"
                       class="input"
                     >
@@ -464,9 +464,9 @@
                     :label-width="style.label_width_tab3"
                   >
                     <el-input
+                      v-model="form.properties.SINGLE_ANSWER_REMARK"
                       maxlength="20"
                       :disabled="!form.properties.SINGLE_EDIT"
-                      v-model="form.properties.SINGLE_ANSWER_REMARK"
                       auto-complete="off"
                       class="input"
                     ></el-input>
@@ -485,9 +485,9 @@
                     :label-width="style.label_width_tab3"
                   >
                     <el-input
+                      v-model="form.properties.MUTIPLE_ANSWER_REMARK"
                       maxlength="20"
                       :disabled="!form.properties.MUTIPLE_EDIT"
-                      v-model="form.properties.MUTIPLE_ANSWER_REMARK"
                       auto-complete="off"
                       class="input"
                     ></el-input>
@@ -506,9 +506,9 @@
                     :label-width="style.label_width_tab3"
                   >
                     <el-input
+                      v-model="form.properties.BOOL_ANSWER_REMARK"
                       maxlength="20"
                       :disabled="!form.properties.BOOL_EDIT"
-                      v-model="form.properties.BOOL_ANSWER_REMARK"
                       class="input"
                       auto-complete="off"
                     ></el-input>
@@ -527,9 +527,9 @@
                     :label-width="style.label_width_tab3"
                   >
                     <el-input
+                      v-model="form.properties.FILL_BLANK_REMARK"
                       maxlength="20"
                       :disabled="!form.properties.FILL_BLANK_EDIT"
-                      v-model="form.properties.FILL_BLANK_REMARK"
                       class="input"
                       auto-complete="off"
                     ></el-input>
@@ -564,13 +564,13 @@
                     :label-width="style.label_width_tab4"
                   >
                     <el-radio-group
-                      @change="faceEnableChange"
                       v-model="form.properties.IS_FACE_ENABLE"
                       :disabled="
                         is_face_enable_disabled ||
-                          form.properties.APP_EXAM_ENABLED == true
+                        form.properties.APP_EXAM_ENABLED == true
                       "
                       class="input"
+                      @change="faceEnableChange"
                     >
                       <el-radio label="true">是</el-radio>
                       <el-radio label="false">否</el-radio>
@@ -579,10 +579,10 @@
                 </el-row>
                 <el-row>
                   <el-form-item
+                    v-show="form.properties.IS_FACE_ENABLE == 'true'"
                     label="启用陌生人检测"
                     prop="IS_STRANGER_ENABLE"
                     :label-width="style.label_width_tab4"
-                    v-show="form.properties.IS_FACE_ENABLE == 'true'"
                   >
                     <el-radio-group
                       v-model="form.properties.IS_STRANGER_ENABLE"
@@ -628,8 +628,8 @@
                     :label-width="style.label_width_tab4"
                   >
                     <el-input
-                      maxlength="5"
                       v-model.trim.number="form.properties.SNAPSHOT_INTERVAL"
+                      maxlength="5"
                       auto-complete="off"
                       class="input"
                     >
@@ -644,8 +644,8 @@
                     :label-width="style.label_width_tab4"
                   >
                     <el-input
-                      maxlength="5"
                       v-model="form.properties.WARN_THRESHOLD"
+                      maxlength="5"
                       auto-complete="off"
                       class="input"
                     >
@@ -660,8 +660,8 @@
                     :label-width="style.label_width_tab4"
                   >
                     <el-input
-                      maxlength="5"
                       v-model="form.properties.LIVING_WARN_THRESHOLD"
+                      maxlength="5"
                       auto-complete="off"
                       class="input"
                     >
@@ -672,7 +672,7 @@
                 <el-row
                   v-if="
                     form.properties.APP_EXAM_ENABLED == false &&
-                      form.properties.IS_FACE_ENABLE == 'true'
+                    form.properties.IS_FACE_ENABLE == 'true'
                   "
                 >
                   <el-form-item
@@ -681,7 +681,7 @@
                   >
                     <el-radio-group
                       v-model="form.properties.IS_FACE_VERIFY"
-                      :disabled="this.is_face_verify_diabled"
+                      :disabled="is_face_verify_diabled"
                       class="input"
                     >
                       <el-radio label="true">是</el-radio>
@@ -692,7 +692,7 @@
                 <el-row
                   v-if="
                     form.properties.APP_EXAM_ENABLED == false &&
-                      form.properties.IS_FACE_VERIFY == 'true'
+                    form.properties.IS_FACE_VERIFY == 'true'
                   "
                 >
                   <el-form-item
@@ -701,10 +701,10 @@
                     :label-width="style.label_width_tab4"
                   >
                     <el-input
-                      maxlength="5"
                       v-model.trim.number="
                         form.properties.FACE_VERIFY_START_MINUTE
                       "
+                      maxlength="5"
                       auto-complete="off"
                       class="input"
                     >
@@ -715,7 +715,7 @@
                 <el-row
                   v-if="
                     form.properties.APP_EXAM_ENABLED == false &&
-                      form.properties.IS_FACE_VERIFY == 'true'
+                    form.properties.IS_FACE_VERIFY == 'true'
                   "
                 >
                   <el-form-item
@@ -724,10 +724,10 @@
                     :label-width="style.label_width_tab4"
                   >
                     <el-input
-                      maxlength="5"
                       v-model.trim.number="
                         form.properties.FACE_VERIFY_END_MINUTE
                       "
+                      maxlength="5"
                       auto-complete="off"
                       class="input"
                     >
@@ -738,8 +738,8 @@
                 <el-row
                   v-if="
                     form.properties.APP_EXAM_ENABLED == false &&
-                      form.properties.IS_FACE_ENABLE == 'true' &&
-                      form.IDENTIFICATION_OF_LIVING_BODY_SCHEME == 'S2'
+                    form.properties.IS_FACE_ENABLE == 'true' &&
+                    form.IDENTIFICATION_OF_LIVING_BODY_SCHEME == 'S2'
                   "
                 >
                   <el-form-item
@@ -759,8 +759,8 @@
                 <el-row
                   v-if="
                     form.properties.APP_EXAM_ENABLED == false &&
-                      form.IDENTIFICATION_OF_LIVING_BODY_SCHEME == 'S2' &&
-                      form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME == 'true'
+                    form.IDENTIFICATION_OF_LIVING_BODY_SCHEME == 'S2' &&
+                    form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME == 'true'
                   "
                 >
                   <el-form-item
@@ -769,10 +769,10 @@
                     :label-width="style.label_width_tab4"
                   >
                     <el-input
-                      maxlength="5"
                       v-model.trim.number="
                         form.properties.OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE
                       "
+                      maxlength="5"
                       auto-complete="off"
                       class="input"
                     >
@@ -783,8 +783,8 @@
                 <el-row
                   v-if="
                     form.properties.APP_EXAM_ENABLED == false &&
-                      form.IDENTIFICATION_OF_LIVING_BODY_SCHEME == 'S2' &&
-                      form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME == 'true'
+                    form.IDENTIFICATION_OF_LIVING_BODY_SCHEME == 'S2' &&
+                    form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME == 'true'
                   "
                 >
                   <el-form-item
@@ -793,10 +793,10 @@
                     :label-width="style.label_width_tab4"
                   >
                     <el-input
-                      maxlength="5"
                       v-model.trim.number="
                         form.properties.OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE
                       "
+                      maxlength="5"
                       auto-complete="off"
                       class="input"
                     >
@@ -812,8 +812,8 @@
                     :label-width="style.label_width_tab5"
                   >
                     <el-radio-group
-                      :disabled="form.started"
                       v-model="form.properties.MARKING_TYPE"
+                      :disabled="form.started"
                       class="input"
                     >
                       <el-radio label="ALL">全部评阅</el-radio>
@@ -841,8 +841,8 @@
                     :label-width="style.label_width_tab6"
                   >
                     <el-input
-                      maxlength="2000"
                       v-model="form.properties.IP_ADDRESSES"
+                      maxlength="2000"
                       class="input"
                       type="textarea"
                       rows="6"
@@ -1290,7 +1290,7 @@ let validateOutFreezeTimeFaceVerifyEndMinute = (rule, value, callback) => {
 export default {
   components: {
     ckeditor,
-    LinkTitlesCustom
+    LinkTitlesCustom,
   },
   data() {
     return {
@@ -1301,7 +1301,7 @@ export default {
         label_width_tab4: "170px",
         label_width_tab5: "80px",
         label_width_tab6: "120px",
-        label_width_tab7: "150px"
+        label_width_tab7: "150px",
       },
       examCycleTimeRangeArr: [],
       examCycleWeekArr: [1, 2, 3, 4, 5, 6, 7],
@@ -1367,8 +1367,8 @@ export default {
           LIMITED_IF_NO_SPECIAL_SETTINGS: "false",
           EXAM_CYCLE_ENABLED: "false",
           EXAM_CYCLE_WEEK: "",
-          EXAM_CYCLE_TIME_RANGE: ""
-        }
+          EXAM_CYCLE_TIME_RANGE: "",
+        },
       },
       examTypeList: EXAM_TYPE,
       examId: "",
@@ -1380,99 +1380,106 @@ export default {
           {
             required: true,
             validator: validateExamDatetimeRange,
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         duration: [
-          { required: true, validator: validateDuration, trigger: "blur" }
+          { required: true, validator: validateDuration, trigger: "blur" },
         ],
         examTimes: [
-          { required: true, validator: validateExamTimes, trigger: "blur" }
+          { required: true, validator: validateExamTimes, trigger: "blur" },
         ],
         FREEZE_TIME: [
-          { required: true, validator: validateFreezeTime, trigger: "blur" }
+          { required: true, validator: validateFreezeTime, trigger: "blur" },
         ],
         EXAM_RECONNECT_TIME: [
           {
             required: true,
             validator: validateExamReconnectTime,
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         MAX_INTERRUPT_NUM: [
           {
             required: false,
             validator: validateMaxInterruptNum,
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         SNAPSHOT_INTERVAL: [
           {
             required: true,
             validator: validateSnapshotInterval,
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         WARN_THRESHOLD: [
           {
             required: true,
             validator: validateWarnThreshold,
-            trigger: "change"
-          }
+            trigger: "change",
+          },
         ],
         FACE_VERIFY_START_MINUTE: [
           {
             required: true,
             validator: validateFaceVerifyStartMinute,
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         FACE_VERIFY_END_MINUTE: [
           {
             required: true,
             validator: validateFaceVerifyEndMinute,
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE: [
           {
             required: true,
             validator: validateOutFreezeTimeFaceVerifyStartMinute,
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE: [
           {
             required: true,
             validator: validateOutFreezeTimeFaceVerifyEndMinute,
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         LIVING_WARN_THRESHOLD: [
           {
             required: true,
             validator: validateLivingWarnThreshold,
-            trigger: "change"
-          }
+            trigger: "change",
+          },
         ],
         examCycleWeekArr: [
           {
             required: true,
             validator: validateExamCycleWeek,
-            trigger: "change"
-          }
+            trigger: "change",
+          },
         ],
         examCycleTimeRangeArr: [
           {
             required: true,
             validator: validateExamCycleTimeRange,
-            trigger: "change"
-          }
-        ]
-      }
+            trigger: "change",
+          },
+        ],
+      },
     };
   },
-
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    _this = this;
+    this.examId = this.$route.params.id;
+    this.init();
+  },
   methods: {
     examCycleEnabledChange(val) {
       if (val == "true") {
@@ -1502,7 +1509,7 @@ export default {
       if (this.examCycleTimeRangeArr.length == 1) {
         this.$notify({
           type: "warning",
-          message: "不能删除最后一个分段"
+          message: "不能删除最后一个分段",
         });
         return;
       }
@@ -1513,12 +1520,12 @@ export default {
       if (this.examCycleTimeRangeArr.length >= 12) {
         this.$notify({
           type: "warning",
-          message: "时间分段不得超过12条"
+          message: "时间分段不得超过12条",
         });
         return;
       }
       this.examCycleTimeRangeArr.push({
-        timeRange: [this.getNowTimeStr(), this.getEndTimeStr()]
+        timeRange: [this.getNowTimeStr(), this.getEndTimeStr()],
       });
       this.$refs.form.validateField("examCycleTimeRangeArr");
     },
@@ -1533,7 +1540,7 @@ export default {
     init() {
       if (this.examId != "add") {
         let url = EXAM_WORK_API + "/exam/" + this.examId;
-        this.$httpWithMsg.get(url).then(response => {
+        this.$httpWithMsg.get(url).then((response) => {
           let body = response.data;
           this.rootOrgId = body.rootOrgId;
           body.properties = this.form.properties;
@@ -1544,7 +1551,7 @@ export default {
           console.log("getOnlineExam(); form: ", this.form);
 
           let url = EXAM_WORK_API + "/exam/allProperties/" + this.examId;
-          this.$httpWithMsg.get(url).then(response => {
+          this.$httpWithMsg.get(url).then((response) => {
             this.form.properties = Object.assign(
               this.form.properties,
               response.data
@@ -1591,11 +1598,11 @@ export default {
         this.checkRootOrgPrivileges();
       }
     },
-    checkRootOrgPrivileges: function() {
+    checkRootOrgPrivileges: function () {
       let url =
         CORE_API +
         "/rolePrivilege/checkRootOrgPrivileges?privilegeCodes=FACE_CHECK,IDENTIFICATION_OF_LIVING_BODY";
-      this.$httpWithMsg.post(url).then(response => {
+      this.$httpWithMsg.post(url).then((response) => {
         let res = response.data;
         if (!res.FACE_CHECK) {
           this.form.properties.IS_FACE_ENABLE = "false";
@@ -1621,7 +1628,7 @@ export default {
         "/org/property/" +
         this.user.rootOrgId +
         "/WEIXIN_ANSWER_ENABLED";
-      this.$httpWithMsg.get(url2).then(response => {
+      this.$httpWithMsg.get(url2).then((response) => {
         let res = response.data;
         this.rootOrgWenXinAnswerEnabled = res == true;
         if (!this.rootOrgWenXinAnswerEnabled) {
@@ -1629,25 +1636,26 @@ export default {
         }
       });
       let that = this;
-      this.getOrgProperty("IDENTIFICATION_OF_LIVING_BODY_SCHEME", function(
-        res
-      ) {
-        that.form.IDENTIFICATION_OF_LIVING_BODY_SCHEME = res;
-      });
+      this.getOrgProperty(
+        "IDENTIFICATION_OF_LIVING_BODY_SCHEME",
+        function (res) {
+          that.form.IDENTIFICATION_OF_LIVING_BODY_SCHEME = res;
+        }
+      );
 
-      this.getOrgProperty("APP_ENABLED", function(res) {
+      this.getOrgProperty("APP_ENABLED", function (res) {
         that.APP_ENABLED = res;
       });
     },
-    getOrgProperty: function(propkey, callback) {
+    getOrgProperty: function (propkey, callback) {
       let url =
         CORE_API + "/org/property/" + this.user.rootOrgId + "/" + propkey;
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         let res = response.data;
         callback(res);
       });
     },
-    saveExam: function() {
+    saveExam: function () {
       this.toActiveName = null;
       this.form.beginTime = this.examDatetimeRange[0];
       this.form.endTime = this.examDatetimeRange[1];
@@ -1659,34 +1667,34 @@ export default {
       );
       console.log(this.form);
       let url = EXAM_WORK_API + "/exam";
-      this.$refs.form.validate(valid => {
+      this.$refs.form.validate((valid) => {
         if (valid) {
           if (this.examId != "add") {
-            this.$httpWithMsg.put(url, this.form).then(response => {
+            this.$httpWithMsg.put(url, this.form).then((response) => {
               if (200 != response.status) {
                 this.$notify({
                   type: "error",
-                  message: response.body.desc
+                  message: response.body.desc,
                 });
                 return;
               }
               this.$notify({
                 type: "success",
-                message: "保存成功"
+                message: "保存成功",
               });
             });
           } else {
             this.form.code = this.form.name;
-            this.$httpWithMsg.post(url, this.form).then(response => {
+            this.$httpWithMsg.post(url, this.form).then((response) => {
               console.log(response);
               this.$notify({
                 type: "success",
-                message: "新增成功"
+                message: "新增成功",
               });
               this.examId = response.data.id;
               this.form.id = this.examId;
               this.$router.push({
-                path: "/examwork/onlineExam/" + response.data.id
+                path: "/examwork/onlineExam/" + response.data.id,
               });
             });
           }
@@ -1703,16 +1711,8 @@ export default {
         this.form.properties.IS_FACE_ENABLE = "false";
         this.faceEnableChange();
       }
-    }
-  },
-  created() {
-    _this = this;
-    this.examId = this.$route.params.id;
-    this.init();
+    },
   },
-  computed: {
-    ...mapState({ user: state => state.user })
-  }
 };
 </script>
 <style scoped>

+ 76 - 76
src/modules/examwork/view/onlineExamOrgSettings.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <LinkTitlesCustom
-      :currentPaths="['考试管理', '考试信息', '学习中心设置']"
+      :current-paths="['考试管理', '考试信息', '学习中心设置']"
     />
     <section class="content">
       <div class="box-body">
@@ -13,20 +13,20 @@
         >
           <el-form-item label="学习中心">
             <el-select
+              v-model="formSearch.orgId"
               class="select"
               :remote-method="getOrgList4Search"
               :loading="loadingOrg4Search"
               remote
               filterable
               clearable
-              v-model="formSearch.orgId"
               placeholder="请选择"
             >
               <el-option
                 v-for="item in orgList4Search"
+                :key="item.id"
                 :label="item.name"
                 :value="item.id"
-                :key="item.id"
               >
               </el-option>
             </el-select>
@@ -104,15 +104,15 @@
           >删除所有
         </el-button>
 
-        <div style="width: 100%;margin-bottom: 10px;"></div>
+        <div style="width: 100%; margin-bottom: 10px"></div>
 
         <!-- 页面列表 -->
         <el-table
+          v-loading="loading4FormSearch"
           :data="tableData"
           border
-          style="width: 100%;text-align:center;"
+          style="width: 100%; text-align: center"
           @selection-change="selectChange"
-          v-loading="loading4FormSearch"
         >
           <el-table-column type="selection" width="40"></el-table-column>
           <el-table-column prop="id" width="80" label="ID"></el-table-column>
@@ -144,7 +144,7 @@
                   content="开考"
                   placement="left"
                 >
-                  <i class="el-icon-success" style="color:green;"></i>
+                  <i class="el-icon-success" style="color: green"></i>
                 </el-tooltip>
               </span>
               <span v-else>
@@ -154,7 +154,7 @@
                   content="禁考"
                   placement="left"
                 >
-                  <i class="el-icon-error" style="color:red;"></i>
+                  <i class="el-icon-error" style="color: red"></i>
                 </el-tooltip>
               </span>
             </span>
@@ -198,13 +198,13 @@
         </el-table>
         <div class="page pull-right">
           <el-pagination
-            @current-change="handleCurrentChange"
             :current-page="currentPage"
             :page-size="pageSize"
             :page-sizes="[10, 20, 50, 100, 200, 300]"
-            @size-change="handleSizeChange"
             layout="total, sizes, prev, pager, next, jumper"
             :total="total"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
           >
           </el-pagination>
         </div>
@@ -216,9 +216,9 @@
           :visible.sync="addOrgSettingDialog"
         >
           <el-form
+            ref="addOrgSettingForm"
             :model="orgSetting"
             :rules="orgSettingRules"
-            ref="addOrgSettingForm"
             label-position="right"
             :inline="true"
             inline-message
@@ -226,20 +226,20 @@
             <el-row>
               <el-form-item label="学习中心" prop="orgId" label-width="120px">
                 <el-select
+                  v-model="orgSetting.orgId"
                   class="select"
                   :remote-method="getOrgList4InsertOrUpdate"
                   :loading="loadingOrg4InsertOrUpdate"
                   remote
                   filterable
                   clearable
-                  v-model="orgSetting.orgId"
                   placeholder="请选择"
                 >
                   <el-option
                     v-for="item in orgList4InsertOrUpdate"
+                    :key="item.id"
                     :label="item.name"
                     :value="item.id"
-                    :key="item.id"
                   >
                   </el-option>
                 </el-select>
@@ -271,7 +271,7 @@
               </el-form-item>
             </el-row>
             <el-row>
-              <div style="text-align:center;">
+              <div style="text-align: center">
                 <el-button type="primary" @click="addOrgSetting"
                   >确 定
                 </el-button>
@@ -290,9 +290,9 @@
           :visible.sync="updateOrgSettingDialog"
         >
           <el-form
+            ref="updateOrgSettingForm"
             :model="orgSetting"
             :rules="orgSettingRules"
-            ref="updateOrgSettingForm"
             label-position="right"
             :inline="true"
             inline-message
@@ -300,6 +300,7 @@
             <el-row>
               <el-form-item label="学习中心" prop="orgId" label-width="120px">
                 <el-select
+                  v-model="orgSetting.orgId"
                   class="select"
                   :remote-method="getOrgList4InsertOrUpdate"
                   :loading="loadingOrg4InsertOrUpdate"
@@ -307,14 +308,13 @@
                   filterable
                   clearable
                   :disabled="true"
-                  v-model="orgSetting.orgId"
                   placeholder="请选择"
                 >
                   <el-option
                     v-for="item in orgList4InsertOrUpdate"
+                    :key="item.id"
                     :label="item.name"
                     :value="item.id"
-                    :key="item.id"
                   >
                   </el-option>
                 </el-select>
@@ -346,7 +346,7 @@
               </el-form-item>
             </el-row>
             <el-row>
-              <div style="margin-left:30%">
+              <div style="margin-left: 30%">
                 <el-button type="primary" @click="updateOrgSetting"
                   >确 定
                 </el-button>
@@ -365,9 +365,9 @@
           width="500px"
           :visible.sync="orgSettingsImportDialog"
         >
-          <el-form :model="orgSettingsImportForm" ref="orgSettingsImportForm">
+          <el-form ref="orgSettingsImportForm" :model="orgSettingsImportForm">
             <el-row>
-              <el-form-item style="margin-left:30px">
+              <el-form-item style="margin-left: 30px">
                 <el-upload
                   ref="upload"
                   accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
@@ -381,26 +381,26 @@
                   :multiple="false"
                 >
                   <el-button
-                    size="small"
                     slot="trigger"
+                    size="small"
                     type="primary"
                     icon="el-icon-search"
                     >选择文件
                   </el-button>
                   <el-button
                     size="small"
-                    style="margin-left:10px;"
+                    style="margin-left: 10px"
                     type="primary"
-                    @click="submitUpload"
                     icon="el-icon-check"
+                    @click="submitUpload"
                     >确认上传
                   </el-button>
                   <el-button
                     size="small"
-                    style="margin-left: 10px;"
+                    style="margin-left: 10px"
                     type="primary"
-                    @click="removeFile"
                     icon="el-icon-refresh"
+                    @click="removeFile"
                     >清空文件
                   </el-button>
                   <div slot="tip" class="el-upload__tip">只能上传xlsx文件</div>
@@ -413,9 +413,9 @@
         <!-- 导入错误信息列表 -->
         <el-dialog title="错误提示" :visible.sync="errDialog">
           <div
-            class="text-danger"
             v-for="errMessage in errMessages"
             :key="errMessage.lineNum"
+            class="text-danger"
           >
             第{{ errMessage.lineNum }}行:{{ errMessage.msg }}
           </div>
@@ -442,7 +442,7 @@ export default {
       loading4FormSearch: false,
       formSearch: {
         examId: null,
-        orgId: ""
+        orgId: "",
       },
       loadingOrg4Search: false,
       orgList4Search: [],
@@ -460,8 +460,8 @@ export default {
         endTime: null,
         examLimit: "false",
         properties: {
-          CAN_UPLOAD_ATTACHMENT: "true"
-        }
+          CAN_UPLOAD_ATTACHMENT: "true",
+        },
       },
       orgSettingDatetimeRange: [],
       addOrgSettingDialog: false,
@@ -470,8 +470,8 @@ export default {
       loadingOrg4InsertOrUpdate: false,
       orgSettingRules: {
         orgId: [
-          { required: true, message: "请选择学习中心", trigger: "blur,change" }
-        ]
+          { required: true, message: "请选择学习中心", trigger: "blur,change" },
+        ],
       },
 
       orgSettingsImportDialog: false,
@@ -481,31 +481,42 @@ export default {
       uploadData: {},
       fileList: [],
       errDialog: false,
-      errMessages: []
+      errMessages: [],
     };
   },
   computed: {
-    ...mapState({ user: state => state.user }),
+    ...mapState({ user: (state) => state.user }),
     noBatchSelected() {
       return this.selectedOrgSettings.length === 0;
-    }
+    },
+  },
+  created() {
+    this.examId = this.$route.params.id;
+    this.formSearch.examId = this.examId;
+    this.init();
+    this.uploadHeaders = {
+      key: this.user.key,
+      token: this.user.token,
+    };
+    this.uploadAction =
+      EXAM_WORK_API + "/exam/importExamOrgSettings/" + this.examId;
   },
   methods: {
     batchNotLimit() {
       this.$confirm("是否开考?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         let url =
           EXAM_WORK_API +
           "/exam/setOrgExamNotLimited/" +
           this.selectedOrgSettings;
-        this.$httpWithMsg.put(url).then(response => {
+        this.$httpWithMsg.put(url).then((response) => {
           console.log(response);
           this.$notify({
             type: "success",
-            message: "开考成功"
+            message: "开考成功",
           });
           this.search();
         });
@@ -515,15 +526,15 @@ export default {
       this.$confirm("是否禁考?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         let url =
           EXAM_WORK_API + "/exam/setOrgExamLimited/" + this.selectedOrgSettings;
-        this.$httpWithMsg.put(url).then(response => {
+        this.$httpWithMsg.put(url).then((response) => {
           console.log(response);
           this.$notify({
             type: "success",
-            message: "禁考成功"
+            message: "禁考成功",
           });
           this.search();
         });
@@ -533,17 +544,17 @@ export default {
       this.$confirm("删除所选学习中心特殊设置?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         let url =
           EXAM_WORK_API +
           "/exam/deleteExamOrgSettings/" +
           this.selectedOrgSettings;
-        this.$httpWithMsg.put(url).then(response => {
+        this.$httpWithMsg.put(url).then((response) => {
           console.log(response);
           this.$notify({
             type: "success",
-            message: "删除成功"
+            message: "删除成功",
           });
           this.search();
         });
@@ -553,15 +564,15 @@ export default {
       this.$confirm("删除所有学习中心特殊设置?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         let url =
           EXAM_WORK_API + "/exam/deleteAllExamOrgSettings/" + this.examId;
-        this.$httpWithMsg.put(url).then(response => {
+        this.$httpWithMsg.put(url).then((response) => {
           console.log(response);
           this.$notify({
             type: "success",
-            message: "删除成功"
+            message: "删除成功",
           });
           this.search();
         });
@@ -580,11 +591,11 @@ export default {
       var url = CORE_API + "/org/query?" + new URLSearchParams({ name: name });
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           this.orgList4Search = response.data;
           this.loadingOrg4Search = false;
         })
-        .catch(response => {
+        .catch((response) => {
           console.log(response);
           this.loadingOrg4Search = false;
         });
@@ -594,11 +605,11 @@ export default {
       var url = CORE_API + "/org/query?" + new URLSearchParams({ name: name });
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           this.orgList4InsertOrUpdate = response.data;
           this.loadingOrg4InsertOrUpdate = false;
         })
-        .catch(response => {
+        .catch((response) => {
           console.log(response);
           this.loadingOrg4InsertOrUpdate = false;
         });
@@ -606,7 +617,7 @@ export default {
     updateExamLimit(row) {
       row.examLimit = !row.examLimit;
       let url = EXAM_WORK_API + "/exam/examOrgSettings";
-      this.$httpWithMsg.post(url, row).then(response => {
+      this.$httpWithMsg.post(url, row).then((response) => {
         row.updateTime = response.data.updateTime;
       });
     },
@@ -619,14 +630,14 @@ export default {
         this.orgSetting.endTime = this.orgSettingDatetimeRange[1];
       }
 
-      this.$refs.updateOrgSettingForm.validate(valid => {
+      this.$refs.updateOrgSettingForm.validate((valid) => {
         if (valid) {
           let url = EXAM_WORK_API + "/exam/examOrgSettings";
-          this.$httpWithMsg.post(url, this.orgSetting).then(response => {
+          this.$httpWithMsg.post(url, this.orgSetting).then((response) => {
             console.log(response);
             this.$notify({
               type: "success",
-              message: "保存成功"
+              message: "保存成功",
             });
             this.search();
             this.updateOrgSettingDialog = false;
@@ -644,14 +655,14 @@ export default {
         this.orgSetting.beginTime = this.orgSettingDatetimeRange[0];
         this.orgSetting.endTime = this.orgSettingDatetimeRange[1];
       }
-      this.$refs.addOrgSettingForm.validate(valid => {
+      this.$refs.addOrgSettingForm.validate((valid) => {
         if (valid) {
           let url = EXAM_WORK_API + "/exam/examOrgSettings";
-          this.$httpWithMsg.put(url, this.orgSetting).then(response => {
+          this.$httpWithMsg.put(url, this.orgSetting).then((response) => {
             console.log(response);
             this.$notify({
               type: "success",
-              message: "保存成功"
+              message: "保存成功",
             });
             this.search();
             this.addOrgSettingDialog = false;
@@ -734,7 +745,7 @@ export default {
       console.log(fileList);
       this.$notify({
         message: "上传成功",
-        type: "success"
+        type: "success",
       });
       this.orgSettingsImportDialog = false;
       this.resetPageAndSearch();
@@ -748,7 +759,7 @@ export default {
       if (response.status == 500) {
         this.$notify({
           message: json.desc,
-          type: "error"
+          type: "error",
         });
       }
     },
@@ -772,14 +783,14 @@ export default {
       if (fileList.length == 0) {
         this.$notify({
           message: "上传文件不能为空",
-          type: "error"
+          type: "error",
         });
         return false;
       }
       if (fileList.length > 1) {
         this.$notify({
           message: "每次只能上传一个文件",
-          type: "error"
+          type: "error",
         });
         return false;
       }
@@ -787,7 +798,7 @@ export default {
         if (!file.name.endsWith(".xlsx")) {
           this.$notify({
             message: "上传文件必须为xlsx格式",
-            type: "error"
+            type: "error",
           });
           return false;
         }
@@ -811,32 +822,21 @@ export default {
       this.loading4FormSearch = true;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           console.log(response);
           this.tableData = response.data.list;
           this.total = response.data.total;
           this.loading4FormSearch = false;
         })
-        .catch(response => {
+        .catch((response) => {
           console.log(response);
           this.loading4FormSearch = false;
         });
     },
     init() {
       this.search();
-    }
+    },
   },
-  created() {
-    this.examId = this.$route.params.id;
-    this.formSearch.examId = this.examId;
-    this.init();
-    this.uploadHeaders = {
-      key: this.user.key,
-      token: this.user.token
-    };
-    this.uploadAction =
-      EXAM_WORK_API + "/exam/importExamOrgSettings/" + this.examId;
-  }
 };
 </script>
 <style scoped></style>

+ 81 - 80
src/modules/examwork/view/onlineHomework.vue

@@ -1,33 +1,33 @@
 <template>
   <div>
     <LinkTitlesCustom
-      :currentPaths="['考试管理', '考试信息', '在线作业设置']"
+      :current-paths="['考试管理', '考试信息', '在线作业设置']"
     />
     <section class="content">
       <div class="box box-info">
         <!-- 正文信息 -->
         <div class="box-body">
           <el-form
+            ref="form"
             :inline="true"
             :rules="rules"
-            ref="form"
             :model="form"
             inline-message
             label-position="right"
           >
-            <div style="margin-bottom: 10px;">
+            <div style="margin-bottom: 10px">
               <el-button type="primary" size="small" @click="saveExam"
                 >保 存</el-button
               >
               <el-button
                 type="primary"
                 size="small"
-                @click="back"
                 icon="el-icon-arrow-left"
+                @click="back"
                 >返 回</el-button
               >
             </div>
-            <el-tabs ref="tabs" type="border-card" v-model="activeName">
+            <el-tabs ref="tabs" v-model="activeName" type="border-card">
               <!-- 基础信息 -->
               <el-tab-pane label="基础信息" name="tab1">
                 <el-row v-if="examId != 'add'">
@@ -94,9 +94,9 @@
                     :label-width="style.label_width_tab1"
                   >
                     <el-select
+                      v-model="form.examType"
                       class="input"
                       :disabled="true"
-                      v-model="form.examType"
                       placeholder="请选择"
                     >
                       <el-option
@@ -137,8 +137,8 @@
                     :label-width="style.label_width_tab1"
                   >
                     <el-date-picker
-                      class="input"
                       v-model="examDatetimeRange"
+                      class="input"
                       type="datetimerange"
                       range-separator="至"
                       start-placeholder="开始日期"
@@ -166,8 +166,8 @@
                     :label-width="style.label_width_tab1"
                   >
                     <el-switch
-                      :disabled="!this.rootOrgWenXinAnswerEnabled"
                       v-model="form.properties.WEIXIN_ANSWER_ENABLED"
+                      :disabled="!rootOrgWenXinAnswerEnabled"
                       on-text="是"
                       off-text="否"
                     ></el-switch>
@@ -187,9 +187,9 @@
                 </el-row>
                 <el-row>
                   <el-form-item
+                    v-show="form.specialSettingsEnabled"
                     label="特殊设置方式"
                     :label-width="style.label_width_tab1"
-                    v-show="form.specialSettingsEnabled"
                   >
                     <el-radio-group
                       v-model="form.specialSettingsType"
@@ -202,9 +202,9 @@
                 </el-row>
                 <el-row>
                   <el-form-item
+                    v-show="form.specialSettingsEnabled"
                     label="无特殊设置时禁止考试"
                     :label-width="style.label_width_tab1"
-                    v-show="form.specialSettingsEnabled"
                   >
                     <el-switch
                       v-model="form.properties.LIMITED_IF_NO_SPECIAL_SETTINGS"
@@ -239,14 +239,14 @@
                 >
                   <el-col :span="24">
                     <el-form-item
-                      style="width:100%"
+                      style="width: 100%"
                       label="日期循环设置"
                       prop="examCycleWeekArr"
                       :label-width="style.label_width_tab4"
                     >
                       <el-checkbox-group
-                        style="width:100%"
                         v-model="examCycleWeekArr"
+                        style="width: 100%"
                         class="input"
                       >
                         <el-checkbox :label="1">星期一</el-checkbox>
@@ -270,10 +270,10 @@
                       >
                       </el-form-item>
                     </el-col>
-                    <el-col :span="10" style="line-height: 48px;height: 40px;">
+                    <el-col :span="10" style="line-height: 48px; height: 40px">
                       <i
                         class="el-icon-circle-plus"
-                        style="color:#00A4FF;font-size:24px;"
+                        style="color: #00a4ff; font-size: 24px"
                         @click="addCycleTimeRange"
                       ></i>
                     </el-col>
@@ -289,9 +289,9 @@
                         :label="index + 1 + '.'"
                       >
                         <el-time-picker
-                          class="input"
-                          style="width:100%"
                           v-model="item.timeRange"
+                          class="input"
+                          style="width: 100%"
                           is-range
                           start-placeholder="开始时间"
                           range-separator="至"
@@ -303,10 +303,10 @@
                         ></el-time-picker>
                       </el-form-item>
                     </el-col>
-                    <el-col :span="10" style="line-height: 48px;height: 40px;">
+                    <el-col :span="10" style="line-height: 48px; height: 40px">
                       <i
                         class="el-icon-remove"
-                        style="color:#00A4FF;font-size:24px;"
+                        style="color: #00a4ff; font-size: 24px"
                         @click="removeExamCycleTimeRange(index)"
                       ></i>
                     </el-col>
@@ -322,8 +322,8 @@
                     :label-width="style.label_width_tab2"
                   >
                     <el-input
-                      maxlength="5"
                       v-model.trim.number="form.duration"
+                      maxlength="5"
                       auto-complete="off"
                       class="input"
                     >
@@ -338,8 +338,8 @@
                     :label-width="style.label_width_tab2"
                   >
                     <el-input
-                      maxlength="5"
                       v-model.trim.number="form.examTimes"
+                      maxlength="5"
                       auto-complete="off"
                       class="input"
                     >
@@ -354,8 +354,8 @@
                     :label-width="style.label_width_tab2"
                   >
                     <el-input
-                      maxlength="5"
                       v-model.trim.number="form.properties.FREEZE_TIME"
+                      maxlength="5"
                       auto-complete="off"
                       class="input"
                     >
@@ -370,8 +370,8 @@
                     :label-width="style.label_width_tab2"
                   >
                     <el-input
-                      maxlength="5"
                       v-model.trim.number="form.properties.EXAM_RECONNECT_TIME"
+                      maxlength="5"
                       auto-complete="off"
                       class="input"
                     >
@@ -386,8 +386,8 @@
                     :label-width="style.label_width_tab2"
                   >
                     <el-input
-                      maxlength="5"
                       v-model.trim.number="form.properties.MAX_INTERRUPT_NUM"
+                      maxlength="5"
                       auto-complete="off"
                       class="input"
                     >
@@ -447,9 +447,9 @@
                     :label-width="style.label_width_tab3"
                   >
                     <el-input
+                      v-model="form.properties.SINGLE_ANSWER_REMARK"
                       maxlength="20"
                       :disabled="!form.properties.SINGLE_EDIT"
-                      v-model="form.properties.SINGLE_ANSWER_REMARK"
                       auto-complete="off"
                       class="input"
                     ></el-input>
@@ -468,9 +468,9 @@
                     :label-width="style.label_width_tab3"
                   >
                     <el-input
+                      v-model="form.properties.MUTIPLE_ANSWER_REMARK"
                       maxlength="20"
                       :disabled="!form.properties.MUTIPLE_EDIT"
-                      v-model="form.properties.MUTIPLE_ANSWER_REMARK"
                       auto-complete="off"
                       class="input"
                     ></el-input>
@@ -489,9 +489,9 @@
                     :label-width="style.label_width_tab3"
                   >
                     <el-input
+                      v-model="form.properties.BOOL_ANSWER_REMARK"
                       maxlength="20"
                       :disabled="!form.properties.BOOL_EDIT"
-                      v-model="form.properties.BOOL_ANSWER_REMARK"
                       class="input"
                       auto-complete="off"
                     ></el-input>
@@ -510,9 +510,9 @@
                     :label-width="style.label_width_tab3"
                   >
                     <el-input
+                      v-model="form.properties.FILL_BLANK_REMARK"
                       maxlength="20"
                       :disabled="!form.properties.FILL_BLANK_EDIT"
-                      v-model="form.properties.FILL_BLANK_REMARK"
                       class="input"
                       auto-complete="off"
                     ></el-input>
@@ -547,8 +547,8 @@
                     :label-width="style.label_width_tab5"
                   >
                     <el-radio-group
-                      :disabled="form.started"
                       v-model="form.properties.MARKING_TYPE"
+                      :disabled="form.started"
                       class="input"
                     >
                       <el-radio label="ALL">全部评阅</el-radio>
@@ -576,8 +576,8 @@
                     :label-width="style.label_width_tab6"
                   >
                     <el-input
-                      maxlength="2000"
                       v-model="form.properties.IP_ADDRESSES"
+                      maxlength="2000"
                       class="input"
                       type="textarea"
                       rows="6"
@@ -779,7 +779,7 @@ let validateMaxInterruptNum = (rule, value, callback) => {
 export default {
   components: {
     ckeditor,
-    LinkTitlesCustom
+    LinkTitlesCustom,
   },
   data() {
     return {
@@ -790,7 +790,7 @@ export default {
         label_width_tab4: "170px",
         label_width_tab5: "80px",
         label_width_tab6: "120px",
-        label_width_tab7: "150px"
+        label_width_tab7: "150px",
       },
       examCycleTimeRangeArr: [],
       examCycleWeekArr: [1, 2, 3, 4, 5, 6, 7],
@@ -853,8 +853,8 @@ export default {
           LIMITED_IF_NO_SPECIAL_SETTINGS: "false",
           EXAM_CYCLE_ENABLED: "false",
           EXAM_CYCLE_WEEK: "",
-          EXAM_CYCLE_TIME_RANGE: ""
-        }
+          EXAM_CYCLE_TIME_RANGE: "",
+        },
       },
       examTypeList: EXAM_TYPE,
       examId: "",
@@ -866,49 +866,57 @@ export default {
           {
             required: true,
             validator: validateExamDatetimeRange,
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         duration: [
-          { required: true, validator: validateDuration, trigger: "blur" }
+          { required: true, validator: validateDuration, trigger: "blur" },
         ],
         examTimes: [
-          { required: true, validator: validateExamTimes, trigger: "blur" }
+          { required: true, validator: validateExamTimes, trigger: "blur" },
         ],
         FREEZE_TIME: [
-          { required: true, validator: validateFreezeTime, trigger: "blur" }
+          { required: true, validator: validateFreezeTime, trigger: "blur" },
         ],
         EXAM_RECONNECT_TIME: [
           {
             required: true,
             validator: validateExamReconnectTime,
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         MAX_INTERRUPT_NUM: [
           {
             required: false,
             validator: validateMaxInterruptNum,
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         examCycleWeekArr: [
           {
             required: true,
             validator: validateExamCycleWeek,
-            trigger: "change"
-          }
+            trigger: "change",
+          },
         ],
         examCycleTimeRangeArr: [
           {
             required: true,
             validator: validateExamCycleTimeRange,
-            trigger: "change"
-          }
-        ]
-      }
+            trigger: "change",
+          },
+        ],
+      },
     };
   },
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    _this = this;
+    this.examId = this.$route.params.id;
+    this.init();
+  },
 
   methods: {
     examCycleEnabledChange(val) {
@@ -939,7 +947,7 @@ export default {
       if (this.examCycleTimeRangeArr.length == 1) {
         this.$notify({
           type: "warning",
-          message: "不能删除最后一个分段"
+          message: "不能删除最后一个分段",
         });
         return;
       }
@@ -950,12 +958,12 @@ export default {
       if (this.examCycleTimeRangeArr.length >= 12) {
         this.$notify({
           type: "warning",
-          message: "时间分段不得超过12条"
+          message: "时间分段不得超过12条",
         });
         return;
       }
       this.examCycleTimeRangeArr.push({
-        timeRange: [this.getNowTimeStr(), this.getEndTimeStr()]
+        timeRange: [this.getNowTimeStr(), this.getEndTimeStr()],
       });
       this.$refs.form.validateField("examCycleTimeRangeArr");
     },
@@ -970,7 +978,7 @@ export default {
     init() {
       if (this.examId != "add") {
         let url = EXAM_WORK_API + "/exam/" + this.examId;
-        this.$httpWithMsg.get(url).then(response => {
+        this.$httpWithMsg.get(url).then((response) => {
           let body = response.data;
           this.rootOrgId = body.rootOrgId;
           body.properties = this.form.properties;
@@ -981,7 +989,7 @@ export default {
           console.log("getOnlineHomework(); form: ", this.form);
 
           let url = EXAM_WORK_API + "/exam/allProperties/" + this.examId;
-          this.$httpWithMsg.get(url).then(response => {
+          this.$httpWithMsg.get(url).then((response) => {
             this.form.properties = Object.assign(
               this.form.properties,
               response.data
@@ -1025,11 +1033,11 @@ export default {
         this.checkRootOrgPrivileges();
       }
     },
-    checkRootOrgPrivileges: function() {
+    checkRootOrgPrivileges: function () {
       let url =
         CORE_API +
         "/rolePrivilege/checkRootOrgPrivileges?privilegeCodes=FACE_CHECK,IDENTIFICATION_OF_LIVING_BODY";
-      this.$httpWithMsg.post(url).then(response => {
+      this.$httpWithMsg.post(url).then((response) => {
         let res = response.data;
         if (!res.FACE_CHECK) {
           this.form.properties.IS_FACE_ENABLE = "false";
@@ -1055,7 +1063,7 @@ export default {
         "/org/property/" +
         this.user.rootOrgId +
         "/WEIXIN_ANSWER_ENABLED";
-      this.$httpWithMsg.get(url2).then(response => {
+      this.$httpWithMsg.get(url2).then((response) => {
         let res = response.data;
         this.rootOrgWenXinAnswerEnabled = res == true;
         if (!this.rootOrgWenXinAnswerEnabled) {
@@ -1063,21 +1071,22 @@ export default {
         }
       });
       let that = this;
-      this.getOrgProperty("IDENTIFICATION_OF_LIVING_BODY_SCHEME", function(
-        res
-      ) {
-        that.form.IDENTIFICATION_OF_LIVING_BODY_SCHEME = res;
-      });
+      this.getOrgProperty(
+        "IDENTIFICATION_OF_LIVING_BODY_SCHEME",
+        function (res) {
+          that.form.IDENTIFICATION_OF_LIVING_BODY_SCHEME = res;
+        }
+      );
     },
-    getOrgProperty: function(propkey, callback) {
+    getOrgProperty: function (propkey, callback) {
       let url =
         CORE_API + "/org/property/" + this.user.rootOrgId + "/" + propkey;
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         let res = response.data;
         callback(res);
       });
     },
-    saveExam: function() {
+    saveExam: function () {
       this.toActiveName = null;
       this.form.beginTime = this.examDatetimeRange[0];
       this.form.endTime = this.examDatetimeRange[1];
@@ -1089,34 +1098,34 @@ export default {
       );
       console.log(this.form);
       let url = EXAM_WORK_API + "/exam";
-      this.$refs.form.validate(valid => {
+      this.$refs.form.validate((valid) => {
         if (valid) {
           if (this.examId != "add") {
-            this.$httpWithMsg.put(url, this.form).then(response => {
+            this.$httpWithMsg.put(url, this.form).then((response) => {
               if (200 != response.status) {
                 this.$notify({
                   type: "error",
-                  message: response.body.desc
+                  message: response.body.desc,
                 });
                 return;
               }
               this.$notify({
                 type: "success",
-                message: "保存成功"
+                message: "保存成功",
               });
             });
           } else {
             this.form.code = this.form.name;
-            this.$httpWithMsg.post(url, this.form).then(response => {
+            this.$httpWithMsg.post(url, this.form).then((response) => {
               console.log(response);
               this.$notify({
                 type: "success",
-                message: "新增成功"
+                message: "新增成功",
               });
               this.examId = response.data.id;
               this.form.id = this.examId;
               this.$router.push({
-                path: "/examwork/onlineHomework/" + response.data.id
+                path: "/examwork/onlineHomework/" + response.data.id,
               });
             });
           }
@@ -1127,16 +1136,8 @@ export default {
     },
     back() {
       this.$router.push({ path: "/examwork/examInfo" });
-    }
-  },
-  created() {
-    _this = this;
-    this.examId = this.$route.params.id;
-    this.init();
+    },
   },
-  computed: {
-    ...mapState({ user: state => state.user })
-  }
 };
 </script>
 <style scoped>

+ 76 - 76
src/modules/examwork/view/onlineHomeworkOrgSettings.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <LinkTitlesCustom
-      :currentPaths="['考试管理', '考试信息', '学习中心设置']"
+      :current-paths="['考试管理', '考试信息', '学习中心设置']"
     />
     <section class="content">
       <div class="box-body">
@@ -13,20 +13,20 @@
         >
           <el-form-item label="学习中心">
             <el-select
+              v-model="formSearch.orgId"
               class="select"
               :remote-method="getOrgList4Search"
               :loading="loadingOrg4Search"
               remote
               filterable
               clearable
-              v-model="formSearch.orgId"
               placeholder="请选择"
             >
               <el-option
                 v-for="item in orgList4Search"
+                :key="item.id"
                 :label="item.name"
                 :value="item.id"
-                :key="item.id"
               >
               </el-option>
             </el-select>
@@ -104,15 +104,15 @@
           >删除所有
         </el-button>
 
-        <div style="width: 100%;margin-bottom: 10px;"></div>
+        <div style="width: 100%; margin-bottom: 10px"></div>
 
         <!-- 页面列表 -->
         <el-table
+          v-loading="loading4FormSearch"
           :data="tableData"
           border
-          style="width: 100%;text-align:center;"
+          style="width: 100%; text-align: center"
           @selection-change="selectChange"
-          v-loading="loading4FormSearch"
         >
           <el-table-column type="selection" width="40"></el-table-column>
           <el-table-column prop="id" width="80" label="ID"></el-table-column>
@@ -144,7 +144,7 @@
                   content="开考"
                   placement="left"
                 >
-                  <i class="el-icon-success" style="color:green;"></i>
+                  <i class="el-icon-success" style="color: green"></i>
                 </el-tooltip>
               </span>
               <span v-else>
@@ -154,7 +154,7 @@
                   content="禁考"
                   placement="left"
                 >
-                  <i class="el-icon-error" style="color:red;"></i>
+                  <i class="el-icon-error" style="color: red"></i>
                 </el-tooltip>
               </span>
             </span>
@@ -198,13 +198,13 @@
         </el-table>
         <div class="page pull-right">
           <el-pagination
-            @current-change="handleCurrentChange"
             :current-page="currentPage"
             :page-size="pageSize"
             :page-sizes="[10, 20, 50, 100, 200, 300]"
-            @size-change="handleSizeChange"
             layout="total, sizes, prev, pager, next, jumper"
             :total="total"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
           >
           </el-pagination>
         </div>
@@ -216,9 +216,9 @@
           :visible.sync="addOrgSettingDialog"
         >
           <el-form
+            ref="addOrgSettingForm"
             :model="orgSetting"
             :rules="orgSettingRules"
-            ref="addOrgSettingForm"
             label-position="right"
             :inline="true"
             inline-message
@@ -226,20 +226,20 @@
             <el-row>
               <el-form-item label="学习中心" prop="orgId" label-width="120px">
                 <el-select
+                  v-model="orgSetting.orgId"
                   class="select"
                   :remote-method="getOrgList4InsertOrUpdate"
                   :loading="loadingOrg4InsertOrUpdate"
                   remote
                   filterable
                   clearable
-                  v-model="orgSetting.orgId"
                   placeholder="请选择"
                 >
                   <el-option
                     v-for="item in orgList4InsertOrUpdate"
+                    :key="item.id"
                     :label="item.name"
                     :value="item.id"
-                    :key="item.id"
                   >
                   </el-option>
                 </el-select>
@@ -271,7 +271,7 @@
               </el-form-item>
             </el-row>
             <el-row>
-              <div style="text-align:center;">
+              <div style="text-align: center">
                 <el-button type="primary" @click="addOrgSetting"
                   >确 定
                 </el-button>
@@ -290,9 +290,9 @@
           :visible.sync="updateOrgSettingDialog"
         >
           <el-form
+            ref="updateOrgSettingForm"
             :model="orgSetting"
             :rules="orgSettingRules"
-            ref="updateOrgSettingForm"
             label-position="right"
             :inline="true"
             inline-message
@@ -300,6 +300,7 @@
             <el-row>
               <el-form-item label="学习中心" prop="orgId" label-width="120px">
                 <el-select
+                  v-model="orgSetting.orgId"
                   class="select"
                   :remote-method="getOrgList4InsertOrUpdate"
                   :loading="loadingOrg4InsertOrUpdate"
@@ -307,14 +308,13 @@
                   filterable
                   clearable
                   :disabled="true"
-                  v-model="orgSetting.orgId"
                   placeholder="请选择"
                 >
                   <el-option
                     v-for="item in orgList4InsertOrUpdate"
+                    :key="item.id"
                     :label="item.name"
                     :value="item.id"
-                    :key="item.id"
                   >
                   </el-option>
                 </el-select>
@@ -346,7 +346,7 @@
               </el-form-item>
             </el-row>
             <el-row>
-              <div style="margin-left:30%">
+              <div style="margin-left: 30%">
                 <el-button type="primary" @click="updateOrgSetting"
                   >确 定
                 </el-button>
@@ -365,9 +365,9 @@
           width="500px"
           :visible.sync="orgSettingsImportDialog"
         >
-          <el-form :model="orgSettingsImportForm" ref="orgSettingsImportForm">
+          <el-form ref="orgSettingsImportForm" :model="orgSettingsImportForm">
             <el-row>
-              <el-form-item style="margin-left:30px">
+              <el-form-item style="margin-left: 30px">
                 <el-upload
                   ref="upload"
                   accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
@@ -381,26 +381,26 @@
                   :multiple="false"
                 >
                   <el-button
-                    size="small"
                     slot="trigger"
+                    size="small"
                     type="primary"
                     icon="el-icon-search"
                     >选择文件
                   </el-button>
                   <el-button
                     size="small"
-                    style="margin-left:10px;"
+                    style="margin-left: 10px"
                     type="primary"
-                    @click="submitUpload"
                     icon="el-icon-check"
+                    @click="submitUpload"
                     >确认上传
                   </el-button>
                   <el-button
                     size="small"
-                    style="margin-left: 10px;"
+                    style="margin-left: 10px"
                     type="primary"
-                    @click="removeFile"
                     icon="el-icon-refresh"
+                    @click="removeFile"
                     >清空文件
                   </el-button>
                   <div slot="tip" class="el-upload__tip">只能上传xlsx文件</div>
@@ -413,9 +413,9 @@
         <!-- 导入错误信息列表 -->
         <el-dialog title="错误提示" :visible.sync="errDialog">
           <div
-            class="text-danger"
             v-for="errMessage in errMessages"
             :key="errMessage.lineNum"
+            class="text-danger"
           >
             第{{ errMessage.lineNum }}行:{{ errMessage.msg }}
           </div>
@@ -442,7 +442,7 @@ export default {
       loading4FormSearch: false,
       formSearch: {
         examId: null,
-        orgId: ""
+        orgId: "",
       },
       loadingOrg4Search: false,
       orgList4Search: [],
@@ -460,8 +460,8 @@ export default {
         endTime: null,
         examLimit: "false",
         properties: {
-          CAN_UPLOAD_ATTACHMENT: "true"
-        }
+          CAN_UPLOAD_ATTACHMENT: "true",
+        },
       },
       orgSettingDatetimeRange: [],
       addOrgSettingDialog: false,
@@ -470,8 +470,8 @@ export default {
       loadingOrg4InsertOrUpdate: false,
       orgSettingRules: {
         orgId: [
-          { required: true, message: "请选择学习中心", trigger: "blur,change" }
-        ]
+          { required: true, message: "请选择学习中心", trigger: "blur,change" },
+        ],
       },
 
       orgSettingsImportDialog: false,
@@ -481,31 +481,42 @@ export default {
       uploadData: {},
       fileList: [],
       errDialog: false,
-      errMessages: []
+      errMessages: [],
     };
   },
   computed: {
-    ...mapState({ user: state => state.user }),
+    ...mapState({ user: (state) => state.user }),
     noBatchSelected() {
       return this.selectedOrgSettings.length === 0;
-    }
+    },
+  },
+  created() {
+    this.examId = this.$route.params.id;
+    this.formSearch.examId = this.examId;
+    this.init();
+    this.uploadHeaders = {
+      key: this.user.key,
+      token: this.user.token,
+    };
+    this.uploadAction =
+      EXAM_WORK_API + "/exam/importExamOrgSettings/" + this.examId;
   },
   methods: {
     batchNotLimit() {
       this.$confirm("是否开考?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         let url =
           EXAM_WORK_API +
           "/exam/setOrgExamNotLimited/" +
           this.selectedOrgSettings;
-        this.$httpWithMsg.put(url).then(response => {
+        this.$httpWithMsg.put(url).then((response) => {
           console.log(response);
           this.$notify({
             type: "success",
-            message: "开考成功"
+            message: "开考成功",
           });
           this.search();
         });
@@ -515,15 +526,15 @@ export default {
       this.$confirm("是否禁考?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         let url =
           EXAM_WORK_API + "/exam/setOrgExamLimited/" + this.selectedOrgSettings;
-        this.$httpWithMsg.put(url).then(response => {
+        this.$httpWithMsg.put(url).then((response) => {
           console.log(response);
           this.$notify({
             type: "success",
-            message: "禁考成功"
+            message: "禁考成功",
           });
           this.search();
         });
@@ -533,17 +544,17 @@ export default {
       this.$confirm("删除所选学习中心特殊设置?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         let url =
           EXAM_WORK_API +
           "/exam/deleteExamOrgSettings/" +
           this.selectedOrgSettings;
-        this.$httpWithMsg.put(url).then(response => {
+        this.$httpWithMsg.put(url).then((response) => {
           console.log(response);
           this.$notify({
             type: "success",
-            message: "删除成功"
+            message: "删除成功",
           });
           this.search();
         });
@@ -553,15 +564,15 @@ export default {
       this.$confirm("删除所有学习中心特殊设置?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         let url =
           EXAM_WORK_API + "/exam/deleteAllExamOrgSettings/" + this.examId;
-        this.$httpWithMsg.put(url).then(response => {
+        this.$httpWithMsg.put(url).then((response) => {
           console.log(response);
           this.$notify({
             type: "success",
-            message: "删除成功"
+            message: "删除成功",
           });
           this.search();
         });
@@ -580,11 +591,11 @@ export default {
       var url = CORE_API + "/org/query?" + new URLSearchParams({ name: name });
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           this.orgList4Search = response.data;
           this.loadingOrg4Search = false;
         })
-        .catch(response => {
+        .catch((response) => {
           console.log(response);
           this.loadingOrg4Search = false;
         });
@@ -594,11 +605,11 @@ export default {
       var url = CORE_API + "/org/query?" + new URLSearchParams({ name: name });
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           this.orgList4InsertOrUpdate = response.data;
           this.loadingOrg4InsertOrUpdate = false;
         })
-        .catch(response => {
+        .catch((response) => {
           console.log(response);
           this.loadingOrg4InsertOrUpdate = false;
         });
@@ -606,7 +617,7 @@ export default {
     updateExamLimit(row) {
       row.examLimit = !row.examLimit;
       let url = EXAM_WORK_API + "/exam/examOrgSettings";
-      this.$httpWithMsg.post(url, row).then(response => {
+      this.$httpWithMsg.post(url, row).then((response) => {
         row.updateTime = response.data.updateTime;
       });
     },
@@ -619,14 +630,14 @@ export default {
         this.orgSetting.endTime = this.orgSettingDatetimeRange[1];
       }
 
-      this.$refs.updateOrgSettingForm.validate(valid => {
+      this.$refs.updateOrgSettingForm.validate((valid) => {
         if (valid) {
           let url = EXAM_WORK_API + "/exam/examOrgSettings";
-          this.$httpWithMsg.post(url, this.orgSetting).then(response => {
+          this.$httpWithMsg.post(url, this.orgSetting).then((response) => {
             console.log(response);
             this.$notify({
               type: "success",
-              message: "保存成功"
+              message: "保存成功",
             });
             this.search();
             this.updateOrgSettingDialog = false;
@@ -644,14 +655,14 @@ export default {
         this.orgSetting.beginTime = this.orgSettingDatetimeRange[0];
         this.orgSetting.endTime = this.orgSettingDatetimeRange[1];
       }
-      this.$refs.addOrgSettingForm.validate(valid => {
+      this.$refs.addOrgSettingForm.validate((valid) => {
         if (valid) {
           let url = EXAM_WORK_API + "/exam/examOrgSettings";
-          this.$httpWithMsg.put(url, this.orgSetting).then(response => {
+          this.$httpWithMsg.put(url, this.orgSetting).then((response) => {
             console.log(response);
             this.$notify({
               type: "success",
-              message: "保存成功"
+              message: "保存成功",
             });
             this.search();
             this.addOrgSettingDialog = false;
@@ -734,7 +745,7 @@ export default {
       console.log(fileList);
       this.$notify({
         message: "上传成功",
-        type: "success"
+        type: "success",
       });
       this.orgSettingsImportDialog = false;
       this.resetPageAndSearch();
@@ -748,7 +759,7 @@ export default {
       if (response.status == 500) {
         this.$notify({
           message: json.desc,
-          type: "error"
+          type: "error",
         });
       }
     },
@@ -772,14 +783,14 @@ export default {
       if (fileList.length == 0) {
         this.$notify({
           message: "上传文件不能为空",
-          type: "error"
+          type: "error",
         });
         return false;
       }
       if (fileList.length > 1) {
         this.$notify({
           message: "每次只能上传一个文件",
-          type: "error"
+          type: "error",
         });
         return false;
       }
@@ -787,7 +798,7 @@ export default {
         if (!file.name.endsWith(".xlsx")) {
           this.$notify({
             message: "上传文件必须为xlsx格式",
-            type: "error"
+            type: "error",
           });
           return false;
         }
@@ -811,32 +822,21 @@ export default {
       this.loading4FormSearch = true;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           console.log(response);
           this.tableData = response.data.list;
           this.total = response.data.total;
           this.loading4FormSearch = false;
         })
-        .catch(response => {
+        .catch((response) => {
           console.log(response);
           this.loading4FormSearch = false;
         });
     },
     init() {
       this.search();
-    }
+    },
   },
-  created() {
-    this.examId = this.$route.params.id;
-    this.formSearch.examId = this.examId;
-    this.init();
-    this.uploadHeaders = {
-      key: this.user.key,
-      token: this.user.token
-    };
-    this.uploadAction =
-      EXAM_WORK_API + "/exam/importExamOrgSettings/" + this.examId;
-  }
 };
 </script>
 <style scoped></style>

+ 56 - 56
src/modules/examwork/view/practiceExam.vue

@@ -1,33 +1,33 @@
 <template>
   <div>
     <LinkTitlesCustom
-      :currentPaths="['考试管理', '考试信息', '练习考试设置']"
+      :current-paths="['考试管理', '考试信息', '练习考试设置']"
     />
     <section class="content">
       <div class="box box-info">
         <!-- 正文信息 -->
         <div class="box-body">
           <el-form
+            ref="form"
             :inline="true"
             :rules="rules"
-            ref="form"
             :model="form"
             label-position="right"
             inline-message
           >
-            <div style="margin-bottom: 10px;">
+            <div style="margin-bottom: 10px">
               <el-button type="primary" size="small" @click="saveExam"
                 >保 存</el-button
               >
               <el-button
                 type="primary"
                 size="small"
-                @click="back"
                 icon="el-icon-arrow-left"
+                @click="back"
                 >返 回</el-button
               >
             </div>
-            <el-tabs type="border-card" v-model="activeName">
+            <el-tabs v-model="activeName" type="border-card">
               <!-- 基础信息 -->
               <el-tab-pane label="基础信息" name="tab1">
                 <el-row v-if="examId != 'add'">
@@ -82,8 +82,8 @@
                     prop="name"
                   >
                     <el-input
-                      maxlength="20"
                       v-model="form.name"
+                      maxlength="20"
                       class="input"
                     ></el-input>
                   </el-form-item>
@@ -94,9 +94,9 @@
                     :label-width="style.label_width_tab1"
                   >
                     <el-select
+                      v-model="form.examType"
                       class="input"
                       :disabled="true"
-                      v-model="form.examType"
                       placeholder="请选择"
                     >
                       <el-option
@@ -127,8 +127,8 @@
                     :label-width="style.label_width_tab1"
                   >
                     <el-date-picker
-                      class="input"
                       v-model="examDatetimeRange"
+                      class="input"
                       type="datetimerange"
                       range-separator="至"
                       start-placeholder="开始日期"
@@ -165,14 +165,14 @@
                 >
                   <el-col :span="24">
                     <el-form-item
-                      style="width:100%"
+                      style="width: 100%"
                       label="日期循环设置"
                       prop="examCycleWeekArr"
                       :label-width="style.label_width_tab4"
                     >
                       <el-checkbox-group
-                        style="width:100%"
                         v-model="examCycleWeekArr"
+                        style="width: 100%"
                         class="input"
                       >
                         <el-checkbox :label="1">星期一</el-checkbox>
@@ -196,10 +196,10 @@
                       >
                       </el-form-item>
                     </el-col>
-                    <el-col :span="10" style="line-height: 48px;height: 40px;">
+                    <el-col :span="10" style="line-height: 48px; height: 40px">
                       <i
                         class="el-icon-circle-plus"
-                        style="color:#00A4FF;font-size:24px;"
+                        style="color: #00a4ff; font-size: 24px"
                         @click="addCycleTimeRange"
                       ></i>
                     </el-col>
@@ -215,9 +215,9 @@
                         :label="index + 1 + '.'"
                       >
                         <el-time-picker
-                          class="input"
-                          style="width:100%"
                           v-model="item.timeRange"
+                          class="input"
+                          style="width: 100%"
                           is-range
                           start-placeholder="开始时间"
                           range-separator="至"
@@ -229,10 +229,10 @@
                         ></el-time-picker>
                       </el-form-item>
                     </el-col>
-                    <el-col :span="10" style="line-height: 48px;height: 40px;">
+                    <el-col :span="10" style="line-height: 48px; height: 40px">
                       <i
                         class="el-icon-remove"
-                        style="color:#00A4FF;font-size:24px;"
+                        style="color: #00a4ff; font-size: 24px"
                         @click="removeExamCycleTimeRange(index)"
                       ></i>
                     </el-col>
@@ -248,9 +248,9 @@
                     :label-width="style.label_width_tab2"
                   >
                     <el-input
+                      v-model.trim.number="form.duration"
                       maxlength="5"
                       class="input"
-                      v-model.trim.number="form.duration"
                       auto-complete="off"
                       ><template slot="append">分钟</template></el-input
                     >
@@ -263,9 +263,9 @@
                     :label-width="style.label_width_tab2"
                   >
                     <el-input
+                      v-model.trim.number="form.examTimes"
                       maxlength="5"
                       class="input"
-                      v-model.trim.number="form.examTimes"
                       auto-complete="off"
                       ><template slot="append">次</template></el-input
                     >
@@ -278,9 +278,9 @@
                     :label-width="style.label_width_tab2"
                   >
                     <el-input
+                      v-model.trim.number="form.properties.FREEZE_TIME"
                       maxlength="5"
                       class="input"
-                      v-model.trim.number="form.properties.FREEZE_TIME"
                       auto-complete="off"
                       ><template slot="append">分钟</template></el-input
                     >
@@ -293,9 +293,9 @@
                     :label-width="style.label_width_tab2"
                   >
                     <el-input
+                      v-model.trim.number="form.properties.EXAM_RECONNECT_TIME"
                       maxlength="5"
                       class="input"
-                      v-model.trim.number="form.properties.EXAM_RECONNECT_TIME"
                       auto-complete="off"
                       ><template slot="append">分钟</template></el-input
                     >
@@ -514,7 +514,7 @@ let validateExamReconnectTime = (rule, value, callback) => {
 export default {
   components: {
     ckeditor,
-    LinkTitlesCustom
+    LinkTitlesCustom,
   },
   data() {
     return {
@@ -522,7 +522,7 @@ export default {
         label_width_tab1: "80px",
         label_width_tab2: "110px",
         label_width_tab3: "120px",
-        label_width_tab4: "170px"
+        label_width_tab4: "170px",
       },
       examCycleTimeRangeArr: [],
       examCycleWeekArr: [1, 2, 3, 4, 5, 6, 7],
@@ -548,8 +548,8 @@ export default {
           PRACTICE_TYPE: "IN_PRACTICE",
           EXAM_CYCLE_ENABLED: "false",
           EXAM_CYCLE_WEEK: "",
-          EXAM_CYCLE_TIME_RANGE: ""
-        }
+          EXAM_CYCLE_TIME_RANGE: "",
+        },
       },
       examTypeList: EXAM_TYPE,
       examId: "",
@@ -560,42 +560,47 @@ export default {
           {
             required: true,
             validator: validateExamDatetimeRange,
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         duration: [
-          { required: true, validator: validateDuration, trigger: "blur" }
+          { required: true, validator: validateDuration, trigger: "blur" },
         ],
         examTimes: [
-          { required: true, validator: validateExamTimes, trigger: "blur" }
+          { required: true, validator: validateExamTimes, trigger: "blur" },
         ],
         FREEZE_TIME: [
-          { required: true, validator: validateFreezeTime, trigger: "blur" }
+          { required: true, validator: validateFreezeTime, trigger: "blur" },
         ],
         EXAM_RECONNECT_TIME: [
           {
             required: true,
             validator: validateExamReconnectTime,
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         examCycleWeekArr: [
           {
             required: true,
             validator: validateExamCycleWeek,
-            trigger: "change"
-          }
+            trigger: "change",
+          },
         ],
         examCycleTimeRangeArr: [
           {
             required: true,
             validator: validateExamCycleTimeRange,
-            trigger: "change"
-          }
-        ]
-      }
+            trigger: "change",
+          },
+        ],
+      },
     };
   },
+  created() {
+    _this = this;
+    this.examId = this.$route.params.id;
+    this.init();
+  },
 
   methods: {
     examCycleEnabledChange(val) {
@@ -626,7 +631,7 @@ export default {
       if (this.examCycleTimeRangeArr.length == 1) {
         this.$notify({
           type: "warning",
-          message: "不能删除最后一个分段"
+          message: "不能删除最后一个分段",
         });
         return;
       }
@@ -637,19 +642,19 @@ export default {
       if (this.examCycleTimeRangeArr.length >= 12) {
         this.$notify({
           type: "warning",
-          message: "时间分段不得超过12条"
+          message: "时间分段不得超过12条",
         });
         return;
       }
       this.examCycleTimeRangeArr.push({
-        timeRange: [this.getNowTimeStr(), this.getEndTimeStr()]
+        timeRange: [this.getNowTimeStr(), this.getEndTimeStr()],
       });
       this.$refs.form.validateField("examCycleTimeRangeArr");
     },
     init() {
       if (this.examId != "add") {
         let url = EXAM_WORK_API + "/exam/" + this.examId;
-        this.$httpWithMsg.get(url).then(response => {
+        this.$httpWithMsg.get(url).then((response) => {
           let body = response.data;
           body.properties = this.form.properties;
           this.form = Object.assign(this.form, response.data);
@@ -658,7 +663,7 @@ export default {
           console.log("getOnlineExam(); form: ", this.form);
 
           let url = EXAM_WORK_API + "/exam/allProperties/" + this.examId;
-          this.$httpWithMsg.get(url).then(response => {
+          this.$httpWithMsg.get(url).then((response) => {
             this.form.properties = Object.assign(
               this.form.properties,
               response.data
@@ -682,7 +687,7 @@ export default {
         this.show_ckeditor = true;
       }
     },
-    saveExam: function() {
+    saveExam: function () {
       this.toActiveName = null;
       this.form.beginTime = this.examDatetimeRange[0];
       this.form.endTime = this.examDatetimeRange[1];
@@ -694,34 +699,34 @@ export default {
       );
       console.log(this.form);
       let url = EXAM_WORK_API + "/exam";
-      this.$refs.form.validate(valid => {
+      this.$refs.form.validate((valid) => {
         if (valid) {
           if (this.examId != "add") {
-            this.$httpWithMsg.put(url, this.form).then(response => {
+            this.$httpWithMsg.put(url, this.form).then((response) => {
               if (200 != response.status) {
                 this.$notify({
                   type: "error",
-                  message: response.body.desc
+                  message: response.body.desc,
                 });
                 return;
               }
               this.$notify({
                 type: "success",
-                message: "保存成功"
+                message: "保存成功",
               });
             });
           } else {
             this.form.code = this.form.name;
-            this.$httpWithMsg.post(url, this.form).then(response => {
+            this.$httpWithMsg.post(url, this.form).then((response) => {
               console.log(response);
               this.$notify({
                 type: "success",
-                message: "新增成功"
+                message: "新增成功",
               });
               this.examId = response.data.id;
               this.form.id = this.examId;
               this.$router.push({
-                path: "/examwork/practiceExam/" + response.data.id
+                path: "/examwork/practiceExam/" + response.data.id,
               });
             });
           }
@@ -732,13 +737,8 @@ export default {
     },
     back() {
       this.$router.push({ path: "/examwork/examInfo" });
-    }
+    },
   },
-  created() {
-    _this = this;
-    this.examId = this.$route.params.id;
-    this.init();
-  }
 };
 </script>
 <style scoped>

+ 29 - 29
src/modules/examwork/view/printExam.vue

@@ -1,16 +1,16 @@
 <template>
   <div>
     <LinkTitlesCustom
-      :currentPaths="['考试管理', '考试信息', '印刷考试设置']"
+      :current-paths="['考试管理', '考试信息', '印刷考试设置']"
     />
     <section class="content">
       <div class="box box-info">
         <!-- 正文信息 -->
         <div class="box-body">
           <el-form
+            ref="form"
             :inline="true"
             :rules="rules"
-            ref="form"
             :model="form"
             label-position="right"
             inline-message
@@ -22,12 +22,12 @@
               <el-button
                 type="primary"
                 size="small"
-                @click="back"
                 icon="el-icon-arrow-left"
+                @click="back"
                 >返 回</el-button
               >
             </div>
-            <el-tabs type="border-card" v-model="activeName">
+            <el-tabs v-model="activeName" type="border-card">
               <!-- 基础信息 -->
               <el-tab-pane label="基础信息" name="tab1">
                 <el-row v-if="examId != 'add'">
@@ -82,8 +82,8 @@
                     prop="name"
                   >
                     <el-input
-                      maxlength="20"
                       v-model="form.name"
+                      maxlength="20"
                       class="input"
                     ></el-input>
                   </el-form-item>
@@ -94,9 +94,9 @@
                     :label-width="style.label_width_tab1"
                   >
                     <el-select
+                      v-model="form.examType"
                       class="input"
                       :disabled="true"
-                      v-model="form.examType"
                       placeholder="请选择"
                     >
                       <el-option
@@ -127,8 +127,8 @@
                     :label-width="style.label_width_tab1"
                   >
                     <el-date-picker
-                      class="input"
                       v-model="examDatetimeRange"
+                      class="input"
                       type="datetimerange"
                       range-separator="至"
                       start-placeholder="开始日期"
@@ -196,7 +196,7 @@ export default {
   data() {
     return {
       style: {
-        label_width_tab1: "80px"
+        label_width_tab1: "80px",
       },
       activeName: "tab1",
       examDatetimeRange: [],
@@ -210,7 +210,7 @@ export default {
         endTime: null,
         duration: 120,
         enable: "true",
-        properties: {}
+        properties: {},
       },
       examTypeList: EXAM_TYPE,
       examId: "",
@@ -221,18 +221,23 @@ export default {
           {
             required: true,
             validator: validateExamDatetimeRange,
-            trigger: "blur"
-          }
-        ]
-      }
+            trigger: "blur",
+          },
+        ],
+      },
     };
   },
+  created() {
+    _this = this;
+    this.examId = this.$route.params.id;
+    this.init();
+  },
 
   methods: {
     init() {
       if (this.examId != "add") {
         let url = EXAM_WORK_API + "/exam/" + this.examId;
-        this.$httpWithMsg.get(url).then(response => {
+        this.$httpWithMsg.get(url).then((response) => {
           let body = response.data;
           body.properties = this.form.properties;
           this.form = Object.assign(this.form, response.data);
@@ -241,7 +246,7 @@ export default {
           console.log("getOnlineExam(); form: ", this.form);
 
           let url = EXAM_WORK_API + "/exam/allProperties/" + this.examId;
-          this.$httpWithMsg.get(url).then(response => {
+          this.$httpWithMsg.get(url).then((response) => {
             this.form.properties = Object.assign(
               this.form.properties,
               response.data
@@ -255,39 +260,39 @@ export default {
         this.show_ckeditor = true;
       }
     },
-    saveExam: function() {
+    saveExam: function () {
       this.form.beginTime = this.examDatetimeRange[0];
       this.form.endTime = this.examDatetimeRange[1];
       console.log(this.form);
       let url = EXAM_WORK_API + "/exam";
-      this.$refs.form.validate(valid => {
+      this.$refs.form.validate((valid) => {
         if (valid) {
           if (this.examId != "add") {
-            this.$httpWithMsg.put(url, this.form).then(response => {
+            this.$httpWithMsg.put(url, this.form).then((response) => {
               if (200 != response.status) {
                 this.$notify({
                   type: "error",
-                  message: response.body.desc
+                  message: response.body.desc,
                 });
                 return;
               }
               this.$notify({
                 type: "success",
-                message: "保存成功"
+                message: "保存成功",
               });
             });
           } else {
             this.form.code = this.form.name;
-            this.$httpWithMsg.post(url, this.form).then(response => {
+            this.$httpWithMsg.post(url, this.form).then((response) => {
               console.log(response);
               this.$notify({
                 type: "success",
-                message: "新增成功"
+                message: "新增成功",
               });
               this.examId = response.data.id;
               this.form.id = this.examId;
               this.$router.push({
-                path: "/examwork/printExam/" + response.data.id
+                path: "/examwork/printExam/" + response.data.id,
               });
             });
           }
@@ -298,13 +303,8 @@ export default {
     },
     back() {
       this.$router.push({ path: "/examwork/examInfo" });
-    }
+    },
   },
-  created() {
-    _this = this;
-    this.examId = this.$route.params.id;
-    this.init();
-  }
 };
 </script>
 <style scoped>

+ 110 - 110
src/modules/examwork/view/stageSpecialSettings.vue

@@ -1,14 +1,14 @@
 <template>
   <div>
     <LinkTitlesCustom
-      :currentPaths="['考试管理', '考试信息', '场次特殊设置']"
+      :current-paths="['考试管理', '考试信息', '场次特殊设置']"
     />
     <section class="content">
       <div class="box box-info">
         <div
-          class="box-body"
           v-loading.body="loading"
           v-loading.fullscreen="loading"
+          class="box-body"
           element-loading-text="请稍后..."
         >
           <!-- 表单 -->
@@ -16,19 +16,19 @@
             <el-row>
               <el-col :span="7">
                 <el-form-item label="考试名称">
-                  <el-input :disabled="true" v-model="examName"></el-input>
+                  <el-input v-model="examName" :disabled="true"></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="6">
                 <el-form-item label="考试类型">
-                  <el-input :disabled="true" v-model="examTypeName"></el-input>
+                  <el-input v-model="examTypeName" :disabled="true"></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="11">
                 <el-form-item label="时间范围">
                   <el-date-picker
-                    class="input"
                     v-model="startExamDatetimeRange"
+                    class="input"
                     type="datetimerange"
                     start-placeholder="开始时间"
                     range-separator="至"
@@ -45,8 +45,8 @@
               <el-col :span="7">
                 <el-form-item label=" 场次号">
                   <el-input
-                    placeholder="场次号"
                     v-model="formSearch.stageOrder"
+                    placeholder="场次号"
                   ></el-input>
                 </el-form-item>
               </el-col>
@@ -130,7 +130,7 @@
               >清空所有场次</el-button
             >
           </div>
-          <div style="width: 100%;margin-bottom: 10px;"></div>
+          <div style="width: 100%; margin-bottom: 10px"></div>
 
           <!-- 页面列表 -->
           <el-table
@@ -138,8 +138,8 @@
             border
             resizable
             stripe
+            style="width: 100%"
             @selection-change="selectChange"
-            style="width: 100%;"
           >
             <el-table-column
               type="selection"
@@ -180,7 +180,7 @@
                     content="启用"
                     placement="left"
                   >
-                    <i class="el-icon-success" style="color:green;"></i>
+                    <i class="el-icon-success" style="color: green"></i>
                   </el-tooltip>
                 </span>
                 <span v-else>
@@ -190,7 +190,7 @@
                     content="禁用"
                     placement="left"
                   >
-                    <i class="el-icon-error" style="color:red;"></i>
+                    <i class="el-icon-error" style="color: red"></i>
                   </el-tooltip>
                 </span>
               </span>
@@ -202,16 +202,16 @@
                   size="mini"
                   type="primary"
                   plain
-                  @click="modifyStageEnable(scope.row)"
                   icon="el-icon-check"
+                  @click="modifyStageEnable(scope.row)"
                   >启用</el-button
                 >
                 <el-button
                   v-if="scope.row.enable"
                   size="mini"
                   type="danger"
-                  @click="modifyStageEnable(scope.row)"
                   icon="el-icon-close"
+                  @click="modifyStageEnable(scope.row)"
                   >禁用</el-button
                 >&nbsp;
                 <el-dropdown>
@@ -225,8 +225,8 @@
                         size="mini"
                         type="primary"
                         plain
-                        @click="editStage(scope.row)"
                         icon="el-icon-edit"
+                        @click="editStage(scope.row)"
                         >编辑</el-button
                       >
                     </el-dropdown-item>
@@ -238,13 +238,13 @@
           <div class="page pull-right">
             <el-pagination
               v-if="paginationShow"
-              @current-change="handleCurrentChange"
               :current-page="currentPage"
               :page-size="pageSize"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
-              @size-change="handleSizeChange"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @current-change="handleCurrentChange"
+              @size-change="handleSizeChange"
             />
           </div>
         </div>
@@ -256,18 +256,18 @@
           :visible.sync="addStageVisible"
         >
           <el-form
+            ref="addStageForm"
             :inline="true"
             :inline-message="false"
             :model="addStageForm"
-            ref="addStageForm"
             label-position="right"
             label-width="120px"
           >
             <el-row>
               <el-form-item label="创建方式">
                 <el-radio-group
-                  class="pull_right_sm"
                   v-model="addStageForm.createType"
+                  class="pull_right_sm"
                 >
                   <el-radio label="simple">简单创建</el-radio>
                   <el-radio label="loop">循环创建</el-radio>
@@ -288,10 +288,10 @@
                     ></el-input-number>
                   </el-form-item>
                 </el-col>
-                <el-col :span="10" style="line-height: 48px;height: 40px;">
+                <el-col :span="10" style="line-height: 48px; height: 40px">
                   <i
                     class="el-icon-circle-plus"
-                    style="color:#00A4FF;font-size:24px;"
+                    style="color: #00a4ff; font-size: 24px"
                     @click="addTimeRange"
                   ></i>
                 </el-col>
@@ -304,9 +304,9 @@
                 <el-col :span="22">
                   <el-form-item :label="index + 1 + '.'">
                     <el-date-picker
-                      class="input"
-                      style="width:100%"
                       v-model="item.timeRange"
+                      class="input"
+                      style="width: 100%"
                       type="datetimerange"
                       start-placeholder="开始时间"
                       range-separator="至"
@@ -318,10 +318,10 @@
                     ></el-date-picker>
                   </el-form-item>
                 </el-col>
-                <el-col :span="2" style="line-height: 48px;height: 40px;">
+                <el-col :span="2" style="line-height: 48px; height: 40px">
                   <i
                     class="el-icon-remove"
-                    style="color:#00A4FF;font-size:24px;"
+                    style="color: #00a4ff; font-size: 24px"
                     @click="removeTimeRange(index)"
                   ></i>
                 </el-col>
@@ -355,10 +355,10 @@
                     ></el-input-number>
                   </el-form-item>
                 </el-col>
-                <el-col :span="10" style="line-height: 48px;height: 40px;">
+                <el-col :span="10" style="line-height: 48px; height: 40px">
                   <i
                     class="el-icon-circle-plus"
-                    style="color:#00A4FF;font-size:24px;"
+                    style="color: #00a4ff; font-size: 24px"
                     @click="addTimeRange"
                   ></i>
                 </el-col>
@@ -378,7 +378,7 @@
                       value-format="HH:mm:ss"
                       format="HH:mm:ss"
                       :picker-options="{
-                        selectableRange: '00:00:00 - 23:59:59'
+                        selectableRange: '00:00:00 - 23:59:59',
                       }"
                     ></el-time-picker>
                     <span class="mx-3">至</span>
@@ -390,15 +390,15 @@
                       value-format="HH:mm:ss"
                       format="HH:mm:ss"
                       :picker-options="{
-                        selectableRange: '00:00:00 - 23:59:59'
+                        selectableRange: '00:00:00 - 23:59:59',
                       }"
                     ></el-time-picker>
                   </el-form-item>
                 </el-col>
-                <el-col :span="2" style="line-height: 48px;height: 40px;">
+                <el-col :span="2" style="line-height: 48px; height: 40px">
                   <i
                     class="el-icon-remove"
-                    style="color:#00A4FF;font-size:24px;"
+                    style="color: #00a4ff; font-size: 24px"
                     @click="removeTimeRange(index)"
                   ></i>
                 </el-col>
@@ -418,10 +418,10 @@
           :visible.sync="editStageVisible"
         >
           <el-form
+            ref="editStageForm"
             :inline="true"
             :inline-message="false"
             :model="editStageForm"
-            ref="editStageForm"
             :rules="editStageRules"
             label-position="right"
             label-width="120px"
@@ -429,8 +429,8 @@
             <el-row>
               <el-form-item label="ID">
                 <el-input
-                  class="input_width_lg"
                   v-model="editStageForm.id"
+                  class="input_width_lg"
                   :disabled="true"
                 />
               </el-form-item>
@@ -438,8 +438,8 @@
             <el-row>
               <el-form-item label="场次号">
                 <el-input
-                  class="input_width_lg"
                   v-model="editStageForm.stageOrder"
+                  class="input_width_lg"
                   :disabled="true"
                 />
               </el-form-item>
@@ -447,8 +447,8 @@
             <el-row>
               <el-form-item label="开考时间" prop="startExamDatetimeRange2Edit">
                 <el-date-picker
-                  class="input"
                   v-model="startExamDatetimeRange2Edit"
+                  class="input"
                   type="datetimerange"
                   start-placeholder="开始时间"
                   range-separator="至"
@@ -463,8 +463,8 @@
             <el-row>
               <el-form-item label="特殊设置">
                 <el-radio-group
-                  class="pull_right_sm"
                   v-model="editStageForm.specialSetting"
+                  class="pull_right_sm"
                 >
                   <el-radio :label="false">通用设置</el-radio>
                   <el-radio :label="true">特殊设置</el-radio>
@@ -475,8 +475,8 @@
               <el-row>
                 <el-form-item label="收卷设置">
                   <el-radio-group
-                    class="pull_right_sm"
                     v-model="editStageForm.submitType"
+                    class="pull_right_sm"
                   >
                     <el-radio label="NORMAL">正常交卷</el-radio>
                     <el-radio label="TIMING_END">定点交卷</el-radio>
@@ -486,8 +486,8 @@
               <el-row v-if="editStageForm.submitType == 'TIMING_END'">
                 <el-form-item label="统一交卷时间" prop="submitDuration">
                   <el-input
-                    class="input_width_lg"
                     v-model="editStageForm.submitDuration"
+                    class="input_width_lg"
                     maxlength="10"
                     @keyup.native="handleSubmitDuration4editStage"
                   >
@@ -511,19 +511,19 @@
           :visible.sync="editStageCommonSettingVisible"
         >
           <el-form
+            ref="editStageCommonSettingForm"
             :inline="true"
             :inline-message="false"
             :model="editStageCommonSettingForm"
             :rules="commonSettingRules"
-            ref="editStageCommonSettingForm"
             label-position="right"
             label-width="120px"
           >
             <el-row>
               <el-form-item label="考试ID">
                 <el-input
-                  class="input_width_lg"
                   v-model="editStageCommonSettingForm.examId"
+                  class="input_width_lg"
                   :disabled="true"
                 />
               </el-form-item>
@@ -531,8 +531,8 @@
             <el-row>
               <el-form-item label="考试名称">
                 <el-input
-                  class="input_width_lg"
                   v-model="editStageCommonSettingForm.examName"
+                  class="input_width_lg"
                   :disabled="true"
                 />
               </el-form-item>
@@ -540,8 +540,8 @@
             <el-row>
               <el-form-item label="收卷设置" prop="submitType">
                 <el-radio-group
-                  class="pull_right_sm"
                   v-model="editStageCommonSettingForm.submitType"
+                  class="pull_right_sm"
                 >
                   <el-radio label="NORMAL">正常交卷</el-radio>
                   <el-radio label="TIMING_END">定点交卷</el-radio>
@@ -553,8 +553,8 @@
             >
               <el-form-item label="统一交卷时间" prop="submitDuration">
                 <el-input
-                  class="input_width_lg"
                   v-model="editStageCommonSettingForm.submitDuration"
+                  class="input_width_lg"
                   maxlength="10"
                   @keyup.native="handleSubmitDuration"
                 >
@@ -585,9 +585,9 @@ import moment from "moment";
 
 let _this = null;
 export default {
-  name: "stageSpecialSettings",
+  name: "StageSpecialSettings",
   components: {
-    LinkTitlesCustom
+    LinkTitlesCustom,
   },
   data() {
     let validateExamDatetimeRange = (rule, value, callback) => {
@@ -616,7 +616,7 @@ export default {
         startTime: null,
         endTime: null,
         stageOrder: "",
-        enable: true
+        enable: true,
       },
       addStageForm: {
         timeRange0: [],
@@ -626,9 +626,9 @@ export default {
         num2: 1,
         addTimeRangeArr2: [
           {
-            timeRange: ["", ""]
-          }
-        ]
+            timeRange: ["", ""],
+          },
+        ],
       },
       editStageForm: {
         id: null,
@@ -637,87 +637,96 @@ export default {
         endTime: null,
         specialSetting: false,
         submitType: "NORMAL",
-        submitDuration: 0
+        submitDuration: 0,
       },
       editStageCommonSettingForm: {
         id: null,
         examId: null,
         examName: "",
         submitType: "NORMAL",
-        submitDuration: 0
+        submitDuration: 0,
       },
       addStageRules: {
         startTime: [
           {
             required: true,
             message: "开始时间不允许为空",
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         endTime: [
           {
             required: true,
             message: "结束时间不允许为空",
-            trigger: "blur"
-          }
-        ]
+            trigger: "blur",
+          },
+        ],
       },
       editStageRules: {
         startExamDatetimeRange2Edit: [
           {
             required: true,
             validator: validateExamDatetimeRange,
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         submitDuration: [
           {
             required: true,
             trigger: "blur",
-            message: "定点交卷时长不允许为空"
-          }
-        ]
+            message: "定点交卷时长不允许为空",
+          },
+        ],
       },
       commonSettingRules: {
         submitType: [
           {
             required: true,
             trigger: "change",
-            message: "请选择交卷类型"
-          }
+            message: "请选择交卷类型",
+          },
         ],
         submitDuration: [
           {
             required: true,
             trigger: "blur",
-            message: "定点交卷时长不允许为空"
-          }
-        ]
+            message: "定点交卷时长不允许为空",
+          },
+        ],
       },
       tableData: [],
       currentPage: 1,
       pageSize: 10,
-      total: 10
+      total: 10,
     };
   },
   computed: {
-    ...mapState({ user: state => state.user }),
+    ...mapState({ user: (state) => state.user }),
     isSuperAdmin() {
-      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
+      return this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN");
     },
     noBatchSelected() {
       return this.selectedExamStageIds.length === 0;
-    }
+    },
+  },
+  //初始化查询
+  async created() {
+    this.formSearch.examId = this.$route.params.id;
+    await this.getExamDetail(this.formSearch.examId);
+    this.examName = this.$route.params.examName;
+    this.examTypeName = this.$route.params.examTypeName;
+    this.searchForm();
+    _this = this;
   },
   methods: {
     repeatDatePickOptions() {
       return {
-        disabledDate: time => {
+        disabledDate: (time) => {
           return !moment(time).isBetween(
             moment(this.exam.beginTime),
             moment(this.exam.endTime)
           );
-        }
+        },
       };
     },
     handleSubmitDuration() {
@@ -745,9 +754,9 @@ export default {
         num2: 1,
         addTimeRangeArr2: [
           {
-            timeRange: ["", ""]
-          }
-        ]
+            timeRange: ["", ""],
+          },
+        ],
       };
     },
     handleCommonSetting() {
@@ -758,7 +767,7 @@ export default {
       var url = EXAM_WORK_API + "/examStage/getExamStageSetting";
       this.$httpWithMsg
         .get(url, { params: this.formSearch })
-        .then(response => {
+        .then((response) => {
           if (response.data) {
             this.editStageCommonSettingForm.id = response.data.id;
             this.editStageCommonSettingForm.submitType =
@@ -788,7 +797,7 @@ export default {
         {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "error"
+          type: "error",
         }
       ).then(() => {
         var url =
@@ -798,7 +807,7 @@ export default {
         this.$httpWithMsg.delete(url, {}).then(() => {
           this.$notify({
             type: "success",
-            message: "操作成功!"
+            message: "操作成功!",
           });
           this.searchForm();
         });
@@ -834,11 +843,11 @@ export default {
 
           if (ct == "simple") {
             addTimeRangeArr.push({
-              timeRange: []
+              timeRange: [],
             });
           } else {
             addTimeRangeArr.push({
-              timeRange: ["", ""]
+              timeRange: ["", ""],
             });
           }
         }
@@ -897,17 +906,17 @@ export default {
       this.$confirm(confirmMsg, "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "error"
+        type: "error",
       }).then(() => {
         let url = EXAM_WORK_API + "/examStage/modifyStageEnable";
         let param = new URLSearchParams({
           examStageIds: [row.id],
-          enable: enable
+          enable: enable,
         });
         this.$httpWithMsg.put(url, param).then(() => {
           this.$notify({
             type: "success",
-            message: "操作成功!"
+            message: "操作成功!",
           });
           this.searchForm();
         });
@@ -924,17 +933,17 @@ export default {
       this.$confirm(confirmMsg, "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "error"
+        type: "error",
       }).then(() => {
         let url = EXAM_WORK_API + "/examStage/modifyStageEnable";
         let param = new URLSearchParams({
           examStageIds: this.selectedExamStageIds,
-          enable: enable
+          enable: enable,
         });
         this.$httpWithMsg.put(url, param).then(() => {
           this.$notify({
             type: "success",
-            message: "操作成功!"
+            message: "操作成功!",
           });
           this.searchForm();
         });
@@ -965,7 +974,7 @@ export default {
             this.$notify({
               showClose: true,
               message: "日期范围不允许为空",
-              type: "error"
+              type: "error",
             });
             return;
           }
@@ -975,7 +984,7 @@ export default {
             examId: this.formSearch.examId,
             stageOrder: i + 1,
             startTime: startTime,
-            endTime: endTime
+            endTime: endTime,
           });
         }
       } else {
@@ -983,20 +992,20 @@ export default {
           this.$notify({
             showClose: true,
             message: "日期范围不允许为空",
-            type: "error"
+            type: "error",
           });
           return;
         }
 
         if (
           this.addStageForm.addTimeRangeArr2.some(
-            p => p.timeRange == null || p.timeRange.some(t => t == "")
+            (p) => p.timeRange == null || p.timeRange.some((t) => t == "")
           )
         ) {
           this.$notify({
             showClose: true,
             message: "时间段不允许为空",
-            type: "error"
+            type: "error",
           });
           return;
         }
@@ -1017,7 +1026,7 @@ export default {
               examId: this.formSearch.examId,
               stageOrder: order,
               startTime: st,
-              endTime: et
+              endTime: et,
             });
           }
         }
@@ -1031,31 +1040,31 @@ export default {
             title: "提示",
             message: "保存成功",
             type: "success",
-            duration: 2000
+            duration: 2000,
           });
           this.addStageVisible = false;
           this.searchForm();
         })
-        .catch(e => {
+        .catch((e) => {
           let response = e.response;
           if (response.status == 500) {
             this.$notify({
               showClose: true,
               message: response.data.desc,
-              type: "error"
+              type: "error",
             });
           }
         });
     },
     saveEditStage() {
       var url = EXAM_WORK_API + "/examStage/modifyStage";
-      this.$refs.editStageForm.validate(valid => {
+      this.$refs.editStageForm.validate((valid) => {
         if (valid) {
           let param = new URLSearchParams(this.editStageForm);
           this.$httpWithMsg.put(url, param).then(() => {
             this.$notify({
               type: "success",
-              message: "保存成功"
+              message: "保存成功",
             });
             this.editStageVisible = false;
             this.searchForm();
@@ -1067,14 +1076,14 @@ export default {
     },
     saveEditStageCommonSetting() {
       var url = EXAM_WORK_API + "/examStage/saveStageSetting";
-      this.$refs.editStageCommonSettingForm.validate(valid => {
+      this.$refs.editStageCommonSettingForm.validate((valid) => {
         if (valid) {
           this.$httpWithMsg
             .post(url, this.editStageCommonSettingForm)
             .then(() => {
               this.$notify({
                 type: "success",
-                message: "保存成功"
+                message: "保存成功",
               });
               this.searchForm();
               this.editStageCommonSettingVisible = false;
@@ -1114,12 +1123,12 @@ export default {
         this.pageSize;
       this.$httpWithMsg
         .get(url, { params: temParams })
-        .then(response => {
+        .then((response) => {
           this.tableData = response.data.list;
           this.total = response.data.total;
           this.loading = false;
 
-          this.$nextTick(function() {
+          this.$nextTick(function () {
             this.paginationShow = true;
           });
         })
@@ -1146,20 +1155,11 @@ export default {
     },
     async getExamDetail(examId) {
       let url = EXAM_WORK_API + "/exam/" + examId;
-      return this.$httpWithMsg.get(url).then(response => {
+      return this.$httpWithMsg.get(url).then((response) => {
         this.exam = response.data;
       });
-    }
+    },
   },
-  //初始化查询
-  async created() {
-    this.formSearch.examId = this.$route.params.id;
-    await this.getExamDetail(this.formSearch.examId);
-    this.examName = this.$route.params.examName;
-    this.examTypeName = this.$route.params.examTypeName;
-    this.searchForm();
-    _this = this;
-  }
 };
 </script>
 

+ 132 - 132
src/modules/examwork/view/student.vue

@@ -4,9 +4,9 @@
       <!-- 正文信息 -->
       <div class="box-body">
         <el-form
+          ref="formSearch"
           :model="formSearch"
           :inline="true"
-          ref="formSearch"
           label-width="70px"
         >
           <el-form-item v-if="isSuperAdmin" label="学校">
@@ -18,50 +18,50 @@
             >
               <el-option
                 v-for="item in rootOrgList"
+                :key="item.id"
                 :label="item.name"
                 :value="item.id"
-                :key="item.id"
               ></el-option>
             </el-select>
           </el-form-item>
           <el-form-item label="姓名">
             <el-input
-              placeholder="请输入姓名"
               v-model="formSearch.name"
+              placeholder="请输入姓名"
               class="input"
             ></el-input>
           </el-form-item>
           <el-form-item label="学号">
             <el-input
-              placeholder="请输入学号"
               v-model="formSearch.studentCode"
+              placeholder="请输入学号"
               class="input"
             ></el-input>
           </el-form-item>
           <el-form-item label="身份证">
             <el-input
-              placeholder="请输入身份证"
               v-model="formSearch.identityNumber"
+              placeholder="请输入身份证"
               class="input"
             ></el-input>
           </el-form-item>
           <el-form-item label="学习中心">
             <el-select
+              v-model="formSearch.orgId"
               class="input"
               :remote-method="getOrgList4Search"
               :loading="getOrgList4SearchLoading"
               remote
               filterable
               clearable
-              v-model="formSearch.orgId"
               placeholder="请选择"
               :disabled="pureLC"
             >
               <el-option
                 v-for="item in orgList4Search"
+                :key="item.id"
                 :label="item.name + ' - ' + item.code"
                 :value="item.id"
-                :key="item.id"
               ></el-option>
             </el-select>
           </el-form-item>
@@ -153,7 +153,7 @@
           >重置学习中心所有学生密码</el-button
         >
 
-        <div style="width: 100%; margin-bottom: 10px;"></div>
+        <div style="width: 100%; margin-bottom: 10px"></div>
 
         <!-- 重置学习中心所有学生密码-->
         <el-dialog
@@ -162,34 +162,34 @@
           :visible.sync="resetPasswordByOrgIdDialog"
         >
           <el-form
+            ref="resetPasswordByOrgIdForm"
             :model="resetPasswordByOrgIdForm"
             :inline="true"
-            ref="resetPasswordByOrgIdForm"
             label-width="80px"
             :rules="resetPasswordByOrgIdRules"
           >
             <el-form-item label="学习中心" prop="orgId">
               <el-select
+                v-model="resetPasswordByOrgIdForm.orgId"
                 class="input"
                 :remote-method="getOrgList4RestPassword"
                 :loading="getOrgList4RestPasswordLoading"
                 remote
                 filterable
                 clearable
-                v-model="resetPasswordByOrgIdForm.orgId"
                 placeholder="请选择"
                 :disabled="pureLC"
               >
                 <el-option
                   v-for="item in orgList4RestPassword"
+                  :key="item.id"
                   :label="item.name + ' - ' + item.code"
                   :value="item.id"
-                  :key="item.id"
                 ></el-option>
               </el-select>
             </el-form-item>
           </el-form>
-          <div style="text-align: center; margin-top: 20px;">
+          <div style="text-align: center; margin-top: 20px">
             <el-button type="primary" @click="submitResetPasswordByOrgId"
               >确 定</el-button
             >
@@ -203,7 +203,7 @@
         <el-table
           :data="tableData"
           border
-          style="width: 100%; text-align: center;"
+          style="width: 100%; text-align: center"
           @selection-change="selectChange"
         >
           <el-table-column type="selection" width="50"></el-table-column>
@@ -216,52 +216,52 @@
           <el-table-column label="考生" width="100">
             <template slot-scope="scope">
               <el-popover trigger="hover" placement="left">
-                <div style="font-size: 18px; font-family: 新宋体;">
+                <div style="font-size: 18px; font-family: 新宋体">
                   <tr>
-                    <td style="color: green;">姓名</td>
-                    <td style="color: purple; padding-left: 20px;">
+                    <td style="color: green">姓名</td>
+                    <td style="color: purple; padding-left: 20px">
                       {{ scope.row.name }}
                     </td>
                   </tr>
                   <tr>
-                    <td style="color: green;">身份证号</td>
-                    <td style="color: purple; padding-left: 20px;">
+                    <td style="color: green">身份证号</td>
+                    <td style="color: purple; padding-left: 20px">
                       {{ scope.row.privateIdentityNumber }}
                     </td>
                   </tr>
                   <tr>
-                    <td style="color: green;">学号</td>
-                    <td style="color: purple; padding-left: 20px;">
+                    <td style="color: green">学号</td>
+                    <td style="color: purple; padding-left: 20px">
                       {{ scope.row.studentCodeList }}
                     </td>
                   </tr>
                   <tr>
-                    <td style="color: green;">学习中心名称</td>
-                    <td style="color: purple; padding-left: 20px;">
+                    <td style="color: green">学习中心名称</td>
+                    <td style="color: purple; padding-left: 20px">
                       {{ scope.row.orgName }}
                     </td>
                   </tr>
                   <tr>
-                    <td style="color: green;">学习中心编码</td>
-                    <td style="color: purple; padding-left: 20px;">
+                    <td style="color: green">学习中心编码</td>
+                    <td style="color: purple; padding-left: 20px">
                       {{ scope.row.orgCode }}
                     </td>
                   </tr>
                   <tr>
-                    <td style="color: green;">手机号</td>
-                    <td style="color: purple; padding-left: 20px;">
+                    <td style="color: green">手机号</td>
+                    <td style="color: purple; padding-left: 20px">
                       {{ scope.row.phoneNumber }}
                     </td>
                   </tr>
                   <tr>
-                    <td style="color: green;">安全手机号</td>
-                    <td style="color: purple; padding-left: 20px;">
+                    <td style="color: green">安全手机号</td>
+                    <td style="color: purple; padding-left: 20px">
                       {{ scope.row.securityPhone }}
                     </td>
                   </tr>
                   <tr>
-                    <td style="color: green;">创建时间</td>
-                    <td style="color: purple; padding-left: 20px;">
+                    <td style="color: green">创建时间</td>
+                    <td style="color: purple; padding-left: 20px">
                       {{ scope.row.creationTime }}
                     </td>
                   </tr>
@@ -290,7 +290,7 @@
           ></el-table-column>
           <el-table-column width="168" label="更新时间" sortable>
             <template slot-scope="scope">
-              <el-button @click="gotoOperateLog(scope.row.id)" type="text">{{
+              <el-button type="text" @click="gotoOperateLog(scope.row.id)">{{
                 scope.row.updateTime
               }}</el-button>
             </template>
@@ -304,7 +304,7 @@
                   content="启用"
                   placement="left"
                 >
-                  <i class="el-icon-success" style="color: green;"></i>
+                  <i class="el-icon-success" style="color: green"></i>
                 </el-tooltip>
               </span>
               <span v-else>
@@ -314,7 +314,7 @@
                   content="禁用"
                   placement="left"
                 >
-                  <i class="el-icon-error" style="color: red;"></i>
+                  <i class="el-icon-error" style="color: red"></i>
                 </el-tooltip>
               </span>
             </span>
@@ -333,8 +333,8 @@
               <el-button
                 v-if="
                   null != scope.row.enable &&
-                    !scope.row.enable &&
-                    rolePrivileges.change_student_availability
+                  !scope.row.enable &&
+                  rolePrivileges.change_student_availability
                 "
                 size="mini"
                 type="primary"
@@ -352,7 +352,7 @@
                 >禁用</el-button
               >
 
-              <el-dropdown style="margin-left: 10px;">
+              <el-dropdown style="margin-left: 10px">
                 <el-button type="primary" plain size="mini">
                   更多
                   <i class="el-icon-arrow-down el-icon--right"></i>
@@ -403,13 +403,13 @@
         </el-table>
         <div class="page pull-right">
           <el-pagination
-            @current-change="handleCurrentChange"
             :current-page="currentPage"
             :page-size="pageSize"
             :page-sizes="[10, 20, 50, 100, 200, 300]"
-            @size-change="handleSizeChange"
             layout="total, sizes, prev, pager, next, jumper"
             :total="total"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
           ></el-pagination>
         </div>
 
@@ -422,7 +422,7 @@
           <el-table
             :data="unbindStudentCodeData.tableData"
             border
-            style="width: 100%; text-align: center;"
+            style="width: 100%; text-align: center"
           >
             <el-table-column prop="name" label="姓名" />
             <el-table-column prop="identityNumber" label="身份证" />
@@ -432,8 +432,8 @@
                 <el-button
                   size="mini"
                   type="danger"
-                  @click="unbindStudentCode(scope.row)"
                   icon="el-icon-delete"
+                  @click="unbindStudentCode(scope.row)"
                   >解绑</el-button
                 >
               </div>
@@ -443,10 +443,10 @@
 
         <!-- 考试记录 -->
         <el-dialog
+          v-loading="stuExamLoading"
           title="学生考试记录"
           width="60%"
           :visible.sync="stuExamDialog"
-          v-loading="stuExamLoading"
           element-loading-text="拼命加载中"
         >
           <el-form
@@ -457,26 +457,27 @@
           >
             <el-form-item label="考试" class="pull-left">
               <el-select
+                v-model="stuExamSearch.examId"
                 class="input"
                 :remote-method="queryExams4Search"
                 remote
                 :loading="queryExams4SearchLoading"
                 filterable
                 clearable
-                v-model="stuExamSearch.examId"
                 placeholder="请选择"
                 @change="handleExamChange4Search"
               >
                 <el-option
                   v-for="item in examList4Search"
+                  :key="item.id"
                   :label="item.name"
                   :value="item.id"
-                  :key="item.id"
                 ></el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="场次" class="pull-left">
               <el-select
+                v-model="stuExamSearch.examStageId"
                 clearable
                 :disabled="examStageDisabled4Search"
                 class="input"
@@ -484,14 +485,13 @@
                 remote
                 :loading="queryExamStages4SearchLoading"
                 :filterable="true"
-                v-model="stuExamSearch.examStageId"
                 placeholder="请选择"
               >
                 <el-option
                   v-for="item in examStageList4Search"
+                  :key="item.id"
                   :label="item.stageOrder"
                   :value="item.id"
-                  :key="item.id"
                 ></el-option>
               </el-select>
             </el-form-item>
@@ -509,7 +509,7 @@
           <el-table
             :data="stuExamList"
             border
-            style="width: 100%; text-align: center;"
+            style="width: 100%; text-align: center"
           >
             <el-table-column
               prop="studentName"
@@ -544,16 +544,16 @@
           </el-table>
           <div class="page pull-right">
             <el-pagination
-              @current-change="stuExamCurChange"
               :current-page="stuExamCurPage"
               :page-size="stuExamPageSize"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
-              @size-change="handleStuExamSizeChange"
               layout="total, sizes, prev, pager, next, jumper"
               :total="stuExamTotal"
+              @current-change="stuExamCurChange"
+              @size-change="handleStuExamSizeChange"
             ></el-pagination>
           </div>
-          <div style="margin-top: 10px;"></div>
+          <div style="margin-top: 10px"></div>
         </el-dialog>
 
         <!-- 导入照片弹窗 -->
@@ -564,10 +564,10 @@
         >
           <el-form>
             <el-row>
-              <el-form-item style="margin-left: 30px;">
+              <el-form-item style="margin-left: 30px">
                 <el-upload
-                  class="form_left"
                   ref="upload"
+                  class="form_left"
                   list-type="picture"
                   :action="uploadAction"
                   :headers="uploadHeaders"
@@ -581,15 +581,15 @@
                   :multiple="false"
                 >
                   <el-button
-                    size="small"
                     slot="trigger"
+                    size="small"
                     type="primary"
                     icon="el-icon-search"
                     >选择文件</el-button
                   >
                   <el-button
                     size="small"
-                    style="margin-left: 10px;"
+                    style="margin-left: 10px"
                     type="primary"
                     icon="el-icon-check"
                     @click="submitUpload"
@@ -607,19 +607,19 @@
         <!--查看照片-->
         <el-dialog
           title="照片"
-          @close="closePhotoDialog"
           :visible.sync="photoDialog"
           width="300px"
           :center="true"
+          @close="closePhotoDialog"
         >
           <img :src="photo.url" height="100%" width="100%" />
         </el-dialog>
 
         <el-dialog
+          v-loading="studentLog.loading"
           title="学生日志"
           width="60%"
           :visible.sync="stuLogDialog"
-          v-loading="studentLog.loading"
           :close-on-click-modal="false"
           element-loading-text="拼命加载中"
         >
@@ -627,15 +627,15 @@
           <el-form inline :model="studentLog.formSearch">
             <el-form-item label="操作内容">
               <el-input
-                placeholder="请输入操作内容"
                 v-model="studentLog.formSearch.operate"
-                style="width: 180px;"
+                placeholder="请输入操作内容"
+                style="width: 180px"
               />
             </el-form-item>
             <el-form-item label="操作时间">
               <el-date-picker
-                class="input"
                 v-model="studentLog.timeRange"
+                class="input"
                 type="datetimerange"
                 start-placeholder="开始日期"
                 range-separator="至"
@@ -664,7 +664,7 @@
             border
             resizable
             stripe
-            style="width: 100%;"
+            style="width: 100%"
           >
             <el-table-column
               width="200"
@@ -686,13 +686,13 @@
           <div class="page pull-right">
             <el-pagination
               v-if="studentLog.paginationShow"
-              @current-change="loghandleCurrentChange"
               :current-page="studentLog.currentPage"
               :page-size="studentLog.pageSize"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
-              @size-change="loghandleSizeChange"
               layout="total, sizes, prev, pager, next, jumper"
               :total="studentLog.total"
+              @current-change="loghandleCurrentChange"
+              @size-change="loghandleSizeChange"
             />
           </div>
         </el-dialog>
@@ -706,7 +706,7 @@ import {
   CORE_API,
   EXAM_WORK_API,
   EXCHANGE_API,
-  REPORTS_API
+  REPORTS_API,
 } from "@/constants/constants.js";
 import { mapState } from "vuex";
 
@@ -719,7 +719,7 @@ export default {
         reset_student_password: false,
         change_student_availability: false,
         unbind_student_code: false,
-        unbind_security_phone: false
+        unbind_security_phone: false,
       },
       rootOrgList: null,
       stuExamLoading: false,
@@ -734,7 +734,7 @@ export default {
       getOrgList4RestPasswordLoading: false,
       resetPasswordByOrgIdDialog: false,
       resetPasswordByOrgIdForm: {
-        orgId: ""
+        orgId: "",
       },
       formSearch: {
         orgId: "",
@@ -743,18 +743,18 @@ export default {
         studentCode: "",
         identityNumber: "",
         enable: "UNDEFINED",
-        hasPhoto: "UNDEFINED"
+        hasPhoto: "UNDEFINED",
       },
       selectedStuIds: [],
       statusList: [
         {
           value: true,
-          label: "启用"
+          label: "启用",
         },
         {
           value: false,
-          label: "禁用"
-        }
+          label: "禁用",
+        },
       ],
 
       tableData: [],
@@ -767,7 +767,7 @@ export default {
 
       unbindStudentCodeDialog: false,
       unbindStudentCodeData: {
-        tableData: []
+        tableData: [],
       },
 
       errMessages: [],
@@ -797,7 +797,7 @@ export default {
         courseName: "",
         infoCollector: "",
         identityNumber: "",
-        identityNumberLike: false
+        identityNumberLike: false,
       },
       resetPasswordByOrgIdRules: {
         orgId: [
@@ -805,9 +805,9 @@ export default {
             type: "number",
             required: true,
             message: "请选择学习中心",
-            trigger: "change"
-          }
-        ]
+            trigger: "change",
+          },
+        ],
       },
       examStageDisabled4Search: true,
       queryExamStages4SearchLoading: false,
@@ -820,17 +820,17 @@ export default {
           operate: null,
           studentId: "",
           startTime: null,
-          endTime: null
+          endTime: null,
         },
         tableData: [],
         currentPage: 1,
         pageSize: 10,
-        total: 10
-      }
+        total: 10,
+      },
     };
   },
   computed: {
-    ...mapState({ user: state => state.user }),
+    ...mapState({ user: (state) => state.user }),
     stuIds() {
       var stuIds = "";
       for (let stuId of this.selectedStuIds) {
@@ -846,8 +846,15 @@ export default {
       return this.selectedStuIds.length === 0;
     },
     isSuperAdmin() {
-      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
-    }
+      return this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN");
+    },
+  },
+  created() {
+    this.init();
+    this.uploadHeaders = {
+      key: this.user.key,
+      token: this.user.token,
+    };
   },
   methods: {
     gotoOperateLog(studentId) {
@@ -895,12 +902,12 @@ export default {
         this.studentLog.pageSize;
       this.$httpWithMsg
         .get(url, { params: this.studentLog.formSearch })
-        .then(response => {
+        .then((response) => {
           this.studentLog.tableData = response.data.list;
           this.studentLog.total = response.data.total;
           this.studentLog.loading = false;
 
-          this.$nextTick(function() {
+          this.$nextTick(function () {
             this.studentLog.paginationShow = true;
           });
         })
@@ -911,7 +918,7 @@ export default {
       this.resetPasswordByOrgIdForm.orgId = null;
       if (this.pureLC) {
         this.orgList4RestPassword = [
-          { id: this.lc_id, name: this.lc_name, code: this.lc_code }
+          { id: this.lc_id, name: this.lc_name, code: this.lc_code },
         ];
         this.resetPasswordByOrgIdForm.orgId = this.lc_id;
       } else {
@@ -920,17 +927,17 @@ export default {
       this.resetPasswordByOrgIdDialog = true;
     },
     submitResetPasswordByOrgId() {
-      this.$refs.resetPasswordByOrgIdForm.validate(valid => {
+      this.$refs.resetPasswordByOrgIdForm.validate((valid) => {
         if (valid) {
           var url =
             CORE_API +
             "/student/resetPasswordByOrgId/" +
             this.resetPasswordByOrgIdForm.orgId;
-          this.$httpWithMsg.put(url).then(response => {
+          this.$httpWithMsg.put(url).then((response) => {
             console.log(response);
             this.$notify({
               type: "success",
-              message: "重置密码成功"
+              message: "重置密码成功",
             });
             this.searchForm();
             this.resetPasswordByOrgIdDialog = false;
@@ -953,11 +960,11 @@ export default {
         orgName;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           this.getOrgList4SearchLoading = false;
           this.orgList4Search = response.data;
         })
-        .catch(response => {
+        .catch((response) => {
           console.log(response);
           this.getOrgList4SearchLoading = false;
         });
@@ -972,11 +979,11 @@ export default {
         orgName;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           this.getOrgList4RestPasswordLoading = false;
           this.orgList4RestPassword = response.data;
         })
-        .catch(response => {
+        .catch((response) => {
           console.log(response);
           this.getOrgList4RestPasswordLoading = false;
         });
@@ -991,7 +998,7 @@ export default {
       }
       this.$httpWithMsg
         .get(EXAM_WORK_API + "/exam/queryByNameLike?enable=true&name=" + name)
-        .then(response => {
+        .then((response) => {
           if ("search" == where) {
             this.queryExams4SearchLoading = false;
             this.examList4Search = response.data;
@@ -1030,12 +1037,12 @@ export default {
         param;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           this.stuExamList = response.data.list;
           this.stuExamTotal = response.data.total;
           this.stuExamLoading = false;
         })
-        .catch(function(response) {
+        .catch(function (response) {
           console.log(response);
           this.stuExamLoading = false;
         });
@@ -1060,7 +1067,7 @@ export default {
         this.$notify({
           showClose: true,
           message: "未上传照片",
-          type: "error"
+          type: "error",
         });
       }
     },
@@ -1109,7 +1116,7 @@ export default {
         this.pageSize +
         "?" +
         param;
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         this.tableData = response.data.list;
         this.total = response.data.total;
       });
@@ -1133,7 +1140,7 @@ export default {
         if (this.stuIds.length == 0) {
           this.$notify({
             type: "warning",
-            message: "请选择学生"
+            message: "请选择学生",
           });
           return "";
         } else {
@@ -1148,7 +1155,7 @@ export default {
           studentCode: cur,
           rootOrgId: row.rootOrgId,
           name: row.name,
-          identityNumber: row.identityNumber
+          identityNumber: row.identityNumber,
         });
       }
       this.unbindStudentCodeDialog = true;
@@ -1156,15 +1163,15 @@ export default {
     unbindStudentCode(row) {
       var params = new URLSearchParams({
         studentCode: row.studentCode,
-        rootOrgId: row.rootOrgId
+        rootOrgId: row.rootOrgId,
       });
       this.$confirm("是否解绑学号?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         var url = CORE_API + "/student/unbindStudentCode?" + params;
-        this.$httpWithMsg.post(url).then(response => {
+        this.$httpWithMsg.post(url).then((response) => {
           console.log(response);
           let newTableData = [];
           for (let cur of this.unbindStudentCodeData.tableData) {
@@ -1175,7 +1182,7 @@ export default {
           this.unbindStudentCodeData.tableData = newTableData;
           this.$notify({
             type: "success",
-            message: "解绑成功"
+            message: "解绑成功",
           });
           this.searchForm();
         });
@@ -1187,14 +1194,14 @@ export default {
       this.$confirm("是否解绑安全手机号?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         var url = CORE_API + "/student/unbindSecurityPhone/" + stuIds;
-        this.$httpWithMsg.put(url).then(response => {
+        this.$httpWithMsg.put(url).then((response) => {
           console.log(response);
           this.$notify({
             type: "success",
-            message: "解绑成功"
+            message: "解绑成功",
           });
           this.searchForm();
         });
@@ -1207,14 +1214,14 @@ export default {
       this.$confirm("是否重置所选学生的密码?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         var url = CORE_API + "/student/resetPass/" + stuIds;
-        this.$httpWithMsg.put(url).then(response => {
+        this.$httpWithMsg.put(url).then((response) => {
           console.log(response);
           this.$notify({
             type: "success",
-            message: "重置密码成功"
+            message: "重置密码成功",
           });
           this.searchForm();
         });
@@ -1228,14 +1235,14 @@ export default {
       this.$confirm("是否禁用所选学生?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         var url = CORE_API + "/student/disable/" + stuIds;
-        this.$httpWithMsg.put(url).then(response => {
+        this.$httpWithMsg.put(url).then((response) => {
           console.log(response);
           this.$notify({
             type: "success",
-            message: "禁用成功"
+            message: "禁用成功",
           });
           this.searchForm();
         });
@@ -1249,14 +1256,14 @@ export default {
       this.$confirm("是否启用所选学生?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         var url = CORE_API + "/student/enable/" + stuIds;
-        this.$httpWithMsg.put(url).then(response => {
+        this.$httpWithMsg.put(url).then((response) => {
           console.log(response);
           this.$notify({
             type: "success",
-            message: "启用成功"
+            message: "启用成功",
           });
           this.searchForm();
         });
@@ -1277,7 +1284,7 @@ export default {
       console.log(fileList);
       this.$notify({
         message: "上传成功",
-        type: "success"
+        type: "success",
       });
       this.fileLoading = false;
       this.photoUploadDialog = false;
@@ -1291,7 +1298,7 @@ export default {
       if (response.status == 500) {
         this.$notify({
           message: json.desc,
-          type: "error"
+          type: "error",
         });
       }
       this.fileLoading = false;
@@ -1304,14 +1311,14 @@ export default {
       if (fileList.length == 0) {
         this.$notify({
           message: "上传文件不能为空",
-          type: "error"
+          type: "error",
         });
         return false;
       }
       if (fileList.length > 1) {
         this.$notify({
           message: "每次只能上传一个文件",
-          type: "error"
+          type: "error",
         });
         return false;
       }
@@ -1320,7 +1327,7 @@ export default {
         if (!f.endsWith(".jpg") && !f.endsWith(".png")) {
           this.$notify({
             message: "上传文件必须为jpg或者png格式",
-            type: "error"
+            type: "error",
           });
           this.initUpload();
           return false;
@@ -1347,7 +1354,7 @@ export default {
         Object.keys(this.rolePrivileges).toString()
       );
       let url = CORE_API + "/rolePrivilege/checkPrivileges?" + params;
-      this.$httpWithMsg.post(url).then(response => {
+      this.$httpWithMsg.post(url).then((response) => {
         this.rolePrivileges = response.data;
       });
     },
@@ -1367,13 +1374,13 @@ export default {
 
       if (this.pureLC) {
         let url = CORE_API + "/user/" + this.user.userId;
-        await this.$httpWithMsg.get(url).then(response => {
+        await this.$httpWithMsg.get(url).then((response) => {
           var userInfo = response.data;
           this.lc_id = userInfo.orgId;
           this.lc_name = userInfo.orgName;
           this.lc_code = userInfo.orgCode;
           this.orgList4Search = [
-            { id: this.lc_id, name: this.lc_name, code: this.lc_code }
+            { id: this.lc_id, name: this.lc_name, code: this.lc_code },
           ];
           this.formSearch.orgId = this.lc_id;
         });
@@ -1381,7 +1388,7 @@ export default {
 
       let url = CORE_API + "/org/getRootOrgList";
 
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         this.rootOrgList = response.data;
       });
 
@@ -1392,7 +1399,7 @@ export default {
     handleExamChange4Search(value) {
       this.stuExamSearch.examStageId = "";
       if (this.examList4Search.length > 0) {
-        let examArr = this.examList4Search.filter(p => p.id == value);
+        let examArr = this.examList4Search.filter((p) => p.id == value);
         if (examArr && examArr.length > 0) {
           let exam = examArr[0];
           if (
@@ -1422,7 +1429,7 @@ export default {
             "&enable=true&name=" +
             name
         )
-        .then(response => {
+        .then((response) => {
           if ("search" == where) {
             this.queryExamStages4SearchLoading = false;
             this.examStageList4Search = response.data;
@@ -1431,7 +1438,7 @@ export default {
             this.examStageList4InsertOrUpdate = response.data;
           }
         })
-        .catch(response => {
+        .catch((response) => {
           console.log(response);
           if ("search" == where) {
             this.queryExamStages4SearchLoading = false;
@@ -1439,15 +1446,8 @@ export default {
             this.queryExamStages4InsertOrUpdateLoading = false;
           }
         });
-    }
+    },
   },
-  created() {
-    this.init();
-    this.uploadHeaders = {
-      key: this.user.key,
-      token: this.user.token
-    };
-  }
 };
 </script>
 <style scoped>

+ 23 - 29
src/modules/examwork/view/studentSpecialSettings.vue

@@ -2,23 +2,23 @@
   <section class="content">
     <div class="box box-info">
       <div
-        class="box-body"
         v-loading.body="loading"
         v-loading.fullscreen="loading"
+        class="box-body"
         element-loading-text="请稍后..."
       >
         <!-- 表单 -->
         <el-form inline :model="formSearch">
           <el-form-item label="学生ID">
             <el-input
-              placeholder="学生ID"
               v-model="formSearch.studentId"
+              placeholder="学生ID"
             ></el-input>
           </el-form-item>
           <el-form-item label="身份证号">
             <el-input
-              placeholder="身份证号"
               v-model="formSearch.identityNumber"
+              placeholder="身份证号"
             ></el-input>
           </el-form-item>
           <el-form-item>
@@ -41,13 +41,7 @@
 
         <div class="block-seperator"></div>
         <!-- 页面列表 -->
-        <el-table
-          :data="tableData"
-          border
-          resizable
-          stripe
-          style="width: 100%;"
-        >
+        <el-table :data="tableData" border resizable stripe style="width: 100%">
           <el-table-column
             prop="studentId"
             width="180"
@@ -78,13 +72,13 @@
         <div class="page pull-right">
           <el-pagination
             v-if="paginationShow"
-            @current-change="handleCurrentChange"
             :current-page="currentPage"
             :page-size="pageSize"
             :page-sizes="[10, 20, 50, 100, 200, 300]"
-            @size-change="handleSizeChange"
             layout="total, sizes, prev, pager, next, jumper"
             :total="total"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
           />
         </div>
       </div>
@@ -104,29 +98,34 @@ export default {
       yesNoList: [
         {
           value: true,
-          label: "是"
+          label: "是",
         },
         {
           value: false,
-          label: "否"
-        }
+          label: "否",
+        },
       ],
       formSearch: {
         examId: null,
         studentId: null,
-        identityNumber: null
+        identityNumber: null,
       },
       tableData: [],
       currentPage: 1,
       pageSize: 10,
-      total: 10
+      total: 10,
     };
   },
   computed: {
-    ...mapState({ user: state => state.user }),
+    ...mapState({ user: (state) => state.user }),
     isSuperAdmin() {
-      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
-    }
+      return this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN");
+    },
+  },
+  //初始化查询
+  created() {
+    this.formSearch.examId = this.$route.params.id;
+    this.searchForm();
   },
   methods: {
     getYesNo(val) {
@@ -159,7 +158,7 @@ export default {
         this.$notify({
           title: "警告",
           message: "学生ID只能输入数字",
-          type: "warning"
+          type: "warning",
         });
         return false;
       }
@@ -176,23 +175,18 @@ export default {
         this.pageSize;
       this.$httpWithMsg
         .get(url, { params: temParams })
-        .then(response => {
+        .then((response) => {
           this.tableData = response.data.list;
           this.total = response.data.total;
           this.loading = false;
 
-          this.$nextTick(function() {
+          this.$nextTick(function () {
             this.paginationShow = true;
           });
         })
         .finally(() => (this.loading = false));
-    }
+    },
   },
-  //初始化查询
-  created() {
-    this.formSearch.examId = this.$route.params.id;
-    this.searchForm();
-  }
 };
 </script>
 

+ 27 - 27
src/modules/examwork/view/traditionExam.vue

@@ -1,16 +1,16 @@
 <template>
   <div>
     <LinkTitlesCustom
-      :currentPaths="['考试管理', '考试信息', '传统考试设置设置']"
+      :current-paths="['考试管理', '考试信息', '传统考试设置设置']"
     />
     <section class="content">
       <div class="box box-info">
         <!-- 正文信息 -->
         <div class="box-body">
           <el-form
+            ref="form"
             :inline="true"
             :rules="rules"
-            ref="form"
             :model="form"
             label-position="right"
             inline-message
@@ -22,12 +22,12 @@
               <el-button
                 type="primary"
                 size="small"
-                @click="back"
                 icon="el-icon-arrow-left"
+                @click="back"
                 >返 回</el-button
               >
             </div>
-            <el-tabs type="border-card" v-model="activeName">
+            <el-tabs v-model="activeName" type="border-card">
               <!-- 基础信息 -->
               <el-tab-pane label="基础信息" name="tab1">
                 <el-row v-if="examId != 'add'">
@@ -82,8 +82,8 @@
                     prop="name"
                   >
                     <el-input
-                      maxlength="20"
                       v-model="form.name"
+                      maxlength="20"
                       class="input"
                     ></el-input>
                   </el-form-item>
@@ -94,9 +94,9 @@
                     :label-width="style.label_width_tab1"
                   >
                     <el-select
+                      v-model="form.examType"
                       class="input"
                       :disabled="true"
-                      v-model="form.examType"
                       placeholder="请选择"
                     >
                       <el-option
@@ -127,8 +127,8 @@
                     :label-width="style.label_width_tab1"
                   >
                     <el-date-picker
-                      class="input"
                       v-model="examDatetimeRange"
+                      class="input"
                       type="datetimerange"
                       range-separator="至"
                       start-placeholder="开始日期"
@@ -196,7 +196,7 @@ export default {
   data() {
     return {
       style: {
-        label_width_tab1: "80px"
+        label_width_tab1: "80px",
       },
       activeName: "tab1",
       examDatetimeRange: [],
@@ -210,7 +210,7 @@ export default {
         endTime: null,
         duration: 120,
         enable: "true",
-        properties: {}
+        properties: {},
       },
       examTypeList: EXAM_TYPE,
       examId: "",
@@ -221,18 +221,23 @@ export default {
           {
             required: true,
             validator: validateExamDatetimeRange,
-            trigger: "blur"
-          }
-        ]
-      }
+            trigger: "blur",
+          },
+        ],
+      },
     };
   },
+  created() {
+    _this = this;
+    this.examId = this.$route.params.id;
+    this.init();
+  },
 
   methods: {
     init() {
       if (this.examId != "add") {
         let url = EXAM_WORK_API + "/exam/" + this.examId;
-        this.$httpWithMsg.get(url).then(response => {
+        this.$httpWithMsg.get(url).then((response) => {
           let body = response.data;
           body.properties = this.form.properties;
           this.form = Object.assign(this.form, response.data);
@@ -241,7 +246,7 @@ export default {
           console.log("getOnlineExam(); form: ", this.form);
 
           let url = EXAM_WORK_API + "/exam/allProperties/" + this.examId;
-          this.$httpWithMsg.get(url).then(response => {
+          this.$httpWithMsg.get(url).then((response) => {
             this.form.properties = Object.assign(
               this.form.properties,
               response.data
@@ -255,32 +260,32 @@ export default {
         this.show_ckeditor = true;
       }
     },
-    saveExam: function() {
+    saveExam: function () {
       this.form.beginTime = this.examDatetimeRange[0];
       this.form.endTime = this.examDatetimeRange[1];
       console.log(this.form);
       let url = EXAM_WORK_API + "/exam";
-      this.$refs.form.validate(valid => {
+      this.$refs.form.validate((valid) => {
         if (valid) {
           if (this.examId != "add") {
             this.$httpWithMsg.put(url, this.form).then(() => {
               this.$notify({
                 type: "success",
-                message: "保存成功"
+                message: "保存成功",
               });
             });
           } else {
             this.form.code = this.form.name;
-            this.$httpWithMsg.post(url, this.form).then(response => {
+            this.$httpWithMsg.post(url, this.form).then((response) => {
               console.log(response);
               this.$notify({
                 type: "success",
-                message: "新增成功"
+                message: "新增成功",
               });
               this.examId = response.data.id;
               this.form.id = this.examId;
               this.$router.push({
-                path: "/examwork/traditionExam/" + response.data.id
+                path: "/examwork/traditionExam/" + response.data.id,
               });
             });
           }
@@ -291,13 +296,8 @@ export default {
     },
     back() {
       this.$router.push({ path: "/examwork/examInfo" });
-    }
+    },
   },
-  created() {
-    _this = this;
-    this.examId = this.$route.params.id;
-    this.init();
-  }
 };
 </script>
 <style scoped>

+ 22 - 22
src/modules/marking/canvas/mark_sign.js

@@ -8,7 +8,7 @@ export function Drawing(canvas, option) {
   this.init(canvas, option);
 }
 Drawing.prototype = {
-  init: function(canvas, option) {
+  init: function (canvas, option) {
     typeof option == "object" ||
       (option = { score: 0, data: "", width: 500, height: 500, loc: [] });
     this.itemId = "";
@@ -22,24 +22,24 @@ Drawing.prototype = {
     this.bindEvent();
     this.drawHtml(option.data);
   },
-  setItemId: function(itemId) {
+  setItemId: function (itemId) {
     this.itemId = itemId;
   },
-  setPaperKey: function(paperKey) {
+  setPaperKey: function (paperKey) {
     this.paperKey = paperKey;
   },
-  setImg: function(imgSrc) {
+  setImg: function (imgSrc) {
     var img = new Image();
     img.src = imgSrc;
     this.img = img;
     this.drawImg();
   },
-  setHtml: function(html) {
+  setHtml: function (html) {
     this.clearDraw();
     this.option.data = html;
     this.drawHtml(this.option.data);
   },
-  setLocation: function(scoreLocs, type) {
+  setLocation: function (scoreLocs, type) {
     if (!scoreLocs) return;
     //初始化时从localStorage中获取
     if (type == "localStorage") {
@@ -50,68 +50,68 @@ Drawing.prototype = {
       this.drawScoreLoc(scoreLoc.loc);
     }
   },
-  getLocation: function(x, y) {
+  getLocation: function (x, y) {
     var bbox = this.canvas.getBoundingClientRect();
     return {
       x: (x - bbox.left) * (this.canvas.width / bbox.width),
-      y: (y - bbox.top) * (this.canvas.height / bbox.height)
+      y: (y - bbox.top) * (this.canvas.height / bbox.height),
     };
   },
-  drawHtml: function(data) {
+  drawHtml: function (data) {
     if (!data) return;
     var self = this;
     rasterizeHTML
       .drawHTML(data, this.canvas, {
         width: this.option.width,
-        height: this.option.height
+        height: this.option.height,
       })
-      .then(function(renderResult) {
+      .then(function (renderResult) {
         self.img = renderResult.image;
         self.context.drawImage(renderResult.image, 0, 0);
       });
   },
-  drawImg: function() {
+  drawImg: function () {
     this.context.drawImage(this.img, 0, 0);
   },
-  bindEvent: function() {
+  bindEvent: function () {
     var self = this;
     this.canvas.addEventListener(
       "click",
-      function(e) {
+      function (e) {
         var location = self.getLocation(e.clientX, e.clientY);
         self.onClick(location);
       },
       false
     );
   },
-  removeEvent: function() {
-    this.canvas.removeEventListener("click", function() {}, false);
+  removeEvent: function () {
+    this.canvas.removeEventListener("click", function () {}, false);
   },
-  ResetDrawAll: function() {
+  ResetDrawAll: function () {
     this.clearDraw();
     this.drawImg();
   },
-  clearDraw: function() {
+  clearDraw: function () {
     this.context.clearRect(0, 0, this.option.width, this.option.height);
   },
-  clearScoreLoc: function() {
+  clearScoreLoc: function () {
     this.scoreLoc.splice(0, this.scoreLoc.length);
   },
   drawScoreLoc(pos) {
     this.context.font = "48px serif";
     this.context.fillText(this.option.score, pos.x, pos.y);
   },
-  onClick: function(pos) {
+  onClick: function (pos) {
     var numReg = /^\d+$/;
     if (numReg.test(this.option.score)) {
       this.drawScoreLoc(pos);
       this.scoreLoc.push({
         loc: { x: pos.x, y: pos.y },
         score: this.option.score,
-        itemId: this.itemId
+        itemId: this.itemId,
       });
       //选中一次分数只能标记一次
       this.option.score = "";
     }
-  }
+  },
 };

+ 1 - 1
src/modules/marking/constants/constants.js

@@ -3,7 +3,7 @@ import Vue from "vue";
 export const LEVEL_TYPE = [
   { label: "专升本", value: "ZSB" },
   { label: "高起专", value: "GQZ" },
-  { label: "不限", value: "ALL" }
+  { label: "不限", value: "ALL" },
 ];
 
 export const EVENTHUB = new Vue();

+ 4 - 4
src/modules/marking/filters/filters.js

@@ -5,10 +5,10 @@ export const TAGS = [
   { label: "空白卷", value: "BLANK" },
   { label: "答非所问", value: "IRRELEVANT" },
   { label: "科目错误", value: "SUBJECT_ERROR" },
-  { label: "非手写", value: "QUESTIONABLE" }
+  { label: "非手写", value: "QUESTIONABLE" },
 ];
 //标记卷过滤器
-Vue.filter("tagFilter", function(val) {
+Vue.filter("tagFilter", function (val) {
   for (let tag of TAGS) {
     if (tag.value === val) {
       return tag.label;
@@ -21,10 +21,10 @@ export const EXAMTYPES = [
   { label: "离线考试", value: "OFFLINE" },
   { label: "传统考试", value: "TRADITION" },
   { label: "练习", value: "PRACTICE" },
-  { label: "在线作业", value: "ONLINE_HOMEWORK" }
+  { label: "在线作业", value: "ONLINE_HOMEWORK" },
 ];
 //考试类型过滤器
-Vue.filter("examTypeFilter", function(val) {
+Vue.filter("examTypeFilter", function (val) {
   for (let examType of EXAMTYPES) {
     if (examType.value === val) {
       return examType.label;

+ 15 - 15
src/modules/marking/routes/routes.js

@@ -20,58 +20,58 @@ export default [
     children: [
       {
         path: "tips", //模块说明
-        component: Tips
+        component: Tips,
       },
       {
         path: "mark_work_overview", //评卷进度
         meta: { privilegeCodes: "mark_process" },
-        component: MarkWorkOverview
+        component: MarkWorkOverview,
       },
       {
         path: "course_detail/:workId/:markWorkName/:courseCode/:courseName", //课程详情
-        component: CourseDetail
+        component: CourseDetail,
       },
       {
         path: "marker", //评卷员一览
         meta: { privilegeCodes: "mark_people" },
-        component: Marker
+        component: Marker,
       },
       {
         path: "marker_detail/:workId/:markerId/:userName", //评卷员详情
-        component: MarkerDetail
+        component: MarkerDetail,
       },
       {
         path: "mark_setting_main/:workId/:name", //评卷设置主页面
-        component: MarkSettingMain
+        component: MarkSettingMain,
       },
       {
         path: "mark_setting_fast/:workId/:name/:courseCode/:courseName", //评卷快速设置主页面
-        component: MarkSettingFast
+        component: MarkSettingFast,
       },
       {
         path: "mark_work", //评卷工作
         meta: { privilegeCodes: "create_marking_task" },
-        component: MarkWork
+        component: MarkWork,
       },
       {
         path: "mark_paper_check", //试卷检查
         meta: { privilegeCodes: "marking_check_menu2" },
-        component: MarkPaperCheck
+        component: MarkPaperCheck,
       },
       {
         path: "mark_setting_work/:type", //选择评卷工作
         meta: { privilegeCodes: "marking" },
-        component: MarkSettingWork
+        component: MarkSettingWork,
       },
       {
         path: "view_paper/:workId/:studentPaperId", //查看原卷
-        component: ViewPaper
-      }
-    ]
+        component: ViewPaper,
+      },
+    ],
   },
   {
     path: "/marking/:workId", //试卷正评
-    component: Marking
+    component: Marking,
   },
-  { path: "*", redirect: "/login" }
+  { path: "*", redirect: "/login" },
 ];

+ 21 - 21
src/modules/marking/views/CourseDetail.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <LinkTitlesCustom :currentPaths="['评卷总览', '评卷进度', '课程详情']" />
+    <LinkTitlesCustom :current-paths="['评卷总览', '评卷进度', '课程详情']" />
     <section class="content">
       <div class="box box-info">
         <div class="box-body">
@@ -12,14 +12,14 @@
           >
             <el-form-item label="登录名" class="pull-left">
               <el-input
-                placeholder="登录名"
                 v-model="formSearch.userLoginName"
+                placeholder="登录名"
               ></el-input>
             </el-form-item>
             <el-form-item label="姓名" class="pull-left">
               <el-input
-                placeholder="姓名"
                 v-model="formSearch.userName"
+                placeholder="姓名"
               ></el-input>
             </el-form-item>
             <el-form-item>
@@ -45,8 +45,8 @@
           <div class="block-seperator"></div>
           <!-- 页面列表 -->
           <el-table
-            stripe
             v-loading="loading"
+            stripe
             element-loading-text="拼命加载中"
             :data="tableData"
             border
@@ -97,13 +97,13 @@
           <div class="page pull-right">
             <el-pagination
               background
-              @current-change="handleSettingCurrentChange"
-              @size-change="handleSizeChange"
               :current-page="currentPage"
               :page-size="pageSize"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @current-change="handleSettingCurrentChange"
+              @size-change="handleSizeChange"
             ></el-pagination>
           </div>
         </div>
@@ -117,11 +117,14 @@ import { DATA_PROCESS_API } from "@/constants/constants";
 import { mapState } from "vuex";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
 export default {
+  components: {
+    LinkTitlesCustom,
+  },
   data() {
     return {
       formSearch: {
         userLoginName: "",
-        userName: ""
+        userName: "",
       },
       tableData: [],
       oldData: [],
@@ -130,11 +133,16 @@ export default {
       total: 10,
       loading: true,
       workId: "",
-      courseCode: ""
+      courseCode: "",
     };
   },
-  components: {
-    LinkTitlesCustom
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    this.workId = this.$route.params.workId;
+    this.courseCode = this.$route.params.courseCode;
+    this.initSetting();
   },
   methods: {
     handleSettingCurrentChange(val) {
@@ -170,7 +178,7 @@ export default {
             "&courseCode=" +
             this.courseCode
         )
-        .then(response => {
+        .then((response) => {
           console.log(response);
           this.tableData = response.data.content;
           this.total = response.data.totalElements;
@@ -192,7 +200,7 @@ export default {
             this.courseCode,
           { params: this.formSearch }
         )
-        .then(response => {
+        .then((response) => {
           console.log(response);
           this.tableData = response.data.content;
           this.total = response.data.totalElements;
@@ -211,16 +219,8 @@ export default {
       // this.$router.push({
       //   path: "/marking/mark_work_overview"
       // });
-    }
-  },
-  computed: {
-    ...mapState({ user: state => state.user })
+    },
   },
-  created() {
-    this.workId = this.$route.params.workId;
-    this.courseCode = this.$route.params.courseCode;
-    this.initSetting();
-  }
 };
 </script>
 <style lang="css" scoped>

+ 73 - 73
src/modules/marking/views/MarkPaperCheck.vue

@@ -4,135 +4,135 @@
       <div class="box box-info">
         <div class="box-body">
           <el-form
+            ref="formSearch"
             :inline="true"
             :model="formSearch"
-            ref="formSearch"
             label-width="70px"
           >
             <el-form-item label="评卷名称" prop="workId">
               <el-select
+                v-model="formSearch.workId"
                 clearable
                 filterable
                 class="input"
-                v-model="formSearch.workId"
                 placeholder="请选择"
-                style="width:150px;"
+                style="width: 150px"
                 @change="changeMarkWork"
                 @clear="resetForm"
               >
                 <el-option
                   v-for="item in markWorkSelect"
+                  :key="item.workId"
                   :label="item.markName"
                   :value="item.workId"
-                  :key="item.workId"
                 ></el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="学习中心" prop="orgCode">
               <el-select
+                v-model="formSearch.orgCode"
                 :remote-method="getOrgs"
                 remote
                 :loading="getOrgsSearchLoading"
                 class="input"
                 clearable
-                v-model="formSearch.orgCode"
                 placeholder="请选择"
                 filterable
-                style="width:150px;"
-                @focus="e => getOrgs(e.target.value)"
+                style="width: 150px"
+                @focus="(e) => getOrgs(e.target.value)"
               >
                 <el-option
                   v-for="item in orgList"
+                  :key="item.code"
                   :label="item.name"
                   :value="item.code"
-                  :key="item.code"
                 ></el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="姓名" prop="studentName">
               <el-input
-                placeholder="请输入姓名"
                 v-model="formSearch.studentName"
-                style="width:150px;"
+                placeholder="请输入姓名"
+                style="width: 150px"
               ></el-input>
             </el-form-item>
             <el-form-item label="学号" prop="studentCode">
               <el-input
-                placeholder="请输入学号"
                 v-model="formSearch.studentCode"
-                style="width:150px;"
+                placeholder="请输入学号"
+                style="width: 150px"
               ></el-input>
             </el-form-item>
             <el-form-item label="标记卷" prop="tag">
               <el-select
-                clearable
                 v-model="formSearch.tag"
+                clearable
                 placeholder="请选择"
                 filterable
-                style="width:150px;"
+                style="width: 150px"
               >
                 <el-option
                   v-for="item in tags"
+                  :key="item.code"
                   :label="item.name"
                   :value="item.code"
-                  :key="item.code"
                 ></el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="课程" prop="courseCode">
               <el-select
+                v-model="formSearch.courseCode"
                 clearable
                 filterable
                 class="input"
-                v-model="formSearch.courseCode"
                 placeholder="请选择"
-                style="width:150px;"
+                style="width: 150px"
               >
                 <el-option
                   v-for="item in courseAllListSelect"
+                  :key="item.code"
                   :label="item.courseInfo"
                   :value="item.code"
-                  :key="item.code"
                 ></el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="评委" prop="userId">
               <el-select
+                v-model="formSearch.userId"
                 clearable
                 filterable
                 class="input"
-                v-model="formSearch.userId"
                 placeholder="请选择"
-                style="width:150px;"
+                style="width: 150px"
               >
                 <el-option
                   v-for="item in userList"
+                  :key="item.userId"
                   :label="item.name"
                   :value="item.userId"
-                  :key="item.userId"
                 ></el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="评卷备注" prop="markRemark">
               <el-input
-                placeholder="请输入备注"
                 v-model="formSearch.markRemark"
-                style="width:150px;"
+                placeholder="请输入备注"
+                style="width: 150px"
               ></el-input>
             </el-form-item>
             <el-form-item label="试卷ID" prop="examRecordDataId">
               <el-input
-                placeholder="请输入试卷ID"
                 v-model="formSearch.examRecordDataId"
-                style="width:150px;"
+                placeholder="请输入试卷ID"
+                style="width: 150px"
                 maxlength="18"
               ></el-input>
             </el-form-item>
             <el-form-item label="身份证号" prop="identityNumber">
               <el-input
-                placeholder="请输入身份证号"
                 v-model="formSearch.identityNumber"
-                style="width:150px;"
+                placeholder="请输入身份证号"
+                style="width: 150px"
               ></el-input>
             </el-form-item>
             <div></div>
@@ -145,9 +145,9 @@
                 >查询</el-button
               >
               <el-button
-                @click="resetForm()"
                 size="small"
                 icon="el-icon-refresh"
+                @click="resetForm()"
                 >重置</el-button
               >
             </el-form-item>
@@ -163,11 +163,11 @@
             @click="bachBackRefresh"
             >打回
           </el-button>
-          <div style="width: 100%;margin-bottom: 10px;"></div>
+          <div style="width: 100%; margin-bottom: 10px"></div>
           <!-- 页面列表 -->
           <el-table
-            stripe
             v-loading="loading"
+            stripe
             element-loading-text="拼命加载中"
             :data="tableData"
             border
@@ -225,7 +225,7 @@
             <el-table-column label="评卷备注" width="120">
               <template slot-scope="scope">
                 <el-popover trigger="hover" name="text" placement="top">
-                  <div style="width:200px;">{{ scope.row.markRemark }}</div>
+                  <div style="width: 200px">{{ scope.row.markRemark }}</div>
                   <div slot="reference" class="interceptStr">
                     <span>{{ scope.row.markRemark }}</span>
                   </div>
@@ -235,18 +235,18 @@
             <el-table-column fixed="right" label="操作" width="180">
               <template slot-scope="scope">
                 <el-button
-                  @click="viewPaper(scope.row)"
                   type="primary"
                   size="mini"
                   icon="el-icon-view"
                   plain
+                  @click="viewPaper(scope.row)"
                   >原卷</el-button
                 >
                 <el-button
-                  @click="backRefresh(scope.row)"
                   type="danger"
                   icon="el-icon-arrow-left"
                   size="mini"
+                  @click="backRefresh(scope.row)"
                   >打回</el-button
                 >
               </template>
@@ -255,13 +255,13 @@
           <div class="page pull-right">
             <el-pagination
               v-if="paginationShow"
-              @current-change="handleCurrentChange"
-              @size-change="handleSizeChange"
               :current-page="currentPage"
               :page-size="pageSize"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @current-change="handleCurrentChange"
+              @size-change="handleSizeChange"
             ></el-pagination>
           </div>
         </div>
@@ -275,7 +275,7 @@
       @close="closeImageDialog"
     >
       <div
-        style="text-align: center;width: 90%;height: 90%"
+        style="text-align: center; width: 90%; height: 90%"
         v-html="imgHtml"
       ></div>
     </el-dialog>
@@ -302,7 +302,7 @@ export default {
         workId: "",
         markRemark: "",
         examRecordDataId: "",
-        identityNumber: ""
+        identityNumber: "",
       },
       orgList: [],
       courseList: [],
@@ -318,17 +318,17 @@ export default {
       getOrgsSearchLoading: false,
       markWorkList: [],
       imgHtml: "",
-      imageDialog: false
+      imageDialog: false,
     };
   },
   computed: {
-    ...mapState({ user: state => state.user }),
+    ...mapState({ user: (state) => state.user }),
     markWorkSelect() {
       let markWorkNames = [];
       for (let markWork of this.markWorkList) {
         markWorkNames.push({
           workId: markWork.id,
-          markName: markWork.name
+          markName: markWork.name,
         });
       }
       return markWorkNames;
@@ -343,12 +343,21 @@ export default {
     },
     noBatchSelected() {
       return this.selectedIds.length === 0;
-    }
+    },
+  },
+  created() {
+    //查询标记卷
+    this.getTags();
+    this.getMarkWorks();
+    this.operaQuery();
+  },
+  mounted() {
+    window.viewPicture = this.viewPicture;
   },
   methods: {
     selectChange(rows) {
       this.selectedIds = [];
-      rows.forEach(element => {
+      rows.forEach((element) => {
         this.selectedIds.push(element.id);
       });
     },
@@ -365,20 +374,20 @@ export default {
           prev: 1,
           play: {
             show: 0,
-            size: "large"
+            size: "large",
           },
           next: 1,
           rotateLeft: 1,
           rotateRight: 1,
           flipHorizontal: 1,
-          flipVertical: 1
+          flipVertical: 1,
         },
         ready() {
           viewer.view(index);
         },
         hidden() {
           viewer.destroy();
-        }
+        },
       });
       viewer.show();
     },
@@ -399,13 +408,13 @@ export default {
         userId: "",
         markRemark: "",
         examRecordDataId: "",
-        identityNumber: ""
+        identityNumber: "",
       });
     },
     getMarkWorks() {
       this.$http
         .get(DATA_PROCESS_API + "/markWorks?status=1")
-        .then(response => {
+        .then((response) => {
           this.markWorkList = response.data;
           if (this.$route.query && this.$route.query.workId) {
             this.formSearch.workId = parseInt(this.$route.query.workId);
@@ -415,7 +424,7 @@ export default {
     //查询学习中心
     getOrgs(name) {
       this.getOrgsSearchLoading = true;
-      this.$http.get(CORE_API + "/org/query?name=" + name).then(response => {
+      this.$http.get(CORE_API + "/org/query?name=" + name).then((response) => {
         this.getOrgsSearchLoading = false;
         this.orgList = response.data;
       });
@@ -428,7 +437,7 @@ export default {
             "/markResults/queryExamCourseList?workId=" +
             this.formSearch.workId
         )
-        .then(response => {
+        .then((response) => {
           this.courseList = response.data;
           if (this.$route.query && this.$route.query.courseCode) {
             this.formSearch.courseCode = this.$route.query.courseCode;
@@ -449,7 +458,7 @@ export default {
             this.formSearch.workId +
             "&courseCode="
         )
-        .then(response => {
+        .then((response) => {
           this.userList = response.data;
           if (this.$route.query && this.$route.query.userId) {
             this.formSearch.userId = parseInt(this.$route.query.userId);
@@ -458,7 +467,7 @@ export default {
     },
     //查询标记卷
     getTags() {
-      this.$http.get(MARKING_API + "/markResults/tag").then(response => {
+      this.$http.get(MARKING_API + "/markResults/tag").then((response) => {
         this.tags = response.data;
         //移除科目错误
         for (let i = 0; i < this.tags.length; i++) {
@@ -473,7 +482,7 @@ export default {
       var orgId = this.user.rootOrgId;
       this.$http
         .get(CORE_API + "/specialty/all?orgId=" + orgId)
-        .then(response => {
+        .then((response) => {
           this.specialtyList = response.data;
         });
     },
@@ -487,7 +496,7 @@ export default {
         this.$notify({
           title: "警告",
           message: "请选择评卷名称",
-          type: "warning"
+          type: "warning",
         });
         return false;
       }
@@ -496,7 +505,7 @@ export default {
         this.$notify({
           title: "警告",
           message: "试卷ID只能输入数字",
-          type: "warning"
+          type: "warning",
         });
         return false;
       }
@@ -507,7 +516,7 @@ export default {
         (this.currentPage - 1) +
         "/" +
         this.pageSize;
-      this.$http.get(url, { params: this.formSearch }).then(response => {
+      this.$http.get(url, { params: this.formSearch }).then((response) => {
         this.tableData = response.data.list;
         this.total = response.data.total;
         this.loading = false;
@@ -525,10 +534,10 @@ export default {
             currentPage: this.currentPage,
             pageSize: this.pageSize,
             examRecordDataId: this.formSearch.examRecordDataId,
-            identityNumber: this.formSearch.identityNumber
-          }
+            identityNumber: this.formSearch.identityNumber,
+          },
         });
-        this.$nextTick(function() {
+        this.$nextTick(function () {
           this.paginationShow = true;
         });
       });
@@ -544,7 +553,7 @@ export default {
         workId: "",
         markRemark: "",
         examRecordDataId: "",
-        identityNumber: ""
+        identityNumber: "",
       });
       this.tableData = [];
       this.total = 0;
@@ -577,7 +586,7 @@ export default {
           "/" +
           studentPaperId;
         this.$router.push({
-          path: url
+          path: url,
         });
       }
     },
@@ -623,7 +632,7 @@ export default {
     },
     generateUUID() {
       let date = new Date().getTime();
-      return "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, function(c) {
+      return "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, function (c) {
         let r = (date + Math.random() * 16) % 16 | 0;
         date = Math.floor(date / 16);
         return (c == "x" ? r : (r & 0x3) | 0x8).toString(16);
@@ -635,7 +644,7 @@ export default {
       this.$confirm("确定打回?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       })
         .then(() => {
           var url = MARKING_API + "/markResults/reject";
@@ -652,7 +661,7 @@ export default {
       this.$confirm("确定打回?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       })
         .then(() => {
           var url = MARKING_API + "/markResults/reject";
@@ -684,17 +693,8 @@ export default {
         this.getUserList();
         this.initMarkPaperCheck();
       }
-    }
-  },
-  created() {
-    //查询标记卷
-    this.getTags();
-    this.getMarkWorks();
-    this.operaQuery();
+    },
   },
-  mounted() {
-    window.viewPicture = this.viewPicture;
-  }
 };
 </script>
 <style lang="css" scoped>

+ 45 - 45
src/modules/marking/views/MarkSettingFast.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <LinkTitlesCustom :currentPaths="['评卷设置', '设置列表', '快速设置']" />
+    <LinkTitlesCustom :current-paths="['评卷设置', '设置列表', '快速设置']" />
     <section class="content">
       <div class="box box-info">
         <div class="box-header with-border">
@@ -15,16 +15,16 @@
               label-width="40px"
               @submit.native.prevent
             >
-              <el-row :gutter="10" v-if="selectedMarker.length != 0">
+              <el-row v-if="selectedMarker.length != 0" :gutter="10">
                 <el-col :xs="30" :sm="30" :md="30" :lg="30">
                   <el-form-item label="已选">
                     <el-tag
                       v-for="tag in selectedMarker"
+                      :key="tag.userId"
                       :closable="tagClosable"
                       :close-transition="false"
-                      @close="tagClose(tag)"
                       :type="tagType"
-                      :key="tag.userId"
+                      @close="tagClose(tag)"
                       >{{ tag.name }}</el-tag
                     >
                   </el-form-item>
@@ -32,8 +32,8 @@
               </el-row>
               <el-form-item label="姓名" class="pull-left">
                 <el-input
-                  placeholder="姓名"
                   v-model="markerSearch.name"
+                  placeholder="姓名"
                   @change="searchMarker"
                 ></el-input>
               </el-form-item>
@@ -64,8 +64,8 @@
             <div class="block-seperator"></div>
             <div class="table-native">
               <el-table
-                stripe
                 v-loading="loading"
+                stripe
                 element-loading-text="拼命加载中"
                 :data="markerData"
                 border
@@ -81,13 +81,13 @@
               <div class="page pull-right">
                 <el-pagination
                   background
-                  @current-change="handleMarkerCurrentChange"
-                  @size-change="handleSizeChange"
                   :current-page="curMarker"
                   :page-size="pageSize"
                   :page-sizes="[10, 20, 50, 100, 200, 300]"
                   layout="total, sizes, prev, pager, next, jumper"
                   :total="totalMarker"
+                  @current-change="handleMarkerCurrentChange"
+                  @size-change="handleSizeChange"
                 ></el-pagination>
               </div>
             </div>
@@ -103,10 +103,13 @@ import { MARKING_API, DATA_PROCESS_API } from "@/constants/constants";
 import { mapState } from "vuex";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
 export default {
+  components: {
+    LinkTitlesCustom,
+  },
   data() {
     return {
       markerSearch: {
-        name: ""
+        name: "",
       },
       markerData: [],
       oldData: [],
@@ -122,22 +125,38 @@ export default {
       markTasks: {
         workId: "",
         userId: [],
-        paperId: ""
+        paperId: "",
       },
       paperId: "",
       tagType: "primary",
       tagClosable: true,
       marked: false,
-      progress: 0
+      progress: 0,
     };
   },
-  components: {
-    LinkTitlesCustom
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+    selectedIds() {
+      var selectedIds = [];
+      for (let marker of this.selectedMarker) {
+        selectedIds.push(marker.userId);
+      }
+      return selectedIds;
+    },
+  },
+  created() {
+    this.workId = this.$route.params.workId;
+    this.examName = this.$route.params.name;
+    this.courseCode = this.$route.params.courseCode;
+    this.initMarker();
+    this.searchSelectedMarker();
+    //校验评卷工作是否开始,如果开始则不能删除评卷员
+    this.checkMarked();
   },
   methods: {
     selectChange(val) {
       var selectedMarker = this.selectedMarker;
-      val.forEach(element => {
+      val.forEach((element) => {
         selectedMarker.push(element);
         this.removeMarkerData(element.userId);
       });
@@ -151,14 +170,14 @@ export default {
         this.markTasks = {
           workId: this.workId,
           userIds: this.selectedIds,
-          courseCode: this.courseCode
+          courseCode: this.courseCode,
         };
         this.loading = true;
         this.$http.post(DATA_PROCESS_API + "/markTasks", this.markTasks).then(
           () => {
             this.$notify({
               message: "快速设置成功",
-              type: "success"
+              type: "success",
             });
             this.loading = false;
             this.initMarker();
@@ -167,7 +186,7 @@ export default {
           () => {
             this.$notify({
               message: "快速设置失败",
-              type: "error"
+              type: "error",
             });
             this.loading = false;
             this.initMarker();
@@ -177,7 +196,7 @@ export default {
       }
     },
     filterMarker() {
-      var tempData = this.markerData.filter(element => {
+      var tempData = this.markerData.filter((element) => {
         if (this.markerSearch.name) {
           return element.name.includes(this.markerSearch.name);
         } else {
@@ -226,7 +245,7 @@ export default {
             "&courseCode=" +
             this.courseCode
         )
-        .then(response => {
+        .then((response) => {
           this.markerData = response.data;
           this.oldData = this.markerData.slice(0);
           this.totalMarker = response.data.length;
@@ -239,17 +258,17 @@ export default {
       self.loading = true;
       self.$http
         .get(MARKING_API + "/markWorks/" + self.workId)
-        .then(response => {
+        .then((response) => {
           self.loading = false;
           if (response.markedStudentPaper > 0) {
             self.marked = true;
             self.progress = response.progress;
           }
         })
-        .catch(error => {
+        .catch((error) => {
           this.$notify({
             message: error.message,
-            type: "error"
+            type: "error",
           });
         });
     },
@@ -263,7 +282,7 @@ export default {
             "&courseCode=" +
             this.courseCode
         )
-        .then(response => {
+        .then((response) => {
           this.selectedMarker = response.data;
           this.oldSelectedMarker = this.selectedMarker.slice(0);
           this.loading = false;
@@ -275,7 +294,7 @@ export default {
           "/marking/mark_setting_main/" +
           this.$route.params.workId +
           "/" +
-          this.$route.params.name
+          this.$route.params.name,
       });
     },
     isOldSelectedMarker(marker) {
@@ -293,7 +312,7 @@ export default {
       if (this.marked && this.isOldSelectedMarker(tag)) {
         this.$notify({
           message: "评卷工作已开始,不能删除该评卷员!",
-          type: "error"
+          type: "error",
         });
         return;
       }
@@ -319,27 +338,8 @@ export default {
           break;
         }
       }
-    }
-  },
-  computed: {
-    ...mapState({ user: state => state.user }),
-    selectedIds() {
-      var selectedIds = [];
-      for (let marker of this.selectedMarker) {
-        selectedIds.push(marker.userId);
-      }
-      return selectedIds;
-    }
+    },
   },
-  created() {
-    this.workId = this.$route.params.workId;
-    this.examName = this.$route.params.name;
-    this.courseCode = this.$route.params.courseCode;
-    this.initMarker();
-    this.searchSelectedMarker();
-    //校验评卷工作是否开始,如果开始则不能删除评卷员
-    this.checkMarked();
-  }
 };
 </script>
 <style lang="css" scoped>

+ 62 - 60
src/modules/marking/views/MarkSettingMain.vue

@@ -1,10 +1,10 @@
 <template>
   <div>
-    <LinkTitlesCustom :currentPaths="['评卷工作', '评卷设置', '设置列表']" />
+    <LinkTitlesCustom :current-paths="['评卷工作', '评卷设置', '设置列表']" />
     <section class="content">
       <div
-        class="box box-info"
         v-loading="fileLoading"
+        class="box box-info"
         element-loading-text="导入需要较长时间,请耐心等候"
       >
         <div class="box-body">
@@ -16,17 +16,17 @@
           >
             <el-form-item label="课程" class="pull-left">
               <el-select
+                v-model="formSearch.courseCode"
                 clearable
                 filterable
                 class="input"
-                v-model="formSearch.courseCode"
                 placeholder="请选择"
               >
                 <el-option
                   v-for="item in courseAllListSelect"
+                  :key="item.code"
                   :label="item.courseInfo"
                   :value="item.code"
-                  :key="item.code"
                 ></el-option>
               </el-select>
             </el-form-item>
@@ -46,9 +46,9 @@
                 >返回</el-button
               >
               <el-dropdown
-                style="margin-left:10px;"
-                @command="handleCommand"
+                style="margin-left: 10px"
                 placement="bottom-start"
+                @command="handleCommand"
               >
                 <el-button size="small" type="primary">
                   更多 <i class="el-icon-arrow-down el-icon--right"></i>
@@ -80,8 +80,8 @@
               <el-row>
                 <el-form-item>
                   <el-upload
-                    class="form_left"
                     ref="upload"
+                    class="form_left"
                     accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
                     :action="uploadAction"
                     :headers="uploadHeaders"
@@ -99,21 +99,21 @@
                     >
                     <el-button
                       size="small"
-                      style="margin-left:5px;"
+                      style="margin-left: 5px"
                       type="success"
                       @click="submitUpload"
                       >确认上传</el-button
                     >
                     <el-button
                       size="small"
-                      style="margin-left:5px;"
+                      style="margin-left: 5px"
                       type="danger"
                       @click="removeFile"
                       >清空文件</el-button
                     >
                     <el-button
                       size="small"
-                      style="margin-left:5px;"
+                      style="margin-left: 5px"
                       type="info"
                       @click="exportFile"
                       >下载模板</el-button
@@ -129,9 +129,9 @@
           <!-- 导入错误信息列表 -->
           <el-dialog title="错误提示" :visible.sync="errDialog">
             <div
-              class="text-danger"
               v-for="errMessage in errMessages"
               :key="errMessage.row"
+              class="text-danger"
             >
               第{{ errMessage.row }}行:{{ errMessage.excelErrorType }}
             </div>
@@ -142,8 +142,8 @@
           <div class="block-seperator"></div>
           <!-- 页面列表 -->
           <el-table
-            stripe
             v-loading="loading"
+            stripe
             element-loading-text="拼命加载中"
             :data="tableData"
             border
@@ -179,17 +179,17 @@
                 <div class="pull-left">
                   <el-button
                     v-if="scope.row.totalCount > 0"
-                    @click="fastSetting(scope.$index, scope.row)"
                     type="primary"
                     size="mini"
                     plain
+                    @click="fastSetting(scope.$index, scope.row)"
                     >快速设置</el-button
                   >
                   <el-button
-                    @click="openStepModel(scope.row)"
                     type="primary"
                     size="mini"
                     plain
+                    @click="openStepModel(scope.row)"
                     >给分间隔设置</el-button
                   >
                 </div>
@@ -199,13 +199,13 @@
           <div class="page pull-right">
             <el-pagination
               background
-              @current-change="handleSettingCurrentChange"
-              @size-change="handleSizeChange"
               :current-page="currentPage"
               :page-size="pageSize"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @current-change="handleSettingCurrentChange"
+              @size-change="handleSizeChange"
             ></el-pagination>
           </div>
         </div>
@@ -217,18 +217,18 @@
           @close="closeStepModel"
         >
           <el-form
+            ref="stepForm"
+            :key="stepModelKey"
             :inline="true"
             :model="stepForm"
-            ref="stepForm"
             :rules="stepRules"
             label-width="90px"
-            :key="stepModelKey"
           >
             <el-row>
               <el-form-item label="给分间隔" prop="step">
                 <el-input-number
-                  size="mini"
                   v-model="stepForm.step"
+                  size="mini"
                   :precision="1"
                   :step="0.1"
                   :min="0.1"
@@ -239,8 +239,8 @@
             <el-row class="pull-center">
               <el-button
                 type="primary"
+                :loading="stepForm.loading"
                 @click="subStep"
-                :loading="this.stepForm.loading"
                 >确定</el-button
               >
               <el-button @click="closeStepModel">取消</el-button>
@@ -257,6 +257,9 @@ import { MARKING_API, DATA_PROCESS_API } from "@/constants/constants";
 import { mapState } from "vuex";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
 export default {
+  components: {
+    LinkTitlesCustom,
+  },
   data() {
     return {
       formSearch: {
@@ -264,7 +267,7 @@ export default {
         courseName: "",
         specialtyLevel: "",
         specialtyName: "",
-        leader: ""
+        leader: "",
       },
       courseList: [],
       tableData: [],
@@ -277,7 +280,7 @@ export default {
       markTasks: {
         workId: "",
         userId: [],
-        paperId: ""
+        paperId: "",
       },
       stepModel: false,
       stepModelKey: Math.random(),
@@ -285,7 +288,7 @@ export default {
         workId: null,
         courseCode: null,
         step: null,
-        loading: false
+        loading: false,
       },
       paperId: "",
       impDialog: false,
@@ -297,12 +300,32 @@ export default {
       fileLoading: false,
       fileList: [],
       stepRules: {
-        step: [{ required: true, message: "请输入给分间隔", trigger: "change" }]
-      }
+        step: [
+          { required: true, message: "请输入给分间隔", trigger: "change" },
+        ],
+      },
     };
   },
-  components: {
-    LinkTitlesCustom
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+    courseAllListSelect() {
+      let courseSelect = [];
+      for (let course of this.courseList) {
+        let courseInfo = course.name + "(" + course.code + ")";
+        courseSelect.push({ code: course.code, courseInfo: courseInfo });
+      }
+      return courseSelect;
+    },
+  },
+  created() {
+    this.workId = this.$route.params.workId;
+    this.uploadData.workId = this.workId;
+    this.uploadHeaders = {
+      key: this.user.key,
+      token: this.user.token,
+    };
+    this.initSetting();
+    this.getCourses();
   },
   methods: {
     openStepModel(row) {
@@ -334,7 +357,7 @@ export default {
         .then(() => {
           this.$notify({
             type: "success",
-            message: "设置成功!"
+            message: "设置成功!",
           });
           this.closeStepModel();
           this.initSetting();
@@ -349,7 +372,7 @@ export default {
             "/markResults/queryExamCourseList?workId=" +
             this.$route.params.workId
         )
-        .then(response => {
+        .then((response) => {
           this.courseList = response.data;
         });
     },
@@ -365,14 +388,14 @@ export default {
         "/" +
         row.name;
       this.$router.push({
-        path: url
+        path: url,
       });
     },
     filterSetting() {
       if (!this.formSearch.courseCode && !this.formSearch.courseName) {
         return;
       }
-      var tempData = this.tableData.filter(element => {
+      var tempData = this.tableData.filter((element) => {
         var flag = true;
         if (this.formSearch.courseCode || this.formSearch.courseName) {
           if (this.formSearch.courseCode) {
@@ -426,7 +449,7 @@ export default {
             this.workId,
           { params: this.formSearch }
         )
-        .then(response => {
+        .then((response) => {
           console.log(response.data);
           this.tableData = response.data.content;
           this.total = response.data.totalElements;
@@ -444,7 +467,7 @@ export default {
     },
     back() {
       this.$router.push({
-        path: "/marking/mark_work"
+        path: "/marking/mark_work",
       });
     },
     //导入
@@ -467,7 +490,7 @@ export default {
       if (!response || response.length == 0) {
         this.$notify({
           message: "上传成功",
-          type: "success"
+          type: "success",
         });
         this.fileLoading = false;
         this.impDialog = false;
@@ -484,7 +507,7 @@ export default {
       var errMessage = JSON.parse(result[0]).desc;
       this.$notify({
         message: errMessage,
-        type: "error"
+        type: "error",
       });
       this.fileLoading = false;
     },
@@ -501,14 +524,14 @@ export default {
       if (fileList.length == 0) {
         this.$notify({
           message: "上传文件不能为空",
-          type: "error"
+          type: "error",
         });
         return false;
       }
       if (fileList.length > 1) {
         this.$notify({
           message: "每次只能上传一个文件",
-          type: "error"
+          type: "error",
         });
         return false;
       }
@@ -516,7 +539,7 @@ export default {
         if (!file.name.endsWith(".xlsx")) {
           this.$notify({
             message: "上传文件必须为xlsx格式",
-            type: "error"
+            type: "error",
           });
           this.initUpload();
           return false;
@@ -558,29 +581,8 @@ export default {
     handleCommand(buttonType) {
       if (buttonType == "in") this.imp();
       else if (buttonType == "out") this.exportCourse();
-    }
-  },
-  computed: {
-    ...mapState({ user: state => state.user }),
-    courseAllListSelect() {
-      let courseSelect = [];
-      for (let course of this.courseList) {
-        let courseInfo = course.name + "(" + course.code + ")";
-        courseSelect.push({ code: course.code, courseInfo: courseInfo });
-      }
-      return courseSelect;
-    }
+    },
   },
-  created() {
-    this.workId = this.$route.params.workId;
-    this.uploadData.workId = this.workId;
-    this.uploadHeaders = {
-      key: this.user.key,
-      token: this.user.token
-    };
-    this.initSetting();
-    this.getCourses();
-  }
 };
 </script>
 <style lang="css" scoped>

+ 22 - 22
src/modules/marking/views/MarkSettingWork.vue

@@ -12,15 +12,15 @@
           >
             <el-form-item label="评卷工作名称" class="pull-left">
               <el-input
-                placeholder="评卷工作名称"
                 v-model="formSearch.name"
+                placeholder="评卷工作名称"
                 @keyup.native="searchMarkWork"
               ></el-input>
             </el-form-item>
           </el-form>
           <el-table
-            stripe
             v-loading="loading"
+            stripe
             element-loading-text="拼命加载中"
             :data="tableData"
             border
@@ -32,9 +32,9 @@
               <template slot-scope="scope">
                 <div>
                   <span
-                    style="display: block;"
                     v-for="item in scope.row.examNameAndType"
                     :key="item.index"
+                    style="display: block"
                     >{{ item }}</span
                   >
                 </div>
@@ -53,10 +53,10 @@
               <template slot-scope="scope">
                 <div class="pull-left">
                   <el-button
-                    @click="marking(scope.row)"
                     type="primary"
                     size="mini"
                     plain
+                    @click="marking(scope.row)"
                     >阅卷</el-button
                   >
                 </div>
@@ -66,13 +66,13 @@
           <div class="page pull-right">
             <el-pagination
               background
-              @current-change="handleCurrentChange"
-              @size-change="handleSizeChange"
               :current-page="currentPage"
               :page-size="pageSize"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @current-change="handleCurrentChange"
+              @size-change="handleSizeChange"
             >
             </el-pagination>
           </div>
@@ -89,7 +89,7 @@ export default {
   data() {
     return {
       formSearch: {
-        name: ""
+        name: "",
       },
       tableData: [],
       totalTableData: [],
@@ -98,15 +98,24 @@ export default {
       total: 0,
       markWorkId: "",
       loading: false,
-      isMarkingView: true
+      isMarkingView: true,
     };
   },
+  computed: {
+    routeType() {
+      return this.$route.params.type;
+    },
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    this.initMarkWork();
+  },
   methods: {
     initMarkWork() {
       this.loading = true;
       this.$http
         .get(DATA_PROCESS_API + "/markWorks?userId=" + this.user.userId)
-        .then(response => {
+        .then((response) => {
           this.totalTableData = response.data;
           this.total = response.data.length;
           this.filterMarkWork();
@@ -119,7 +128,7 @@ export default {
       this.paging();
     },
     filterMarkWork() {
-      var tempData = this.totalTableData.filter(element => {
+      var tempData = this.totalTableData.filter((element) => {
         if (this.formSearch.name) {
           return element.name.includes(this.formSearch.name);
         } else {
@@ -167,28 +176,19 @@ export default {
             "&userId=" +
             userId
         )
-        .then(response => {
+        .then((response) => {
           if (response.data > 0) {
             self.$router.push({
-              path: url
+              path: url,
             });
           } else {
             self.$notify({
               message: "没有评卷任务",
-              type: "warning"
+              type: "warning",
             });
           }
         });
-    }
-  },
-  computed: {
-    routeType() {
-      return this.$route.params.type;
     },
-    ...mapState({ user: state => state.user })
   },
-  created() {
-    this.initMarkWork();
-  }
 };
 </script>

+ 90 - 88
src/modules/marking/views/MarkWork.vue

@@ -12,8 +12,8 @@
           >
             <el-form-item label="评卷工作名称" class="pull-left">
               <el-input
-                placeholder="评卷工作名称"
                 v-model="formSearch.name"
+                placeholder="评卷工作名称"
                 @keyup.native="searchMarkWork"
               ></el-input>
             </el-form-item>
@@ -31,12 +31,12 @@
           </el-form>
           <div class="block-seperator"></div>
           <el-table
-            stripe
             v-loading="loading"
+            stripe
             element-loading-text="拼命加载中"
             :data="tableData"
             border
-            style="width: 100%;"
+            style="width: 100%"
           >
             <el-table-column label="评卷工作名称" width="150">
               <template slot-scope="scope">
@@ -49,9 +49,9 @@
               <template slot-scope="scope">
                 <div>
                   <span
-                    style="display: block;"
                     v-for="item in scope.row.examNameAndType"
                     :key="item.index"
+                    style="display: block"
                     >{{ item }}</span
                   >
                 </div>
@@ -89,14 +89,14 @@
               <template slot-scope="scope">
                 <div class="pull-left">
                   <el-button
-                    @click="settingMarkWork(scope.row)"
                     type="primary"
                     size="mini"
                     plain
+                    @click="settingMarkWork(scope.row)"
                     >评卷设置</el-button
                   >
                   <el-dropdown
-                    style="margin-left: 10px;"
+                    style="margin-left: 10px"
                     placement="bottom-start"
                   >
                     <el-button size="mini" type="primary" plain>
@@ -105,37 +105,37 @@
                     <el-dropdown-menu slot="dropdown">
                       <el-dropdown-item v-if="scope.row.status == 2">
                         <el-button
-                          @click="recreate(scope.row)"
                           type="primary"
                           size="mini"
                           plain
+                          @click="recreate(scope.row)"
                           >重新创建</el-button
                         >
                       </el-dropdown-item>
                       <el-dropdown-item>
                         <el-button
-                          @click="editMarkWorkModal(scope.row)"
                           type="primary"
                           size="mini"
                           icon="el-icon-edit"
                           plain
+                          @click="editMarkWorkModal(scope.row)"
                           >编辑</el-button
                         >
                       </el-dropdown-item>
                       <el-dropdown-item>
                         <el-button
-                          @click="delMarkWork(scope.row)"
                           type="danger"
                           size="mini"
                           icon="el-icon-delete"
+                          @click="delMarkWork(scope.row)"
                           >删除</el-button
                         >
                       </el-dropdown-item>
                       <el-dropdown-item>
                         <el-button
-                          @click="pubGrade(scope.row)"
                           size="mini"
                           icon="el-icon-bell"
+                          @click="pubGrade(scope.row)"
                           >成绩发布</el-button
                         >
                       </el-dropdown-item>
@@ -143,10 +143,10 @@
                         v-if="!scope.row.isEnd && scope.row.status == 1"
                       >
                         <el-button
-                          @click="endMarkWork(scope.row)"
                           type="primary"
                           size="mini"
                           plain
+                          @click="endMarkWork(scope.row)"
                           >结束评卷</el-button
                         >
                       </el-dropdown-item>
@@ -154,10 +154,10 @@
                         v-if="scope.row.isEnd && scope.row.status == 1"
                       >
                         <el-button
-                          @click="disendMarkWork(scope.row)"
                           type="primary"
                           size="mini"
                           plain
+                          @click="disendMarkWork(scope.row)"
                           >开启评卷</el-button
                         >
                       </el-dropdown-item>
@@ -171,48 +171,48 @@
           <div class="page pull-right">
             <el-pagination
               background
-              @current-change="handleCurrentChange"
-              @size-change="handleSizeChange"
               :current-page="currentPage"
               :page-size="pageSize"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @current-change="handleCurrentChange"
+              @size-change="handleSizeChange"
             ></el-pagination>
           </div>
 
           <el-dialog
-            @open="openModal"
-            @close="closeModal"
-            :title="examTitle"
             v-loading="loading"
+            :title="examTitle"
             element-loading-text="拼命加载中"
             :visible.sync="markWorkDialog"
             width="500px"
+            @open="openModal"
+            @close="closeModal"
           >
             <el-form
+              ref="formMarkWork"
               :model="formMarkWork"
               label-width="120px"
               :rules="rules"
-              ref="formMarkWork"
               inline
               inline-message
             >
               <el-form-item label="评卷工作名称" prop="name">
                 <el-input
-                  placeholder="评卷工作名称"
                   v-model="formMarkWork.name"
-                  style="width: 200px;"
+                  placeholder="评卷工作名称"
+                  style="width: 200px"
                 ></el-input>
               </el-form-item>
               <el-form-item
+                v-if="!examDisabled"
                 label="考试类型"
                 prop="examType"
-                v-if="!examDisabled"
               >
                 <el-select
                   v-model="formMarkWork.examType"
-                  style="width: 200px;"
+                  style="width: 200px"
                   @change="examTypeChange()"
                 >
                   <el-option label="在线考试" value="ONLINE"> </el-option>
@@ -223,31 +223,31 @@
               </el-form-item>
               <el-form-item label="考试" prop="examIds">
                 <el-select
-                  :disabled="examDisabled"
                   v-model="formMarkWork.examIds"
+                  :disabled="examDisabled"
                   filterable
                   multiple
                   placeholder="考试"
-                  style="width: 200px;"
+                  style="width: 200px"
                 >
                   <el-option
                     v-for="item in examSelect"
+                    :key="item.value"
                     :label="item.label"
                     :value="item.value"
-                    :key="item.value"
                   ></el-option>
                 </el-select>
               </el-form-item>
               <el-form-item label="备注" prop="remark">
                 <el-input
-                  style="width: 200px;"
+                  v-model="formMarkWork.remark"
+                  style="width: 200px"
                   type="textarea"
                   :rows="3"
                   placeholder="备注"
-                  v-model="formMarkWork.remark"
                 ></el-input>
               </el-form-item>
-              <el-form-item style="margin-top: 10px; margin-left: 100px;">
+              <el-form-item style="margin-top: 10px; margin-left: 100px">
                 <el-button
                   :loading="saveLoading"
                   type="primary"
@@ -272,13 +272,13 @@ export default {
   data() {
     return {
       formSearch: {
-        name: ""
+        name: "",
       },
       formMarkWork: {
         examType: "",
         name: "",
         examIds: [],
-        remark: ""
+        remark: "",
       },
       rules: {
         name: [{ required: true, message: "请输入名称", trigger: "blur" }],
@@ -287,23 +287,23 @@ export default {
             required: true,
             message: "请选择考试",
             trigger: "change",
-            type: "array"
-          }
+            type: "array",
+          },
         ],
         examType: [
           {
             required: true,
             message: "请选择考试类型",
             trigger: "change",
-            type: "string"
-          }
-        ]
+            type: "string",
+          },
+        ],
       },
       statusList: [
         { code: 0, name: "创建中" },
         { code: 1, name: "创建成功" },
         { code: 2, name: "创建失败" },
-        { code: 3, name: "追加中" }
+        { code: 3, name: "追加中" },
       ],
       examSelect: [],
       tableData: [],
@@ -318,18 +318,21 @@ export default {
       loading: false,
       closeClickModal: false,
       saveLoading: false,
-      oldWorkName: ""
+      oldWorkName: "",
     };
   },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    this.initMarkWorkData();
   },
   methods: {
     settingMarkWork(row) {
       if (Number.parseInt(row.status) != 1) {
         this.$notify({
           message: "该评卷工作未完成,不能进行设置.",
-          type: "warning"
+          type: "warning",
         });
         return;
       }
@@ -339,7 +342,7 @@ export default {
         "/" +
         encodeURIComponent(row.name);
       this.$router.push({
-        path: url
+        path: url,
       });
     },
     getStatus(code) {
@@ -364,7 +367,7 @@ export default {
         .then(() => {
           this.$notify({
             message: "操作成功",
-            type: "success"
+            type: "success",
           });
           this.initMarkWorkData();
           this.loading = false;
@@ -375,7 +378,7 @@ export default {
       this.$http.put(DATA_PROCESS_API + "/markWorks/" + row.id).then(() => {
         this.$notify({
           message: "操作成功",
-          type: "success"
+          type: "success",
         });
         this.initMarkWorkData();
         this.loading = false;
@@ -400,23 +403,25 @@ export default {
       if (this.formMarkWork.examType) {
         params = params + "&examType=" + this.formMarkWork.examType;
       }
-      this.$http.get(DATA_PROCESS_API + "/exam/all" + params).then(response => {
-        response.data.forEach((element, index) => {
-          tempSelect[index] = {
-            value: element.id,
-            label: element.name
-          };
+      this.$http
+        .get(DATA_PROCESS_API + "/exam/all" + params)
+        .then((response) => {
+          response.data.forEach((element, index) => {
+            tempSelect[index] = {
+              value: element.id,
+              label: element.name,
+            };
+          });
+          this.examSelect = tempSelect;
+          //this.loading = false;
         });
-        this.examSelect = tempSelect;
-        //this.loading = false;
-      });
     },
     initMarkWorkData() {
       var orgId = this.user.rootOrgId;
       this.loading = true;
       this.$http
         .get(DATA_PROCESS_API + "/markWorks?orgId=" + orgId)
-        .then(response => {
+        .then((response) => {
           console.log(response);
           this.totalTableData = response.data;
           this.total = response.data.length;
@@ -433,10 +438,10 @@ export default {
           .get(
             MARKING_API + "/markWorks/getWorkList?workIds=" + creatingWorkIds
           )
-          .then(response => {
-            response.data.forEach(element => {
+          .then((response) => {
+            response.data.forEach((element) => {
               if (element.status != 0) {
-                this.tableData.forEach(e => {
+                this.tableData.forEach((e) => {
                   if (e.id == element.id) {
                     e.status = element.status;
                   }
@@ -451,7 +456,7 @@ export default {
     },
     getCreatingWorkId() {
       var tempData = [];
-      this.tableData.forEach(element => {
+      this.tableData.forEach((element) => {
         if (element.status == 0) {
           tempData.push(element.id);
         }
@@ -463,7 +468,7 @@ export default {
       this.paging();
     },
     filterMarkWork() {
-      var tempData = this.totalTableData.filter(element => {
+      var tempData = this.totalTableData.filter((element) => {
         if (this.formSearch.name) {
           return element.name.includes(this.formSearch.name);
         } else {
@@ -518,14 +523,14 @@ export default {
       if (Number.parseInt(row.status) == 0) {
         this.$notify({
           message: "创建中的评卷工作不能删除!",
-          type: "error"
+          type: "error",
         });
         return;
       }
       this.$confirm("确认删除评卷工作?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         this.loading = true;
         this.$http
@@ -533,14 +538,14 @@ export default {
           .then(() => {
             this.$notify({
               message: "删除成功",
-              type: "success"
+              type: "success",
             });
             this.initMarkWorkData();
           })
-          .catch(e => {
+          .catch((e) => {
             this.$notify({
               message: e.response.data.desc,
-              type: "error"
+              type: "error",
             });
           });
         this.loading = false;
@@ -550,7 +555,7 @@ export default {
       this.$confirm("确认结束评卷工作?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         this.loading = true;
         this.$http
@@ -558,14 +563,14 @@ export default {
           .then(() => {
             this.$notify({
               message: "操作成功",
-              type: "success"
+              type: "success",
             });
             this.initMarkWorkData();
           })
-          .catch(e => {
+          .catch((e) => {
             this.$notify({
               message: e.response.data.desc,
-              type: "error"
+              type: "error",
             });
           });
         this.loading = false;
@@ -575,7 +580,7 @@ export default {
       this.$confirm("确认开启评卷工作?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         this.loading = true;
         this.$http
@@ -583,14 +588,14 @@ export default {
           .then(() => {
             this.$notify({
               message: "操作成功",
-              type: "success"
+              type: "success",
             });
             this.initMarkWorkData();
           })
-          .catch(e => {
+          .catch((e) => {
             this.$notify({
               message: e.response.data.desc,
-              type: "error"
+              type: "error",
             });
           });
         this.loading = false;
@@ -600,27 +605,27 @@ export default {
       if (!(Number.parseInt(row.progress) == 100)) {
         this.$notify({
           message: "进度未达到100%,不能进行成绩发布",
-          type: "error"
+          type: "error",
         });
         return;
       }
       this.$confirm("确认成绩发布?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         this.loading = true;
         this.$http.post(MARKING_API + "/markWorks/" + row.id + "/publish").then(
           () => {
             this.$notify({
               message: "成绩发布成功",
-              type: "success"
+              type: "success",
             });
           },
           () => {
             this.$notify({
               message: "成绩发布失败",
-              type: "error"
+              type: "error",
             });
           }
         );
@@ -633,7 +638,7 @@ export default {
         if (workList.name == workName) {
           this.$notify({
             message: "评卷工作名称已存在,请重新输入!",
-            type: "warning"
+            type: "warning",
           });
           return true;
         }
@@ -641,7 +646,7 @@ export default {
       return false;
     },
     saveMarkWork() {
-      this.$refs.formMarkWork.validate(valid => {
+      this.$refs.formMarkWork.validate((valid) => {
         if (valid) {
           var newWorkName = this.formMarkWork.name;
           if (newWorkName != this.oldWorkName) {
@@ -662,17 +667,17 @@ export default {
                 () => {
                   this.$notify({
                     message: "评卷工作保存成功",
-                    type: "success"
+                    type: "success",
                   });
                   this.closeMarkWork();
                   this.initMarkWorkData();
                   this.loading = false;
                   this.saveLoading = false;
                 },
-                error => {
+                (error) => {
                   this.$notify({
                     message: error.response.data,
-                    type: "error"
+                    type: "error",
                   });
                   this.loading = false;
                   this.saveLoading = false;
@@ -685,17 +690,17 @@ export default {
                 () => {
                   this.$notify({
                     message: "评卷工作新增成功",
-                    type: "success"
+                    type: "success",
                   });
                   this.closeMarkWork();
                   this.initMarkWorkData();
                   this.loading = false;
                   this.saveLoading = false;
                 },
-                error => {
+                (error) => {
                   this.$notify({
                     message: error.response.data,
-                    type: "error"
+                    type: "error",
                   });
                   this.loading = false;
                   this.saveLoading = false;
@@ -715,7 +720,7 @@ export default {
         //编辑
         this.formMarkWork = Object.assign(this.formMarkWork, {
           remark: "",
-          name: ""
+          name: "",
         });
         this.$refs["formMarkWork"].clearValidate();
       } else {
@@ -723,7 +728,7 @@ export default {
         this.formMarkWork = Object.assign(this.formMarkWork, {
           remark: "",
           examName: "",
-          name: ""
+          name: "",
         });
         this.$refs["formMarkWork"].clearValidate();
       }
@@ -738,11 +743,8 @@ export default {
       this.pageSize = val;
       this.filterMarkWork();
       this.paging();
-    }
+    },
   },
-  created() {
-    this.initMarkWorkData();
-  }
 };
 </script>
 <style scoped>

+ 128 - 128
src/modules/marking/views/MarkWorkOverview.vue

@@ -11,19 +11,19 @@
           >
             <el-form-item label="评卷名称" class="pull-left">
               <el-select
+                v-model="markWorkSearchForm.markId"
                 clearable
                 filterable
                 class="input"
-                v-model="markWorkSearchForm.markId"
                 placeholder="请选择"
                 @change="searchMarkWork"
                 @clear="cleanMarkWork"
               >
                 <el-option
                   v-for="item in markWorkSelect"
+                  :key="item.markId"
                   :label="item.markName"
                   :value="item.markId"
-                  :key="item.markId"
                 ></el-option>
               </el-select>
             </el-form-item>
@@ -48,17 +48,17 @@
           >
             <el-form-item label="课程" class="pull-left">
               <el-select
+                v-model="formSearch.courseCode"
                 clearable
                 filterable
                 class="input"
-                v-model="formSearch.courseCode"
                 placeholder="请选择"
               >
                 <el-option
                   v-for="item in courseAllListSelect"
+                  :key="item.code"
                   :label="item.courseInfo"
                   :value="item.code"
-                  :key="item.code"
                 ></el-option>
               </el-select>
             </el-form-item>
@@ -86,8 +86,8 @@
       <el-row>
         <el-col :span="24">
           <el-table
-            stripe
             v-loading="loading"
+            stripe
             element-loading-text="拼命加载中"
             :data="tableData"
             border
@@ -131,10 +131,10 @@
             <el-table-column :context="_self" label="操作">
               <template slot-scope="scope">
                 <el-button
-                  @click="courseDetail(scope.row)"
                   type="primary"
                   size="mini"
                   plain
+                  @click="courseDetail(scope.row)"
                   >详情</el-button
                 >
               </template>
@@ -143,13 +143,13 @@
           <div class="page pull-right">
             <el-pagination
               v-if="paginationShow"
-              @current-change="handleSettingCurrentChange"
-              @size-change="handleSizeChange"
               :current-page="currentPage"
               :page-size="pageSize"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @current-change="handleSettingCurrentChange"
+              @size-change="handleSizeChange"
             ></el-pagination>
           </div>
         </el-col>
@@ -165,16 +165,16 @@ import ECharts from "vue-echarts/components/ECharts";
 import "echarts/lib/chart/pie";
 export default {
   components: {
-    "v-charts": ECharts
+    "v-charts": ECharts,
   },
   data() {
     return {
       paginationShow: false,
       formSearch: {
-        courseCode: ""
+        courseCode: "",
       },
       markWorkSearchForm: {
-        markId: ""
+        markId: "",
       },
       tableData: [],
       oldData: [],
@@ -190,16 +190,16 @@ export default {
       pie: {
         title: {
           text: "试卷进度情况",
-          left: "center"
+          left: "center",
         },
         tooltip: {
           trigger: "item",
-          formatter: "{a} <br/>{b} : {c} ({d}%)"
+          formatter: "{a} <br/>{b} : {c} ({d}%)",
         },
         legend: {
           orient: "vertical",
           left: "left",
-          data: ["待完成", "完成数"]
+          data: ["待完成", "完成数"],
         },
         series: [
           {
@@ -213,43 +213,43 @@ export default {
                 name: "待完成",
                 itemStyle: {
                   normal: {
-                    color: "#FE8463"
-                  }
-                }
+                    color: "#FE8463",
+                  },
+                },
               },
               {
                 value: 0,
                 name: "完成数",
                 itemStyle: {
                   normal: {
-                    color: "#7CB5EC"
-                  }
-                }
-              }
+                    color: "#7CB5EC",
+                  },
+                },
+              },
             ],
             itemStyle: {
               emphasis: {
                 shadowBlur: 10,
                 shadowOffsetX: 0,
-                shadowColor: "rgba(0, 0, 0, 0.5)"
-              }
-            }
-          }
-        ]
+                shadowColor: "rgba(0, 0, 0, 0.5)",
+              },
+            },
+          },
+        ],
       },
       pie1: {
         title: {
           text: "课程进度情况",
-          left: "center"
+          left: "center",
         },
         tooltip: {
           trigger: "item",
-          formatter: "{a} <br/>{b} : {c} ({d}%)"
+          formatter: "{a} <br/>{b} : {c} ({d}%)",
         },
         legend: {
           orient: "vertical",
           left: "left",
-          data: ["待完成", "完成数"]
+          data: ["待完成", "完成数"],
         },
         series: [
           {
@@ -263,32 +263,57 @@ export default {
                 name: "待完成",
                 itemStyle: {
                   normal: {
-                    color: "#FE8463"
-                  }
-                }
+                    color: "#FE8463",
+                  },
+                },
               },
               {
                 value: 0,
                 name: "完成数",
                 itemStyle: {
                   normal: {
-                    color: "#7CB5EC"
-                  }
-                }
-              }
+                    color: "#7CB5EC",
+                  },
+                },
+              },
             ],
             itemStyle: {
               emphasis: {
                 shadowBlur: 10,
                 shadowOffsetX: 0,
-                shadowColor: "rgba(0, 0, 0, 0.5)"
-              }
-            }
-          }
-        ]
-      }
+                shadowColor: "rgba(0, 0, 0, 0.5)",
+              },
+            },
+          },
+        ],
+      },
     };
   },
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+    courseAllListSelect() {
+      let courseSelect = [];
+      for (let course of this.courseList) {
+        let courseInfo = course.name + "(" + course.code + ")";
+        courseSelect.push({ code: course.code, courseInfo: courseInfo });
+      }
+      return courseSelect;
+    },
+    markWorkSelect() {
+      let markWorkNames = [];
+      for (let markWork of this.markWorkList) {
+        markWorkNames.push({
+          markId: markWork.id,
+          markName: markWork.name,
+        });
+      }
+      return markWorkNames;
+    },
+  },
+  created() {
+    this.getMarkWorks();
+    this.backFill();
+  },
   methods: {
     cleanMarkWork() {
       //代表清空所有数据列表信息
@@ -304,28 +329,28 @@ export default {
               name: "待完成",
               itemStyle: {
                 normal: {
-                  color: "#FE8463"
-                }
-              }
+                  color: "#FE8463",
+                },
+              },
             },
             {
               value: 0,
               name: "完成数",
               itemStyle: {
                 normal: {
-                  color: "#7CB5EC"
-                }
-              }
-            }
+                  color: "#7CB5EC",
+                },
+              },
+            },
           ],
           itemStyle: {
             emphasis: {
               shadowBlur: 10,
               shadowOffsetX: 0,
-              shadowColor: "rgba(0, 0, 0, 0.5)"
-            }
-          }
-        }
+              shadowColor: "rgba(0, 0, 0, 0.5)",
+            },
+          },
+        },
       ];
 
       this.pie1.series = [
@@ -340,28 +365,28 @@ export default {
               name: "待完成",
               itemStyle: {
                 normal: {
-                  color: "#FE8463"
-                }
-              }
+                  color: "#FE8463",
+                },
+              },
             },
             {
               value: 0,
               name: "完成数",
               itemStyle: {
                 normal: {
-                  color: "#7CB5EC"
-                }
-              }
-            }
+                  color: "#7CB5EC",
+                },
+              },
+            },
           ],
           itemStyle: {
             emphasis: {
               shadowBlur: 10,
               shadowOffsetX: 0,
-              shadowColor: "rgba(0, 0, 0, 0.5)"
-            }
-          }
-        }
+              shadowColor: "rgba(0, 0, 0, 0.5)",
+            },
+          },
+        },
       ];
       this.courseList = [];
       this.tableData = [];
@@ -370,7 +395,7 @@ export default {
     getMarkWorks() {
       this.$http
         .get(DATA_PROCESS_API + "/markWorks?status=1")
-        .then(response => {
+        .then((response) => {
           this.markWorkList = response.data;
           if (this.$route.query && this.$route.query.markId) {
             this.markWorkSearchForm.markId = parseInt(this.$route.query.markId);
@@ -382,7 +407,7 @@ export default {
         .get(
           MARKING_API + "/markResults/queryExamCourseList?workId=" + this.workId
         )
-        .then(response => {
+        .then((response) => {
           this.courseList = response.data;
           if (this.$route.query && this.$route.query.courseCode) {
             this.formSearch.courseCode = this.$route.query.courseCode;
@@ -406,7 +431,7 @@ export default {
         this.$notify({
           title: "警告",
           message: "请选择评卷名称",
-          type: "warning"
+          type: "warning",
         });
         return false;
       }
@@ -427,7 +452,7 @@ export default {
         this.$notify({
           title: "警告",
           message: "请选择评卷名称",
-          type: "warning"
+          type: "warning",
         });
         return false;
       }
@@ -448,16 +473,16 @@ export default {
             this.workId,
           { params: this.formSearch }
         )
-        .then(response => {
+        .then((response) => {
           this.tableData = response.data.content;
           this.total = response.data.totalElements;
           this.loading = false;
           this.$router.push({
             path:
               "/marking/mark_work_overview?" +
-              new URLSearchParams(JSON.parse(JSON.stringify(this.quertTemp)))
+              new URLSearchParams(JSON.parse(JSON.stringify(this.quertTemp))),
           });
-          this.$nextTick(function() {
+          this.$nextTick(function () {
             this.paginationShow = true;
           });
         });
@@ -473,14 +498,14 @@ export default {
         "/" +
         row.name;
       this.$router.push({
-        path: url
+        path: url,
       });
     },
     doPie() {
       this.loading = true;
       this.$http
         .get(MARKING_API + "/markWorks/" + this.workId)
-        .then(response => {
+        .then((response) => {
           this.pie.series = [
             {
               name: "试卷总数:" + response.data.totalStudentPaper,
@@ -495,30 +520,30 @@ export default {
                   name: "待完成",
                   itemStyle: {
                     normal: {
-                      color: "#FE8463"
-                    }
+                      color: "#FE8463",
+                    },
                   },
-                  selected: true
+                  selected: true,
                 },
                 {
                   value: response.data.markedStudentPaper,
                   name: "完成数",
                   itemStyle: {
                     normal: {
-                      color: "#7CB5EC"
-                    }
-                  }
-                }
+                      color: "#7CB5EC",
+                    },
+                  },
+                },
               ],
               itemStyle: {
                 normal: {
                   label: {
                     show: true,
-                    formatter: "{b}:{d}%"
+                    formatter: "{b}:{d}%",
                   },
                   labelLine: {
-                    show: true
-                  }
+                    show: true,
+                  },
                 },
                 emphasis: {
                   shadowBlur: 10,
@@ -526,11 +551,11 @@ export default {
                   shadowColor: "rgba(0, 0, 0, 0.5)",
                   label: {
                     show: true,
-                    formatter: "{b}:{d}%"
-                  }
-                }
-              }
-            }
+                    formatter: "{b}:{d}%",
+                  },
+                },
+              },
+            },
           ];
           this.pie1.series = [
             {
@@ -544,30 +569,30 @@ export default {
                   name: "待完成",
                   itemStyle: {
                     normal: {
-                      color: "#FE8463"
-                    }
+                      color: "#FE8463",
+                    },
                   },
-                  selected: true
+                  selected: true,
                 },
                 {
                   value: response.data.markedCourse,
                   name: "完成数",
                   itemStyle: {
                     normal: {
-                      color: "#7CB5EC"
-                    }
-                  }
-                }
+                      color: "#7CB5EC",
+                    },
+                  },
+                },
               ],
               itemStyle: {
                 normal: {
                   label: {
                     show: true,
-                    formatter: "{b}:{d}%"
+                    formatter: "{b}:{d}%",
                   },
                   labelLine: {
-                    show: true
-                  }
+                    show: true,
+                  },
                 },
                 emphasis: {
                   shadowBlur: 10,
@@ -575,11 +600,11 @@ export default {
                   shadowColor: "rgba(0, 0, 0, 0.5)",
                   label: {
                     show: true,
-                    formatter: "{b}:{d}%"
-                  }
-                }
-              }
-            }
+                    formatter: "{b}:{d}%",
+                  },
+                },
+              },
+            },
           ];
           this.loading = false;
         });
@@ -612,33 +637,8 @@ export default {
         this.getCourses();
         this.searchSetting();
       }
-    }
-  },
-  computed: {
-    ...mapState({ user: state => state.user }),
-    courseAllListSelect() {
-      let courseSelect = [];
-      for (let course of this.courseList) {
-        let courseInfo = course.name + "(" + course.code + ")";
-        courseSelect.push({ code: course.code, courseInfo: courseInfo });
-      }
-      return courseSelect;
     },
-    markWorkSelect() {
-      let markWorkNames = [];
-      for (let markWork of this.markWorkList) {
-        markWorkNames.push({
-          markId: markWork.id,
-          markName: markWork.name
-        });
-      }
-      return markWorkNames;
-    }
   },
-  created() {
-    this.getMarkWorks();
-    this.backFill();
-  }
 };
 </script>
 <style lang="css" scoped>

+ 39 - 39
src/modules/marking/views/Marker.vue

@@ -11,31 +11,31 @@
           >
             <el-form-item label="评卷名称" class="pull-left">
               <el-select
+                v-model="formSearch.workId"
                 clearable
                 filterable
                 class="input"
-                v-model="formSearch.workId"
                 placeholder="请选择"
                 @clear="clearData"
               >
                 <el-option
                   v-for="item in markWorkSelect"
+                  :key="item.workId"
                   :label="item.markName"
                   :value="item.workId"
-                  :key="item.workId"
                 ></el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="登录名" class="pull-left">
               <el-input
-                placeholder="登录名"
                 v-model="formSearch.userLoginName"
+                placeholder="登录名"
               ></el-input>
             </el-form-item>
             <el-form-item label="姓名" class="pull-left">
               <el-input
-                placeholder="姓名"
                 v-model="formSearch.userName"
+                placeholder="姓名"
               ></el-input>
             </el-form-item>
             <el-form-item>
@@ -50,7 +50,7 @@
                 size="small"
                 type="primary"
                 icon="el-icon-download"
-                @click="this.export"
+                @click="exportIt"
                 >导出</el-button
               >
             </el-form-item>
@@ -58,8 +58,8 @@
           <div class="block-seperator"></div>
           <!-- 页面列表 -->
           <el-table
-            stripe
             v-loading="loading"
+            stripe
             element-loading-text="拼命加载中"
             :data="tableData"
             border
@@ -116,10 +116,10 @@
             <el-table-column :context="_self" label="操作" fixed="right">
               <template slot-scope="scope">
                 <el-button
-                  @click="markerDetail(scope.row)"
                   type="primary"
                   size="mini"
                   plain
+                  @click="markerDetail(scope.row)"
                   >详情</el-button
                 >
               </template>
@@ -128,13 +128,13 @@
           <div class="page pull-right">
             <el-pagination
               v-if="paginationShow"
-              @current-change="handleSettingCurrentChange"
-              @size-change="handleSizeChange"
               :current-page="currentPage"
               :page-size="pageSize"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @current-change="handleSettingCurrentChange"
+              @size-change="handleSizeChange"
             ></el-pagination>
           </div>
         </div>
@@ -152,7 +152,7 @@ export default {
       formSearch: {
         userLoginName: "",
         userName: "",
-        workId: ""
+        workId: "",
       },
       tableData: [],
       oldData: [],
@@ -161,16 +161,33 @@ export default {
       total: 10,
       loading: false,
       markWorkList: [],
-      paginationShow: false
+      paginationShow: false,
     };
   },
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+    markWorkSelect() {
+      let markWorkNames = [];
+      for (let markWork of this.markWorkList) {
+        markWorkNames.push({
+          workId: markWork.id,
+          markName: markWork.name,
+        });
+      }
+      return markWorkNames;
+    },
+  },
+  created() {
+    this.getMarkWorks();
+    this.backFill();
+  },
   methods: {
-    export() {
+    exportIt() {
       if (!this.formSearch.workId) {
         this.$notify({
           title: "警告",
           message: "请选择评卷名称",
-          type: "warning"
+          type: "warning",
         });
         return false;
       }
@@ -198,12 +215,12 @@ export default {
       this.formSearch = Object.assign(this.formSearch, {
         workId: "",
         userLoginName: "",
-        userName: ""
+        userName: "",
       });
       this.tableData = [];
       this.total = 0;
       this.$router.push({
-        path: "/marking/marker"
+        path: "/marking/marker",
       });
     },
     searchBtnFn() {
@@ -223,7 +240,7 @@ export default {
         this.$notify({
           title: "警告",
           message: "请选择评卷名称",
-          type: "warning"
+          type: "warning",
         });
         return false;
       }
@@ -239,7 +256,7 @@ export default {
             this.formSearch.workId,
           { params: this.formSearch }
         )
-        .then(response => {
+        .then((response) => {
           console.log(response);
           this.tableData = response.data.content;
           this.total = response.data.totalElements;
@@ -247,9 +264,9 @@ export default {
           this.$router.push({
             path:
               "/marking/marker?" +
-              new URLSearchParams(JSON.parse(JSON.stringify(this.formSearch)))
+              new URLSearchParams(JSON.parse(JSON.stringify(this.formSearch))),
           });
-          this.$nextTick(function() {
+          this.$nextTick(function () {
             this.paginationShow = true;
           });
         });
@@ -263,14 +280,14 @@ export default {
         "/" +
         row.userName;
       this.$router.push({
-        path: url
+        path: url,
       });
     },
     //获取创建成功的markWork列表
     getMarkWorks() {
       this.$http
         .get(DATA_PROCESS_API + "/markWorks?status=1")
-        .then(response => {
+        .then((response) => {
           this.markWorkList = response.data;
           if (this.$route.query && this.$route.query.workId) {
             this.formSearch.workId = parseInt(this.$route.query.workId);
@@ -285,25 +302,8 @@ export default {
         this.formSearch.userName = formData.userName;
         this.searchSetting();
       }
-    }
-  },
-  computed: {
-    ...mapState({ user: state => state.user }),
-    markWorkSelect() {
-      let markWorkNames = [];
-      for (let markWork of this.markWorkList) {
-        markWorkNames.push({
-          workId: markWork.id,
-          markName: markWork.name
-        });
-      }
-      return markWorkNames;
-    }
+    },
   },
-  created() {
-    this.getMarkWorks();
-    this.backFill();
-  }
 };
 </script>
 <style lang="css" scoped>

+ 24 - 24
src/modules/marking/views/MarkerDetail.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <LinkTitlesCustom
-      :currentPaths="['评卷总览', '评卷员一览', '评卷员详情']"
+      :current-paths="['评卷总览', '评卷员一览', '评卷员详情']"
     />
     <section class="content">
       <div class="box box-info">
@@ -14,14 +14,14 @@
           >
             <el-form-item label="课程代码" class="pull-left">
               <el-input
-                placeholder="课程代码"
                 v-model="formSearch.courseCode"
+                placeholder="课程代码"
               ></el-input>
             </el-form-item>
             <el-form-item label="课程名称" class="pull-left">
               <el-input
-                placeholder="课程名称"
                 v-model="formSearch.courseName"
+                placeholder="课程名称"
               ></el-input>
             </el-form-item>
 
@@ -37,7 +37,7 @@
                 size="small"
                 type="primary"
                 icon="el-icon-download"
-                @click="this.export"
+                @click="exportIt"
                 >导出</el-button
               >
               <el-button
@@ -52,8 +52,8 @@
           <div class="block-seperator"></div>
           <!-- 页面列表 -->
           <el-table
-            stripe
             v-loading="loading"
+            stripe
             element-loading-text="拼命加载中"
             :data="tableData"
             border
@@ -85,13 +85,13 @@
           <div class="page pull-right">
             <el-pagination
               background
-              @current-change="handleSettingCurrentChange"
-              @size-change="handleSizeChange"
               :current-page="currentPage"
               :page-size="pageSize"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @current-change="handleSettingCurrentChange"
+              @size-change="handleSizeChange"
             ></el-pagination>
           </div>
         </div>
@@ -105,11 +105,14 @@ import { MARKING_API } from "@/constants/constants";
 import { mapState } from "vuex";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
 export default {
+  components: {
+    LinkTitlesCustom,
+  },
   data() {
     return {
       formSearch: {
         courseCode: "",
-        courseName: ""
+        courseName: "",
       },
       tableData: [],
       oldData: [],
@@ -118,14 +121,20 @@ export default {
       total: 10,
       loading: true,
       workId: "",
-      courseCode: ""
+      courseCode: "",
     };
   },
-  components: {
-    LinkTitlesCustom
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    this.workId = this.$route.params.workId;
+    this.userName = this.$route.params.userName;
+    this.userId = this.$route.params.markerId;
+    this.initSetting();
   },
   methods: {
-    export() {
+    exportIt() {
       var key = this.user.key;
       var token = this.user.token;
       let url =
@@ -183,7 +192,7 @@ export default {
             "&userId=" +
             this.userId
         )
-        .then(response => {
+        .then((response) => {
           console.log(response);
           this.tableData = response.data.content;
           this.total = response.data.totalElements;
@@ -209,7 +218,7 @@ export default {
             this.userId,
           { params: this.formSearch }
         )
-        .then(response => {
+        .then((response) => {
           console.log(response);
           this.tableData = response.data.content;
           this.total = response.data.totalElements;
@@ -218,17 +227,8 @@ export default {
     },
     back() {
       this.$router.back();
-    }
-  },
-  computed: {
-    ...mapState({ user: state => state.user })
+    },
   },
-  created() {
-    this.workId = this.$route.params.workId;
-    this.userName = this.$route.params.userName;
-    this.userId = this.$route.params.markerId;
-    this.initSetting();
-  }
 };
 </script>
 <style lang="css" scoped>

+ 94 - 99
src/modules/marking/views/Marking.vue

@@ -42,8 +42,8 @@
             <el-button
               class="course-tags"
               type="primary"
-              @click="taskChange"
               size="small"
+              @click="taskChange"
             >
               <span class="titlefont">
                 切换任务 <i class="el-icon-caret-bottom el-icon--right"></i>
@@ -60,14 +60,14 @@
               >
                 <el-form-item label="课程代码" class="pull-left">
                   <el-input
-                    placeholder="课程代码"
                     v-model="taskFormSearch.courseCode"
+                    placeholder="课程代码"
                   ></el-input>
                 </el-form-item>
                 <el-form-item label="课程名称" class="pull-left">
                   <el-input
-                    placeholder="课程名称"
                     v-model="taskFormSearch.courseName"
+                    placeholder="课程名称"
                   ></el-input>
                 </el-form-item>
                 <el-form-item class="pull-right">
@@ -113,11 +113,11 @@
               <div class="page pull-right">
                 <el-pagination
                   background
-                  @current-change="taskCurrentChange"
                   :current-page="taskCurrentPage"
                   :page-size="taskPageSize"
                   layout="total, prev, pager, next, jumper"
                   :total="changeTaskTotal"
+                  @current-change="taskCurrentChange"
                 ></el-pagination>
               </div>
             </div>
@@ -129,12 +129,7 @@
             width="80%"
           >
             <div class="scroll">
-              <el-table
-                :data="markedResults"
-                border
-                style="width: 100%;"
-                script
-              >
+              <el-table :data="markedResults" border style="width: 100%" script>
                 <el-table-column
                   label="试卷ID"
                   width="100"
@@ -184,13 +179,13 @@
               <div class="page pull-right">
                 <el-pagination
                   background
-                  @current-change="markedCurrentChange"
-                  @size-change="markedSizeChange"
                   :current-page="markedCurrentPage"
                   :page-size="markedPageSize"
                   :page-sizes="[10, 20, 50, 100, 200, 300]"
                   layout="total, sizes, prev, pager, next, jumper"
                   :total="markedTotal"
+                  @current-change="markedCurrentChange"
+                  @size-change="markedSizeChange"
                 ></el-pagination>
               </div>
             </div>
@@ -199,16 +194,16 @@
         <span class="pull-right icon-right">
           <small class="marktitle titlefont">
             <span class="titlefont">
-              <v-icon name="user" style="height:12px" />
+              <v-icon name="user" style="height: 12px" />
               {{ user.displayName }}
             </span>
           </small>
           <small class="marktitle titlefont marksign">
             <el-button
               type="success"
-              @click="backIndex"
               size="small"
               icon="el-icon-arrow-left"
+              @click="backIndex"
             >
               <!-- <v-icon name="sign-out-alt" scale="0.5"/> -->
               <span class="titlefont">返回</span>
@@ -223,33 +218,33 @@
         <div class="box-body">
           <!-- 文本图片阅卷主界面 -->
           <tpMain
+            :paper-mark-sign="paperMarkSign"
+            :sign-item="signItem"
+            :sign-scores="signScores"
+            :sign-option="signOption"
+            :mark-sign="markSign"
+            :student-paper="studentPaper"
+            :exam-type="examType"
+            :answer-html="answerHtml"
             @changePaperSign="changePaperSign"
             @clearScores="clearScores"
             @changeSignScores="changeSignScores"
-            :paperMarkSign="paperMarkSign"
-            :signItem="signItem"
-            :signScores="signScores"
-            :signOption="signOption"
-            :markSign="markSign"
-            :studentPaper="studentPaper"
-            :examType="examType"
-            :answerHtml="answerHtml"
           ></tpMain>
           <!-- 文本图片给分板 -->
           <tpScoreboard
+            :paper-mark-sign="paperMarkSign"
+            :sign-item="signItem"
+            :sign-scores="signScores"
+            :sign-option="signOption"
+            :mark-sign="markSign"
+            :paper-mark="paperMark"
+            :marked-result="markedResult"
+            :result-items="resultItems"
+            :student-paper-id="studentPaper.id"
+            :score-step="studentPaper.scoreStep"
+            :mark-task-id="task.id"
             @submitMark="getNext"
             @changeSign="changeSign"
-            :paperMarkSign="paperMarkSign"
-            :signItem="signItem"
-            :signScores="signScores"
-            :signOption="signOption"
-            :markSign="markSign"
-            :paperMark="paperMark"
-            :markedResult="markedResult"
-            :resultItems="resultItems"
-            :studentPaperId="studentPaper.id"
-            :scoreStep="studentPaper.scoreStep"
-            :markTaskId="task.id"
           ></tpScoreboard>
         </div>
       </div>
@@ -263,12 +258,12 @@ import TpScoreBoard from "./TpScoreBoard.vue";
 import {
   MARKING_API,
   DATA_PROCESS_API,
-  QUESTION_API
+  QUESTION_API,
 } from "@/constants/constants";
 export default {
   components: {
     tpMain: TpMain,
-    tpScoreboard: TpScoreBoard
+    tpScoreboard: TpScoreBoard,
   },
   data() {
     return {
@@ -301,24 +296,24 @@ export default {
       problemTaskVisible: false,
       degree: [
         { label: "是", value: "Y" },
-        { label: "否", value: "N" }
+        { label: "否", value: "N" },
       ],
       markTaskFormSearch: {
         courseCode: "",
         courseName: "",
-        degree: ""
+        degree: "",
       },
       taskFormSearch: {
         courseCode: "",
         courseName: "",
-        paperCode: ""
+        paperCode: "",
       },
       course: {},
       workId: "",
       examType: "",
       markSearch: {
         userId: "",
-        workId: ""
+        workId: "",
       },
       //回评标志
       backMark: false,
@@ -326,12 +321,59 @@ export default {
       paperMark: true,
       tags: [],
       answerHtml: null,
-      rangeId: null
+      rangeId: null,
     };
   },
+  computed: {
+    allMarked() {
+      if (this.tasks.length == 0) {
+        return false;
+      } else {
+        for (let task of this.tasks) {
+          if (task.leftCount > 0) {
+            return false;
+          }
+        }
+        return true;
+      }
+    },
+    taskCur() {
+      //任务及时动态切换
+      if (this.tasks.length == 0) {
+        return 0;
+      } else {
+        for (let [index, task] of this.tasks.entries()) {
+          if (task.leftCount > 0) {
+            return index;
+          }
+        }
+        return 0;
+      }
+    },
+    changeTaskCur() {
+      for (let [index, task] of this.tasks.entries()) {
+        if (task.id == this.task.id) {
+          return index;
+        }
+      }
+      return this.taskCur;
+    },
+    ...mapState({ user: (state) => state.user }),
+  },
+  async created() {
+    this.loading = true;
+    await this.markInit();
+    //await this.getChangeTasks();
+    await this.getPaper();
+    await this.getAnswerHtml();
+    await this.getMarkRange();
+    await this.getMarkedTask();
+    this.getTags();
+    this.loading = false;
+  },
   methods: {
     getTags() {
-      this.$http.get(MARKING_API + "/markResults/tag").then(response => {
+      this.$http.get(MARKING_API + "/markResults/tag").then((response) => {
         this.tags = response.data;
       });
     },
@@ -419,7 +461,7 @@ export default {
             "&userId=" +
             userId
         )
-        .then(response => {
+        .then((response) => {
           self.tasks = response.data;
           self.taskTotal = self.tasks.length;
           //切换任务提交试卷后,继续维持该任务
@@ -453,7 +495,7 @@ export default {
             "&userId=" +
             userId
         )
-        .then(response => {
+        .then((response) => {
           self.changeTasks = response.data;
           self.changeTaskTotal = self.changeTasks.length;
           self.filterChangeTasks();
@@ -462,7 +504,7 @@ export default {
         });
     },
     filterChangeTasks() {
-      var tempData = this.changeTasks.filter(element => {
+      var tempData = this.changeTasks.filter((element) => {
         var flag = true;
         if (this.taskFormSearch.courseCode || this.taskFormSearch.courseName) {
           if (this.taskFormSearch.courseCode) {
@@ -501,11 +543,11 @@ export default {
       var self = this;
       await self.$http
         .get(DATA_PROCESS_API + "/studentPapers?markTaskId=" + self.task.id)
-        .then(response => {
+        .then((response) => {
           if (!response.data) {
             self.$notify({
               message: "该任务下试卷已评完,如有剩余任务将自动切换任务",
-              type: "warning"
+              type: "warning",
             });
             this.resultItems.splice(0, this.resultItems.length);
             self.studentPaper = { id: "" };
@@ -533,7 +575,7 @@ export default {
             "/" +
             this.markedPageSize
         )
-        .then(response => {
+        .then((response) => {
           self.markedResults = response.data.data;
           self.markedTotal = response.data.pageInfo.totalElements;
           self.markedCurrentPage = response.data.pageInfo.page + 1;
@@ -544,7 +586,7 @@ export default {
       var self = this;
       await self.$http
         .get(DATA_PROCESS_API + "/studentPapers/" + studentPaperId)
-        .then(response => {
+        .then((response) => {
           self.studentPaper = response.data;
           self.examType = response.data.examType;
         });
@@ -553,7 +595,7 @@ export default {
       var self = this;
       await self.$http
         .get(MARKING_API + "/markResults/" + markResultId)
-        .then(response => {
+        .then((response) => {
           self.resultItems = response.data.resultItems;
           self.markedResult = response.data;
           console.log(self.markedResult);
@@ -573,7 +615,7 @@ export default {
       var self = this;
       await self.$http
         .get(MARKING_API + "/markRanges/" + self.task.markRangeId)
-        .then(response => {
+        .then((response) => {
           self.markRange = response.data;
           self.getResultItems(self.markRange);
           console.log("markRange", self.markRange);
@@ -624,7 +666,7 @@ export default {
         this.$message({
           showClose: true,
           message: "轨迹模式已开启,只支持鼠标操作",
-          type: "warning"
+          type: "warning",
         });
       }
     },
@@ -633,59 +675,12 @@ export default {
         var paperId = this.studentPaper.basePaperId;
         await this.$http
           .get(QUESTION_API + "/extract/getAnswerHtml/" + paperId)
-          .then(response => {
+          .then((response) => {
             this.answerHtml = response.data;
           });
       }
-    }
-  },
-  computed: {
-    allMarked() {
-      if (this.tasks.length == 0) {
-        return false;
-      } else {
-        for (let task of this.tasks) {
-          if (task.leftCount > 0) {
-            return false;
-          }
-        }
-        return true;
-      }
-    },
-    taskCur() {
-      //任务及时动态切换
-      if (this.tasks.length == 0) {
-        return 0;
-      } else {
-        for (let [index, task] of this.tasks.entries()) {
-          if (task.leftCount > 0) {
-            return index;
-          }
-        }
-        return 0;
-      }
-    },
-    changeTaskCur() {
-      for (let [index, task] of this.tasks.entries()) {
-        if (task.id == this.task.id) {
-          return index;
-        }
-      }
-      return this.taskCur;
     },
-    ...mapState({ user: state => state.user })
   },
-  async created() {
-    this.loading = true;
-    await this.markInit();
-    //await this.getChangeTasks();
-    await this.getPaper();
-    await this.getAnswerHtml();
-    await this.getMarkRange();
-    await this.getMarkedTask();
-    this.getTags();
-    this.loading = false;
-  }
 };
 </script>
 <style scoped>

+ 125 - 129
src/modules/marking/views/TpMain.vue

@@ -1,15 +1,15 @@
 <template>
-  <div class="markmain pull-left" id="student_paper">
+  <div id="student_paper" class="markmain pull-left">
     <el-tabs :active-name="activeName">
       <el-tab-pane label="考生答卷" name="first">
-        <div v-if="this.examType != 'OFFLINE'">
-          <div id="main-source" v-if="this.studentPaper.id != ''">
+        <div v-if="examType != 'OFFLINE'">
+          <div v-if="studentPaper.id != ''" id="main-source">
             <div
+              v-if="!markSign"
               class="paper"
-              v-if="!this.markSign"
-              v-html="this.studentPaper.studentSubjectiveHtml"
+              v-html="studentPaper.studentSubjectiveHtml"
             ></div>
-            <div class="paper" v-show="this.markSign">
+            <div v-show="markSign" class="paper">
               <div class="fixed marktitle signTitle">
                 <el-button-group class="itemTitle">
                   <el-button type="info" size="small">
@@ -35,16 +35,16 @@
             </div>
           </div>
         </div>
-        <div v-if="this.examType == 'OFFLINE'">
-          <div v-if="this.studentPaper.id != ''">
-            <div v-html="getPdfUrl()" style="float: left;"></div>
+        <div v-if="examType == 'OFFLINE'">
+          <div v-if="studentPaper.id != ''">
+            <div style="float: left" v-html="getPdfUrl()"></div>
             <div
               v-if="
-                this.studentPaper.studentSubjectiveHtml &&
-                  this.studentPaper.studentSubjectiveHtml != '' &&
-                  this.studentPaper.studentSubjectiveHtml.indexOf('.pdf') > -1
+                studentPaper.studentSubjectiveHtml &&
+                studentPaper.studentSubjectiveHtml != '' &&
+                studentPaper.studentSubjectiveHtml.indexOf('.pdf') > -1
               "
-              style="float: right;margin-right: 20px;"
+              style="float: right; margin-right: 20px"
               class="no-print"
             >
               <el-button size="small" type="success" @click="pdfDown()"
@@ -54,19 +54,15 @@
           </div>
         </div>
       </el-tab-pane>
-      <template v-if="this.examType == 'OFFLINE'">
+      <template v-if="examType == 'OFFLINE'">
         <el-tab-pane label="标答" name="second">
-          <div id="answer-source" v-if="this.examType == 'OFFLINE'">
-            <div style="float: right;margin-right: 20px;" class="no-print">
+          <div v-if="examType == 'OFFLINE'" id="answer-source">
+            <div style="float: right; margin-right: 20px" class="no-print">
               <el-button size="small" type="success" @click="printAnswer()"
                 >打印</el-button
               >
             </div>
-            <div
-              class="paper"
-              id="answer-content"
-              v-html="this.answerHtml"
-            ></div>
+            <div id="answer-content" class="paper" v-html="answerHtml"></div>
           </div>
         </el-tab-pane>
       </template>
@@ -82,6 +78,16 @@ import "viewerjs/dist/viewer.css";
 import Viewer from "viewerjs";
 import { mapState } from "vuex";
 export default {
+  props: [
+    "paperMarkSign",
+    "studentPaper",
+    "markSign",
+    "signOption",
+    "signScores",
+    "signItem",
+    "examType",
+    "answerHtml",
+  ],
   data() {
     return {
       activeName: "first",
@@ -92,20 +98,96 @@ export default {
       picModel: false,
       picForm: {
         imgUrl: "",
-        rotate: 0
-      }
+        rotate: 0,
+      },
     };
   },
-  props: [
-    "paperMarkSign",
-    "studentPaper",
-    "markSign",
-    "signOption",
-    "signScores",
-    "signItem",
-    "examType",
-    "answerHtml"
-  ],
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+    itemTitle() {
+      if (!this.markSign) return "无";
+      var title = "无";
+      if (this.signItem.id) {
+        title =
+          Number.parseInt(this.signItem.mainNumber) +
+          1 +
+          "(" +
+          this.signItem.orders +
+          ")";
+      }
+      return title;
+    },
+    itemKey() {
+      if (!this.markSign) return "";
+      return this.studentPaper.id + "-" + this.signItem.id;
+    },
+    paperKey() {
+      if (!this.markSign) return "";
+      return this.studentPaper.id;
+    },
+    paperSigns() {
+      if (!this.markSign) return [];
+      var paperSigns = [];
+      if (this.drawing.scoreLoc.length > 0) {
+        for (let scoreLoc of this.drawing.scoreLoc) {
+          paperSigns.push({
+            loc: scoreLoc.loc,
+            score: scoreLoc.score,
+            itemId: scoreLoc.itemId,
+          });
+        }
+      }
+      return paperSigns;
+    },
+  },
+  watch: {
+    signItem(val) {
+      if (this.markSign) {
+        console.log("signItem", val);
+        this.changeMarkSign();
+      }
+    },
+    studentPaper() {
+      if (this.markSign) {
+        this.intMarkDraw();
+      }
+    },
+    tmpSignScores(val) {
+      this.$emit("changeSignScores", val);
+    },
+    signScores(val) {
+      this.tmpSignScores = val;
+    },
+    markSign() {
+      this.intMarkDraw();
+    },
+    paperSigns(val) {
+      this.$emit("changePaperSign", val);
+    },
+  },
+  mounted() {
+    //this.createMarkDraw();
+    window.viewPicture = this.viewPicture;
+  },
+  created() {
+    EVENTHUB.$on("positionDiv", function (id) {
+      let o = document.getElementById("student_paper");
+      o.scrollTop = 0;
+      var height = 0;
+      let outObject = document.getElementById("anchor-" + id);
+      if (outObject) {
+        if (outObject.currentStyle) {
+          height = parseInt(outObject.currentStyle["marginTop"]);
+        } else {
+          height = parseInt(
+            document.defaultView.getComputedStyle(outObject, null)["marginTop"]
+          );
+        }
+        var y = document.getElementById("anchor-" + id).offsetTop - height / 2;
+        o.scrollTop = y - 5;
+      }
+    });
+  },
   methods: {
     viewPicture(imagesClass, index) {
       const viewer = new Viewer(document.querySelector(imagesClass), {
@@ -122,20 +204,20 @@ export default {
           prev: 1,
           play: {
             show: 0,
-            size: "large"
+            size: "large",
           },
           next: 1,
           rotateLeft: 1,
           rotateRight: 1,
           flipHorizontal: 1,
-          flipVertical: 1
+          flipVertical: 1,
         },
         ready() {
           viewer.view(index);
         },
         hidden() {
           viewer.destroy();
-        }
+        },
       });
       viewer.show();
     },
@@ -190,7 +272,7 @@ export default {
     },
     generateUUID() {
       let date = new Date().getTime();
-      return "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, function(c) {
+      return "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, function (c) {
         let r = (date + Math.random() * 16) % 16 | 0;
         date = Math.floor(date / 16);
         return (c == "x" ? r : (r & 0x3) | 0x8).toString(16);
@@ -199,6 +281,7 @@ export default {
     createMarkDraw() {
       console.log("create");
       var drawing = {};
+      // eslint-disable-next-line vue/no-mutating-props
       this.signOption.data = this.studentPaper.studentSubjectiveHtml;
       drawing = new Drawing("canvas", this.signOption);
       this.drawing = drawing;
@@ -221,12 +304,12 @@ export default {
         localStorage.setItem(this.paperKey, JSON.stringify(this.paperSigns));
         this.$notify({
           message: "轨迹保存成功",
-          type: "success"
+          type: "success",
         });
       } else {
         this.$notify({
           message: "请选择给分步骤",
-          type: "error"
+          type: "error",
         });
       }
     },
@@ -275,7 +358,7 @@ export default {
         this.setSignLocation();
         this.$notify({
           message: "轨迹清除成功",
-          type: "success"
+          type: "success",
         });
       }
     },
@@ -318,7 +401,7 @@ export default {
         this.drawing.ResetDrawAll();
         this.$notify({
           message: "轨迹全部清除成功",
-          type: "success"
+          type: "success",
         });
       }
     },
@@ -358,98 +441,11 @@ export default {
       } else {
         this.$notify({
           message: "离线url为空",
-          type: "warning"
+          type: "warning",
         });
       }
-    }
-  },
-  computed: {
-    ...mapState({ user: state => state.user }),
-    itemTitle() {
-      if (!this.markSign) return "无";
-      var title = "无";
-      if (this.signItem.id) {
-        title =
-          Number.parseInt(this.signItem.mainNumber) +
-          1 +
-          "(" +
-          this.signItem.orders +
-          ")";
-      }
-      return title;
-    },
-    itemKey() {
-      if (!this.markSign) return "";
-      return this.studentPaper.id + "-" + this.signItem.id;
-    },
-    paperKey() {
-      if (!this.markSign) return "";
-      return this.studentPaper.id;
     },
-    paperSigns() {
-      if (!this.markSign) return [];
-      var paperSigns = [];
-      if (this.drawing.scoreLoc.length > 0) {
-        for (let scoreLoc of this.drawing.scoreLoc) {
-          paperSigns.push({
-            loc: scoreLoc.loc,
-            score: scoreLoc.score,
-            itemId: scoreLoc.itemId
-          });
-        }
-      }
-      return paperSigns;
-    }
-  },
-  watch: {
-    signItem(val) {
-      if (this.markSign) {
-        console.log("signItem", val);
-        this.changeMarkSign();
-      }
-    },
-    studentPaper() {
-      if (this.markSign) {
-        this.intMarkDraw();
-      }
-    },
-    tmpSignScores(val) {
-      this.$emit("changeSignScores", val);
-    },
-    signScores(val) {
-      this.tmpSignScores = val;
-    },
-    markSign() {
-      this.intMarkDraw();
-    },
-    paperSigns(val) {
-      this.$emit("changePaperSign", val);
-    }
-  },
-  updated() {},
-  mounted() {
-    //this.createMarkDraw();
-    window.viewPicture = this.viewPicture;
   },
-  created() {
-    EVENTHUB.$on("positionDiv", function(id) {
-      let o = document.getElementById("student_paper");
-      o.scrollTop = 0;
-      var height = 0;
-      let outObject = document.getElementById("anchor-" + id);
-      if (outObject) {
-        if (outObject.currentStyle) {
-          height = parseInt(outObject.currentStyle["marginTop"]);
-        } else {
-          height = parseInt(
-            document.defaultView.getComputedStyle(outObject, null)["marginTop"]
-          );
-        }
-        var y = document.getElementById("anchor-" + id).offsetTop - height / 2;
-        o.scrollTop = y - 5;
-      }
-    });
-  }
 };
 </script>
 <style scoped>

+ 175 - 174
src/modules/marking/views/TpScoreBoard.vue

@@ -4,8 +4,8 @@
       <div class="first-board">
         <span class="title-font">操作方式切换:</span>
         <el-switch
-          class="pull-right"
           v-model="isMouseMode"
+          class="pull-right"
           active-text="鼠标"
           inactive-text="键盘"
           active-color="#4cb0f9"
@@ -15,7 +15,7 @@
       <div class="second-board">
         <div class="board-title"><span>总分</span></div>
         <div class="board-score">
-          <span>{{ this.totalScore }}分</span>
+          <span>{{ totalScore }}分</span>
         </div>
       </div>
       <!-- 鼠标模式 -->
@@ -23,34 +23,34 @@
         <div class="title-board"><span class="title-font">评分</span></div>
         <div class="itemScroll">
           <div
-            :key="resultItem.markItem.id"
-            v-for="(resultItem, index) in resultItems"
+            v-for="(resultItemInner, index) in resultItems"
+            :id="resultItemInner.markItem.id"
+            :key="resultItemInner.markItem.id"
             class="pull-left scoretitle titlebutton"
             size="small"
-            :id="resultItem.markItem.id"
             @click="
               itemClick(
-                resultItem.markItem.id,
+                resultItemInner.markItem.id,
                 $event,
-                resultItem.markItem.orders
+                resultItemInner.markItem.orders
               )
             "
           >
             <div
-              v-bind:class="{ 'active-btn': itemClass[index] }"
+              :class="{ 'active-btn': itemClass[index] }"
               class="title-item-top"
             >
               <span>
-                {{ resultItem.markItem.mainNumber }}({{
-                  resultItem.markItem.orders
+                {{ resultItemInner.markItem.mainNumber }}({{
+                  resultItemInner.markItem.orders
                 }})
               </span>
             </div>
             <div
               class="title-item-bottom"
-              v-bind:class="{ 'active-text': itemClass[index] }"
+              :class="{ 'active-text': itemClass[index] }"
             >
-              <span>{{ resultItem.score }}分</span>
+              <span>{{ resultItemInner.score }}分</span>
             </div>
           </div>
         </div>
@@ -59,14 +59,14 @@
           <div class="title-board"><span class="title-font">打分</span></div>
           <div class="itemScroll">
             <div
-              :key="score"
               v-for="(score, index) in itemScores"
+              :key="score"
               class="pull-left scoretitle"
             >
               <div
-                @click="scoreClick(score, index)"
                 class="scorebutton"
-                v-bind:class="{ 'score-btn': itemScoreBtn[index] }"
+                :class="{ 'score-btn': itemScoreBtn[index] }"
+                @click="scoreClick(score, index)"
               >
                 <span class="score-item">{{ score }}</span>
               </div>
@@ -80,34 +80,36 @@
         <div>
           <div class="itemScroll">
             <div
-              :key="resultItem.markItem.id"
-              v-for="(resultItem, index) in resultItems"
+              v-for="(resultItemInner, index) in resultItems"
+              :key="resultItemInner.markItem.id"
               class="scoretitle"
             >
               <div class="box-card">
                 <div class="item-title">
                   <div class="pull-left item-number">
-                    {{ resultItem.markItem.mainNumber }}({{
-                      resultItem.markItem.orders
+                    {{ resultItemInner.markItem.mainNumber }}({{
+                      resultItemInner.markItem.orders
                     }})
                   </div>
                   <div class="pull-left item-number2">
-                    <span>{{ resultItem.markItem.maxScore }}分</span>
+                    <span>{{ resultItemInner.markItem.maxScore }}分</span>
                   </div>
                   <div class="pull-left item-number3">
-                    间隔:{{ itemScoreStep(resultItem.markItem.scoreInterval) }}
+                    间隔:{{
+                      itemScoreStep(resultItemInner.markItem.scoreInterval)
+                    }}
                   </div>
                 </div>
                 <div class="item-score">
                   <input
-                    :id="getItemId(resultItem.markItem.id)"
-                    @focus="scoreFocus(resultItem)"
-                    @keydown.enter="scoreEnter(index, resultItem)"
-                    @keydown.up="scoreUp(index, resultItem)"
-                    @keydown.down="scoreDown(index, resultItem)"
-                    @change="scoreChange(index, resultItem.score)"
-                    v-model="resultItem.score"
+                    :id="getItemId(resultItemInner.markItem.id)"
+                    v-model="resultItemInner.score"
                     class="score-input"
+                    @focus="scoreFocus(resultItemInner)"
+                    @keydown.enter="scoreEnter(index, resultItemInner)"
+                    @keydown.up="scoreUp(index, resultItemInner)"
+                    @keydown.down="scoreDown(index, resultItemInner)"
+                    @change="scoreChange(index, resultItemInner.score)"
                   />
                 </div>
@@ -132,14 +134,14 @@
             @click="showTextarea"
           ></div>
         </div>
-        <div class="remark-step" v-if="textareaflag">
+        <div v-if="textareaflag" class="remark-step">
           <textarea
             id="remark"
+            v-model="markedResult.markRemark"
             type="text"
             rows="3"
             cols="35"
             placeholder="请输入内容"
-            v-model="markedResult.markRemark"
           />
         </div>
       </div>
@@ -153,9 +155,9 @@
               @change="processTagPaper"
             >
               <div
-                class="pull-left scoretitle"
                 v-for="tag in tags"
                 :key="tag.code"
+                class="pull-left scoretitle"
               >
                 <el-radio :label="tag.code">{{ tag.name }}</el-radio>
               </div>
@@ -164,44 +166,44 @@
           <span v-if="!tagFlag">
             <el-radio-group v-model="unusualType" @change="processTagPaper">
               <div
-                class="pull-left scoretitle"
                 v-for="tag in tags"
                 :key="tag.code"
+                class="pull-left scoretitle"
               >
-                <el-radio :label="tag.code" :key="tag.code">{{
+                <el-radio :key="tag.code" :label="tag.code">{{
                   tag.name
                 }}</el-radio>
               </div>
             </el-radio-group>
           </span>
         </div>
-        <div class="pull-left btn" v-if="paperMark">
+        <div v-if="paperMark" class="pull-left btn">
           <el-button
             id="subMarkBtn"
             class="submit-button"
             type="primary"
             size="small"
+            :round="true"
+            :loading="loading"
             @keydown.enter="submitMark"
             @click="submitMark"
-            v-bind:round="true"
-            :loading="loading"
           >
             <span class="sub-btn">提</span> <span>交</span>
           </el-button>
         </div>
-        <div class="pull-left btn" v-if="paperMark">
+        <div v-if="paperMark" class="pull-left btn">
           <el-button
             type="danger"
-            v-bind:round="true"
+            :round="true"
             size="small"
             @click="problemClick"
             >问题卷</el-button
           >
         </div>
-        <div class="pull-left btn" v-if="paperMark && problemView">
+        <div v-if="paperMark && problemView" class="pull-left btn">
           <el-button
             type="danger"
-            v-bind:round="true"
+            :round="true"
             size="small"
             @click="resetProblem"
             >清除问题卷</el-button
@@ -218,6 +220,20 @@ import { mapState } from "vuex";
 import { CORE_API, MARKING_API } from "@/constants/constants";
 import { EVENTHUB } from "../constants/constants";
 export default {
+  props: [
+    "paperMarkSign",
+    "signScores",
+    "signChange",
+    "signOption",
+    "markSign",
+    "markRange",
+    "studentPaperId",
+    "markTaskId",
+    "resultItems",
+    "markedResult",
+    "paperMark",
+    "scoreStep",
+  ],
   data() {
     return {
       activeName: "first",
@@ -228,7 +244,7 @@ export default {
       markItemId: "",
       resultItem: {
         markItem: {},
-        score: 0
+        score: 0,
       },
       markTypeView: false,
       problemView: false,
@@ -245,26 +261,107 @@ export default {
       unusualType: "",
       scoreError: [],
       itemScoreBtn: [],
-      loading: false
+      loading: false,
     };
   },
-  props: [
-    "paperMarkSign",
-    "signScores",
-    "signChange",
-    "signOption",
-    "markSign",
-    "markRange",
-    "studentPaperId",
-    "markTaskId",
-    "resultItems",
-    "markedResult",
-    "paperMark",
-    "scoreStep"
-  ],
+  computed: {
+    tagFlag() {
+      if (this.markedResult.id) {
+        return true;
+      } else {
+        return false;
+      }
+    },
+    paperKey() {
+      if (!this.markSign) return "";
+      return this.studentPaperId;
+    },
+    signScoreSum() {
+      var sum = 0;
+      for (let signScore of this.signScores) {
+        sum += signScore;
+      }
+      return sum;
+    },
+    itemClass() {
+      var itemClass = [];
+      for (let resultItem of this.resultItems) {
+        if (resultItem.score.length == 0) {
+          itemClass.push(false);
+        } else {
+          itemClass.push(true);
+        }
+      }
+      return itemClass;
+    },
+    totalScore() {
+      var totalScore = 0;
+      for (let resultItem of this.resultItems) {
+        if (resultItem.score.length == 0) {
+          totalScore = this.accAdd(totalScore, 0);
+        } else {
+          totalScore = this.accAdd(
+            totalScore,
+            Number.parseFloat(resultItem.score)
+          );
+        }
+      }
+      return totalScore;
+    },
+    itemScores() {
+      var itemScores = [];
+      var scoreInterval = this.resultItem.markItem.scoreInterval;
+      if (this.scoreStep != null) {
+        scoreInterval = this.scoreStep;
+      }
+      let i = 0;
+      let j = 0;
+      do {
+        itemScores[j] = i;
+        i = this.accAdd(i, scoreInterval);
+        j++;
+      } while (i <= this.resultItem.markItem.maxScore);
+      if (
+        itemScores[itemScores.length - 1] < this.resultItem.markItem.maxScore
+      ) {
+        itemScores[itemScores.length] = this.resultItem.markItem.maxScore;
+      }
+      return itemScores;
+    },
+    ...mapState({ user: (state) => state.user }),
+  },
+  watch: {
+    resultItems: {
+      immediate: false,
+      handler() {
+        if (!this.isMouseMode) {
+          //切换不同考试的试卷时,光标定位要在resultItems变化之后做
+          this.initKeyBoardMode();
+        }
+      },
+    },
+    signItem(val) {
+      this.tmpSignItem = val;
+    },
+    tmpSignItem(val) {
+      this.$emit("changeSign", val);
+    },
+    isMouseMode(val) {
+      if (!val) {
+        this.initKeyBoardMode();
+      }
+    },
+    studentPaperId() {
+      if (!this.isMouseMode) {
+        this.initKeyBoardMode();
+      }
+    },
+  },
+  created() {
+    this.getTags();
+  },
   methods: {
     ...mapActions([USER_SIGNOUT]),
-
     resetProblem() {
       if (this.markedResult.tag) {
         this.markedResult.tag = "";
@@ -290,7 +387,7 @@ export default {
       }
     },
     getTags() {
-      this.$http.get(MARKING_API + "/markResults/tag").then(response => {
+      this.$http.get(MARKING_API + "/markResults/tag").then((response) => {
         this.tags = response.data;
         //移除科目错误
         for (let i = 0; i < this.tags.length; i++) {
@@ -323,7 +420,7 @@ export default {
           } else {
             this.resultItem = {
               markItem: value.markItem,
-              score: ""
+              score: "",
             };
           }
           this.curIndex = index;
@@ -350,7 +447,7 @@ export default {
       this.$notify({
         showClose: true,
         message: "当前选择题目为" + title,
-        type: "warning"
+        type: "warning",
       });
     },
     checkSignScore(score) {
@@ -372,7 +469,7 @@ export default {
         this.$notify({
           message: "分数不能为空",
           type: "error",
-          duration: 2000
+          duration: 2000,
         });
         return false;
       } else {
@@ -381,7 +478,7 @@ export default {
           this.$notify({
             message: "分数必须为数字且最多一位小数",
             type: "error",
-            duration: 2000
+            duration: 2000,
           });
           return false;
         } else {
@@ -389,7 +486,7 @@ export default {
             this.$notify({
               message: "分数不能超过" + maxScore + "分",
               type: "error",
-              duration: 2000
+              duration: 2000,
             });
             return false;
           }
@@ -408,7 +505,7 @@ export default {
         this.$notify({
           message: "分数必须是给分间隔的倍数或者零分、满分",
           type: "error",
-          duration: 2000
+          duration: 2000,
         });
         return false;
       }
@@ -425,7 +522,7 @@ export default {
         } else {
           this.$notify({
             message: "轨迹总分不能超过满分",
-            type: "error"
+            type: "error",
           });
         }
       } else {
@@ -534,7 +631,7 @@ export default {
           this.$notify({
             title: "警告",
             message: itemName + "没有打分,请打分",
-            type: "warning"
+            type: "warning",
           });
           if (!this.isMouseMode) {
             let curItemInput = "item" + resultItem.markItem.id;
@@ -580,17 +677,17 @@ export default {
             this.resultItems
           )
           .then(
-            response => {
+            (response) => {
               this.saveMarkSign();
               if (response.data.id) {
                 this.$notify({
                   message: "提交成功",
-                  type: "success"
+                  type: "success",
                 });
               } else {
                 this.$notify({
                   message: "提交失败",
-                  type: "error"
+                  type: "error",
                 });
               }
               //调用Marking.vue中方法:执行的是拿取下一份试卷
@@ -600,7 +697,7 @@ export default {
               this.problemView = false;
               this.unusualType = "";
             },
-            error => {
+            (error) => {
               // 响应错误回调
               if (error.response.data.desc) {
                 var errorInfo = error.response.data.desc;
@@ -620,26 +717,26 @@ export default {
                             this.USER_SIGNOUT();
                             window.name = "";
                             this.$router.replace({
-                              path: "/login" + "?orgId=" + orgId
+                              path: "/login" + "?orgId=" + orgId,
                             });
                           })
-                          .catch(response => {
+                          .catch((response) => {
                             const orgId = this.user.rootOrgId;
                             if (response.status == 500) {
                               this.$notify({
                                 showClose: true,
                                 message: response.data.desc,
-                                type: "error"
+                                type: "error",
                               });
                             }
                             this.USER_SIGNOUT();
                             window.name = "";
                             this.$router.replace({
-                              path: "/login" + "?orgId=" + orgId
+                              path: "/login" + "?orgId=" + orgId,
                             });
                           });
                         return;
-                      }
+                      },
                     }
                   );
                 } else {
@@ -656,7 +753,7 @@ export default {
               } else {
                 this.$notify({
                   message: "提交失败",
-                  type: "error"
+                  type: "error",
                 });
                 this.$emit("submitMark");
                 this.loading = false;
@@ -676,7 +773,7 @@ export default {
               this.saveMarkSign();
               this.$notify({
                 message: "提交成功",
-                type: "success"
+                type: "success",
               });
               this.$emit("submitMark");
               this.loading = false;
@@ -684,7 +781,7 @@ export default {
               this.problemView = false;
               this.unusualType = "";
             },
-            error => {
+            (error) => {
               // 响应错误回调
               if (error.response.data.code == 403) {
                 this.$loading().close();
@@ -740,104 +837,8 @@ export default {
         return this.scoreStep;
       }
       return scoreInterval;
-    }
-  },
-  watch: {
-    resultItems: {
-      immediate: false,
-      handler() {
-        if (!this.isMouseMode) {
-          //切换不同考试的试卷时,光标定位要在resultItems变化之后做
-          this.initKeyBoardMode();
-        }
-      }
-    },
-    signItem(val) {
-      this.tmpSignItem = val;
-    },
-    tmpSignItem(val) {
-      this.$emit("changeSign", val);
-    },
-    isMouseMode(val) {
-      if (!val) {
-        this.initKeyBoardMode();
-      }
-    },
-    studentPaperId() {
-      if (!this.isMouseMode) {
-        this.initKeyBoardMode();
-      }
-    }
-  },
-  computed: {
-    tagFlag() {
-      if (this.markedResult.id) {
-        return true;
-      } else {
-        return false;
-      }
-    },
-    paperKey() {
-      if (!this.markSign) return "";
-      return this.studentPaperId;
     },
-    signScoreSum() {
-      var sum = 0;
-      for (let signScore of this.signScores) {
-        sum += signScore;
-      }
-      return sum;
-    },
-    itemClass() {
-      var itemClass = [];
-      for (let resultItem of this.resultItems) {
-        if (resultItem.score.length == 0) {
-          itemClass.push(false);
-        } else {
-          itemClass.push(true);
-        }
-      }
-      return itemClass;
-    },
-    totalScore() {
-      var totalScore = 0;
-      for (let resultItem of this.resultItems) {
-        if (resultItem.score.length == 0) {
-          totalScore = this.accAdd(totalScore, 0);
-        } else {
-          totalScore = this.accAdd(
-            totalScore,
-            Number.parseFloat(resultItem.score)
-          );
-        }
-      }
-      return totalScore;
-    },
-    itemScores() {
-      var itemScores = [];
-      var scoreInterval = this.resultItem.markItem.scoreInterval;
-      if (this.scoreStep != null) {
-        scoreInterval = this.scoreStep;
-      }
-      let i = 0;
-      let j = 0;
-      do {
-        itemScores[j] = i;
-        i = this.accAdd(i, scoreInterval);
-        j++;
-      } while (i <= this.resultItem.markItem.maxScore);
-      if (
-        itemScores[itemScores.length - 1] < this.resultItem.markItem.maxScore
-      ) {
-        itemScores[itemScores.length] = this.resultItem.markItem.maxScore;
-      }
-      return itemScores;
-    },
-    ...mapState({ user: state => state.user })
   },
-  created() {
-    this.getTags();
-  }
 };
 </script>
 <style scoped>

+ 24 - 24
src/modules/marking/views/ViewPaper.vue

@@ -1,18 +1,18 @@
 <template>
   <div style="position: relative">
-    <LinkTitlesCustom :currentPaths="['试卷检查', '试卷列表', '试卷详情']" />
-    <div style="position: absolute;right: 10px;">
+    <LinkTitlesCustom :current-paths="['试卷检查', '试卷列表', '试卷详情']" />
+    <div style="position: absolute; right: 10px">
       <el-button
         type="primary"
         size="small"
-        @click="back"
-        style="padding-bottom:8px;"
+        style="padding-bottom: 8px"
         icon="el-icon-arrow-left"
+        @click="back"
         >返回</el-button
       >
     </div>
     <br />
-    <div style="margin-left:50px;width: 95%;height: 80%" v-html="html"></div>
+    <div style="margin-left: 50px; width: 95%; height: 80%" v-html="html"></div>
   </div>
 </template>
 <script>
@@ -22,6 +22,9 @@ import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
 import "viewerjs/dist/viewer.css";
 import Viewer from "viewerjs";
 export default {
+  components: {
+    LinkTitlesCustom,
+  },
   data() {
     return {
       workId: "",
@@ -31,15 +34,20 @@ export default {
       picModel: false,
       picForm: {
         imgUrl: "",
-        rotate: 0
-      }
+        rotate: 0,
+      },
     };
   },
-  components: {
-    LinkTitlesCustom
-  },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    this.workId = this.$route.params.workId;
+    this.studentPaperId = this.$route.params.studentPaperId;
+    this.getStudentPaper();
+  },
+  mounted() {
+    window.viewPicture = this.viewPicture;
   },
   methods: {
     viewPicture(imagesClass, index) {
@@ -55,20 +63,20 @@ export default {
           prev: 1,
           play: {
             show: 0,
-            size: "large"
+            size: "large",
           },
           next: 1,
           rotateLeft: 1,
           rotateRight: 1,
           flipHorizontal: 1,
-          flipVertical: 1
+          flipVertical: 1,
         },
         ready() {
           viewer.view(index);
         },
         hidden() {
           viewer.destroy();
-        }
+        },
       });
       viewer.show();
     },
@@ -78,20 +86,12 @@ export default {
     getStudentPaper() {
       var url =
         DATA_PROCESS_API + "/studentPapers/check/" + this.studentPaperId;
-      this.$http.get(url).then(response => {
+      this.$http.get(url).then((response) => {
         console.log(response);
         this.html = response.data.studentSubjectiveHtml;
       });
-    }
-  },
-  created() {
-    this.workId = this.$route.params.workId;
-    this.studentPaperId = this.$route.params.studentPaperId;
-    this.getStudentPaper();
+    },
   },
-  mounted() {
-    window.viewPicture = this.viewPicture;
-  }
 };
 </script>
 <style>

+ 27 - 14
src/modules/oe/component/commonExport.vue

@@ -1,25 +1,38 @@
 <template>
   <span>
     <el-button
-      type="primary"
       v-show="!exportLoading"
-      @click="exportData"
+      type="primary"
       size="small"
       icon="el-icon-download"
+      @click="exportData"
       >导出
     </el-button>
     <el-button
+      v-show="exportLoading"
       size="small"
       icon="el-icon-download"
       :loading="true"
-      v-show="exportLoading"
       >导出数据中...
     </el-button>
-  </span></template
->
+  </span>
+</template>
 <script>
 export default {
-  props: ["form", "exportUrl", "exportFileName"],
+  props: {
+    form: {
+      type: Object,
+      default: () => {},
+    },
+    exportUrl: {
+      type: String,
+      default: "",
+    },
+    exportFileName: {
+      type: String,
+      default: "",
+    },
+  },
   data() {
     return { exportLoading: false };
   },
@@ -30,29 +43,29 @@ export default {
           title: "警告",
           message: "请选择考试",
           type: "warning",
-          duration: 1000
+          duration: 1000,
         });
         return false;
       }
       this.$confirm("确定执行导出?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         this.exportLoading = true;
         this.$http
           .get(this.exportUrl, {
             params: {
-              query: this.form
+              query: this.form,
             },
             responseType: "arraybuffer",
-            timeout: 20 * 60 * 1000 //限时20分钟
+            timeout: 20 * 60 * 1000, //限时20分钟
           })
-          .then(response => {
+          .then((response) => {
             if (response.data) {
               var blob = new Blob([response.data], {
                 type:
-                  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
+                  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
               });
               var url = URL.createObjectURL(blob);
               var a = document.createElement("a");
@@ -65,7 +78,7 @@ export default {
             this.exportLoading = false;
           });
       });
-    }
-  }
+    },
+  },
 };
 </script>

+ 65 - 58
src/modules/oe/component/commonForm.vue

@@ -1,18 +1,19 @@
 <template>
+  <!-- eslint-disable vue/no-mutating-props -->
   <el-form :model="form" label-width="70px">
     <el-col :span="6">
       <el-form-item label="考试">
         <el-select
-          class="form_search_width"
           v-model="form.examId"
+          class="form_search_width"
           filterable
           remote
           :remote-method="getExams"
-          @change="changeExam"
           clearable
-          @clear="getExams"
           placeholder="请选择考试"
           size="small"
+          @change="changeExam"
+          @clear="getExams"
         >
           <el-option
             v-for="item in examList"
@@ -26,6 +27,7 @@
     <el-col :span="6">
       <el-form-item label="场次">
         <el-select
+          v-model="form.examStageId"
           clearable
           :disabled="examStageDisabled4Search"
           class="form_search_width"
@@ -33,15 +35,14 @@
           remote
           :loading="queryExamStages4SearchLoading"
           :filterable="true"
-          v-model="form.examStageId"
           placeholder="请选择"
           size="small"
         >
           <el-option
             v-for="item in examStageList4Search"
+            :key="item.id"
             :label="`${item.stageOrder} (${item.startTime}至${item.endTime})`"
             :value="item.id"
-            :key="item.id"
           ></el-option>
         </el-select>
       </el-form-item>
@@ -49,17 +50,17 @@
     <el-col :span="6">
       <el-form-item label="学习中心">
         <el-select
-          class="form_search_width"
           v-if="currentPagePrivileges.ORG_FIND_ALL"
           v-model="form.orgId"
+          class="form_search_width"
           filterable
           remote
           :remote-method="getOrgs"
-          @change="getCourses"
           clearable
-          @clear="getOrgs"
           placeholder="全部"
           size="small"
+          @change="getCourses"
+          @clear="getOrgs"
         >
           <el-option
             v-for="item in orgList"
@@ -69,10 +70,10 @@
           ></el-option>
         </el-select>
         <el-input
+          v-if="!currentPagePrivileges.ORG_FIND_ALL"
+          v-model="orgName"
           class="form_search_width"
           size="small"
-          v-model="orgName"
-          v-if="!currentPagePrivileges.ORG_FIND_ALL"
           :disabled="true"
         ></el-input>
         <el-radio v-show="false" v-model="form.ORG_FIND_ALL"></el-radio>
@@ -81,8 +82,8 @@
     <el-col :span="6">
       <el-form-item label="课程">
         <el-select
-          class="form_search_width"
           v-model="form.courseId"
+          class="form_search_width"
           clearable
           filterable
           placeholder="全部"
@@ -100,8 +101,8 @@
     <el-col :span="6">
       <el-form-item label="学生姓名">
         <el-input
-          size="small"
           v-model="form.studentName"
+          size="small"
           placeholder="姓名"
           class="form_search_width"
         ></el-input>
@@ -110,8 +111,8 @@
     <el-col :span="6">
       <el-form-item label="课程层次">
         <el-select
-          class="form_search_width"
           v-model="form.courseLevel"
+          class="form_search_width"
           clearable
           placeholder="不限"
           size="small"
@@ -128,9 +129,9 @@
     <el-col :span="6">
       <el-form-item label="身份证号">
         <el-input
+          v-model="form.identityNumber"
           class="form_search_width"
           size="small"
-          v-model="form.identityNumber"
           placeholder="身份证号"
         ></el-input>
       </el-form-item>
@@ -138,8 +139,8 @@
     <el-col :span="6">
       <el-form-item label="学号">
         <el-input
-          size="small"
           v-model="form.studentCode"
+          size="small"
           placeholder="学号"
           class="form_search_width"
         ></el-input>
@@ -149,11 +150,17 @@
   </el-form>
 </template>
 <script>
+/* eslint-disable vue/no-mutating-props */
+
 import { EXAM_WORK_API } from "@/constants/constants";
 import { COURSE_LEVELS } from "../constants/constants";
+
 import { mapState } from "vuex";
 export default {
-  props: ["form", "getExamCondition"],
+  props: {
+    form: { type: Object, default: () => {} },
+    getExamCondition: { type: Object, default: () => {} },
+  },
   data() {
     return {
       examList: [],
@@ -161,16 +168,39 @@ export default {
       orgList: [],
       courseLevels: COURSE_LEVELS,
       currentPagePrivileges: {
-        ORG_FIND_ALL: false //查询所有学习中心
+        ORG_FIND_ALL: false, //查询所有学习中心
       },
       orgName: "",
       examStageDisabled4Search: true,
       queryExamStages4SearchLoading: false,
-      examStageList4Search: []
+      examStageList4Search: [],
     };
   },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    this.getExams("");
+    let params = new URLSearchParams();
+    params.append(
+      "privilegeCodes",
+      Object.keys(this.currentPagePrivileges).toString()
+    );
+    this.$http
+      .post("/api/ecs_core/rolePrivilege/checkPrivileges?" + params)
+      .then((response) => {
+        this.currentPagePrivileges = response.data;
+        this.form.ORG_FIND_ALL = this.currentPagePrivileges.ORG_FIND_ALL;
+        if (!this.currentPagePrivileges.ORG_FIND_ALL) {
+          var userId = this.user.userId;
+          this.$http.get("/api/ecs_core/user/" + userId).then((response) => {
+            this.form.orgId = response.data.orgId;
+            this.orgName = response.data.orgName;
+          });
+        } else {
+          this.getOrgs("");
+        }
+      });
   },
   methods: {
     getExams(examName) {
@@ -181,18 +211,18 @@ export default {
       this.getExamCondition.params.enable = true;
       this.$http
         .get("/api/ecs_exam_work/exam/queryByNameLike", {
-          params: this.getExamCondition.params
+          params: this.getExamCondition.params,
         })
-        .then(response => {
+        .then((response) => {
           var examList = response.data;
           if (this.getExamCondition.filterCondition == "IS_FACE_ENABLE") {
-            examList = examList.filter(function(e) {
+            examList = examList.filter(function (e) {
               //查询开启人脸识别的
               return e.properties["IS_FACE_ENABLE"] == "true";
             });
           } else if (this.getExamCondition.filterCondition == "OVERDUE") {
             //缺考登记
-            examList = examList.filter(function(e) {
+            examList = examList.filter(function (e) {
               var now = new Date().getTime();
               var endTime = new Date(e.endTime).getTime();
               return now > endTime; //查询考试结束时间已过期的
@@ -215,10 +245,10 @@ export default {
           params: {
             name: orgName,
             rootOrgId: rootOrgId,
-            enable: true
-          }
+            enable: true,
+          },
         })
-        .then(response => {
+        .then((response) => {
           this.orgList = response.data;
         });
     },
@@ -227,7 +257,7 @@ export default {
       //   this.form.examStageId = "";
       // }
 
-      this.examList.forEach(exam => {
+      this.examList.forEach((exam) => {
         if (exam.id == examId) {
           this.form.examType = exam.examType;
         }
@@ -236,7 +266,7 @@ export default {
 
       //场次联动
       if (this.examList.length > 0) {
-        let examArr = this.examList.filter(p => p.id == examId);
+        let examArr = this.examList.filter((p) => p.id == examId);
         if (examArr && examArr.length > 0) {
           let exam = examArr[0];
           if (
@@ -265,10 +295,10 @@ export default {
         .get("/api/ecs_oe_admin/exam/student/findCoursesByExamIdAndOrgId", {
           params: {
             examId: examId,
-            orgId: orgId
-          }
+            orgId: orgId,
+          },
         })
-        .then(response => {
+        .then((response) => {
           this.courseList = response.data;
         });
     },
@@ -286,7 +316,7 @@ export default {
             "&enable=true&name=" +
             name
         )
-        .then(response => {
+        .then((response) => {
           if ("search" == where) {
             this.queryExamStages4SearchLoading = false;
             this.examStageList4Search = response.data;
@@ -294,7 +324,7 @@ export default {
               !(
                 this.examStageList4Search.length > 0 &&
                 this.examStageList4Search.some(
-                  p => p.id == this.form.examStageId
+                  (p) => p.id == this.form.examStageId
                 )
               )
             ) {
@@ -305,7 +335,7 @@ export default {
             this.examStageList4InsertOrUpdate = response.data;
           }
         })
-        .catch(response => {
+        .catch((response) => {
           console.log(response);
           if ("search" == where) {
             this.queryExamStages4SearchLoading = false;
@@ -313,31 +343,8 @@ export default {
             this.queryExamStages4InsertOrUpdateLoading = false;
           }
         });
-    }
+    },
   },
-  created() {
-    this.getExams("");
-    let params = new URLSearchParams();
-    params.append(
-      "privilegeCodes",
-      Object.keys(this.currentPagePrivileges).toString()
-    );
-    this.$http
-      .post("/api/ecs_core/rolePrivilege/checkPrivileges?" + params)
-      .then(response => {
-        this.currentPagePrivileges = response.data;
-        this.form.ORG_FIND_ALL = this.currentPagePrivileges.ORG_FIND_ALL;
-        if (!this.currentPagePrivileges.ORG_FIND_ALL) {
-          var userId = this.user.userId;
-          this.$http.get("/api/ecs_core/user/" + userId).then(response => {
-            this.form.orgId = response.data.orgId;
-            this.orgName = response.data.orgName;
-          });
-        } else {
-          this.getOrgs("");
-        }
-      });
-  }
 };
 </script>
 <style scoped src="../style/common.css"></style>

+ 3 - 3
src/modules/oe/constants/constants.js

@@ -1,7 +1,7 @@
 export const COURSE_LEVELS = [
   { code: "GQZ", name: "高起专" },
   { code: "GQB", name: "高起本" },
-  { code: "ZSB", name: "专升本" }
+  { code: "ZSB", name: "专升本" },
 ];
 export const AUDIT_EXPLAIN_LIST = [
   { name: "CHEAT", desc: "作弊" },
@@ -10,7 +10,7 @@ export const AUDIT_EXPLAIN_LIST = [
   { name: "ACTION_FAILURE", desc: "指定动作失败" },
   { name: "BATCH_PASS", desc: "批量审核通过" },
   { name: "BATCH_NOTPASS", desc: "批量审核不通过" },
-  { name: "OTHER", desc: "其他" }
+  { name: "OTHER", desc: "其他" },
 ];
 export const DISCIPLINE_TYPE_LIST = [
   { name: "CHEAT", desc: "作弊" },
@@ -18,5 +18,5 @@ export const DISCIPLINE_TYPE_LIST = [
   { name: "NOT_ONESELF_OF_PHOTO", desc: "相片替考" },
   { name: "ACTION_FAILURE", desc: "指定动作失败" },
   { name: "BATCH_NOTPASS", desc: "批量审核不通过" },
-  { name: "OTHER", desc: "其他" }
+  { name: "OTHER", desc: "其他" },
 ];

+ 2 - 2
src/modules/oe/mixin/pagePrivilege.js

@@ -11,7 +11,7 @@ export default {
           "&full=" +
           false
       )
-      .then(response => {
+      .then((response) => {
         var allpermissions = response.data;
         var pagePermissions = [];
         for (var i = 0; i < allpermissions.length; i++) {
@@ -28,5 +28,5 @@ export default {
         }
         this.getPermissionStatus = true; //获取权限完成
       });
-  }
+  },
 };

+ 17 - 17
src/modules/oe/routes/routes.js

@@ -18,7 +18,7 @@ export default [
   {
     path: "/oe/examPaperDetail/:courseId/:examRecordDataId",
     name: "examPaperDetail",
-    component: examPaperDetail //考卷详情
+    component: examPaperDetail, //考卷详情
   },
   {
     path: "/oe", //首页
@@ -27,68 +27,68 @@ export default [
     children: [
       {
         path: "tips", //模块说明
-        component: Tips
+        component: Tips,
       },
       {
         path: "absent",
         name: "absent",
-        component: absent //缺考登记
+        component: absent, //缺考登记
       },
       {
         path: "awaitingAudit",
         name: "awaitingAudit",
-        component: awaitingAudit //监考待审
+        component: awaitingAudit, //监考待审
       },
       {
         path: "alreadyAudited",
         name: "alreadyAudited",
-        component: alreadyAudited //监考已审
+        component: alreadyAudited, //监考已审
       },
       {
         path: "reexamine",
         name: "reexamine",
-        component: reexamine //重考列表
+        component: reexamine, //重考列表
       },
       {
         path: "illegalityNameList",
         name: "illegalityNameList",
-        component: illegalityNameList //违纪名单
+        component: illegalityNameList, //违纪名单
       },
       {
         path: "illegalityType",
         name: "illegalityType",
-        component: illegalityType //违纪类型管理
+        component: illegalityType, //违纪类型管理
       },
       {
         path: "scoreStatistics",
         name: "scoreStatistics",
-        component: scoreStatistics //成绩统计
+        component: scoreStatistics, //成绩统计
       },
       {
         path: "examDetail",
         name: "examDetail",
-        component: examDetail //考试详情
+        component: examDetail, //考试详情
       },
       {
         path: "examScheduling",
         name: "examScheduling",
-        component: examScheduling //考试进度详情
+        component: examScheduling, //考试进度详情
       },
       {
         path: "captureDetail/:examRecordDataId/:from",
         name: "captureDetail",
-        component: captureDetail //抓拍详情
+        component: captureDetail, //抓拍详情
       },
       {
         path: "examSummary",
         name: "examSummary",
-        component: examSummary //考试概览
+        component: examSummary, //考试概览
       },
       {
         path: "exportTaskList",
         name: "exportTaskList",
-        component: exportTaskList //导出任务列表
-      }
-    ]
-  }
+        component: exportTaskList, //导出任务列表
+      },
+    ],
+  },
 ];

+ 15 - 15
src/modules/oe/views/absent.vue

@@ -3,14 +3,14 @@
     <el-main class="el-main-padding">
       <commonFormVue
         :form="form"
-        :getExamCondition="getExamCondition"
+        :get-exam-condition="getExamCondition"
       ></commonFormVue>
       <el-col :span="6">
         <el-button
-          @click="search('clickSelectBtn')"
           size="small"
           icon="el-icon-search"
           type="primary"
+          @click="search('clickSelectBtn')"
           >查询</el-button
         >
         <el-button size="small" icon="el-icon-refresh" @click="resetForm"
@@ -23,8 +23,8 @@
           <span>操作:</span>
           <commonExportVue
             :form="form"
-            :exportUrl="exportUrl"
-            :exportFileName="exportFileName"
+            :export-url="exportUrl"
+            :export-file-name="exportFileName"
           ></commonExportVue>
         </el-col>
       </el-row>
@@ -71,13 +71,13 @@
       </el-row>
       <div class="page pull-right">
         <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
           :current-page.sync="form.pageNo"
           :page-sizes="[10, 20, 50, 100, 200, 300]"
           :page-size="form.pageSize"
           layout="total, sizes, prev, pager, next, jumper"
           :total="total"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
         ></el-pagination>
       </div>
     </el-main>
@@ -110,21 +110,22 @@ export default {
         pageSize: 10,
         rootOrgId: "",
         auditStatus: null,
-        ORG_FIND_ALL: false //查询所有机构l
+        ORG_FIND_ALL: false, //查询所有机构l
       },
       getExamCondition: {
         params: { name: "", examTypes: "ONLINE#OFFLINE#ONLINE_HOMEWORK" },
-        filterCondition: "OVERDUE"
+        filterCondition: "OVERDUE",
       },
       tableData: [],
       exportUrl: "/api/ecs_oe_admin/exam/student/unfinished/list/export",
       exportFileName: "缺考登记",
-      currentPagePrivileges: { ABSENT_EXPORT: false }
+      currentPagePrivileges: { ABSENT_EXPORT: false },
     };
   },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: (state) => state.user }),
   },
+  created() {},
   methods: {
     resetForm() {
       this.form = {
@@ -141,7 +142,7 @@ export default {
         pageSize: 10,
         rootOrgId: "",
         auditStatus: null,
-        ORG_FIND_ALL: this.form.ORG_FIND_ALL
+        ORG_FIND_ALL: this.form.ORG_FIND_ALL,
       };
     },
     search(type) {
@@ -150,7 +151,7 @@ export default {
           title: "警告",
           message: "请选择考试",
           type: "warning",
-          duration: 1000
+          duration: 1000,
         });
         return false;
       }
@@ -160,7 +161,7 @@ export default {
       this.tableLoading = true;
       this.$http
         .post("/api/ecs_oe_admin/exam/student/unfinished/list", this.form)
-        .then(response => {
+        .then((response) => {
           if (response.data) {
             this.tableData = response.data.content;
             this.total = response.data.totalElements;
@@ -182,9 +183,8 @@ export default {
      */
     handleCurrentChange() {
       this.search();
-    }
+    },
   },
-  created() {}
 };
 </script>
 <style scoped src="../style/common.css"></style>

+ 51 - 51
src/modules/oe/views/alreadyAudited.vue

@@ -1,14 +1,14 @@
 <template>
   <el-container>
     <el-main class="el-main-padding">
-      <commonFormVue :form="form" :getExamCondition="getExamCondition">
+      <commonFormVue :form="form" :get-exam-condition="getExamCondition">
         <el-row v-show="showAllCondition">
           <el-col :span="6">
             <el-form-item label="考试ID">
               <el-input
+                v-model="form.examRecordDataId"
                 class="form_search_width"
                 size="small"
-                v-model="form.examRecordDataId"
                 placeholder="考试ID"
               ></el-input>
             </el-form-item>
@@ -16,10 +16,10 @@
           <el-col :span="6">
             <el-form-item label="审核结果">
               <el-select
-                class="form_search_width"
-                size="small"
                 v-if="currentPagePrivileges.INVIGILATE_AUDIT_STATUS"
                 v-model="form.status"
+                class="form_search_width"
+                size="small"
                 clearable
                 placeholder="全部"
               >
@@ -27,9 +27,9 @@
                 <el-option value="UN_PASS" label="不通过"></el-option>
               </el-select>
               <el-input
+                v-if="!currentPagePrivileges.INVIGILATE_AUDIT_STATUS"
                 size="small"
                 class="form_search_width"
-                v-if="!currentPagePrivileges.INVIGILATE_AUDIT_STATUS"
                 placeholder="不通过"
                 :disabled="true"
               ></el-input>
@@ -44,9 +44,9 @@
                 :remote-method="getDisciplineTypeList"
                 clearable
                 class="form_search_width"
-                @clear="getDisciplineTypeList"
                 placeholder="全部"
                 size="small"
+                @clear="getDisciplineTypeList"
               >
                 <el-option
                   v-for="item in disciplineTypeList"
@@ -60,9 +60,9 @@
           <el-col :span="6">
             <el-form-item label="审核人">
               <el-input
+                v-model="form.auditUserName"
                 class="form_search_width"
                 size="small"
-                v-model="form.auditUserName"
                 placeholder="审核人"
               ></el-input>
             </el-form-item>
@@ -70,8 +70,8 @@
           <el-col :span="12">
             <el-form-item label="开考时间">
               <el-date-picker
-                class="input"
                 v-model="startExamDatetimeRange"
+                class="input"
                 type="datetimerange"
                 start-placeholder="开始日期"
                 range-separator="至"
@@ -86,8 +86,8 @@
           <el-col :span="12">
             <el-form-item label="交卷时间">
               <el-date-picker
-                class="input"
                 v-model="endExamDatetimeRange"
+                class="input"
                 type="datetimerange"
                 start-placeholder="开始日期"
                 range-separator="至"
@@ -102,8 +102,8 @@
           <el-col :span="12">
             <el-form-item label="审核时间">
               <el-date-picker
-                class="input"
                 v-model="auditExamDatetimeRange"
+                class="input"
                 type="datetimerange"
                 start-placeholder="开始日期"
                 range-separator="至"
@@ -119,51 +119,51 @@
       </commonFormVue>
       <el-col :span="24">
         <el-button
-          @click="search('clickSelectBtn')"
           size="small"
           type="primary"
           icon="el-icon-search"
+          @click="search('clickSelectBtn')"
           >查询</el-button
         >
         <el-button
+          v-if="!showAllCondition"
           size="small"
           type="primary"
           icon="el-icon-more"
-          v-if="!showAllCondition"
           @click="showMoreCondition"
           >高级查询</el-button
         >
         <el-button
+          v-if="showAllCondition"
           size="small"
           type="primary"
-          v-if="showAllCondition"
           @click="showSimpleCondition"
           >简单查询</el-button
         >
         <el-button
           size="small"
           icon="el-icon-refresh"
-          @click="resetForm"
           class="margin-bottom-10"
+          @click="resetForm"
           >重置</el-button
         >
       </el-col>
       <el-row class="margin-top-10">
         <el-col :span="24">
           <el-table
+            ref="multipleTable"
             v-loading="tableLoading"
             element-loading-text="数据加载中"
-            ref="multipleTable"
-            @selection-change="handleSelectionChange"
             :data="tableData"
             border
+            @selection-change="handleSelectionChange"
           >
             <el-table-column label="考试ID">
               <template slot-scope="scope">
                 <el-button
                   v-show="currentPagePrivileges.SNAPSHOT_DETAILS"
-                  @click="gotoCaptureDetail(scope.row.examRecordDataId)"
                   type="text"
+                  @click="gotoCaptureDetail(scope.row.examRecordDataId)"
                   >{{ scope.row.examRecordDataId }}</el-button
                 >
                 <span v-show="!currentPagePrivileges.SNAPSHOT_DETAILS">{{
@@ -269,13 +269,13 @@
           </el-table>
           <div class="block pull-right">
             <el-pagination
-              @size-change="handleSizeChange"
-              @current-change="handleCurrentChange"
               :current-page.sync="form.pageNo"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
               :page-size="form.pageSize"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
             ></el-pagination>
           </div>
         </el-col>
@@ -323,31 +323,47 @@ export default {
         submitStartTime: null, //交卷时间起
         submitEndTime: null, //交卷时间止
         auditStartTime: null, //审核时间起
-        auditEndTime: null //审核时间止
+        auditEndTime: null, //审核时间止
       },
 
       getExamCondition: {
         params: {
           name: "",
           examTypes: "ONLINE#ONLINE_HOMEWORK",
-          propertyKeys: "IS_FACE_ENABLE"
+          propertyKeys: "IS_FACE_ENABLE",
         },
-        filterCondition: "IS_FACE_ENABLE"
+        filterCondition: "IS_FACE_ENABLE",
       },
       tableData: [],
       currentPagePrivileges: {
         INVIGILATE_AUDIT_STATUS: false, //数据状态
-        SNAPSHOT_DETAILS: false //详情查看
+        SNAPSHOT_DETAILS: false, //详情查看
       },
       getPermissionStatus: false, //获取权限状态
       disciplineTypeList: [],
       startExamDatetimeRange: [],
       endExamDatetimeRange: [],
-      auditExamDatetimeRange: []
+      auditExamDatetimeRange: [],
     };
   },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: (state) => state.user }),
+  },
+  watch: {
+    //监控权限是否获取完成
+    getPermissionStatus: function (val) {
+      if (val) {
+        //需求调整20200924:经沟通暂时注释此需求
+        // if (!this.currentPagePrivileges.INVIGILATE_AUDIT_STATUS) {
+        //   this.form.status = "UN_PASS";
+        // }
+        this.backFill();
+      }
+    },
+  },
+  created() {
+    this.backFill();
+    this.getDisciplineTypeList("");
   },
   methods: {
     resetForm() {
@@ -376,7 +392,7 @@ export default {
         submitStartTime: null, //交卷时间起
         submitEndTime: null, //交卷时间止
         auditStartTime: null, //审核时间起
-        auditEndTime: null //审核时间止
+        auditEndTime: null, //审核时间止
       };
       this.startExamDatetimeRange = [];
       this.endExamDatetimeRange = [];
@@ -390,7 +406,7 @@ export default {
         title: "提示",
         message: "高级查询条件值已重置",
         type: "info",
-        duration: 2000
+        duration: 2000,
       });
       this.resetForm();
       this.showAllCondition = false;
@@ -401,7 +417,7 @@ export default {
           title: "警告",
           message: "请选择考试",
           type: "warning",
-          duration: 2000
+          duration: 2000,
         });
         return false;
       }
@@ -415,7 +431,7 @@ export default {
       }
       this.$http
         .post("/api/ecs_oe_admin/exam/audit/list", params)
-        .then(response => {
+        .then((response) => {
           if (response.data) {
             this.tableData = response.data.content;
             this.total = response.data.totalElements;
@@ -425,7 +441,7 @@ export default {
           }
           this.tableLoading = false;
           this.$router.push({
-            path: "/oe/alreadyAudited?" + new URLSearchParams(params)
+            path: "/oe/alreadyAudited?" + new URLSearchParams(params),
           });
         });
     },
@@ -451,7 +467,7 @@ export default {
     },
     gotoCaptureDetail(examRecordDataId) {
       this.$router.push({
-        path: "/oe/captureDetail/" + examRecordDataId + "/alreadyAudited"
+        path: "/oe/captureDetail/" + examRecordDataId + "/alreadyAudited",
       });
     },
     backFill() {
@@ -476,13 +492,13 @@ export default {
       }
       this.$http
         .get("/api/ecs_oe_admin/illegallyType/queryByNameLike", {
-          params: { name }
+          params: { name },
         })
-        .then(response => {
+        .then((response) => {
           if (response.data) {
             //排除断电和机器故障
             this.disciplineTypeList = response.data.filter(
-              v =>
+              (v) =>
                 !(v.rootOrgId == -1 && v.code == "POWER_FAILURE") &&
                 !(v.rootOrgId == -1 && v.code == "MACHINE_STOPPAGE")
             );
@@ -515,24 +531,8 @@ export default {
         this.form.auditStartTime = "";
         this.form.auditEndTime = "";
       }
-    }
-  },
-  watch: {
-    //监控权限是否获取完成
-    getPermissionStatus: function(val) {
-      if (val) {
-        //需求调整20200924:经沟通暂时注释此需求
-        // if (!this.currentPagePrivileges.INVIGILATE_AUDIT_STATUS) {
-        //   this.form.status = "UN_PASS";
-        // }
-        this.backFill();
-      }
-    }
+    },
   },
-  created() {
-    this.backFill();
-    this.getDisciplineTypeList("");
-  }
 };
 </script>
 <style scoped src="../style/common.css"></style>

+ 59 - 59
src/modules/oe/views/awaitingAudit.vue

@@ -1,14 +1,14 @@
 <template>
   <el-container>
     <el-main class="el-main-padding">
-      <commonFormVue :form="form" :getExamCondition="getExamCondition">
+      <commonFormVue :form="form" :get-exam-condition="getExamCondition">
         <el-row v-show="showAllCondition">
           <el-col :span="6">
             <el-form-item label="考试ID">
               <el-input
+                v-model="form.examRecordDataId"
                 class="form_search_width"
                 size="small"
-                v-model="form.examRecordDataId"
                 placeholder="考试ID"
               ></el-input>
             </el-form-item>
@@ -16,9 +16,9 @@
           <el-col :span="6">
             <el-form-item label="需要审核">
               <el-select
+                v-model="form.isWarn"
                 class="form_search_width"
                 size="small"
-                v-model="form.isWarn"
                 clearable
                 placeholder="全部"
               >
@@ -30,9 +30,9 @@
           <el-col :span="6">
             <el-form-item label="陌生人脸">
               <el-select
+                v-model="form.hasStranger"
                 class="form_search_width"
                 size="small"
-                v-model="form.hasStranger"
                 clearable
                 placeholder="全部"
               >
@@ -44,16 +44,16 @@
           <el-col :span="6">
             <el-form-item label="人脸比对">
               <el-input
+                v-model="form.faceSuccessPercentLower"
                 class="form_search_width_50"
                 size="small"
-                v-model="form.faceSuccessPercentLower"
                 placeholder="下限"
               ></el-input>
               <span>-</span>
               <el-input
+                v-model="form.faceSuccessPercentUpper"
                 class="form_search_width_50"
                 size="small"
-                v-model="form.faceSuccessPercentUpper"
                 placeholder="上限"
               ></el-input>
             </el-form-item>
@@ -62,16 +62,16 @@
             <el-form-item label="真实性">
               <el-row>
                 <el-input
+                  v-model="form.livenessSuccessPercentLower"
                   class="form_search_width_50"
                   size="small"
-                  v-model="form.livenessSuccessPercentLower"
                   placeholder="下限"
                 ></el-input>
                 <span>-</span>
                 <el-input
+                  v-model="form.livenessSuccessPercentUpper"
                   class="form_search_width_50"
                   size="small"
-                  v-model="form.livenessSuccessPercentUpper"
                   placeholder="上限"
                 ></el-input>
               </el-row>
@@ -80,9 +80,9 @@
           <el-col :span="6">
             <el-form-item label="虚拟设备">
               <el-select
+                v-model="form.hasVirtual"
                 class="form_search_width"
                 size="small"
-                v-model="form.hasVirtual"
                 clearable
                 placeholder="全部"
               >
@@ -94,8 +94,8 @@
           <el-col :span="12">
             <el-form-item label="开考时间">
               <el-date-picker
-                class="input"
                 v-model="startExamDatetimeRange"
+                class="input"
                 type="datetimerange"
                 start-placeholder="开始日期"
                 range-separator="至"
@@ -110,8 +110,8 @@
           <el-col :span="12">
             <el-form-item label="交卷时间">
               <el-date-picker
-                class="input"
                 v-model="endExamDatetimeRange"
+                class="input"
                 type="datetimerange"
                 start-placeholder="开始日期"
                 range-separator="至"
@@ -127,32 +127,32 @@
       </commonFormVue>
       <el-col :span="24">
         <el-button
-          @click="search('clickSelectBtn')"
           size="small"
           type="primary"
           icon="el-icon-search"
+          @click="search('clickSelectBtn')"
           >查询</el-button
         >
         <el-button
+          v-if="!showAllCondition"
           size="small"
           type="primary"
           icon="el-icon-more"
-          v-if="!showAllCondition"
           @click="showMoreCondition"
           >高级查询</el-button
         >
         <el-button
+          v-if="showAllCondition"
           size="small"
           type="primary"
-          v-if="showAllCondition"
           @click="showSimpleCondition"
           >简单查询</el-button
         >
         <el-button
           size="small"
           icon="el-icon-refresh"
-          @click="resetForm"
           class="margin-bottom-10"
+          @click="resetForm"
           >重置</el-button
         >
       </el-col>
@@ -193,14 +193,14 @@
       <el-row class="margin-top-10">
         <el-col :span="24">
           <el-table
+            ref="multipleTable"
             v-loading="tableLoading"
             element-loading-text="数据加载中"
-            ref="multipleTable"
-            @selection-change="handleSelectionChange"
             :data="tableData"
             border
             resizable
             stripe
+            @selection-change="handleSelectionChange"
           >
             <el-table-column
               type="selection"
@@ -211,8 +211,8 @@
               <template slot-scope="scope">
                 <el-button
                   v-show="currentPagePrivileges.SNAPSHOT_DETAILS"
-                  @click="gotoCaptureDetail(scope.row.dataId)"
                   type="text"
+                  @click="gotoCaptureDetail(scope.row.dataId)"
                   >{{ scope.row.dataId }}</el-button
                 >
                 <span v-show="!currentPagePrivileges.SNAPSHOT_DETAILS">
@@ -309,9 +309,9 @@
               width="180"
             ></el-table-column>
             <el-table-column
+              v-if="currentPagePrivileges.PENDING_OPERATE"
               :context="_self"
               label="操作"
-              v-if="currentPagePrivileges.PENDING_OPERATE"
               fixed="right"
               width="120"
             >
@@ -345,13 +345,13 @@
           </el-table>
           <div class="block pull-right">
             <el-pagination
-              @size-change="handleSizeChange"
-              @current-change="handleCurrentChange"
               :current-page.sync="form.pageNo"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
               :page-size="form.pageSize"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
             ></el-pagination>
           </div>
         </el-col>
@@ -361,12 +361,12 @@
         :visible.sync="dialogFormVisible"
         @closed="auditDialogClosed"
       >
-        <el-form :model="auditForm" ref="auditForm">
+        <el-form ref="auditForm" :model="auditForm">
           <el-form-item
             label="违纪类型"
             prop="illegallyTypeId"
             :rules="[
-              { required: true, message: '请选择违纪类型', trigger: 'change' }
+              { required: true, message: '请选择违纪类型', trigger: 'change' },
             ]"
           >
             <el-select
@@ -375,9 +375,9 @@
               remote
               :remote-method="getDisciplineTypeList"
               clearable
-              @clear="getDisciplineTypeList"
               placeholder="请选择"
               size="small"
+              @clear="getDisciplineTypeList"
             >
               <el-option
                 v-for="item in disciplineTypeList"
@@ -387,7 +387,7 @@
               ></el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="详情描述" style="margin-top:15px;">
+          <el-form-item label="详情描述" style="margin-top: 15px">
             <el-input
               v-model="auditForm.disciplineDetail"
               type="textarea"
@@ -410,8 +410,8 @@ import pagePrivilege from "../mixin/pagePrivilege.js";
 import commonFormVue from "../component/commonForm.vue";
 import _ from "lodash";
 export default {
-  mixins: [pagePrivilege],
   components: { commonFormVue },
+  mixins: [pagePrivilege],
   data() {
     return {
       total: 0,
@@ -442,21 +442,21 @@ export default {
         startTime: null, //开考时间起
         endTime: null, //开考时间止
         submitStartTime: null, //交卷时间起
-        submitEndTime: null //交卷时间止
+        submitEndTime: null, //交卷时间止
       },
       auditForm: {
         examRecordDataId: null,
         illegallyTypeId: null,
         disciplineDetail: "",
-        isPass: null
+        isPass: null,
       },
       getExamCondition: {
         params: {
           name: "",
           examTypes: "ONLINE#ONLINE_HOMEWORK",
-          propertyKeys: "IS_FACE_ENABLE"
+          propertyKeys: "IS_FACE_ENABLE",
         },
-        filterCondition: "IS_FACE_ENABLE"
+        filterCondition: "IS_FACE_ENABLE",
       },
       tableData: [],
       multipleSelection: [],
@@ -464,15 +464,24 @@ export default {
       currentPagePrivileges: {
         PANEING_BATCHAUDIT: false,
         PENDING_OPERATE: false,
-        SNAPSHOT_DETAILS: false
+        SNAPSHOT_DETAILS: false,
       },
       disciplineTypeList: [],
       startExamDatetimeRange: [],
-      endExamDatetimeRange: []
+      endExamDatetimeRange: [],
     };
   },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: (state) => state.user }),
+  },
+  watch: {
+    multipleSelection: function () {
+      this.batchAuditBtnDisabled = !(this.multipleSelection.length > 0);
+    },
+  },
+  created() {
+    this.backFill();
+    this.getDisciplineTypeList("");
   },
   methods: {
     getDisciplineTypeList(name) {
@@ -481,9 +490,9 @@ export default {
       }
       this.$http
         .get("/api/ecs_oe_admin/illegallyType/queryByNameLike", {
-          params: { name, queryScope: "audit" }
+          params: { name, queryScope: "audit" },
         })
-        .then(response => {
+        .then((response) => {
           this.disciplineTypeList = response.data;
         });
     },
@@ -510,7 +519,7 @@ export default {
         startTime: null, //开考时间起
         endTime: null, //开考时间止
         submitStartTime: null, //交卷时间起
-        submitEndTime: null //交卷时间止
+        submitEndTime: null, //交卷时间止
       };
       this.startExamDatetimeRange = [];
       this.endExamDatetimeRange = [];
@@ -523,7 +532,7 @@ export default {
         title: "提示",
         message: "高级查询条件值已重置",
         type: "info",
-        duration: 2000
+        duration: 2000,
       });
       this.resetForm();
       this.showAllCondition = false;
@@ -534,7 +543,7 @@ export default {
           title: "警告",
           message: "请选择考试",
           type: "warning",
-          duration: 2000
+          duration: 2000,
         });
         return false;
       }
@@ -545,7 +554,7 @@ export default {
       var params = JSON.parse(JSON.stringify(this.form));
       this.$http
         .post("/api/ecs_oe_admin/exam/record/waiting/audit/list", params)
-        .then(response => {
+        .then((response) => {
           if (response.data) {
             this.tableData = response.data.content;
             this.total = response.data.totalElements;
@@ -555,7 +564,7 @@ export default {
           }
           this.tableLoading = false;
           this.$router.push({
-            path: "/oe/awaitingAudit?" + new URLSearchParams(params)
+            path: "/oe/awaitingAudit?" + new URLSearchParams(params),
           });
         });
     },
@@ -584,7 +593,7 @@ export default {
       this.$confirm("确定执行?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       })
         .then(() => {
           var examRecordDataIds = [];
@@ -593,7 +602,7 @@ export default {
           }
           var param = new URLSearchParams({
             examRecordDataIds: examRecordDataIds,
-            isPass: isPass
+            isPass: isPass,
           });
           this.$http
             .post("/api/ecs_oe_admin/exam/audit/batch/audit", param)
@@ -602,7 +611,7 @@ export default {
                 title: "成功",
                 message: "操作成功",
                 type: "success",
-                duration: 5000
+                duration: 5000,
               });
               this.search();
             });
@@ -615,11 +624,11 @@ export default {
         examRecordDataId: examRecordDataId,
         illegallyTypeId: null,
         disciplineDetail: "",
-        isPass: false
+        isPass: false,
       };
     },
     doAudit() {
-      this.$refs["auditForm"].validate(valid => {
+      this.$refs["auditForm"].validate((valid) => {
         if (valid) {
           var param = new URLSearchParams(this.auditForm);
           this.$http
@@ -629,7 +638,7 @@ export default {
                 title: "成功",
                 message: "操作成功",
                 type: "success",
-                duration: 5000
+                duration: 5000,
               });
               this.dialogFormVisible = false;
               this.search();
@@ -648,7 +657,7 @@ export default {
     auditPass(examRecordDataId) {
       var auditParams = {
         examRecordDataId: examRecordDataId,
-        isPass: true
+        isPass: true,
       };
       var param = new URLSearchParams(auditParams);
       this.$http
@@ -659,7 +668,7 @@ export default {
             title: "成功",
             message: "操作成功",
             type: "success",
-            duration: 5000
+            duration: 5000,
           });
         });
     },
@@ -668,7 +677,7 @@ export default {
       this.$router.push({
         path: "/oe/captureDetail/" + examRecordDataId + "/awaitingAudit",
         // name: "captureDetail",
-        query: { pendingOperate }
+        query: { pendingOperate },
       });
     },
     backFill() {
@@ -704,17 +713,8 @@ export default {
         this.form.submitStartTime = "";
         this.form.submitEndTime = "";
       }
-    }
-  },
-  watch: {
-    multipleSelection: function() {
-      this.batchAuditBtnDisabled = !(this.multipleSelection.length > 0);
-    }
+    },
   },
-  created() {
-    this.backFill();
-    this.getDisciplineTypeList("");
-  }
 };
 </script>
 <style scoped src="../style/common.css"></style>

+ 46 - 46
src/modules/oe/views/captureDetail.vue

@@ -1,7 +1,7 @@
 <template>
   <el-container>
     <el-header id="capture-detail-header">
-      <LinkTitlesCustom :currentPaths="currentPaths" />
+      <LinkTitlesCustom :current-paths="currentPaths" />
     </el-header>
     <el-main style="overflow: unset; margin-left: 20px" class="el-main-padding">
       <el-row>
@@ -16,8 +16,8 @@
             </el-col>
             <el-col :span="16" style="text-align: right">
               <el-button
-                size="small"
                 v-if="showAudit"
+                size="small"
                 type="success"
                 icon="el-icon-success"
                 title="通过"
@@ -26,8 +26,8 @@
               >
 
               <el-button
-                size="small"
                 v-if="showAudit"
+                size="small"
                 type="danger"
                 icon="el-icon-error"
                 title="不通过"
@@ -169,13 +169,13 @@
           </el-row>
           <el-row class="margin-top-10 photorow">
             <el-col
-              :span="6"
-              :key="item.id"
               v-for="item in capturesList"
+              :key="item.id"
+              :span="6"
               class="photocol"
             >
-              <div class="photo-pass" v-show="item.pass">通过</div>
-              <div class="photo-nopass" v-show="!item.pass">不通过</div>
+              <div v-show="item.pass" class="photo-pass">通过</div>
+              <div v-show="!item.pass" class="photo-nopass">不通过</div>
               <img
                 class="photo"
                 :title="item.virtualCameraNames"
@@ -183,10 +183,10 @@
                 alt
                 width="200"
               />
-              <div class="photo-stranger" v-show="item.stranger">陌生人</div>
+              <div v-show="item.stranger" class="photo-stranger">陌生人</div>
               <div
-                class="photo-facelivenessPass"
                 v-show="!item.isFacelivenessPass"
+                class="photo-facelivenessPass"
               >
                 <i class="el-icon-warning" title="真实性不通过"></i>
               </div>
@@ -218,12 +218,12 @@
         </el-col>
       </el-row>
       <el-dialog title="审核" :visible.sync="dialogFormVisible">
-        <el-form :model="auditForm" ref="auditForm">
+        <el-form ref="auditForm" :model="auditForm">
           <el-form-item
             label="违纪类型"
             prop="illegallyTypeId"
             :rules="[
-              { required: true, message: '请选择违纪类型', trigger: 'change' }
+              { required: true, message: '请选择违纪类型', trigger: 'change' },
             ]"
           >
             <el-select
@@ -232,9 +232,9 @@
               remote
               :remote-method="getDisciplineTypeList"
               clearable
-              @clear="getDisciplineTypeList"
               placeholder="请选择"
               size="small"
+              @clear="getDisciplineTypeList"
             >
               <el-option
                 v-for="item in disciplineTypeList"
@@ -280,16 +280,32 @@ export default {
         examRecordDataId: null,
         illegallyTypeId: null,
         disciplineDetail: "",
-        isPass: null
+        isPass: null,
       },
       currentPaths: ["抓拍详情"],
       disciplineTypeList: [],
       pendingOperate: false,
-      examProcessRecordData: []
+      examProcessRecordData: [],
     };
   },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    this.examRecordDataId = this.$route.params.examRecordDataId;
+    this.pendingOperate = this.$route.query.pendingOperate;
+    var fromPage = this.$route.params.from;
+    var currentPathJson = {
+      illegalityNameList: ["违纪名单", "抓拍详情"],
+      awaitingAudit: ["监考待审", "抓拍详情"],
+      alreadyAudited: ["监考已审", "抓拍详情"],
+      examDetail: ["考试明细", "抓拍详情"],
+    };
+    this.currentPaths = currentPathJson[fromPage];
+    this.getExamAuditData();
+    this.listExamCapture();
+    this.getDisciplineTypeList("");
+    this.getExamProcessRecordData();
   },
   methods: {
     getDisciplineTypeList(name) {
@@ -298,20 +314,20 @@ export default {
       }
       this.$http
         .get("/api/ecs_oe_admin/illegallyType/queryByNameLike", {
-          params: { name, queryScope: "audit" }
+          params: { name, queryScope: "audit" },
         })
-        .then(response => {
+        .then((response) => {
           this.disciplineTypeList = response.data;
         });
     },
     getExamAuditData() {
       var param = new URLSearchParams({
-        examRecordDataId: this.examRecordDataId
+        examRecordDataId: this.examRecordDataId,
       });
       let isPendingAudit = this.pendingOperate;
       this.$http
         .post("/api/ecs_oe_admin/exam/capture/audit/detail", param)
-        .then(response => {
+        .then((response) => {
           if (response.data) {
             this.showAudit =
               isPendingAudit == "false" &&
@@ -331,7 +347,7 @@ export default {
       let url =
         "/api/ecs_oe_admin/exam/capture/getExamProcessRecords?examRecordDataId=" +
         this.examRecordDataId;
-      this.$http.get(url).then(response => {
+      this.$http.get(url).then((response) => {
         if (response.data) {
           this.examProcessRecordData = response.data;
         }
@@ -339,18 +355,18 @@ export default {
     },
     listExamCapture() {
       var param = new URLSearchParams({
-        examRecordDataId: this.examRecordDataId
+        examRecordDataId: this.examRecordDataId,
       });
       this.$http
         .post("/api/ecs_oe_admin/exam/capture/list", param)
-        .then(response => {
+        .then((response) => {
           this.capturesList = response.data;
         });
     },
     getStudentInfo(studentId) {
       this.$http
         .get("/api/ecs_core/student/getStudentInfo?studentId=" + studentId)
-        .then(response => {
+        .then((response) => {
           if (response.data.photoPath) {
             this.studentBasePhotoPath = response.data.photoPath;
           }
@@ -362,7 +378,7 @@ export default {
     auditPass() {
       var auditParams = {
         examRecordDataId: this.examRecordDataId,
-        isPass: true
+        isPass: true,
       };
       var param = new URLSearchParams(auditParams);
       this.$http
@@ -371,7 +387,7 @@ export default {
           this.$notify({
             title: "成功",
             message: "操作成功",
-            type: "success"
+            type: "success",
           });
           this.back();
         });
@@ -382,11 +398,11 @@ export default {
         examRecordDataId: this.examRecordDataId,
         illegallyTypeId: null,
         disciplineDetail: "",
-        isPass: false
+        isPass: false,
       };
     },
     doAuditNoPass() {
-      this.$refs["auditForm"].validate(valid => {
+      this.$refs["auditForm"].validate((valid) => {
         if (valid) {
           var param = new URLSearchParams(this.auditForm);
           this.$http
@@ -395,7 +411,7 @@ export default {
               this.$notify({
                 title: "成功",
                 message: "操作成功",
-                type: "success"
+                type: "success",
               });
               this.back();
             });
@@ -407,7 +423,7 @@ export default {
     back() {
       this.$router.back();
     },
-    disciplineTypeFilter: function(value) {
+    disciplineTypeFilter: function (value) {
       if (value && value.indexOf("&&") > -1) {
         var arr = value.split("&&");
         var detail = "";
@@ -429,24 +445,8 @@ export default {
       } else {
         return "不限";
       }
-    }
+    },
   },
-  created() {
-    this.examRecordDataId = this.$route.params.examRecordDataId;
-    this.pendingOperate = this.$route.query.pendingOperate;
-    var fromPage = this.$route.params.from;
-    var currentPathJson = {
-      illegalityNameList: ["违纪名单", "抓拍详情"],
-      awaitingAudit: ["监考待审", "抓拍详情"],
-      alreadyAudited: ["监考已审", "抓拍详情"],
-      examDetail: ["考试明细", "抓拍详情"]
-    };
-    this.currentPaths = currentPathJson[fromPage];
-    this.getExamAuditData();
-    this.listExamCapture();
-    this.getDisciplineTypeList("");
-    this.getExamProcessRecordData();
-  }
 };
 </script>
 <style scoped>

+ 66 - 66
src/modules/oe/views/examDetail.vue

@@ -1,14 +1,14 @@
 <template>
   <el-container>
     <el-main class="el-main-padding">
-      <commonFormVue :form="form" :getExamCondition="getExamCondition">
+      <commonFormVue :form="form" :get-exam-condition="getExamCondition">
         <el-row v-show="showAllCondition">
           <el-col :span="6">
             <el-form-item label="采集人">
               <el-input
+                v-model="form.infoCollector"
                 class="form_search_width"
                 size="small"
-                v-model="form.infoCollector"
                 placeholder="采集人"
               ></el-input>
             </el-form-item>
@@ -16,9 +16,9 @@
           <el-col :span="6">
             <el-form-item label="虚拟设备">
               <el-select
+                v-model="form.hasVirtual"
                 class="form_search_width"
                 size="small"
-                v-model="form.hasVirtual"
                 clearable
                 placeholder="全部"
               >
@@ -30,8 +30,8 @@
           <el-col :span="12">
             <el-form-item label="开考时间">
               <el-date-picker
-                class="input"
                 v-model="startExamDatetimeRange"
+                class="input"
                 type="datetimerange"
                 start-placeholder="开始日期"
                 range-separator="至"
@@ -47,32 +47,32 @@
       </commonFormVue>
       <el-col :span="24">
         <el-button
-          @click="search('clickSelectBtn')"
           size="small"
           type="primary"
           icon="el-icon-search"
+          @click="search('clickSelectBtn')"
           >查询</el-button
         >
         <el-button
+          v-if="!showAllCondition"
           size="small"
           type="primary"
           icon="el-icon-more"
-          v-if="!showAllCondition"
           @click="showMoreCondition"
           >高级查询</el-button
         >
         <el-button
+          v-if="showAllCondition"
           size="small"
           type="primary"
-          v-if="showAllCondition"
           @click="showSimpleCondition"
           >简单查询</el-button
         >
         <el-button
           size="small"
           icon="el-icon-refresh"
-          @click="resetForm"
           class="margin-bottom-10"
+          @click="resetForm"
           >重置</el-button
         >
       </el-col>
@@ -92,12 +92,12 @@
       <el-row class="margin-top-10">
         <el-col :span="24">
           <el-table
+            ref="multipleTable"
             v-loading="tableLoading"
             element-loading-text="数据加载中"
-            ref="multipleTable"
-            @selection-change="handleSelectionChange"
             :data="tableData"
             border
+            @selection-change="handleSelectionChange"
           >
             <el-table-column label="考试ID" width="120">
               <template slot-scope="scope">
@@ -105,17 +105,17 @@
                   v-show="
                     (scope.row.examType == 'ONLINE' ||
                       scope.row.examType == 'ONLINE_HOMEWORK') &&
-                      currentPagePrivileges.SNAPSHOT_DETAILS
+                    currentPagePrivileges.SNAPSHOT_DETAILS
                   "
-                  @click="gotoCaptureDetail(scope.row.dataId)"
                   type="text"
+                  @click="gotoCaptureDetail(scope.row.dataId)"
                   >{{ scope.row.dataId }}</el-button
                 >
                 <span
                   v-show="
                     (scope.row.examType != 'ONLINE' &&
                       scope.row.examType != 'ONLINE_HOMEWORK') ||
-                      !currentPagePrivileges.SNAPSHOT_DETAILS
+                    !currentPagePrivileges.SNAPSHOT_DETAILS
                   "
                   >{{ scope.row.dataId }}</span
                 >
@@ -240,12 +240,12 @@
             <el-table-column fixed="right" label="详情" width="100">
               <template slot-scope="scope">
                 <el-row
-                  class="operateRow"
                   v-if="
                     (scope.row.examType == 'ONLINE' ||
                       scope.row.examType == 'ONLINE_HOMEWORK') &&
-                      currentPagePrivileges.EXAM_QUERY_GETPAPER
+                    currentPagePrivileges.EXAM_QUERY_GETPAPER
                   "
+                  class="operateRow"
                 >
                   <el-col :span="24">
                     <el-button
@@ -261,11 +261,11 @@
                   </el-col>
                 </el-row>
                 <el-row
-                  class="operateRow"
                   v-if="
                     scope.row.examType == 'ONLINE' &&
-                      currentPagePrivileges.REDO_AUDIT
+                    currentPagePrivileges.REDO_AUDIT
                   "
+                  class="operateRow"
                 >
                   <el-col :span="24">
                     <el-dropdown>
@@ -281,8 +281,8 @@
                           <el-button
                             size="mini"
                             type="success"
-                            @click="redoAudit(scope.row.dataId, 'pass')"
                             icon="el-icon-success"
+                            @click="redoAudit(scope.row.dataId, 'pass')"
                             >通&nbsp;&nbsp;过</el-button
                           >
                         </el-dropdown-item>
@@ -290,8 +290,8 @@
                           <el-button
                             size="mini"
                             type="danger"
-                            @click="redoAudit(scope.row.dataId, 'nopass')"
                             icon="el-icon-error"
+                            @click="redoAudit(scope.row.dataId, 'nopass')"
                             >不通过</el-button
                           >
                         </el-dropdown-item>
@@ -300,12 +300,12 @@
                   </el-col>
                 </el-row>
                 <el-row
-                  class="operateRow"
                   v-if="
                     scope.row.examType == 'OFFLINE' &&
-                      scope.row.offlineFiles &&
-                      currentPagePrivileges.EXAM_QUERY_GETPAPER
+                    scope.row.offlineFiles &&
+                    currentPagePrivileges.EXAM_QUERY_GETPAPER
                   "
+                  class="operateRow"
                 >
                   <el-col :span="24">
                     <el-button
@@ -323,13 +323,13 @@
           </el-table>
           <div class="block pull-right">
             <el-pagination
-              @size-change="handleSizeChange"
-              @current-change="handleCurrentChange"
               :current-page.sync="form.pageNo"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
               :page-size="form.pageSize"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
             ></el-pagination>
           </div>
         </el-col>
@@ -339,12 +339,12 @@
         :visible.sync="dialogAuditFormVisible"
         @closed="auditDialogClosed"
       >
-        <el-form :model="auditForm" ref="redoAuditForm">
+        <el-form ref="redoAuditForm" :model="auditForm">
           <el-form-item
             label="违纪类型"
             prop="illegallyTypeId"
             :rules="[
-              { required: true, message: '请选择违纪类型', trigger: 'change' }
+              { required: true, message: '请选择违纪类型', trigger: 'change' },
             ]"
           >
             <el-select
@@ -353,9 +353,9 @@
               remote
               :remote-method="getDisciplineTypeList"
               clearable
-              @clear="getDisciplineTypeList"
               placeholder="请选择"
               size="small"
+              @clear="getDisciplineTypeList"
             >
               <el-option
                 v-for="item in disciplineTypeList"
@@ -476,14 +476,14 @@ export default {
         hasVirtual: null,
         ORG_FIND_ALL: false, //查询所有机构
         examStageId: null,
-        creator: null
+        creator: null,
       },
       getExamCondition: {
         params: {
           name: "",
-          examTypes: "ONLINE#OFFLINE#ONLINE_HOMEWORK"
+          examTypes: "ONLINE#OFFLINE#ONLINE_HOMEWORK",
         },
-        filterCondition: ""
+        filterCondition: "",
       },
       tableData: [],
       exportUrl: "/api/ecs_oe_admin/exam/record/detail/list/export/async",
@@ -492,19 +492,24 @@ export default {
         EXAM_DETAIL_EXPORT: false, //导出
         SNAPSHOT_DETAILS: false, //详情查看
         EXAM_QUERY_GETPAPER: false, //调卷
-        REDO_AUDIT: false //重新审核
+        REDO_AUDIT: false, //重新审核
       },
       dialogAuditFormVisible: false,
       auditForm: {
         examRecordDataId: null,
         illegallyTypeId: null,
         disciplineDetail: "",
-        isPass: null
-      }
+        isPass: null,
+      },
     };
   },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    this.form.rootOrgId = this.user.rootOrgId;
+    this.backFill();
+    this.getDisciplineTypeList("");
   },
   methods: {
     handleDownload(file) {
@@ -521,9 +526,9 @@ export default {
       }
       this.$http
         .get("/api/ecs_oe_admin/illegallyType/queryByNameLike", {
-          params: { name, queryScope: "audit" }
+          params: { name, queryScope: "audit" },
         })
-        .then(response => {
+        .then((response) => {
           this.disciplineTypeList = response.data;
         });
     },
@@ -548,7 +553,7 @@ export default {
         endTime: null,
         infoCollector: null,
         ORG_FIND_ALL: this.form.ORG_FIND_ALL,
-        examStageId: null
+        examStageId: null,
       };
       this.startExamDatetimeRange = [];
     },
@@ -560,7 +565,7 @@ export default {
         title: "提示",
         message: "高级查询条件值已重置",
         type: "info",
-        duration: 2000
+        duration: 2000,
       });
       this.resetForm();
       this.showAllCondition = false;
@@ -580,7 +585,7 @@ export default {
           title: "警告",
           message: "请选择考试",
           type: "warning",
-          duration: 2000
+          duration: 2000,
         });
         return false;
       }
@@ -591,7 +596,7 @@ export default {
       var params = JSON.parse(JSON.stringify(this.form));
       this.$http
         .post("/api/ecs_oe_admin/exam/record/detail/list", params)
-        .then(response => {
+        .then((response) => {
           if (response.data) {
             this.tableData = response.data.content;
             this.total = response.data.totalElements;
@@ -601,7 +606,7 @@ export default {
           }
           this.tableLoading = false;
           this.$router.push({
-            path: "/oe/examDetail?" + new URLSearchParams(params)
+            path: "/oe/examDetail?" + new URLSearchParams(params),
           });
         });
     },
@@ -628,7 +633,7 @@ export default {
     },
     gotoCaptureDetail(examRecordDataId) {
       this.$router.push({
-        path: "/oe/captureDetail/" + examRecordDataId + "/examDetail"
+        path: "/oe/captureDetail/" + examRecordDataId + "/examDetail",
       });
     },
     exportData() {
@@ -637,7 +642,7 @@ export default {
           title: "警告",
           message: "请选择考试",
           type: "warning",
-          duration: 1000
+          duration: 1000,
         });
         return false;
       }
@@ -645,26 +650,26 @@ export default {
       this.$confirm("确定执行导出?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         this.form.rootOrgId = this.user.rootOrgId;
         this.form.creator = this.user.userId;
         this.$http
           .get(this.exportUrl, {
             params: {
-              query: this.form
-            }
+              query: this.form,
+            },
           })
           .then(() => {
             this.$notify({
               type: "success",
-              message: "正在后台导出中,请稍后到“导出任务列表”中下载!"
+              message: "正在后台导出中,请稍后到“导出任务列表”中下载!",
             });
           })
-          .catch(error => {
+          .catch((error) => {
             this.$notify({
               type: "error",
-              message: error.response.data.desc
+              message: error.response.data.desc,
             });
           });
       });
@@ -680,7 +685,7 @@ export default {
         for (let f of files) {
           this.imageAnswerFileList.push({
             url: f.offlineFileUrl,
-            name: f.offlineFileName
+            name: f.offlineFileName,
           });
         }
         this.downloadImageDialogVisible = true;
@@ -696,7 +701,7 @@ export default {
           examRecordDataIds: [examRecordDataId],
           isPass: true,
           illegallyTypeId: null,
-          disciplineDetail: ""
+          disciplineDetail: "",
         };
         this.$http
           .post("/api/ecs_oe_admin/exam/audit/redoAudit", redoAuditInfo)
@@ -704,11 +709,11 @@ export default {
             this.$notify({
               title: "成功",
               message: "操作成功",
-              type: "success"
+              type: "success",
             });
             this.search();
           })
-          .catch(res => {
+          .catch((res) => {
             var errorMsg = "操作失败";
             if (res.response && res.response.data) {
               errorMsg = res.response.data.desc;
@@ -716,19 +721,19 @@ export default {
             this.$notify({
               title: "提示",
               message: errorMsg,
-              type: "error"
+              type: "error",
             });
           });
       }
     },
     doRedoAuditNoPass() {
-      this.$refs["redoAuditForm"].validate(valid => {
+      this.$refs["redoAuditForm"].validate((valid) => {
         if (valid) {
           var redoAuditInfo = {
             examRecordDataIds: [this.auditForm.examRecordDataId],
             isPass: false,
             illegallyTypeId: this.auditForm.illegallyTypeId,
-            disciplineDetail: this.auditForm.disciplineDetail
+            disciplineDetail: this.auditForm.disciplineDetail,
           };
           this.$http
             .post("/api/ecs_oe_admin/exam/audit/redoAudit", redoAuditInfo)
@@ -736,12 +741,12 @@ export default {
               this.$notify({
                 title: "成功",
                 message: "操作成功",
-                type: "success"
+                type: "success",
               });
               this.doRedoAuditNoPassPostProcess();
               this.search();
             })
-            .catch(res => {
+            .catch((res) => {
               var errorMsg = "操作失败";
               if (res.response && res.response.data) {
                 errorMsg = res.response.data.desc;
@@ -750,7 +755,7 @@ export default {
               this.$notify({
                 title: "提示",
                 message: errorMsg,
-                type: "error"
+                type: "error",
               });
             });
         } else {
@@ -763,7 +768,7 @@ export default {
         examRecordDataId: null,
         illegallyTypeId: null,
         disciplineDetail: "",
-        isPass: null
+        isPass: null,
       };
       this.$refs["redoAuditForm"].resetFields();
       this.dialogAuditFormVisible = false;
@@ -805,13 +810,8 @@ export default {
     },
     closeDownloadImageDialog() {
       this.downloadImageDialogVisible = false;
-    }
+    },
   },
-  created() {
-    this.form.rootOrgId = this.user.rootOrgId;
-    this.backFill();
-    this.getDisciplineTypeList("");
-  }
 };
 </script>
 <style scope>

+ 57 - 43
src/modules/oe/views/examPaperDetail.vue

@@ -27,7 +27,7 @@
       :key="index"
       class="mainQuestionDiv"
     >
-      <div style="font-size: 16px;font-weight: bold;">
+      <div style="font-size: 16px; font-weight: bold">
         {{ toChineseNumber(index + 1) }}、{{ questionGroup.groupName }}({{
           questionGroup.groupScore
         }}分)
@@ -35,31 +35,31 @@
       <div>{{ questionGroup.score }}</div>
       <!-- 遍历大题下的小题 -->
       <div
-        v-for="(questionWrapper, index) in questionGroup.questionWrapperList"
-        :key="index"
+        v-for="(questionWrapper, index2) in questionGroup.questionWrapperList"
+        :key="index2"
       >
         <div
-          v-for="(question, index) in questionWrapper.questionList"
-          :key="index"
+          v-for="(question, index3) in questionWrapper.questionList"
+          :key="index3"
         >
-          <div style="display: flex;flex-direction:row;">
+          <div style="display: flex; flex-direction: row">
             <div v-html="restoreAudio(question.body)"></div>
           </div>
           <div
-            v-for="(questionUnit, index) in question.questionUnitList"
-            :key="index"
+            v-for="(questionUnit, index4) in question.questionUnitList"
+            :key="index4"
           >
-            <div style="display: flex;flex-direction:row;">
+            <div style="display: flex; flex-direction: row">
               <div>{{ questionUnit.order }}、</div>
               <div v-html="restoreAudio(questionUnit.body)"></div>
               <span>({{ questionUnit.questionScore }}分)</span>
             </div>
 
             <div
-              v-for="(option, index) in questionUnit.quesOptions"
-              :key="index"
+              v-for="(option, index5) in questionUnit.quesOptions"
+              :key="index5"
             >
-              <div style="display: flex;flex-direction:row;">
+              <div style="display: flex; flex-direction: row">
                 <div>{{ option.letter }}.</div>
                 <div v-html="restoreAudio(option.body)"></div>
               </div>
@@ -67,7 +67,12 @@
 
             <div>
               <div
-                style="display: flex;flex-direction:row;color: green;font-weight: bold;"
+                style="
+                  display: flex;
+                  flex-direction: row;
+                  color: green;
+                  font-weight: bold;
+                "
               >
                 <div>标准答案:</div>
                 <span v-html="questionUnit.correctAnswer"></span>
@@ -75,46 +80,53 @@
               <div
                 v-if="
                   questionUnit.answerType !== 'SINGLE_AUDIO' ||
-                    (questionUnit.answerType === 'SINGLE_AUDIO' &&
-                      (questionUnit.studentAnswer == null ||
-                        questionUnit.studentAnswer == ''))
+                  (questionUnit.answerType === 'SINGLE_AUDIO' &&
+                    (questionUnit.studentAnswer == null ||
+                      questionUnit.studentAnswer == ''))
                 "
-                style="color: blue;font-weight: bold;"
+                style="color: blue; font-weight: bold"
               >
                 学生答案:
                 <span v-html="questionUnit.studentAnswer"></span>
                 <i
-                  class="el-icon-check"
                   v-show="
                     questionUnit.isObjectiveQuestion && questionUnit.isRight
                   "
+                  class="el-icon-check"
                 ></i>
                 <i
-                  class="el-icon-close"
                   v-show="
                     questionUnit.isObjectiveQuestion && !questionUnit.isRight
                   "
+                  class="el-icon-close"
                 ></i>
               </div>
               <div
                 v-if="
                   questionUnit.answerType === 'SINGLE_AUDIO' &&
-                    questionUnit.studentAnswer != null &&
-                    questionUnit.studentAnswer != ''
+                  questionUnit.studentAnswer != null &&
+                  questionUnit.studentAnswer != ''
                 "
               >
                 <div
-                  style="float:left;color: blue;font-weight: bold;height:54px;line-height:54px;margin-right:10px;"
+                  style="
+                    float: left;
+                    color: blue;
+                    font-weight: bold;
+                    height: 54px;
+                    line-height: 54px;
+                    margin-right: 10px;
+                  "
                 >
                   学生答案:
                 </div>
                 <audio
-                  style="height:54px;"
                   v-if="
                     questionUnit.answerType === 'SINGLE_AUDIO' &&
-                      questionUnit.studentAnswer != null &&
-                      questionUnit.studentAnswer != ''
+                    questionUnit.studentAnswer != null &&
+                    questionUnit.studentAnswer != ''
                   "
+                  style="height: 54px"
                   :src="questionUnit.studentAnswer"
                   controls
                 ></audio>
@@ -137,24 +149,33 @@ export default {
       examRecord: {},
       courseInfo: {},
       paperStruct: {},
-      examQuestionList: []
+      examQuestionList: [],
     };
   },
+  created() {
+    this.courseId = this.$route.params.courseId;
+    this.examRecordDataId = this.$route.params.examRecordDataId;
+    this.getExamRecordData();
+    this.getCourseInfo();
+    this.getPaperData();
+  },
   methods: {
     getExamRecordData() {
       this.$http
         .get("/api/ecs_oe_admin/exam/record/data/findExamRecordDataEntity", {
-          params: { examRecordDataId: this.examRecordDataId }
+          params: { examRecordDataId: this.examRecordDataId },
         })
-        .then(response => {
+        .then((response) => {
           this.examRecordData = response.data;
           this.examRecord = response.data.examRecord;
         });
     },
     getCourseInfo() {
-      this.$http.get("/api/ecs_core/course/" + this.courseId).then(response => {
-        this.courseInfo = response.data;
-      });
+      this.$http
+        .get("/api/ecs_core/course/" + this.courseId)
+        .then((response) => {
+          this.courseInfo = response.data;
+        });
     },
     getPaperData() {
       this.$http
@@ -162,7 +183,7 @@ export default {
           "/api/ecs_oe_admin/examRecordPaperStruct/getExamRecordPaperStruct",
           { params: { examRecordDataId: this.examRecordDataId } }
         )
-        .then(response => {
+        .then((response) => {
           this.paperStruct = response.data.defaultPaper;
           var questionGroupList = this.paperStruct.questionGroupList; //大题集合
           this.$http
@@ -170,7 +191,7 @@ export default {
               "/api/ecs_oe_admin/examRecordQuestions/getExamRecordQuestions",
               { params: { examRecordDataId: this.examRecordDataId } }
             )
-            .then(response => {
+            .then((response) => {
               this.examQuestionList = response.data.examQuestionEntities;
               var order = 0;
               for (var i = 0; i < questionGroupList.length; i++) {
@@ -194,11 +215,11 @@ export default {
         examId: this.examRecordData.examRecord.examId,
         courseCode: this.courseInfo.code,
         groupCode: this.examRecordData.examRecord.paperType,
-        questionId: questionId
+        questionId: questionId,
       };
       this.$http
         .post("/api/ecs_ques/default_question/question", params)
-        .then(response => {
+        .then((response) => {
           var question = response.data.masterVersion;
           var questionUnitList = question.questionUnitList;
           var num = questionUnitList.length;
@@ -344,15 +365,8 @@ export default {
         .replace(/<a/g, "<audio controls ")
         .replace(/url=/g, "src=")
         .replace(/a>/g, "audio>");
-    }
+    },
   },
-  created() {
-    this.courseId = this.$route.params.courseId;
-    this.examRecordDataId = this.$route.params.examRecordDataId;
-    this.getExamRecordData();
-    this.getCourseInfo();
-    this.getPaperData();
-  }
 };
 </script>
 

+ 97 - 97
src/modules/oe/views/examScheduling.vue

@@ -1,19 +1,19 @@
 <template>
   <el-container>
     <el-main v-loading="loading" class="el-main-padding">
-      <commonFormVue :form="form" :getExamCondition="getExamCondition">
+      <commonFormVue :form="form" :get-exam-condition="getExamCondition">
         <el-row v-show="showAllCondition">
           <el-col :span="6">
             <el-form-item label="完成状态">
               <el-select
                 v-if="
                   form.examType == '' ||
-                    form.examType == 'ONLINE' ||
-                    form.examType == 'ONLINE_HOMEWORK'
+                  form.examType == 'ONLINE' ||
+                  form.examType == 'ONLINE_HOMEWORK'
                 "
+                v-model="form.finished"
                 class="form_search_width"
                 size="small"
-                v-model="form.finished"
                 clearable
                 placeholder="全部"
               >
@@ -22,9 +22,9 @@
               </el-select>
               <el-select
                 v-if="form.examType == 'OFFLINE'"
+                v-model="form.finished"
                 class="form_search_width"
                 size="small"
-                v-model="form.finished"
                 clearable
                 placeholder="全部"
               >
@@ -37,9 +37,9 @@
           <el-col :span="6">
             <el-form-item label="采集人">
               <el-input
+                v-model="form.infoCollector"
                 class="form_search_width"
                 size="small"
-                v-model="form.infoCollector"
                 placeholder="采集人"
               ></el-input>
             </el-form-item>
@@ -48,39 +48,39 @@
       </commonFormVue>
       <el-col :span="24">
         <el-button
-          @click="search('clickSelectBtn')"
           size="small"
           type="primary"
           icon="el-icon-search"
+          @click="search('clickSelectBtn')"
           >查询</el-button
         >
         <el-button
+          v-if="!showAllCondition"
           size="small"
           type="primary"
           icon="el-icon-more"
-          v-if="!showAllCondition"
           @click="showMoreCondition"
           >高级查询</el-button
         >
         <el-button
+          v-if="showAllCondition"
           size="small"
           type="primary"
-          v-if="showAllCondition"
           @click="showSimpleCondition"
           >简单查询</el-button
         >
         <el-button
           size="small"
           icon="el-icon-refresh"
-          @click="resetForm"
           class="margin-bottom-10"
+          @click="resetForm"
           >重置</el-button
         >
       </el-col>
       <el-row>
         <el-col
-          :span="24"
           v-show="currentPagePrivileges.EXAM_PARTICULARS_EXPORT"
+          :span="24"
         >
           <div class="block-seperator"></div>
           <span>操作:</span>
@@ -96,12 +96,12 @@
       <el-row class="margin-top-10">
         <el-col :span="24">
           <el-table
+            ref="multipleTable"
             v-loading="tableLoading"
             element-loading-text="数据加载中"
-            ref="multipleTable"
-            @selection-change="handleSelectionChange"
             :data="tableData"
             border
+            @selection-change="handleSelectionChange"
           >
             <el-table-column
               sortable
@@ -185,12 +185,12 @@
                 <el-row class="operateRow">
                   <el-col :span="24">
                     <el-button
+                      v-if="scope.row.examType == 'OFFLINE'"
                       plain
                       type="primary"
                       size="mini"
                       icon="el-icon-view"
                       @click="previewPaper(scope.row.examStudentId)"
-                      v-if="scope.row.examType == 'OFFLINE'"
                       >查看考题</el-button
                     >
                   </el-col>
@@ -198,12 +198,12 @@
                 <el-row class="operateRow">
                   <el-col :span="24">
                     <el-button
+                      v-if="scope.row.examType == 'OFFLINE'"
                       plain
                       type="primary"
                       size="mini"
                       icon="el-icon-download"
                       @click="exportPaper(scope.row.examStudentId)"
-                      v-if="scope.row.examType == 'OFFLINE'"
                       >下载考题</el-button
                     >
                   </el-col>
@@ -211,15 +211,15 @@
                 <el-row class="operateRow">
                   <el-col :span="24">
                     <el-button
+                      v-if="
+                        scope.row.examType == 'OFFLINE' &&
+                        scope.row.canUploadAttachment
+                      "
                       plain
                       type="primary"
                       size="mini"
                       icon="el-icon-upload2"
                       @click="openUploadAnswerDialog(scope.row.examStudentId)"
-                      v-if="
-                        scope.row.examType == 'OFFLINE' &&
-                          scope.row.canUploadAttachment
-                      "
                       >上传作答</el-button
                     >
                   </el-col>
@@ -227,15 +227,15 @@
                 <el-row class="operateRow">
                   <el-col :span="24">
                     <el-button
+                      v-if="
+                        scope.row.examType == 'OFFLINE' &&
+                        scope.row.offlineFiles
+                      "
                       plain
                       type="primary"
                       size="mini"
                       icon="el-icon-download"
                       @click="downloadAnswer(scope.row.offlineFiles)"
-                      v-if="
-                        scope.row.examType == 'OFFLINE' &&
-                          scope.row.offlineFiles
-                      "
                       >下载作答</el-button
                     >
                   </el-col>
@@ -245,21 +245,21 @@
           </el-table>
           <div class="page pull-right">
             <el-pagination
-              @size-change="handleSizeChange"
-              @current-change="handleCurrentChange"
               :current-page.sync="form.pageNo"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
               :page-size="form.pageSize"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
             ></el-pagination>
           </div>
         </el-col>
       </el-row>
       <div>
         <el-dialog
-          title="上传作答"
           v-loading="uploadAnswerDialogLoading"
+          title="上传作答"
           :visible.sync="uploadAnswerDialogVisible"
         >
           <el-form>
@@ -275,11 +275,11 @@
             <el-form-item label="选择文件">
               <div
                 v-show="fileType == 'image'"
-                style="width:580px;padding-left:80px;"
+                style="width: 580px; padding-left: 80px"
               >
                 <el-upload
-                  :class="{ disabled: uploadDisabled }"
                   ref="upload"
+                  :class="{ disabled: uploadDisabled }"
                   action
                   :limit="fileLimit"
                   :http-request="customUpload"
@@ -317,18 +317,18 @@
                   </div>
                 </el-upload>
 
-                <div style="width:580px;">
+                <div style="width: 580px">
                   温馨提示:仅支持JPG,JPEG和PNG文件,单个图片大小请不要超过5M,图片数量最多6张!
                 </div>
               </div>
               <div v-show="fileType != 'image'">
                 <input
-                  type="file"
-                  :accept="accept"
                   id="importFile"
                   ref="offlineFileInput"
+                  type="file"
+                  :accept="accept"
+                  :class="{ offline_file: offlineAnswerFile }"
                   @change="uploadAnswerChange"
-                  v-bind:class="{ offline_file: offlineAnswerFile }"
                 />
                 <div>温馨提示:仅支持pdf和zip文件,文件大小请不要超过30M!</div>
               </div>
@@ -358,7 +358,7 @@
         <el-dialog title="图片作答" :visible.sync="downloadImageDialogVisible">
           <el-form>
             <el-form-item label="作答结果">
-              <div style="width:580px;padding-left:80px;">
+              <div style="width: 580px; padding-left: 80px">
                 <el-upload
                   :class="{ disabled: true }"
                   action
@@ -451,14 +451,14 @@ export default {
         pageSize: 10,
         examType: "",
         ORG_FIND_ALL: false, //查询所有机构
-        examStageId: null
+        examStageId: null,
       },
       getExamCondition: {
         params: {
           name: "",
-          examTypes: "ONLINE#OFFLINE#ONLINE_HOMEWORK"
+          examTypes: "ONLINE#OFFLINE#ONLINE_HOMEWORK",
         },
-        filterCondition: ""
+        filterCondition: "",
       },
       tableData: [],
       exportUrl:
@@ -467,24 +467,29 @@ export default {
       currentOfflineExamRecordDataId: "",
       offlineAnswerFile: "",
       currentPagePrivileges: {
-        EXAM_PARTICULARS_EXPORT: false //导出
+        EXAM_PARTICULARS_EXPORT: false, //导出
       },
       summary: "",
       summaryList: [],
       md5Size: 0,
       optZipVisible: false,
       optPdfVisible: false,
-      optImageVisible: false
+      optImageVisible: false,
     };
   },
   computed: {
-    ...mapState({ user: state => state.user }),
+    ...mapState({ user: (state) => state.user }),
     batchSubmitUploadDisabled() {
       return this.fileList.length == 0 || this.fileList.length != this.md5Size;
     },
     //计算是否显示图片上传框
     uploadDisabled() {
       return this.fileList.length >= this.fileLimit;
+    },
+  },
+  created() {
+    if (this.form.examId) {
+      this.getUploadFileType();
     }
   },
   methods: {
@@ -494,7 +499,7 @@ export default {
           title: "警告",
           message: "请选择考试",
           type: "warning",
-          duration: 1000
+          duration: 1000,
         });
         return false;
       }
@@ -502,24 +507,24 @@ export default {
       this.$confirm("确定执行导出?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         this.$http
           .get(this.exportUrl, {
             params: {
-              query: this.form
-            }
+              query: this.form,
+            },
           })
           .then(() => {
             this.$notify({
               type: "success",
-              message: "正在后台导出中,请稍后到“导出任务列表”中下载!"
+              message: "正在后台导出中,请稍后到“导出任务列表”中下载!",
             });
           })
-          .catch(error => {
+          .catch((error) => {
             this.$notify({
               type: "error",
-              message: error.response.data.desc
+              message: error.response.data.desc,
             });
           });
       });
@@ -544,7 +549,7 @@ export default {
 
       //文件读取完毕之后的处理
       //a639e28526d1809745b46bf1189594fe  6d9efe0c593b1383482feb229318e03a
-      fileReader.onload = function(e) {
+      fileReader.onload = function (e) {
         spark.appendBinary(e.target.result);
         var md5 = spark.end();
         console.log(md5);
@@ -552,7 +557,7 @@ export default {
       };
     },
     handleRemove(file) {
-      let index = this.fileList.findIndex(p => p.uid == file.uid);
+      let index = this.fileList.findIndex((p) => p.uid == file.uid);
       this.fileList.splice(index, 1);
       this.calcSummary(this.fileList);
     },
@@ -563,7 +568,7 @@ export default {
 
       for (let i = 0; i < fileList.length; i++) {
         let f = fileList[i];
-        this.getFileMD5(f.raw, md5 => {
+        this.getFileMD5(f.raw, (md5) => {
           summaryList.push({ index: i, summary: md5 });
           md5Size++;
           this.summaryList = summaryList;
@@ -603,7 +608,7 @@ export default {
         pageSize: 10,
         examType: "",
         ORG_FIND_ALL: this.form.ORG_FIND_ALL,
-        examStageId: null
+        examStageId: null,
       };
     },
     showMoreCondition() {
@@ -614,7 +619,7 @@ export default {
         title: "提示",
         message: "高级查询条件值已重置",
         type: "info",
-        duration: 2000
+        duration: 2000,
       });
       this.resetForm();
       this.showAllCondition = false;
@@ -625,7 +630,7 @@ export default {
           title: "警告",
           message: "请选择考试",
           type: "warning",
-          duration: 2000
+          duration: 2000,
         });
         return false;
       }
@@ -635,7 +640,7 @@ export default {
       this.tableLoading = true;
       this.$http
         .post("/api/ecs_oe_admin/exam/student/examScheduling/list", this.form)
-        .then(response => {
+        .then((response) => {
           if (response.data) {
             var dataList = response.data.content;
             this.tableData = dataList;
@@ -669,9 +674,9 @@ export default {
     previewPaper(examStudentId) {
       this.$http
         .get("/api/ecs_oe_admin/exam/record/select/byExamStudentId", {
-          params: { examStudentId: examStudentId }
+          params: { examStudentId: examStudentId },
         })
-        .then(response => {
+        .then((response) => {
           if (response.data) {
             var examRecordList = response.data;
             if (examRecordList && examRecordList.length > 0) {
@@ -683,7 +688,7 @@ export default {
                 title: "提示",
                 message: "该考生未参加考试",
                 type: "error",
-                duration: 2000
+                duration: 2000,
               });
             }
           }
@@ -694,9 +699,9 @@ export default {
       var currentUser = this.user;
       this.$http
         .get("/api/ecs_oe_admin/exam/record/select/byExamStudentId", {
-          params: { examStudentId: examStudentId }
+          params: { examStudentId: examStudentId },
         })
-        .then(response => {
+        .then((response) => {
           if (response.data) {
             var examRecordList = response.data;
             if (examRecordList && examRecordList.length > 0) {
@@ -713,13 +718,13 @@ export default {
                     "/offLine",
                   {
                     responseType: "arraybuffer",
-                    filename: "utf-8"
+                    filename: "utf-8",
                   }
                 )
-                .then(response => {
+                .then((response) => {
                   if (response.data && response.data.byteLength > 0) {
                     var blob = new Blob([response.data], {
-                      type: "application/zip"
+                      type: "application/zip",
                     });
                     var url = URL.createObjectURL(blob);
                     var fileName = response.headers["content-disposition"]
@@ -736,7 +741,7 @@ export default {
                       title: "提示",
                       message: "无相关文件",
                       type: "error",
-                      duration: 2000
+                      duration: 2000,
                     });
                   }
                   this.loading = false;
@@ -750,7 +755,7 @@ export default {
                 title: "提示",
                 message: "该考生未参加考试",
                 type: "error",
-                duration: 2000
+                duration: 2000,
               });
             }
           }
@@ -764,16 +769,16 @@ export default {
 
       this.$http
         .get("/api/ecs_oe_admin/exam/record/data/findByExamStudentId", {
-          params: { examStudentId: examStudentId }
+          params: { examStudentId: examStudentId },
         })
-        .then(response => {
+        .then((response) => {
           var examRecordDataList = response.data;
           if (examRecordDataList.length == 0) {
             this.$notify({
               title: "提示",
               message: "该考生未参加考试",
               type: "error",
-              duration: 2000
+              duration: 2000,
             });
           } else {
             this.uploadAnswerDialogVisible = true;
@@ -801,14 +806,14 @@ export default {
             this.form.examId +
             "/OFFLINE_UPLOAD_FILE_TYPE"
         )
-        .then(response => {
+        .then((response) => {
           var allowfileSuffixs = response.data;
           if (!allowfileSuffixs || allowfileSuffixs.length == 0) {
             this.$notify({
               title: "提示",
               message: "当前考试设置不允许上传附件",
               type: "error",
-              duration: 2000
+              duration: 2000,
             });
             return false;
           }
@@ -818,13 +823,13 @@ export default {
               message:
                 "当前考试允许上传文件格式为:" + allowfileSuffixs.toString(),
               type: "error",
-              duration: 2000
+              duration: 2000,
             });
             return false;
           }
           this.uploadAnswerDialogLoading = true;
           let config = {
-            headers: { "Content-Type": "multipart/form-data" }
+            headers: { "Content-Type": "multipart/form-data" },
           };
           let param = new FormData();
 
@@ -837,7 +842,7 @@ export default {
                 title: "提示",
                 message: "上传成功",
                 type: "success",
-                duration: 2000
+                duration: 2000,
               });
               this.uploadAnswerDialogVisible = false;
               this.uploadAnswerDialogLoading = false;
@@ -850,7 +855,7 @@ export default {
                 title: "提示",
                 message: "上传失败",
                 type: "error",
-                duration: 2000
+                duration: 2000,
               });
               this.uploadAnswerDialogLoading = false;
               this.$refs.offlineFileInput.value = "";
@@ -866,21 +871,21 @@ export default {
             this.form.examId +
             "/OFFLINE_UPLOAD_FILE_TYPE"
         )
-        .then(response => {
+        .then((response) => {
           var allowfileSuffixs = response.data;
           if (!allowfileSuffixs || allowfileSuffixs.length == 0) {
             return false;
           }
 
-          if (allowfileSuffixs.some(p => p.toUpperCase() == "ZIP")) {
+          if (allowfileSuffixs.some((p) => p.toUpperCase() == "ZIP")) {
             this.optZipVisible = true;
           }
 
-          if (allowfileSuffixs.some(p => p.toUpperCase() == "PDF")) {
+          if (allowfileSuffixs.some((p) => p.toUpperCase() == "PDF")) {
             this.optPdfVisible = true;
           }
 
-          if (allowfileSuffixs.some(p => p.toUpperCase() == "IMAGE")) {
+          if (allowfileSuffixs.some((p) => p.toUpperCase() == "IMAGE")) {
             this.optImageVisible = true;
           }
         });
@@ -897,14 +902,14 @@ export default {
             this.form.examId +
             "/OFFLINE_UPLOAD_FILE_TYPE"
         )
-        .then(response => {
+        .then((response) => {
           var allowfileSuffixs = response.data;
           if (!allowfileSuffixs || allowfileSuffixs.length == 0) {
             this.$notify({
               title: "提示",
               message: "当前考试设置不允许上传附件",
               type: "error",
-              duration: 2000
+              duration: 2000,
             });
             return false;
           }
@@ -914,7 +919,7 @@ export default {
               message:
                 "当前考试允许上传文件格式为:" + allowfileSuffixs.toString(),
               type: "error",
-              duration: 2000
+              duration: 2000,
             });
             return false;
           }
@@ -923,11 +928,11 @@ export default {
 
       this.uploadData = {
         examRecordDataId: this.currentOfflineExamRecordDataId,
-        summary: this.summary
+        summary: this.summary,
       };
       console.log(this.uploadData);
-      let promise = new Promise(resolve => {
-        this.$nextTick(function() {
+      let promise = new Promise((resolve) => {
+        this.$nextTick(function () {
           resolve(true);
         });
       });
@@ -936,7 +941,7 @@ export default {
     submitUpload() {
       this.uploadAnswerDialogLoading = true;
       let config = {
-        headers: { "Content-Type": "multipart/form-data" }
+        headers: { "Content-Type": "multipart/form-data" },
       };
       let param = new FormData();
       param.append("file", this.offlineAnswerFile);
@@ -950,7 +955,7 @@ export default {
             title: "提示",
             message: "上传成功",
             type: "success",
-            duration: 2000
+            duration: 2000,
           });
           this.uploadAnswerDialogVisible = false;
           this.$refs.offlineFileInput.value = "";
@@ -962,7 +967,7 @@ export default {
             title: "提示",
             message: "上传失败",
             type: "error",
-            duration: 2000
+            duration: 2000,
           });
           this.uploadAnswerDialogLoading = false;
           this.$refs.offlineFileInput.value = "";
@@ -987,7 +992,7 @@ export default {
         for (let f of files) {
           this.imageAnswerFileList.push({
             url: f.offlineFileUrl,
-            name: f.offlineFileName
+            name: f.offlineFileName,
           });
         }
         this.downloadImageDialogVisible = true;
@@ -1025,7 +1030,7 @@ export default {
       params.append("fileMd5Array", summaries);
 
       let config = {
-        headers: { "Content-Type": "multipart/form-data" }
+        headers: { "Content-Type": "multipart/form-data" },
       };
       this.$http
         .post("/api/ecs_oe_admin/offlineExam/batchSubmitPaper", params, config)
@@ -1034,7 +1039,7 @@ export default {
             title: "提示",
             message: "上传成功",
             type: "success",
-            duration: 2000
+            duration: 2000,
           });
 
           this.uploadAnswerDialogVisible = false;
@@ -1042,7 +1047,7 @@ export default {
           this.offlineAnswerFile = "";
           this.search();
         })
-        .catch(e => {
+        .catch((e) => {
           let errMsg = "上传失败";
           if (e.response) {
             errMsg = e.response.data.desc;
@@ -1051,7 +1056,7 @@ export default {
             title: "提示",
             message: errMsg,
             type: "error",
-            duration: 2000
+            duration: 2000,
           });
           this.uploadAnswerDialogLoading = false;
           this.offlineAnswerFile = "";
@@ -1061,7 +1066,7 @@ export default {
       const isLt5M = file.size / 1024 / 1024 <= 5;
       if (!isLt5M) {
         this.$message.error("上传的单个数据文件大小不能超过5MB!");
-        let index = this.fileList.findIndex(p => p.uid == file.uid);
+        let index = this.fileList.findIndex((p) => p.uid == file.uid);
         this.fileList.splice(index, 1);
         this.calcSummary(this.fileList);
       }
@@ -1076,13 +1081,8 @@ export default {
     customUpload(file) {
       console.log(file);
       return false;
-    }
+    },
   },
-  created() {
-    if (this.form.examId) {
-      this.getUploadFileType();
-    }
-  }
 };
 </script>
 <style scoped>

+ 90 - 92
src/modules/oe/views/examSummary.vue

@@ -11,10 +11,10 @@
                 remote
                 :remote-method="getExams"
                 clearable
-                @clear="getExams"
-                @change="changeExam"
                 placeholder="请选择考试"
                 size="small"
+                @clear="getExams"
+                @change="changeExam"
               >
                 <el-option
                   v-for="item in examList"
@@ -30,24 +30,22 @@
           <el-form>
             <el-form-item label="场次">
               <el-select
+                v-model="examStageId"
                 clearable
                 :disabled="examStageDisabled4Search"
                 :remote-method="queryExamStages4Search"
                 remote
                 :loading="queryExamStages4SearchLoading"
                 :filterable="true"
-                v-model="examStageId"
                 placeholder="请选择"
                 size="small"
                 @change="changeExamStage"
               >
                 <el-option
                   v-for="item in examStageList4Search"
-                  :label="
-                    `${item.stageOrder} (${item.startTime}至${item.endTime})`
-                  "
-                  :value="item.id"
                   :key="item.id"
+                  :label="`${item.stageOrder} (${item.startTime}至${item.endTime})`"
+                  :value="item.id"
                 ></el-option>
               </el-select>
             </el-form-item>
@@ -61,13 +59,13 @@
                 :stroke-width="22"
                 :percentage="examSyncPercentage"
                 status="success"
-                style="width: 200px; float: left; line-height: 38px;"
+                style="width: 200px; float: left; line-height: 38px"
               ></el-progress>
               <el-button
                 size="small"
                 type="primary"
                 icon="el-icon-refresh"
-                style="float: left; margin-left: 20px; margin-top: 4px;"
+                style="float: left; margin-left: 20px; margin-top: 4px"
                 @click="refreshExamSyncPercentage"
                 >刷新</el-button
               >
@@ -89,11 +87,11 @@
           </div>
         </el-col>
       </el-row>
-      <el-row style="margin-top: 10px;">
+      <el-row style="margin-top: 10px">
         <el-col :span="24">
-          <el-tabs type="card" v-model="activeName" @tab-click="handleClick">
+          <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
             <el-tab-pane label="学习中心完成进度" name="first">
-              <el-row style="margin-top: 20px;">
+              <el-row style="margin-top: 20px">
                 <el-col :span="24">
                   <el-form>
                     <el-form-item label="学习中心">
@@ -103,10 +101,10 @@
                         remote
                         :remote-method="getOrgs"
                         clearable
-                        @clear="getOrgs"
-                        @change="getOrgExamInfos"
                         placeholder="请选择学习中心"
                         size="small"
+                        @clear="getOrgs"
+                        @change="getOrgExamInfos"
                       >
                         <el-option
                           v-for="item in orgList"
@@ -118,18 +116,18 @@
                     </el-form-item>
                     <el-form-item>
                       <el-button
+                        v-show="!exportOrgLoading"
                         type="primary"
                         size="small"
                         icon="el-icon-download"
                         @click="exportOrg"
-                        v-show="!exportOrgLoading"
                         >导出</el-button
                       >
                       <el-button
+                        v-show="exportOrgLoading"
                         size="small"
                         icon="el-icon-download"
                         :loading="true"
-                        v-show="exportOrgLoading"
                         >导出数据中...</el-button
                       >
                     </el-form-item>
@@ -172,7 +170,7 @@
               </el-row>
             </el-tab-pane>
             <el-tab-pane label="课程完成进度" name="two">
-              <el-row style="margin-top: 20px;">
+              <el-row style="margin-top: 20px">
                 <el-col :span="24">
                   <el-form>
                     <el-form-item label="课程">
@@ -182,10 +180,10 @@
                         remote
                         :remote-method="getCourses"
                         clearable
-                        @clear="getCourses"
-                        @change="getCourseProgress"
                         placeholder="请选择课程"
                         size="small"
+                        @clear="getCourses"
+                        @change="getCourseProgress"
                       >
                         <el-option
                           v-for="item in courseList"
@@ -197,18 +195,18 @@
                     </el-form-item>
                     <el-form-item>
                       <el-button
+                        v-show="!exportCourseLoading"
                         type="primary"
                         size="small"
                         icon="el-icon-download"
                         @click="exportCourse"
-                        v-show="!exportCourseLoading"
                         >导出</el-button
                       >
                       <el-button
+                        v-show="exportCourseLoading"
                         size="small"
                         icon="el-icon-download"
                         :loading="true"
-                        v-show="exportCourseLoading"
                         >导出数据中...</el-button
                       >
                     </el-form-item>
@@ -289,11 +287,15 @@ export default {
       examStageDisabled4Search: true,
       queryExamStages4SearchLoading: false,
       examStageList4Search: [],
-      currentExamType: null
+      currentExamType: null,
     };
   },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    this.getExams();
+    this.getOrgs();
   },
   methods: {
     getExams(examName) {
@@ -305,10 +307,10 @@ export default {
           params: {
             enable: true,
             name: examName,
-            examTypes: "ONLINE#OFFLINE#ONLINE_HOMEWORK"
-          }
+            examTypes: "ONLINE#OFFLINE#ONLINE_HOMEWORK",
+          },
         })
-        .then(response => {
+        .then((response) => {
           this.examList = response.data;
         });
     },
@@ -322,10 +324,10 @@ export default {
           params: {
             name: orgName,
             rootOrgId: rootOrgId,
-            enable: true
-          }
+            enable: true,
+          },
         })
-        .then(response => {
+        .then((response) => {
           this.orgList = response.data;
         });
     },
@@ -342,7 +344,7 @@ export default {
             "&orgId=" +
             this.orgId
         )
-        .then(response => {
+        .then((response) => {
           if (response.data && response.data.length > 0) {
             this.orgExamInfos = response.data;
           } else {
@@ -356,10 +358,10 @@ export default {
           params: {
             examId: this.examId,
             examStageId: this.examStageId,
-            courseId: this.courseId
-          }
+            courseId: this.courseId,
+          },
         })
-        .then(response => {
+        .then((response) => {
           if (response.data && response.data.length > 0) {
             this.courseProgressList = response.data;
             this.buildLine(response.data);
@@ -378,10 +380,10 @@ export default {
           params: {
             examId: this.examId,
             examStageId: this.examStageId,
-            orgId: this.orgId
-          }
+            orgId: this.orgId,
+          },
         })
-        .then(response => {
+        .then((response) => {
           if (response.data && response.data.length > 0) {
             this.courseList = response.data;
           } else {
@@ -391,7 +393,7 @@ export default {
     },
     changeExam(examId) {
       this.examStageId = "";
-      var exam = this.examList.filter(item => {
+      var exam = this.examList.filter((item) => {
         return item.id == examId;
       })[0];
       this.currentExamType = exam.examType;
@@ -402,7 +404,7 @@ export default {
 
       //场次联动
       if (this.examList.length > 0) {
-        let examArr = this.examList.filter(p => p.id == examId);
+        let examArr = this.examList.filter((p) => p.id == examId);
         if (examArr && examArr.length > 0) {
           let exam = examArr[0];
           if (
@@ -444,24 +446,24 @@ export default {
             "&examStageId=" +
             this.examStageId
         )
-        .then(response => {
+        .then((response) => {
           var resp = response.data;
           var optionData = {
             title: "考试人次:" + (resp.finished + resp.unFinished),
             legendData: [
               noCompletedWord + resp.unFinished,
-              completedWord + resp.finished
+              completedWord + resp.finished,
             ],
             seriesData: [
               {
                 name: noCompletedWord + resp.unFinished,
-                value: resp.unFinished
+                value: resp.unFinished,
               },
               {
                 name: completedWord + resp.finished,
-                value: resp.finished
-              }
-            ]
+                value: resp.finished,
+              },
+            ],
           };
           this.buildPieOptions(optionData);
         });
@@ -473,18 +475,18 @@ export default {
         title: {
           text: data.title,
           subtext: "",
-          x: "left"
+          x: "left",
         },
         tooltip: {
           trigger: "item",
-          formatter: "{b}人次<br/>占比:{d}%"
+          formatter: "{b}人次<br/>占比:{d}%",
         },
         legend: {
           type: "scroll",
           orient: "vertical",
           right: 200,
           top: 30,
-          data: data.legendData
+          data: data.legendData,
         },
         series: [
           {
@@ -497,15 +499,15 @@ export default {
               emphasis: {
                 shadowBlur: 10,
                 shadowOffsetX: 0,
-                shadowColor: "rgba(0, 0, 0, 0.5)"
-              }
-            }
-          }
-        ]
+                shadowColor: "rgba(0, 0, 0, 0.5)",
+              },
+            },
+          },
+        ],
       };
     },
     buildLine(courseProgressList) {
-      courseProgressList.sort(function(a, b) {
+      courseProgressList.sort(function (a, b) {
         if (b["completedProportion"] != a["completedProportion"]) {
           return b["completedProportion"] - a["completedProportion"];
         } else if (b["allNum"] != a["allNum"]) {
@@ -527,18 +529,18 @@ export default {
       var seriesBar = {
         name: "计划数",
         type: "bar",
-        data: []
+        data: [],
       };
       var seriesLine1 = {
         name: "完成数",
         type: "line",
-        data: []
+        data: [],
       };
       var seriesLine2 = {
         name: "完成比(%)",
         type: "line",
         yAxisIndex: 1,
-        data: []
+        data: [],
       };
       var yAxis_maxScale1 = 0;
       for (var i = 0; i < courseProgressDataList.length; i++) {
@@ -554,7 +556,7 @@ export default {
         legendData: ["计划数", "完成数", "完成比(%)"],
         xAxis: { data: xAxisData },
         series: [seriesBar, seriesLine1, seriesLine2],
-        yAxis_maxScale1
+        yAxis_maxScale1,
       };
       this.buildLineOptions(optionData);
     },
@@ -567,29 +569,29 @@ export default {
           axisPointer: {
             type: "cross",
             crossStyle: {
-              color: "#999"
-            }
-          }
+              color: "#999",
+            },
+          },
         },
         toolbox: {
           feature: {
             dataView: { show: true, readOnly: false },
             magicType: { show: true, type: ["line", "bar"] },
             restore: { show: true },
-            saveAsImage: { show: true }
-          }
+            saveAsImage: { show: true },
+          },
         },
         legend: {
-          data: optionData.legendData
+          data: optionData.legendData,
         },
         xAxis: [
           {
             type: "category",
             data: optionData.xAxis.data,
             axisPointer: {
-              type: "shadow"
-            }
-          }
+              type: "shadow",
+            },
+          },
         ],
         yAxis: [
           {
@@ -599,8 +601,8 @@ export default {
             max: optionData.yAxis_maxScale1,
             interval: 10000,
             axisLabel: {
-              formatter: "{value} "
-            }
+              formatter: "{value} ",
+            },
           },
           {
             type: "value",
@@ -609,11 +611,11 @@ export default {
             max: 100,
             interval: 20,
             axisLabel: {
-              formatter: "{value} %"
-            }
-          }
+              formatter: "{value} %",
+            },
+          },
         ],
-        series: optionData.series
+        series: optionData.series,
       };
     },
     sortByFinishedPercent(obj1, obj2) {
@@ -628,16 +630,16 @@ export default {
           params: {
             examId: this.examId,
             examStageId: this.examStageId,
-            orgId: this.orgId
+            orgId: this.orgId,
           },
           responseType: "arraybuffer",
-          timeout: 20 * 60 * 1000 //限时20分钟
+          timeout: 20 * 60 * 1000, //限时20分钟
         })
-        .then(response => {
+        .then((response) => {
           if (response.data) {
             var blob = new Blob([response.data], {
               type:
-                "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
+                "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
             });
             var url = URL.createObjectURL(blob);
             var a = document.createElement("a");
@@ -657,16 +659,16 @@ export default {
           params: {
             examId: this.examId,
             examStageId: this.examStageId,
-            courseId: this.courseId
+            courseId: this.courseId,
           },
           responseType: "arraybuffer",
-          timeout: 20 * 60 * 1000 //限时20分钟
+          timeout: 20 * 60 * 1000, //限时20分钟
         })
-        .then(response => {
+        .then((response) => {
           if (response.data) {
             var blob = new Blob([response.data], {
               type:
-                "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
+                "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
             });
             var url = URL.createObjectURL(blob);
             var a = document.createElement("a");
@@ -685,18 +687,18 @@ export default {
           title: "警告",
           message: "请选择考试",
           type: "warning",
-          duration: 2000
+          duration: 2000,
         });
         return false;
       }
       this.$http
         .get("/api/ecs_oe_admin/examControl/getExamSyncPercentage", {
-          params: { examId: this.examId }
+          params: { examId: this.examId },
         })
-        .then(response => {
+        .then((response) => {
           this.examSyncPercentage = response.data;
         })
-        .catch(res => {
+        .catch((res) => {
           var errorMsg = "操作失败";
           if (res.response && res.response.data) {
             errorMsg = res.response.data.desc;
@@ -704,7 +706,7 @@ export default {
           this.$notify({
             title: "提示",
             message: errorMsg,
-            type: "error"
+            type: "error",
           });
         });
     },
@@ -721,24 +723,20 @@ export default {
         name;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           if ("search" == where) {
             this.queryExamStages4SearchLoading = false;
             this.examStageList4Search = response.data;
           }
         })
-        .catch(response => {
+        .catch((response) => {
           console.log(response);
           if ("search" == where) {
             this.queryExamStages4SearchLoading = false;
           }
         });
-    }
+    },
   },
-  created() {
-    this.getExams();
-    this.getOrgs();
-  }
 };
 </script>
 <style>

+ 27 - 27
src/modules/oe/views/export_task_list.vue

@@ -1,21 +1,21 @@
 <template>
-  <section style="margin-top: 0px;">
+  <section style="margin-top: 0px">
     <el-form
       :model="formSearch"
       :inline="true"
-      style="border-bottom: 1px solid rgb(221, 221, 221);margin-bottom: 10px;"
+      style="border-bottom: 1px solid rgb(221, 221, 221); margin-bottom: 10px"
     >
       <el-form-item label="考试">
         <el-select
           v-model="formSearch.examId"
           :remote-method="getExams"
-          @clear="getExams"
           placeholder="请选择"
           remote
           filterable
           clearable
           size="small"
           class="w180"
+          @clear="getExams"
         >
           <el-option
             v-for="item in examList"
@@ -32,8 +32,8 @@
           size="small"
           class="w180"
           placeholder="请选择"
-          @clear="clearTypeValue"
           clearable
+          @clear="clearTypeValue"
         >
           <el-option label="考试明细" value="EXAM_DETAIL"></el-option>
           <el-option label="成绩统计" value="SCORE_STATISTIC"></el-option>
@@ -47,8 +47,8 @@
           size="small"
           class="w180"
           placeholder="请选择"
-          @clear="clearStatusValue"
           clearable
+          @clear="clearStatusValue"
         >
           <el-option label="导出中" value="EXPORTING"></el-option>
           <el-option label="成功" value="SUCCESS"></el-option>
@@ -75,7 +75,7 @@
       v-loading="loading"
       :data="tableData"
       element-loading-text="数据加载中"
-      style="width:100%;"
+      style="width: 100%"
       border
       stripe
     >
@@ -121,8 +121,8 @@
             type="primary"
             icon="el-icon-download"
             :disabled="scope.row.status != 'SUCCESS'"
-            @click="download(scope.row)"
             plain
+            @click="download(scope.row)"
             >下载
           </el-button>
 
@@ -131,8 +131,8 @@
             type="danger"
             icon="el-icon-delete"
             :disabled="scope.row.status == 'EXPORTING'"
-            @click="doDelete(scope.row)"
             plain
+            @click="doDelete(scope.row)"
             >删除
           </el-button>
         </template>
@@ -141,13 +141,13 @@
 
     <div class="page pull-right">
       <el-pagination
-        @current-change="handlePagerNo"
         :current-page="formSearch.pageNo"
-        @size-change="handlePagerSize"
         :page-size="formSearch.pageSize"
         :page-sizes="[10, 20, 50, 100, 200, 300]"
         :total="totalElements"
         layout="total, sizes, prev, pager, next, jumper"
+        @current-change="handlePagerNo"
+        @size-change="handlePagerSize"
       ></el-pagination>
     </div>
   </section>
@@ -164,14 +164,21 @@ export default {
         type: null,
         status: null,
         pageNo: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       loading: false,
       tableData: [],
       totalElements: 0,
-      examList: []
+      examList: [],
     };
   },
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    this.getExams();
+    this.doSearch(1);
+  },
   methods: {
     getExams(examName) {
       if (!examName) {
@@ -182,10 +189,10 @@ export default {
           params: {
             enable: true,
             name: examName,
-            examTypes: "ONLINE#OFFLINE#ONLINE_HOMEWORK"
-          }
+            examTypes: "ONLINE#OFFLINE#ONLINE_HOMEWORK",
+          },
         })
-        .then(response => {
+        .then((response) => {
           this.examList = response.data;
         });
     },
@@ -195,12 +202,12 @@ export default {
       this.loading = true;
       let url = "/api/ecs_oe_admin/export/task/list";
       this.$http.post(url, this.formSearch).then(
-        response => {
+        (response) => {
           this.tableData = response.data.content;
           this.totalElements = response.data.totalElements;
           this.loading = false;
         },
-        error => {
+        (error) => {
           console.log(error);
           this.loading = false;
         }
@@ -210,13 +217,13 @@ export default {
       this.$confirm("确认删除当前任务?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       }).then(() => {
         let url = "/api/ecs_oe_admin/export/task/delete?taskId=" + row.id;
         this.$httpWithMsg.post(url).then(() => {
           this.$notify({
             type: "success",
-            message: "删除成功"
+            message: "删除成功",
           });
           this.doSearch();
         });
@@ -243,15 +250,8 @@ export default {
       this.formSearch.type = null;
       this.formSearch.status = null;
       this.doSearch(1);
-    }
-  },
-  computed: {
-    ...mapState({ user: state => state.user })
+    },
   },
-  created() {
-    this.getExams();
-    this.doSearch(1);
-  }
 };
 </script>
 

+ 32 - 32
src/modules/oe/views/illegalityNameList.vue

@@ -1,7 +1,7 @@
 <template>
   <el-container>
     <el-main class="el-main-padding">
-      <commonFormVue :form="form" :getExamCondition="getExamCondition">
+      <commonFormVue :form="form" :get-exam-condition="getExamCondition">
         <el-col :span="6">
           <el-form-item label="违纪类型">
             <el-select
@@ -11,9 +11,9 @@
               :remote-method="getDisciplineTypeList"
               clearable
               class="form_search_width"
-              @clear="getDisciplineTypeList"
               placeholder="全部"
               size="small"
+              @clear="getDisciplineTypeList"
             >
               <el-option
                 v-for="item in disciplineTypeList"
@@ -28,17 +28,17 @@
       <el-row>
         <el-col :span="24">
           <el-button
-            @click="search('clickSelectBtn')"
             size="small"
             icon="el-icon-search"
             type="primary"
+            @click="search('clickSelectBtn')"
             >查询</el-button
           >
           <el-button
             size="small"
             icon="el-icon-refresh"
+            style="margin-right: 10px"
             @click="resetForm"
-            style="margin-right:10px;"
             >重置</el-button
           >
         </el-col>
@@ -49,27 +49,27 @@
           <span>操作:</span>
           <commonExportVue
             :form="form"
-            :exportUrl="exportUrl"
-            :exportFileName="exportFileName"
+            :export-url="exportUrl"
+            :export-file-name="exportFileName"
           ></commonExportVue>
         </el-col>
       </el-row>
       <el-row class="margin-top-10">
         <el-col :span="24">
           <el-table
+            ref="multipleTable"
             v-loading="tableLoading"
             element-loading-text="数据加载中"
-            ref="multipleTable"
-            @selection-change="handleSelectionChange"
             :data="tableData"
             border
+            @selection-change="handleSelectionChange"
           >
             <el-table-column width="80" label="考试ID">
               <template slot-scope="scope">
                 <el-button
                   v-show="currentPagePrivileges.SNAPSHOT_DETAILS"
-                  @click="gotoCaptureDetail(scope.row.examRecordDataId)"
                   type="text"
+                  @click="gotoCaptureDetail(scope.row.examRecordDataId)"
                   >{{ scope.row.examRecordDataId }}</el-button
                 >
                 <span v-show="!currentPagePrivileges.SNAPSHOT_DETAILS">{{
@@ -164,13 +164,13 @@
           </el-table>
           <div class="block pull-right">
             <el-pagination
-              @size-change="handleSizeChange"
-              @current-change="handleCurrentChange"
               :current-page.sync="form.pageNo"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
               :page-size="form.pageSize"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
             ></el-pagination>
           </div>
         </el-col>
@@ -212,28 +212,33 @@ export default {
         pageNo: 1,
         pageSize: 10,
         ORG_FIND_ALL: false, //查询所有机构
-        examStageId: null
+        examStageId: null,
       },
 
       getExamCondition: {
         params: {
           name: "",
           examTypes: "ONLINE",
-          propertyKeys: "IS_FACE_ENABLE"
+          propertyKeys: "IS_FACE_ENABLE",
         },
-        filterCondition: "IS_FACE_ENABLE"
+        filterCondition: "IS_FACE_ENABLE",
       },
       tableData: [],
       exportUrl: "/api/ecs_oe_admin/exam/audit/discipline/list/export",
       exportFileName: "违纪名单",
       currentPagePrivileges: {
         BREACH_THE_PRINCIPLE_EXPORT: false,
-        SNAPSHOT_DETAILS: false //详情查看
-      }
+        SNAPSHOT_DETAILS: false, //详情查看
+      },
     };
   },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    this.form.rootOrgId = this.user.rootOrgId;
+    this.backFill();
+    this.getDisciplineTypeList("");
   },
   methods: {
     getDisciplineTypeList(name) {
@@ -242,13 +247,13 @@ export default {
       }
       this.$http
         .get("/api/ecs_oe_admin/illegallyType/queryByNameLike", {
-          params: { name }
+          params: { name },
         })
-        .then(response => {
+        .then((response) => {
           if (response.data) {
             //排除断电和机器故障
             this.disciplineTypeList = response.data.filter(
-              v =>
+              (v) =>
                 !(v.rootOrgId == -1 && v.code == "POWER_FAILURE") &&
                 !(v.rootOrgId == -1 && v.code == "MACHINE_STOPPAGE")
             );
@@ -275,7 +280,7 @@ export default {
         pageNo: 1,
         pageSize: 10,
         ORG_FIND_ALL: this.form.ORG_FIND_ALL,
-        examStageId: null
+        examStageId: null,
       };
     },
     search(type) {
@@ -284,7 +289,7 @@ export default {
           title: "警告",
           message: "请选择考试",
           type: "warning",
-          duration: 1000
+          duration: 1000,
         });
         return false;
       }
@@ -298,7 +303,7 @@ export default {
       }
       this.$http
         .post("/api/ecs_oe_admin/exam/audit/discipline/list", params)
-        .then(response => {
+        .then((response) => {
           if (response.data) {
             this.tableData = response.data.content;
             this.total = response.data.totalElements;
@@ -308,7 +313,7 @@ export default {
           }
           this.tableLoading = false;
           this.$router.push({
-            path: "/oe/illegalityNameList?" + new URLSearchParams(params)
+            path: "/oe/illegalityNameList?" + new URLSearchParams(params),
           });
         });
     },
@@ -333,7 +338,7 @@ export default {
     },
     gotoCaptureDetail(examRecordDataId) {
       this.$router.push({
-        path: "/oe/captureDetail/" + examRecordDataId + "/illegalityNameList"
+        path: "/oe/captureDetail/" + examRecordDataId + "/illegalityNameList",
       });
     },
     backFill() {
@@ -352,7 +357,7 @@ export default {
         this.search();
       }
     },
-    disciplineTypeFilter: function(value) {
+    disciplineTypeFilter: function (value) {
       if (value && value.indexOf("&&") > -1) {
         var arr = value.split("&&");
         var detail = "";
@@ -363,13 +368,8 @@ export default {
       } else {
         return value;
       }
-    }
+    },
   },
-  created() {
-    this.form.rootOrgId = this.user.rootOrgId;
-    this.backFill();
-    this.getDisciplineTypeList("");
-  }
 };
 </script>
 <style scoped src="../style/common.css"></style>

+ 55 - 55
src/modules/oe/views/illegalityType.vue

@@ -1,25 +1,25 @@
 <template>
   <section class="content">
     <div
-      class="box-body"
       v-loading.body="fileLoading"
       v-loading.fullscreen="loading"
+      class="box-body"
       element-loading-text="请稍后..."
     >
-      <el-form :inline="true" :model="formSearch" ref="primaryForm">
+      <el-form ref="primaryForm" :inline="true" :model="formSearch">
         <el-row>
           <el-form-item label="违纪类型名称">
             <el-input
+              v-model="formSearch.name"
               class="input_width_lg"
               placeholder="请输入违纪类型名称"
-              v-model="formSearch.name"
             />
           </el-form-item>
           <el-form-item label="违纪类型代码">
             <el-input
+              v-model="formSearch.code"
               class="input_width_lg"
               placeholder="请输入违纪类型代码"
-              v-model="formSearch.code"
             />
           </el-form-item>
 
@@ -33,8 +33,8 @@
             >
             <el-button
               size="small"
-              @click="resetPrimaryForm"
               icon="el-icon-refresh"
+              @click="resetPrimaryForm"
               >重置</el-button
             >
             <el-button
@@ -54,27 +54,27 @@
       <el-button
         size="small"
         type="danger"
-        @click="deleteIds"
         :disabled="noBatchSelected"
         icon="el-icon-delete"
+        @click="deleteIds"
         >删除</el-button
       >
       <el-button
         size="small"
         type="primary"
-        @click="impIllegallyType"
         icon="el-icon-upload2"
+        @click="impIllegallyType"
         >导入</el-button
       >
       <el-button
         size="small"
         type="primary"
-        @click="exportIllegallyType"
         icon="el-icon-download"
+        @click="exportIllegallyType"
         >导出</el-button
       >
 
-      <div style="width: 100%;margin-bottom: 10px;"></div>
+      <div style="width: 100%; margin-bottom: 10px"></div>
 
       <!-- 新增或修改弹出框 -->
       <el-dialog
@@ -84,19 +84,19 @@
         @close="dialogBeforeClose"
       >
         <el-form
+          ref="illegallyTypeForm"
           :inline="true"
           inline-message
           :model="illegallyTypeForm"
-          ref="illegallyTypeForm"
           :rules="rules"
           label-position="right"
           label-width="90px"
         >
           <el-form-item label="代码" prop="code">
             <el-input
+              v-model="illegallyTypeForm.code"
               :disabled="null != illegallyTypeForm.id"
               class="pull_length"
-              v-model="illegallyTypeForm.code"
               auto-complete="off"
               placeholder="违纪类型代码"
               maxlength="100"
@@ -104,8 +104,8 @@
           </el-form-item>
           <el-form-item label="名称" prop="name">
             <el-input
-              class="pull_length"
               v-model="illegallyTypeForm.name"
+              class="pull_length"
               auto-complete="off"
               placeholder="违纪类型名称"
               maxlength="100"
@@ -173,8 +173,8 @@
                 size="mini"
                 type="primary"
                 icon="el-icon-edit"
-                @click="edit(scope.row)"
                 plain
+                @click="edit(scope.row)"
                 >编辑</el-button
               >
               <el-button
@@ -191,13 +191,13 @@
       </el-table>
       <div class="page pull-right">
         <el-pagination
-          @current-change="handleCurrentChange"
           :current-page="currentPage"
           :page-size="pageSize"
           :page-sizes="[10, 20, 50, 100, 200, 300]"
-          @size-change="handleSizeChange"
           layout="total, sizes, prev, pager, next, jumper"
           :total="total"
+          @current-change="handleCurrentChange"
+          @size-change="handleSizeChange"
         />
       </div>
 
@@ -205,10 +205,10 @@
       <el-dialog title="导入窗口" width="520px" :visible.sync="impDialog">
         <el-form>
           <el-row>
-            <el-form-item style="margin-left:20px">
+            <el-form-item style="margin-left: 20px">
               <el-upload
-                class="form_left"
                 ref="upload"
+                class="form_left"
                 accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
                 :action="uploadAction"
                 :headers="uploadHeaders"
@@ -222,8 +222,8 @@
                 :multiple="false"
               >
                 <el-button
-                  size="small"
                   slot="trigger"
+                  size="small"
                   type="primary"
                   icon="el-icon-search"
                   >选择文件</el-button
@@ -231,22 +231,22 @@
                 <el-button
                   size="small"
                   type="primary"
-                  @click="submitUpload"
                   icon="el-icon-check"
+                  @click="submitUpload"
                   >确认上传</el-button
                 >
                 <el-button
                   size="small"
                   type="primary"
-                  @click="removeFile"
                   icon="el-icon-refresh"
+                  @click="removeFile"
                   >清空文件</el-button
                 >
                 <el-button
                   size="small"
                   type="primary"
-                  @click="exportFile"
                   icon="el-icon-download"
+                  @click="exportFile"
                   >下载模板</el-button
                 >
                 <div slot="tip" class="el-upload__tip">只能上传xlsx文件</div>
@@ -259,9 +259,9 @@
       <!-- 导入错误信息列表 -->
       <el-dialog title="错误提示" :visible.sync="errDialog">
         <div
-          class="text-danger"
           v-for="errMessage in errMessages"
           :key="errMessage.lineNum"
+          class="text-danger"
         >
           第{{ errMessage.lineNum }}行:{{ errMessage.msg }}
         </div>
@@ -277,18 +277,18 @@
 import { mapState } from "vuex";
 
 export default {
-  name: "illegallyType",
+  name: "IllegallyType",
   data() {
     return {
       formSearch: {
         name: "",
-        code: ""
+        code: "",
       },
       illegallyTypeForm: {
         id: null,
         name: "",
         code: "",
-        sortNo: 0
+        sortNo: 0,
       },
       illegallyTypeId: "",
       illegallyTypeDialog: false,
@@ -312,19 +312,27 @@ export default {
           {
             required: true,
             message: "代码不允许为空",
-            trigger: "blur"
-          }
-        ]
-      }
+            trigger: "blur",
+          },
+        ],
+      },
     };
   },
   computed: {
     ...mapState({
-      user: state => state.user
+      user: (state) => state.user,
     }),
     noBatchSelected() {
       return this.multipleSelection.length === 0;
-    }
+    },
+  },
+  //初始化查询
+  created() {
+    this.searchForm();
+    this.uploadHeaders = {
+      key: this.user.key,
+      token: this.user.token,
+    };
   },
   methods: {
     dialogBeforeClose() {
@@ -337,7 +345,7 @@ export default {
     resetPrimaryForm() {
       this.formSearch = {
         name: "",
-        code: ""
+        code: "",
       };
       this.$refs.primaryForm.resetFields();
     },
@@ -363,7 +371,7 @@ export default {
         param;
       this.$httpWithMsg
         .get(url)
-        .then(response => {
+        .then((response) => {
           console.log("response :", response);
           this.tableData = response.data.list;
           this.total = response.data.total;
@@ -383,7 +391,7 @@ export default {
     },
     //保存
     submitForm(formData) {
-      this.$refs[formData].validate(valid => {
+      this.$refs[formData].validate((valid) => {
         if (valid) {
           var url = "/api/ecs_oe_admin/illegallyType";
           //修改
@@ -392,7 +400,7 @@ export default {
               () => {
                 this.$notify({
                   type: "success",
-                  message: "修改成功!"
+                  message: "修改成功!",
                 });
                 this.searchForm();
                 this.illegallyTypeDialog = false;
@@ -409,7 +417,7 @@ export default {
               () => {
                 this.$notify({
                   type: "success",
-                  message: "新增成功!"
+                  message: "新增成功!",
                 });
                 this.illegallyTypeDialog = false;
                 this.searchForm();
@@ -454,13 +462,13 @@ export default {
       this.$confirm("是否删除该条违纪类型信息?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "error"
+        type: "error",
       }).then(() => {
         var url = "/api/ecs_oe_admin/illegallyType/" + row.id;
         this.$httpWithMsg.delete(url).then(() => {
           this.$notify({
             type: "success",
-            message: "删除成功!"
+            message: "删除成功!",
           });
           this.searchForm();
         });
@@ -471,13 +479,13 @@ export default {
       if (this.multipleSelection.length === 0) {
         this.$notify({
           type: "warning",
-          message: "请选择要删除的违纪类型"
+          message: "请选择要删除的违纪类型",
         });
       } else {
         this.$confirm("是否删除这些违纪类型信息?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "error"
+          type: "error",
         }).then(() => {
           var ids = [];
           for (var i = 0; i < this.multipleSelection.length; i++) {
@@ -487,7 +495,7 @@ export default {
           this.$httpWithMsg.delete(url).then(() => {
             this.$notify({
               type: "success",
-              message: "删除成功!"
+              message: "删除成功!",
             });
             this.searchForm();
           });
@@ -524,7 +532,7 @@ export default {
       if (!response.hasError) {
         this.$notify({
           message: "上传成功",
-          type: "success"
+          type: "success",
         });
         this.fileLoading = false;
         this.impDialog = false;
@@ -541,7 +549,7 @@ export default {
       if (response.status == 500) {
         this.$notify({
           message: json.desc,
-          type: "error"
+          type: "error",
         });
       }
       this.fileLoading = false;
@@ -559,14 +567,14 @@ export default {
       if (fileList.length == 0) {
         this.$notify({
           message: "上传文件不能为空",
-          type: "error"
+          type: "error",
         });
         return false;
       }
       if (fileList.length > 1) {
         this.$notify({
           message: "每次只能上传一个文件",
-          type: "error"
+          type: "error",
         });
         return false;
       }
@@ -574,7 +582,7 @@ export default {
         if (!file.name.endsWith(".xlsx")) {
           this.$notify({
             message: "上传文件必须为xlsx格式",
-            type: "error"
+            type: "error",
           });
           this.initUpload();
           return false;
@@ -600,16 +608,8 @@ export default {
         return false;
       }
       return true;
-    }
+    },
   },
-  //初始化查询
-  created() {
-    this.searchForm();
-    this.uploadHeaders = {
-      key: this.user.key,
-      token: this.user.token
-    };
-  }
 };
 </script>
 

+ 26 - 26
src/modules/oe/views/reexamine.vue

@@ -3,14 +3,14 @@
     <el-main class="el-main-padding">
       <commonFormVue
         :form="form"
-        :getExamCondition="getExamCondition"
+        :get-exam-condition="getExamCondition"
       ></commonFormVue>
       <el-col :span="6">
         <el-button
-          @click="search('clickSelectBtn')"
           size="small"
           type="primary"
           icon="el-icon-search"
+          @click="search('clickSelectBtn')"
           >查询</el-button
         >
         <el-button size="small" icon="el-icon-refresh" @click="resetForm"
@@ -20,12 +20,12 @@
       <el-row class="margin-top-10">
         <el-col :span="24">
           <el-table
+            ref="multipleTable"
             v-loading="tableLoading"
             element-loading-text="数据加载中"
-            ref="multipleTable"
-            @selection-change="handleSelectionChange"
             :data="tableData"
             border
+            @selection-change="handleSelectionChange"
           >
             <el-table-column
               sortable
@@ -62,8 +62,8 @@
                 <el-button
                   size="mini"
                   type="primary"
-                  @click="openReexamineDialog(scope.row.examStudentId)"
                   icon="el-icon-refresh"
+                  @click="openReexamineDialog(scope.row.examStudentId)"
                   >设置重考</el-button
                 >
               </template>
@@ -71,13 +71,13 @@
           </el-table>
           <div class="block pull-right">
             <el-pagination
-              @size-change="handleSizeChange"
-              @current-change="handleCurrentChange"
               :current-page.sync="form.pageNo"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
               :page-size="form.pageSize"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
             ></el-pagination>
           </div>
         </el-col>
@@ -87,12 +87,12 @@
         :visible.sync="dialogFormVisible"
         @closed="reexamineDialogClosed"
       >
-        <el-form :model="reexamineForm" ref="reexamineForm">
+        <el-form ref="reexamineForm" :model="reexamineForm">
           <el-form-item
             prop="reexamineType"
             label="重考理由"
             :rules="[
-              { required: true, message: '请选择重考理由', trigger: 'change' }
+              { required: true, message: '请选择重考理由', trigger: 'change' },
             ]"
           >
             <el-select
@@ -107,7 +107,7 @@
               ></el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="详情描述" style="margin-top:15px;">
+          <el-form-item label="详情描述" style="margin-top: 15px">
             <el-input
               v-model="reexamineForm.reexamineDetail"
               type="textarea"
@@ -154,31 +154,32 @@ export default {
         isWarn: null,
         pageNo: 1,
         pageSize: 10,
-        ORG_FIND_ALL: false //查询所有机构
+        ORG_FIND_ALL: false, //查询所有机构
       },
       reexamineForm: {
         examStudentId: "",
         reexamineType: "",
-        reexamineDetail: ""
+        reexamineDetail: "",
       },
       getExamCondition: {
         params: {
           name: "",
-          examTypes: "ONLINE#ONLINE_HOMEWORK"
+          examTypes: "ONLINE#ONLINE_HOMEWORK",
         },
-        filterCondition: ""
+        filterCondition: "",
       },
       tableData: [],
       reexamineTypeList: [
         { desc: "断电", name: "POWER_FAILURE" },
         { desc: "机器故障", name: "MACHINE_STOPPAGE" },
-        { desc: "其他", name: "OTHER" }
-      ]
+        { desc: "其他", name: "OTHER" },
+      ],
     };
   },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: (state) => state.user }),
   },
+  created() {},
   methods: {
     resetForm() {
       this.form = {
@@ -199,7 +200,7 @@ export default {
         isWarn: null,
         pageNo: 1,
         pageSize: 10,
-        ORG_FIND_ALL: this.form.ORG_FIND_ALL
+        ORG_FIND_ALL: this.form.ORG_FIND_ALL,
       };
     },
     search(type) {
@@ -208,7 +209,7 @@ export default {
           title: "警告",
           message: "请选择考试",
           type: "warning",
-          duration: 1000
+          duration: 1000,
         });
         return false;
       }
@@ -218,7 +219,7 @@ export default {
       this.tableLoading = true;
       this.$http
         .post("/api/ecs_oe_admin/exam/student/reexamine/list", this.form)
-        .then(response => {
+        .then((response) => {
           if (response.data) {
             this.tableData = response.data.content;
             this.total = response.data.totalElements;
@@ -252,16 +253,16 @@ export default {
       this.reexamineForm = {
         examStudentId: examStudentId,
         reexamineType: "",
-        reexamineDetail: ""
+        reexamineDetail: "",
       };
     },
     doSetReexamine() {
-      this.$refs["reexamineForm"].validate(valid => {
+      this.$refs["reexamineForm"].validate((valid) => {
         if (valid) {
           var param = new URLSearchParams({
             examStudentId: this.reexamineForm.examStudentId,
             reexamineType: this.reexamineForm.reexamineType,
-            reexamineDetail: this.reexamineForm.reexamineDetail
+            reexamineDetail: this.reexamineForm.reexamineDetail,
           });
           this.$http
             .post("/api/ecs_oe_admin/exam/student/reexamine", param)
@@ -269,7 +270,7 @@ export default {
               this.$notify({
                 title: "成功",
                 message: "操作成功",
-                type: "success"
+                type: "success",
               });
               this.dialogFormVisible = false;
               this.search();
@@ -281,9 +282,8 @@ export default {
     },
     reexamineDialogClosed() {
       this.$refs["reexamineForm"].resetFields();
-    }
+    },
   },
-  created() {}
 };
 </script>
 <style scoped src="../style/common.css"></style>

+ 38 - 38
src/modules/oe/views/scoreStatistics.vue

@@ -1,13 +1,13 @@
 <template>
   <el-container>
     <el-main class="el-main-padding">
-      <commonFormVue :form="form" :getExamCondition="getExamCondition">
+      <commonFormVue :form="form" :get-exam-condition="getExamCondition">
         <el-col :span="6">
           <el-form-item label="是否缺考">
             <el-select
+              v-model="form.finished"
               class="form_search_width"
               size="small"
-              v-model="form.finished"
               clearable
               placeholder="全部"
             >
@@ -20,10 +20,10 @@
       <el-row>
         <el-col :span="24">
           <el-button
-            @click="search('clickSelectBtn')"
             size="small"
             type="primary"
             icon="el-icon-search"
+            @click="search('clickSelectBtn')"
             >查询</el-button
           >
           <el-button size="small" icon="el-icon-refresh" @click="resetForm"
@@ -33,22 +33,22 @@
       </el-row>
 
       <el-row>
-        <el-col :span="24" v-show="currentPagePrivileges.SCORE_STATICS_EXPORT">
+        <el-col v-show="currentPagePrivileges.SCORE_STATICS_EXPORT" :span="24">
           <div class="block-seperator"></div>
           <span>操作:</span>
           <el-button
+            v-show="!exportLoading"
             type="primary"
             size="small"
             icon="el-icon-download"
             @click="openExportDialog"
-            v-show="!exportLoading"
             >导出</el-button
           >
           <el-button
+            v-show="exportLoading"
             size="small"
             icon="el-icon-download"
             :loading="true"
-            v-show="exportLoading"
             >导出数据中...</el-button
           >
         </el-col>
@@ -57,12 +57,12 @@
       <el-row class="margin-top-10">
         <el-col :span="24">
           <el-table
+            ref="multipleTable"
             v-loading="tableLoading"
             element-loading-text="数据加载中"
-            ref="multipleTable"
-            @selection-change="handleSelectionChange"
             :data="tableData"
             border
+            @selection-change="handleSelectionChange"
           >
             <el-table-column
               sortable
@@ -171,13 +171,13 @@
           </el-table>
           <div class="block pull-right">
             <el-pagination
-              @size-change="handleSizeChange"
-              @current-change="handleCurrentChange"
               :current-page.sync="form.pageNo"
               :page-sizes="[10, 20, 50, 100, 200, 300]"
               :page-size="form.pageSize"
               layout="total, sizes, prev, pager, next, jumper"
               :total="total"
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
             ></el-pagination>
           </div>
         </el-col>
@@ -189,12 +189,12 @@
             <el-radio v-model="exportType" label="BATCH">分批导出</el-radio>
           </el-col>
         </el-row>
-        <el-row class="margin-top-10" v-show="exportType == 'BATCH'">
+        <el-row v-show="exportType == 'BATCH'" class="margin-top-10">
           <el-col :span="4">导出区间</el-col>
           <el-col :span="9">
             <el-input
-              size="small"
               v-model="form.startLimit"
+              size="small"
               placeholder="下限"
             ></el-input>
           </el-col>
@@ -203,8 +203,8 @@
           >
           <el-col :span="9">
             <el-input
-              size="small"
               v-model="form.endLimit"
+              size="small"
               placeholder="上限"
             ></el-input>
           </el-col>
@@ -257,26 +257,29 @@ export default {
         endLimit: "",
         ORG_FIND_ALL: false, //查询所有机构
         examStageId: null,
-        creator: null
+        creator: null,
       },
       getExamCondition: {
         params: {
           name: "",
-          examTypes: "ONLINE#OFFLINE#ONLINE_HOMEWORK"
+          examTypes: "ONLINE#OFFLINE#ONLINE_HOMEWORK",
         },
-        filterCondition: ""
+        filterCondition: "",
       },
       tableData: [],
       exportUrl: "/api/ecs_oe_admin/exam/score/statistic/list/export/async",
       exportFileName: "成绩统计",
       currentPagePrivileges: {
-        SCORE_STATICS_EXPORT: false //导出
+        SCORE_STATICS_EXPORT: false, //导出
       },
-      exportType: "ALL"
+      exportType: "ALL",
     };
   },
   computed: {
-    ...mapState({ user: state => state.user })
+    ...mapState({ user: (state) => state.user }),
+  },
+  created() {
+    this.form.creator = this.user.userId;
   },
   methods: {
     resetForm() {
@@ -301,7 +304,7 @@ export default {
         startLimit: "",
         endLimit: "",
         ORG_FIND_ALL: this.form.ORG_FIND_ALL,
-        examStageId: null
+        examStageId: null,
       };
     },
     search(type) {
@@ -310,7 +313,7 @@ export default {
           title: "警告",
           message: "请选择考试",
           type: "warning",
-          duration: 1000
+          duration: 1000,
         });
         return false;
       }
@@ -320,7 +323,7 @@ export default {
       this.tableLoading = true;
       this.$http
         .post("/api/ecs_oe_admin/exam/score/statistic/list", this.form)
-        .then(response => {
+        .then((response) => {
           if (response.data) {
             this.tableData = response.data.content;
             this.total = response.data.totalElements;
@@ -352,7 +355,7 @@ export default {
           title: "警告",
           message: "请选择考试",
           type: "warning",
-          duration: 1000
+          duration: 1000,
         });
         return false;
       }
@@ -364,12 +367,12 @@ export default {
     exportData() {
       this.$http
         .post("/api/ecs_oe_admin/exam/record/detail/check", this.form)
-        .then(response => {
+        .then((response) => {
           if (response.data > 0) {
             this.$confirm("成绩统计存在待审数据,是否继续导出?", "提示", {
               confirmButtonText: "确定",
               cancelButtonText: "取消",
-              type: "warning"
+              type: "warning",
             }).then(() => {
               this.dialogExportTypeVisible = false;
               // this._exportData();
@@ -388,19 +391,19 @@ export default {
       this.$http
         .get(this.exportUrl, {
           params: {
-            query: this.form
-          }
+            query: this.form,
+          },
         })
         .then(() => {
           this.$notify({
             type: "success",
-            message: "正在后台导出中,请稍后到“导出任务列表”中下载!"
+            message: "正在后台导出中,请稍后到“导出任务列表”中下载!",
           });
         })
-        .catch(error => {
+        .catch((error) => {
           this.$notify({
             type: "error",
-            message: error.response.data.desc
+            message: error.response.data.desc,
           });
         });
     },
@@ -410,16 +413,16 @@ export default {
       this.$http
         .get(this.exportUrl, {
           params: {
-            query: this.form
+            query: this.form,
           },
           responseType: "arraybuffer",
-          timeout: 20 * 60 * 1000 //限时20分钟
+          timeout: 20 * 60 * 1000, //限时20分钟
         })
-        .then(response => {
+        .then((response) => {
           if (response.data) {
             var blob = new Blob([response.data], {
               type:
-                "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
+                "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
             });
             var url = URL.createObjectURL(blob);
             var a = document.createElement("a");
@@ -453,11 +456,8 @@ export default {
         p2 = 0;
       }
       return p1 - p2;
-    }
+    },
   },
-  created() {
-    this.form.creator = this.user.userId;
-  }
 };
 </script>
 <style scoped src="../style/common.css"></style>

+ 10 - 10
src/modules/portal/routes/routes.js

@@ -10,17 +10,17 @@ export default [
     path: "/",
     name: "Root",
     meta: { pageName: "首页" },
-    component: Login
+    component: Login,
   },
   {
     path: "/login",
     name: "Login",
-    component: Login
+    component: Login,
   },
   {
     path: "/access",
     name: "Access",
-    component: Access
+    component: Access,
   },
   {
     path: "/home",
@@ -29,25 +29,25 @@ export default [
     children: [
       {
         path: "overview",
-        component: HomeMain
+        component: HomeMain,
       },
       {
         path: "site-message",
         name: "SiteMessageHome",
-        component: SiteMessageHome
+        component: SiteMessageHome,
       },
       {
         path: "site-message/:id",
         name: "SiteMessageDetail",
-        component: SiteMessageDetail
-      }
-    ]
+        component: SiteMessageDetail,
+      },
+    ],
   },
   {
     // will match everything
     path: "*",
-    component: Component404
-  }
+    component: Component404,
+  },
   // {
   //   path: "/about",
   //   name: "about",

+ 2 - 2
src/modules/portal/store/currentPaths.js

@@ -9,6 +9,6 @@ export default {
       // Object.assign(state, paths);
       state.length = 0;
       state.push(...paths);
-    }
-  }
+    },
+  },
 };

+ 2 - 2
src/modules/portal/store/menuList.js

@@ -7,6 +7,6 @@ export default {
       // console.log(state, menuList);
       state.length = 0;
       state.push(...menuList);
-    }
-  }
+    },
+  },
 };

+ 4 - 4
src/modules/portal/store/user.js

@@ -12,8 +12,8 @@ export default {
     },
     [USER_SIGNOUT](state) {
       sessionStorage.removeItem("user");
-      Object.keys(state).forEach(k => Vue.delete(state, k));
-    }
+      Object.keys(state).forEach((k) => Vue.delete(state, k));
+    },
   },
   actions: {
     [USER_SIGNIN]({ commit }, user) {
@@ -21,6 +21,6 @@ export default {
     },
     [USER_SIGNOUT]({ commit }) {
       commit(USER_SIGNOUT);
-    }
-  }
+    },
+  },
 };

+ 8 - 8
src/modules/portal/views/Access.vue

@@ -16,8 +16,8 @@ export default {
         loginName: null,
         appId: null,
         timestamp: null,
-        token: null
-      }
+        token: null,
+      },
     };
   },
   created() {
@@ -33,26 +33,26 @@ export default {
     const url = CORE_API + "/auth/thirdPartyAccess";
     this.$httpWithMsg
       .post(url, new URLSearchParams(this.accessInfo), {
-        headers: { "content-type": "application/x-www-form-urlencoded" }
+        headers: { "content-type": "application/x-www-form-urlencoded" },
       })
-      .then(response => {
+      .then((response) => {
         var user = response.data;
         this.USER_SIGNIN(user);
         this.$router.replace({ path: "/home/overview" });
         this.$notify({
           message: "接入成功",
-          type: "success"
+          type: "success",
         });
       })
       .catch(() => {
         this.$notify({
           message: "接入失败",
-          type: "error"
+          type: "error",
         });
       });
   },
   methods: {
-    ...mapActions([USER_SIGNIN])
-  }
+    ...mapActions([USER_SIGNIN]),
+  },
 };
 </script>

+ 37 - 37
src/modules/portal/views/Login.vue

@@ -17,29 +17,29 @@
           <v-icon
             name="user"
             scale="1.4"
-            style="padding: 5px 0px; z-index: 3;"
+            style="padding: 5px 0px; z-index: 3"
           />
           <input
-            @keyup.enter="login"
-            @change="nameChange"
-            type="text"
             id="accountValue"
             v-model="loginInfo.accountValue"
+            type="text"
             placeholder="请输入账号"
+            @keyup.enter="login"
+            @change="nameChange"
           />
         </div>
         <div class="password">
           <v-icon
             name="lock"
             scale="1.4"
-            style="padding: 5px 0px; z-index: 3;"
+            style="padding: 5px 0px; z-index: 3"
           />
           <input
-            @keyup.enter="login"
-            type="password"
             id="password"
             v-model="loginInfo.password"
+            type="password"
             placeholder="请输入密码"
+            @keyup.enter="login"
           />
         </div>
         <div class="smscode">
@@ -47,15 +47,15 @@
             v-if="dialogVisible"
             name="lock"
             scale="1.4"
-            style="padding: 5px 0px; z-index: 3;"
+            style="padding: 5px 0px; z-index: 3"
           />
           <input
             v-if="dialogVisible"
-            @keyup.enter="login"
-            type="text"
             id="smsCode"
             v-model="loginInfo.smsCode"
+            type="text"
             placeholder="请输入短信验证码"
+            @keyup.enter="login"
           />
         </div>
         <button class="login-btn" @click="login">登 录</button>
@@ -85,10 +85,29 @@ export default {
         accountType: "COMMON_LOGIN_NAME",
         accountValue: "",
         password: "",
-        smsCode: null
-      }
+        smsCode: null,
+      },
     };
   },
+  watch: {
+    $route(to) {
+      this.loginInfo.rootOrgId = to.query.orgId;
+    },
+  },
+  created() {
+    if (this.$route.hash && this.$route.hash.startsWith("#/access?")) {
+      this.$router.push(this.$route.hash.slice(1));
+      return;
+    }
+    this.loginInfo.domain =
+      window.location.hostname.split(".")[0] + ".ecs.qmth.com.cn";
+    sessionStorage.clear();
+    var params = this.$route.query;
+
+    this.loginInfo.rootOrgId = params.orgId;
+
+    this.jwptCustomizeMethod();
+  },
   methods: {
     ...mapActions([USER_SIGNIN]),
     nameChange() {
@@ -103,7 +122,7 @@ export default {
         this.$notify({
           showClose: true,
           message: this.errorInfo,
-          type: "error"
+          type: "error",
         });
         return false;
       }
@@ -119,7 +138,7 @@ export default {
         this.$notify({
           showClose: true,
           message: this.errorInfo,
-          type: "error"
+          type: "error",
         });
         return false;
       }
@@ -136,17 +155,17 @@ export default {
       var url = CORE_API + "/auth/login";
       this.$httpWithMsg
         .post(url, this.loginInfo)
-        .then(response => {
+        .then((response) => {
           var user = response.data;
           this.USER_SIGNIN(user);
           this.$router.replace({ path: "/home/overview" });
           this.$notify({
             message: "登录成功",
             type: "success",
-            duration: 1000
+            duration: 1000,
           });
         })
-        .catch(error => {
+        .catch((error) => {
           if (
             error.response.data.code === "B-003100" ||
             error.response.data.code === "B-EX-102008"
@@ -166,27 +185,8 @@ export default {
         this.title = " | 普通高校-题库";
         this.jwptCustomize = true;
       }
-    }
-  },
-  created() {
-    if (this.$route.hash && this.$route.hash.startsWith("#/access?")) {
-      this.$router.push(this.$route.hash.slice(1));
-      return;
-    }
-    this.loginInfo.domain =
-      window.location.hostname.split(".")[0] + ".ecs.qmth.com.cn";
-    sessionStorage.clear();
-    var params = this.$route.query;
-
-    this.loginInfo.rootOrgId = params.orgId;
-
-    this.jwptCustomizeMethod();
+    },
   },
-  watch: {
-    $route(to) {
-      this.loginInfo.rootOrgId = to.query.orgId;
-    }
-  }
 };
 </script>
 

+ 48 - 38
src/modules/portal/views/home/Home.vue

@@ -1,40 +1,50 @@
 <template>
   <el-container>
-    <el-header style="padding: 0;">
+    <el-header style="padding: 0">
       <el-menu class="el-menu" mode="horizontal">
-        <el-menu-item index="1" style="width: 200px;">
+        <el-menu-item index="1" style="width: 200px">
           <router-link
             to="/home/overview"
-            style="display: inline-block; font-size: 20px; line-height: 48px; width: 100%; text-decoration-line: none"
+            style="
+              display: inline-block;
+              font-size: 20px;
+              line-height: 48px;
+              width: 100%;
+              text-decoration-line: none;
+            "
             title="回到主页"
           >
             <img
               src="./icon.png"
-              style="margin-bottom: 2px; line-height: 48px; display: inline-block"
+              style="
+                margin-bottom: 2px;
+                line-height: 48px;
+                display: inline-block;
+              "
             />
             云平台主页
           </router-link>
         </el-menu-item>
         <el-menu-item
           index="4"
-          style="float: right;"
+          style="float: right"
           title="退出系统"
           @click="logout"
         >
           <v-icon name="sign-out-alt" />
           <span style="cursor: pointer"> 退出 </span>
         </el-menu-item>
-        <el-menu-item index="3" style="float: right;" title="个人信息管理">
+        <el-menu-item index="3" style="float: right" title="个人信息管理">
           <v-icon name="user" />
-          <span @click="openUserDialog" style="cursor: pointer">
+          <span style="cursor: pointer" @click="openUserDialog">
             {{ user.displayName }}
           </span>
         </el-menu-item>
         <el-menu-item
-          @click="openMessageHome"
           index="2"
-          style="float: right;"
+          style="float: right"
           title="未读通知"
+          @click="openMessageHome"
         >
           <span class="el-icon-message" />
           <span style="cursor: pointer">{{ unreadMessageCount }}</span>
@@ -42,7 +52,7 @@
         <el-menu-item
           index="1"
           class="navbar-group-item"
-          style="float: right;"
+          style="float: right"
           title="机构名称"
         >
           <v-icon name="users" /> {{ user.rootOrgName }}
@@ -77,7 +87,7 @@
                   v-for="role in user.roleList"
                   :key="role.roleId"
                   type="primary"
-                  style="margin-left:10px;margin-top:10px;"
+                  style="margin-left: 10px; margin-top: 10px"
                 >
                   {{ role.roleName }}
                 </el-tag>
@@ -87,10 +97,10 @@
         </el-tab-pane>
         <el-tab-pane label="修改密码" name="second">
           <el-form
+            ref="passForm"
             :inline="true"
             inline-message
             :model="passForm"
-            ref="passForm"
             :rules="passRules"
             label-position="right"
             label-width="80px"
@@ -98,9 +108,9 @@
             <el-row>
               <el-form-item label="密码" prop="pass">
                 <el-input
+                  v-model="passForm.pass"
                   type="password"
                   style="width: 150px"
-                  v-model="passForm.pass"
                   auto-complete="off"
                   placeholder="请输入密码"
                 />
@@ -109,15 +119,15 @@
             <el-row>
               <el-form-item label="确认密码" prop="checkPass">
                 <el-input
+                  v-model="passForm.checkPass"
                   type="password"
                   style="width: 150px"
-                  v-model="passForm.checkPass"
                   auto-complete="off"
                   placeholder="请输入确认密码"
                 />
               </el-form-item>
             </el-row>
-            <el-row style="margin-left:100px">
+            <el-row style="margin-left: 100px">
               <el-button type="primary" @click="submitForm">保 存</el-button>
               <el-button @click="userDialog = false">取 消</el-button>
             </el-row>
@@ -136,10 +146,10 @@
       @close="() => this.$refs.passWeakForm.clearValidate()"
     >
       <el-form
+        ref="passWeakForm"
         :inline="true"
         inline-message
         :model="passWeakForm"
-        ref="passWeakForm"
         :rules="passWeakRules"
         label-position="right"
         label-width="80px"
@@ -147,9 +157,9 @@
         <el-row>
           <el-form-item label="密码" prop="pass">
             <el-input
+              v-model="passWeakForm.pass"
               type="password"
               style="width: 150px"
-              v-model="passWeakForm.pass"
               auto-complete="off"
               placeholder="输入新密码"
             />
@@ -158,9 +168,9 @@
         <el-row>
           <el-form-item label="确认密码" prop="checkPass">
             <el-input
+              v-model="passWeakForm.checkPass"
               type="password"
               style="width: 150px"
-              v-model="passWeakForm.checkPass"
               auto-complete="off"
               placeholder="再次输入新密码"
             />
@@ -173,7 +183,7 @@
             ></el-form-item
           >
         </el-row>
-        <el-row style="margin-left:80px">
+        <el-row style="margin-left: 80px">
           <el-button type="primary" @click="submitPassWeakForm"
             >确 认</el-button
           >
@@ -193,6 +203,7 @@ import LinkTitles from "./LinkTitles.vue";
 import SiteMessagePopup from "./SiteMessagePopup.vue";
 export default {
   name: "Home",
+  components: { HomeSide, LinkTitles, SiteMessagePopup },
   data() {
     var validatePass = (rule, value, callback) => {
       if (value === "") {
@@ -244,23 +255,27 @@ export default {
       passWeakForm: { pass: "", checkPass: "" },
       passRules: {
         pass: [{ validator: validatePass, trigger: "blur" }],
-        checkPass: [{ validator: validatePass2, trigger: "blur" }]
+        checkPass: [{ validator: validatePass2, trigger: "blur" }],
       },
       passWeakRules: {
         pass: [{ validator: validatePassWeakPass, trigger: "blur" }],
-        checkPass: [{ validator: validatePassWeakPass2, trigger: "blur" }]
-      }
+        checkPass: [{ validator: validatePassWeakPass2, trigger: "blur" }],
+      },
     };
   },
-  components: { HomeSide, LinkTitles, SiteMessagePopup },
   computed: {
-    ...mapState({ user: state => state.user }),
+    ...mapState({ user: (state) => state.user }),
     ifShowHomeSide() {
       return this.$route.fullPath.startsWith("/home") === false;
     },
     sideKey() {
       const module = this.$route.fullPath.split("/")[1];
       return module;
+    },
+  },
+  created() {
+    if (this.user.passwordWeak) {
+      this.passWeakDialog = true;
     }
   },
   methods: {
@@ -277,14 +292,14 @@ export default {
     },
     //保存密码
     submitForm() {
-      this.$refs.passForm.validate(valid => {
+      this.$refs.passForm.validate((valid) => {
         if (valid) {
           var password = encodeURIComponent(this.passForm.pass);
           var url = CORE_API + "/user/password?password=" + password;
           this.$httpWithMsg.put(url).then(() => {
             this.$notify({
               type: "success",
-              message: "修改密码成功!"
+              message: "修改密码成功!",
             });
             this.resetForm();
             this.userDialog = false;
@@ -296,14 +311,14 @@ export default {
       });
     },
     submitPassWeakForm() {
-      this.$refs.passWeakForm.validate(valid => {
+      this.$refs.passWeakForm.validate((valid) => {
         if (valid) {
           var password = encodeURIComponent(this.passWeakForm.pass);
           var url = CORE_API + "/user/password?password=" + password;
           this.$httpWithMsg.put(url).then(() => {
             this.$notify({
               type: "success",
-              message: "修改密码成功!"
+              message: "修改密码成功!",
             });
             this.user.passwordWeak = false;
             this.USER_SIGNIN(this.user);
@@ -336,30 +351,25 @@ export default {
           this.USER_SIGNOUT();
           window.name = "";
           this.$router.replace({
-            path: "/login" + getRootOrgId()
+            path: "/login" + getRootOrgId(),
           });
         })
-        .catch(response => {
+        .catch((response) => {
           if (response.status == 500) {
             this.$notify({
               showClose: true,
               message: response.data.desc,
-              type: "error"
+              type: "error",
             });
           }
           this.USER_SIGNOUT();
           window.name = "";
           this.$router.replace({
-            path: "/login" + getRootOrgId()
+            path: "/login" + getRootOrgId(),
           });
         });
-    }
+    },
   },
-  created() {
-    if (this.user.passwordWeak) {
-      this.passWeakDialog = true;
-    }
-  }
 };
 </script>
 

+ 37 - 37
src/modules/portal/views/home/HomeSide.vue

@@ -1,12 +1,12 @@
 <template>
-  <el-aside width="" v-if="menuList.length > 0">
+  <el-aside v-if="menuList.length > 0" width="">
     <div
       style="height: 50px; margin-top: 20px; margin-left: 20px; font-size: 20px"
     >
       <router-link
         v-if="!isCollapse"
         :to="{ path: group.path + '/tips' }"
-        style="color: white; text-decoration: none;"
+        style="color: white; text-decoration: none"
       >
         {{ group.name }}
       </router-link>
@@ -15,7 +15,7 @@
         type="text"
         class="float-right"
         size="mini"
-        style="padding: 0; padding-right: 16px; outline: none;"
+        style="padding: 0; padding-right: 16px; outline: none"
         @click="toggoleSidebar"
       >
         <v-icon name="bars" scale="1.6" />
@@ -41,11 +41,11 @@
 
         <el-menu-item
           v-for="menu2 in menuList2(menu1)"
-          :index="menu2.ext5"
           :key="menu2.id"
+          :index="menu2.ext5"
           :route="{ path: menu2.ext5 }"
         >
-          <span style="margin-left: 9px;">{{ menu2.name }}</span>
+          <span style="margin-left: 9px">{{ menu2.name }}</span>
         </el-menu-item>
       </el-submenu>
     </el-menu>
@@ -60,42 +60,42 @@ const routesToMenu = [
   {
     path: "/basic",
     name: "基础信息",
-    groupCode: "BASIC_MENUS"
+    groupCode: "BASIC_MENUS",
   },
   {
     path: "/examwork",
     name: "考务管理",
-    groupCode: "EXAM_WORK_MENUS"
+    groupCode: "EXAM_WORK_MENUS",
   },
   {
     path: "/questions",
     name: "题库",
-    groupCode: "QUESTIONS_WORK_MENUS"
+    groupCode: "QUESTIONS_WORK_MENUS",
   },
   {
     path: "/oe",
     name: "网考",
-    groupCode: "NETEXAM_WORK_MENUS"
+    groupCode: "NETEXAM_WORK_MENUS",
   },
   {
     path: "/marking",
     name: "阅卷",
-    groupCode: "MARK_WORK_MENUS"
+    groupCode: "MARK_WORK_MENUS",
   },
   {
     path: "/portal",
-    groupCode: "PORTAL_MENUS"
+    groupCode: "PORTAL_MENUS",
   },
   {
     path: "/print",
     name: "印刷管理",
-    groupCode: "PRINT_MENUS"
+    groupCode: "PRINT_MENUS",
   },
   {
     path: "/reports",
     name: "报表",
-    groupCode: "REPORTS_MENUS"
-  }
+    groupCode: "REPORTS_MENUS",
+  },
 ];
 
 import { mapMutations } from "vuex";
@@ -108,15 +108,29 @@ export default {
     return {
       group: null,
       menuList: [],
-      isCollapse: false
+      isCollapse: false,
     };
   },
   computed: {
-    ...mapState({ user: state => state.user }),
+    ...mapState({ user: (state) => state.user }),
     menuList1() {
       return this.menuList.filter(
-        m => m.parentId === null && m.ext1 === "menu"
+        (m) => m.parentId === null && m.ext1 === "menu"
       );
+    },
+  },
+  watch: {
+    $route() {
+      this.updatePath();
+    },
+  },
+  async created() {
+    this.group = routesToMenu.find((v) => this.$route.path.startsWith(v.path));
+    const groupCode = this.group && this.group.groupCode;
+    if (groupCode) {
+      this.menuList = await this.getUserPrivileges(groupCode);
+      this.UPDATE_MENU_LIST(this.menuList);
+      this.updatePath();
     }
   },
   methods: {
@@ -130,46 +144,32 @@ export default {
       params.append("groupCode", groupCode);
       params.append("full", false);
       const res = await this.$httpWithMsg.post(url, params, {
-        headers: { "content-type": "application/x-www-form-urlencoded" }
+        headers: { "content-type": "application/x-www-form-urlencoded" },
       });
 
       return res.data;
     },
     menuList2(menu1) {
       return this.menuList.filter(
-        m => m.parentId === menu1.id && m.ext1 === "menu"
+        (m) => m.parentId === menu1.id && m.ext1 === "menu"
       );
     },
     updatePath() {
       let currentPaths = [];
-      let part = this.menuList.find(v => v.ext5 === this.$route.path);
+      let part = this.menuList.find((v) => v.ext5 === this.$route.path);
       if (!part) {
         this.UPDATE_CURRENT_PATHS([]);
         return;
       }
       currentPaths.unshift(part.name);
-      while (this.menuList.find(v => v.id === part.parentId)) {
-        part = this.menuList.find(v => v.id === part.parentId);
+      while (this.menuList.find((v) => v.id === part.parentId)) {
+        part = this.menuList.find((v) => v.id === part.parentId);
         currentPaths.unshift(part.name);
       }
       // console.log(currentPaths);
       this.UPDATE_CURRENT_PATHS(currentPaths);
-    }
-  },
-  async created() {
-    this.group = routesToMenu.find(v => this.$route.path.startsWith(v.path));
-    const groupCode = this.group && this.group.groupCode;
-    if (groupCode) {
-      this.menuList = await this.getUserPrivileges(groupCode);
-      this.UPDATE_MENU_LIST(this.menuList);
-      this.updatePath();
-    }
+    },
   },
-  watch: {
-    $route() {
-      this.updatePath();
-    }
-  }
 };
 </script>
 

+ 3 - 3
src/modules/portal/views/home/LinkTitles.vue

@@ -2,7 +2,7 @@
   <el-breadcrumb
     v-if="currentPaths.length > 0"
     separator-class="el-icon-arrow-right"
-    style="border-bottom: 1px solid #ddd; padding-bottom: 5px;"
+    style="border-bottom: 1px solid #ddd; padding-bottom: 5px"
   >
     <el-breadcrumb-item :to="{ path: '/home/overview' }"
       >首页</el-breadcrumb-item
@@ -22,7 +22,7 @@ import { mapState } from "vuex";
 export default {
   name: "LinkTitles",
   computed: {
-    ...mapState(["currentPaths"])
-  }
+    ...mapState(["currentPaths"]),
+  },
 };
 </script>

+ 25 - 13
src/modules/portal/views/home/SiteMessageDetail.vue

@@ -13,12 +13,24 @@
     <el-form-item>
       <div class="site-message-container">
         <h3
-          style="font-size:24px;font-weight:500;color:rgba(34,34,34,1);line-height:33px;"
+          style="
+            font-size: 24px;
+            font-weight: 500;
+            color: rgba(34, 34, 34, 1);
+            line-height: 33px;
+          "
         >
           {{ message.title }}
         </h3>
         <h5
-          style="font-size:13px;font-weight:400;color:rgba(153,153,153,1);line-height:18px;margin-top: 16px;margin-bottom: 40px;"
+          style="
+            font-size: 13px;
+            font-weight: 400;
+            color: rgba(153, 153, 153, 1);
+            line-height: 18px;
+            margin-top: 16px;
+            margin-bottom: 40px;
+          "
         >
           发布时间: {{ message.publishTime }}
         </h5>
@@ -34,15 +46,23 @@ export default {
   name: "SiteMessageDetail",
   data() {
     return {
-      message: {}
+      message: {},
     };
   },
+  watch: {
+    $route: function () {
+      this.init();
+    },
+  },
   async mounted() {
     await this.prepareData();
   },
   async beforeUpdate() {
     await this.prepareData();
   },
+  created() {
+    this.init();
+  },
   methods: {
     back() {
       this.$router.push({ path: "/home/site-message" });
@@ -60,19 +80,11 @@ export default {
     },
     init() {
       var url = EXAM_WORK_API + "/notice/" + this.$route.params.id;
-      this.$httpWithMsg.get(url).then(response => {
+      this.$httpWithMsg.get(url).then((response) => {
         this.message = response.data;
       });
-    }
-  },
-  created() {
-    this.init();
+    },
   },
-  watch: {
-    $route: function() {
-      this.init();
-    }
-  }
 };
 </script>
 

Деякі файли не було показано, через те що забагато файлів було змінено