Przeglądaj źródła

菜单管理菜单管理 权限加到按钮

chenrui 4 lat temu
rodzic
commit
0f1752929c
1 zmienionych plików z 22 dodań i 4 usunięć
  1. 22 4
      src/views/power/menu/menu.vue

+ 22 - 4
src/views/power/menu/menu.vue

@@ -1,9 +1,27 @@
 <template>
   <a-card :bordered="false">
     <a-row :gutter="24">
-      <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addChild" id="menu-addChild">新增子菜单</a-button>
-      <a-button style="margin-right: 10px;background-color: #19be6b;color: #fff;" type="" icon="plus" @click="addTitle" id="menu-addTitle">新增顶部菜单</a-button>
-      <a-button style="margin-right: 10px;background-color: red;color: #fff;" type="" icon="delete" @click="delect()" id="menu-delect">删除</a-button>
+      <a-button
+        v-if="$hasPermissions('B_power_menu_child_add')"
+        style="margin-right: 10px;"
+        type="primary"
+        icon="plus"
+        @click="addChild"
+        id="menu-addChild">新增子菜单</a-button>
+      <a-button
+        v-if="$hasPermissions('B_power_menu_top_add')"
+        style="margin-right: 10px;background-color: #19be6b;color: #fff;"
+        type=""
+        icon="plus"
+        @click="addTitle"
+        id="menu-addTitle">新增顶部菜单</a-button>
+      <a-button
+        v-if="$hasPermissions('B_power_menu_del')"
+        style="margin-right: 10px;background-color: red;color: #fff;"
+        type=""
+        icon="delete"
+        @click="delect()"
+        id="menu-delect">删除</a-button>
 
     </a-row>
     <a-row :gutter="24">
@@ -178,7 +196,7 @@
           </a-form-item>
 
           <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-            <a-button type="primary" @click="handleSubmit()" id="menu-handleSubmit">
+            <a-button v-if="$hasPermissions('B_power_menu_edit')" type="primary" @click="handleSubmit()" id="menu-handleSubmit">
               保存
             </a-button>
             <a-button :style="{ marginLeft: '8px' }" @click="clear" id="menu-clear">