Browse Source

Merge branch 'dev_v5.0.4' of http://git.qmth.com.cn/examcloud-frontend/examcloud-admin-web into dev_v5.0.4

刘洋 10 months ago
parent
commit
eddd22fe5e
1 changed files with 20 additions and 1 deletions
  1. 20 1
      src/modules/examwork/view/ipConfig.vue

+ 20 - 1
src/modules/examwork/view/ipConfig.vue

@@ -59,7 +59,11 @@
           @click="deleteMult(selectedIds)"
           >批量删除</el-button
         >
-        <el-button size="small" type="success" @click="openSynchronousDialog"
+        <el-button
+          v-if="rolePrivileges.ORG_IP_CONFIG_SYNC"
+          size="small"
+          type="success"
+          @click="openSynchronousDialog"
           >同步到考试</el-button
         >
         <el-button
@@ -301,6 +305,9 @@ export default {
   name: "IpConfig",
   data() {
     return {
+      rolePrivileges: {
+        ORG_IP_CONFIG_SYNC: false,
+      },
       examList: [],
       curRow: null,
       showSynchronousDialog: false,
@@ -363,6 +370,7 @@ export default {
     ...mapState({ user: (state) => state.user }),
   },
   created() {
+    this.initPrivileges();
     this.getOrgList4Search("");
     this.searchForm();
     this.getExamList();
@@ -372,6 +380,17 @@ export default {
     };
   },
   methods: {
+    initPrivileges() {
+      let params = new URLSearchParams();
+      params.append(
+        "privilegeCodes",
+        Object.keys(this.rolePrivileges).toString()
+      );
+      var url = CORE_API + "/rolePrivilege/checkPrivileges?" + params;
+      this.$httpWithMsg.post(url).then((response) => {
+        this.rolePrivileges = response.data;
+      });
+    },
     dialogBeforeClose() {
       this.$refs.editRef.clearValidate();
     },