Bläddra i källkod

Merge branch 'master' of http://git.qmth.com.cn/ExamCloud-3/examcloud-web-admin

weiwenhai 6 år sedan
förälder
incheckning
6b50265b54

+ 1 - 0
src/modules/examwork/view/student.vue

@@ -597,6 +597,7 @@ export default {
       this.stuExamSearch.rootOrgId = row.rootOrgId;
       this.stuExamSearch.rootOrgId = row.rootOrgId;
       this.stuExamList = [];
       this.stuExamList = [];
       this.stuExamTotal = 0;
       this.stuExamTotal = 0;
+      this.queryExams4Search("");
       this.searchStuExam();
       this.searchStuExam();
       this.stuExamDialog = true;
       this.stuExamDialog = true;
     },
     },

+ 3 - 40
src/modules/marking/views/MarkWork.vue

@@ -17,7 +17,7 @@
               ></el-input>
               ></el-input>
             </el-form-item>
             </el-form-item>
             <el-form-item>
             <el-form-item>
-              <span v-if="isAdmin">
+              <span>
                 <el-button
                 <el-button
                   size="small"
                   size="small"
                   type="primary"
                   type="primary"
@@ -81,7 +81,7 @@
             </el-table-column>
             </el-table-column>
             <el-table-column label="操作">
             <el-table-column label="操作">
               <template slot-scope="scope">
               <template slot-scope="scope">
-                <div class="pull-left" v-if="isAdmin">
+                <div class="pull-left">
                   <el-button
                   <el-button
                     @click="settingMarkWork(scope.row)"
                     @click="settingMarkWork(scope.row)"
                     type="primary"
                     type="primary"
@@ -228,7 +228,7 @@
 
 
 <script>
 <script>
 import { mapState } from "vuex";
 import { mapState } from "vuex";
-import { CORE_API, MARKING_API, DATA_PROCESS_API } from "@/constants/constants";
+import { MARKING_API, DATA_PROCESS_API } from "@/constants/constants";
 export default {
 export default {
   data() {
   data() {
     return {
     return {
@@ -263,7 +263,6 @@ export default {
       examTitle: "",
       examTitle: "",
       loading: false,
       loading: false,
       closeClickModal: false,
       closeClickModal: false,
-      isAdmin: false,
       saveLoading: false,
       saveLoading: false,
       oldWorkName: ""
       oldWorkName: ""
     };
     };
@@ -578,46 +577,10 @@ export default {
     },
     },
     update(selected) {
     update(selected) {
       this.formMarkWork.examId = selected;
       this.formMarkWork.examId = selected;
-    },
-    getUserPrivileges() {
-      var url = CORE_API + "/rolePrivilege/getUserPrivileges";
-      let config = {
-        url: url,
-        method: "post",
-        params: {
-          groupCode: "MARK_WORK_MENUS",
-          full: false
-        },
-        headers: {
-          "Content-Type": "application/x-www-form-urlencoded"
-        }
-      };
-      this.$http(config)
-        .then(response => {
-          let temp = response.data;
-          for (let menu in temp) {
-            let menuItem = temp[menu];
-            if (menuItem.ext1 == "button") {
-              sessionStorage.setItem(menuItem.code, true);
-            }
-          }
-          if (sessionStorage.getItem("AdminButtonShow")) {
-            this.isAdmin = true;
-          }
-        })
-        .catch(response => {
-          this.$notify({
-            showClose: true,
-            message: response.data,
-            type: "error"
-          });
-        });
     }
     }
   },
   },
   created() {
   created() {
-    this.getUserPrivileges();
     this.initMarkWorkData();
     this.initMarkWorkData();
-    //this.getExamSelect();
   }
   }
 };
 };
 </script>
 </script>

+ 23 - 30
src/modules/oe/mixin/pagePrivilege.js

