瀏覽代碼

同步到考试权限

xiatian 10 月之前
父節點
當前提交
ab7bb98b3b
共有 1 個文件被更改,包括 20 次插入1 次删除
  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
@@ -300,6 +304,9 @@ export default {
   name: "IpConfig",
   data() {
     return {
+      rolePrivileges: {
+        ORG_IP_CONFIG_SYNC: false,
+      },
       examList: [],
       curRow: null,
       showSynchronousDialog: false,
@@ -362,6 +369,7 @@ export default {
     ...mapState({ user: (state) => state.user }),
   },
   created() {
+    this.initPrivileges();
     this.getOrgList4Search("");
     this.searchForm();
     this.getExamList();
@@ -371,6 +379,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;
+      });
+    },
     getExamList() {
       this.$httpWithMsg
         .get(