@@ -2,38 +2,31 @@ export default {
   data() {
   data() {
     return {};
     return {};
   },
   },
-  created: function() {
-    this.getPagePrivilege();
-  },
-  methods: {
-    getPagePrivilege() {
-      var groupCode = "NETEXAM_WORK_MENUS";
-      this.$http
-        .post(
-          "/api/ecs_core/rolePrivilege/getUserPrivileges?groupCode=" +
-            groupCode +
-            "&full=" +
-            false
-        )
-        .then(response => {
-          var pagePermissions = this.filterPagePermission(response.data);
-          if (pagePermissions.length > 0) {
-            for (var currentPagePrivilege in this.currentPagePrivileges) {
-              if (pagePermissions.indexOf(currentPagePrivilege) > -1) {
-                this.currentPagePrivileges[currentPagePrivilege] = true;
-              }
+  beforeCreate() {
+    var groupCode = "NETEXAM_WORK_MENUS";
+    this.$http
+      .post(
+        "/api/ecs_core/rolePrivilege/getUserPrivileges?groupCode=" +
+          groupCode +
+          "&full=" +
+          false
+      )
+      .then(response => {
+        var allpermissions = response.data;
+        var pagePermissions = [];
+        for (var i = 0; i < allpermissions.length; i++) {
+          if (allpermissions[i].ext1 == "PAGE") {
+            pagePermissions.push(allpermissions[i].code);
+          }
+        }
+        if (pagePermissions.length > 0) {
+          for (var currentPagePrivilege in this.currentPagePrivileges) {
+            if (pagePermissions.indexOf(currentPagePrivilege) > -1) {
+              this.currentPagePrivileges[currentPagePrivilege] = true;
             }
             }
           }
           }
-        });
-    },
-    filterPagePermission(allpermissions) {
-      var pagePermissions = [];
-      for (var i = 0; i < allpermissions.length; i++) {
-        if (allpermissions[i].ext1 == "PAGE") {
-          pagePermissions.push(allpermissions[i].code);
         }
         }
-      }
-      return pagePermissions;
-    }
+        this.getPermissionStatus = true; //获取权限完成
+      });
   }
   }
 };
 };

+ 16 - 9
src/modules/oe/views/alreadyAudited.vue

@@ -27,6 +27,8 @@
                 <el-option value="UN_PASS" label="不通过"></el-option>
                 <el-option value="UN_PASS" label="不通过"></el-option>
               </el-select>
               </el-select>
               <el-input
               <el-input
+                size="small"
+                class="form_search_width"
                 v-if="!currentPagePrivileges.INVIGILATE_AUDIT_STATUS"
                 v-if="!currentPagePrivileges.INVIGILATE_AUDIT_STATUS"
                 placeholder="不通过"
                 placeholder="不通过"
                 :disabled="true"
                 :disabled="true"
@@ -271,7 +273,8 @@ export default {
       currentPagePrivileges: {
       currentPagePrivileges: {
         INVIGILATE_AUDIT_STATUS: false, //数据状态
         INVIGILATE_AUDIT_STATUS: false, //数据状态
         SNAPSHOT_DETAILS: false //详情查看
         SNAPSHOT_DETAILS: false //详情查看
-      }
+      },
+      getPermissionStatus: false //获取权限状态
     };
     };
   },
   },
   computed: {
   computed: {
@@ -327,6 +330,9 @@ export default {
       }
       }
       this.tableLoading = true;
       this.tableLoading = true;
       var params = JSON.parse(JSON.stringify(this.form));
       var params = JSON.parse(JSON.stringify(this.form));
+      if (!this.currentPagePrivileges.INVIGILATE_AUDIT_STATUS) {
+        params.status = "UN_PASS";
+      }
       this.$http
       this.$http
         .post("/api/ecs_oe_admin/exam/audit/list", params)
         .post("/api/ecs_oe_admin/exam/audit/list", params)
         .then(response => {
         .then(response => {
@@ -388,16 +394,17 @@ export default {
     }
     }
   },
   },
   watch: {
   watch: {
-    "currentPagePrivileges.INVIGILATE_AUDIT_STATUS": function(val) {
-      this.form.status = val ? "" : "UN_PASS";
+    //监控权限是否获取完成
+    getPermissionStatus: function(val) {
+      if (val) {
+        if (!this.currentPagePrivileges.INVIGILATE_AUDIT_STATUS) {
+          this.form.status = "UN_PASS";
+        }
+        this.backFill();
+      }
     }
     }
   },
   },
-  created() {
-    this.form.status = this.currentPagePrivileges.INVIGILATE_AUDIT_STATUS
-      ? ""
-      : "UN_PASS";
-    this.backFill();
-  }
+  created() {}
 };
 };
 </script>
 </script>
 <style scoped src="../style/common.css"></style>
 <style scoped src="../style/common.css"></style>