浏览代码

fix: 三大块Bug修复

Tong 2 年之前
父节点
当前提交
310a32cfb7

+ 4 - 4
src/views/sys/sysDict/sysDictItemTable/index.vue

@@ -11,13 +11,13 @@
           <TableAction
             :actions="[
               {
-                auth: ['system:sysDictItem:edit'],
+                auth: ['sys:dict:edit'],
                 icon: 'icon-edit|iconfont',
                 tooltip: '编辑',
                 onClick: handleEdit.bind(null, record),
               },
               {
-                auth: ['system:sysDictItem:remove'],
+                auth: ['sys:dict:remove'],
                 icon: 'icon-delete|iconfont',
                 tooltip: '删除',
                 color: 'error',
@@ -33,7 +33,7 @@
       </template>
       <template #toolbar>
         <a-button
-          v-auth="['system:sysDictItem:add']"
+          v-auth="['sys:dict:add']"
           v-show="!!dictId"
           type="primary"
           @click="handleCreate"
@@ -92,7 +92,7 @@
     showTableSetting: true,
     bordered: true,
     actionColumn: {
-      auth: ['system:sysDictItem:edit', 'system:sysDictItem:remove'],
+      auth: ['sys:dict:edit', 'sys:dict:remove'],
       width: 80,
       title: '操作',
       dataIndex: 'action',

+ 1 - 1
src/views/sys/sysDict/sysDictTable/data.ts

@@ -98,7 +98,7 @@ export const dataFormSchema: FormSchema[] = [
         dictCode: 'sys_disable_type',
       },
     },
-    defaultValue: 0,
+    defaultValue: '0',
   },
   {
     label: '备注',

+ 4 - 4
src/views/sys/sysDict/sysDictTable/index.vue

@@ -21,13 +21,13 @@
           <TableAction
             :actions="[
               {
-                auth: ['system:sysDict:edit'],
+                auth: ['sys:dict:edit'],
                 icon: 'icon-edit|iconfont',
                 tooltip: '编辑',
                 onClick: handleEdit.bind(null, record),
               },
               {
-                auth: ['system:sysDict:remove'],
+                auth: ['sys:dict:remove'],
                 icon: 'icon-delete|iconfont',
                 tooltip: '删除',
                 color: 'error',
@@ -42,7 +42,7 @@
       </template>
       <template #toolbar>
         <a-button
-          v-auth="['system:sysDict:add']"
+          v-auth="['sys:dict:add']"
           type="primary"
           @click="handleCreate"
           preIcon="icon-plus|iconfont"
@@ -102,7 +102,7 @@
       showTableSetting: true,
       bordered: true,
       actionColumn: {
-        auth: ['system:sysDict:edit', 'system:sysDict:remove'],
+        auth: ['sys:dict:edit', 'sys:dict:remove'],
         width: 80,
         title: '操作',
         dataIndex: 'action',

+ 14 - 3
src/views/sys/sysMenu/sysMenuTable/FormModal.vue

@@ -67,9 +67,7 @@
 
     const treeDatas = await sysMenuQueryTree({ excludeNodeIds: [data.record.id] });
     treeDatas.forEach(async item => {
-      if (item.id == data.record.id) {
-        await setDisable(item);
-      }
+      findItem(item, data.record.id);
     });
     const treeData = [
       {
@@ -80,6 +78,7 @@
     ];
     await updateSchema({ field: 'parentId', componentProps: { treeData } });
   });
+  // 设置自身及自身下级不可选择
   async function setDisable(item) {
     item.disabled = true;
     if (item.children?.length) {
@@ -88,6 +87,18 @@
       });
     }
   }
+  // 寻找自身菜单
+  async function findItem(item, recordId) {
+    if (item.id == recordId) {
+      await setDisable(item);
+    } else {
+      if (item.children?.length) {
+        item.children.map(async ele => {
+          await findItem(ele, recordId);
+        });
+      }
+    }
+  }
   // 提交按钮事件
   async function handleSubmit() {
     try {

+ 14 - 3
src/views/sys/sysOrg/sysOrgTable/FormModal.vue

@@ -55,9 +55,7 @@
     }
     const treeDatas = await sysOrgQueryTree({ excludeNodeIds: [data.record.id] });
     treeDatas.forEach(async item => {
-      if (item.id == data.record.id) {
-        await setDisable(item);
-      }
+      findItem(item, data.record.id);
     });
     const treeData = [
       {
@@ -74,6 +72,7 @@
     ]);
   });
 
+  // 设置自身及自身下级不可选择
   async function setDisable(item) {
     item.disabled = true;
     if (item.children?.length) {
@@ -82,6 +81,18 @@
       });
     }
   }
+  // 寻找自身菜单
+  async function findItem(item, recordId) {
+    if (item.id == recordId) {
+      await setDisable(item);
+    } else {
+      if (item.children?.length) {
+        item.children.map(async ele => {
+          await findItem(ele, recordId);
+        });
+      }
+    }
+  }
   // 提交按钮事件
   async function handleSubmit() {
     try {

+ 10 - 1
src/views/sys/sysOrg/sysOrgTable/index.vue

@@ -11,11 +11,13 @@
           <TableAction
             :actions="[
               {
+                auth: ['sys:org:edit'],
                 icon: 'icon-edit|iconfont',
                 tooltip: '编辑',
                 onClick: handleEdit.bind(null, record),
               },
               {
+                auth: ['sys:org:remove'],
                 icon: 'icon-delete|iconfont',
                 tooltip: '删除',
                 color: 'error',
@@ -30,7 +32,13 @@
         </template>
       </template>
       <template #toolbar>
-        <a-button type="primary" @click="handleCreate" preIcon="icon-plus|iconfont">新增</a-button>
+        <a-button
+          type="primary"
+          @click="handleCreate"
+          v-auth="['sys:org:add']"
+          preIcon="icon-plus|iconfont"
+          >新增</a-button
+        >
       </template>
     </BasicTable>
     <FormModal @register="registerModal" @success="handleSuccess" />
@@ -88,6 +96,7 @@
     showTableSetting: true,
     bordered: true,
     actionColumn: {
+      auth: ['sys:org:edit', 'sys:org:remove'],
       width: 80,
       title: '操作',
       dataIndex: 'action',

+ 1 - 1
src/views/sys/sysSms/temp/index.vue

@@ -28,7 +28,7 @@
                 onClick: handleView.bind(null, record),
               },
               {
-                auth: 'sms:temp:edit',
+                auth: 'sms:temp:send',
                 icon: 'icon-send|iconfont',
                 tooltip: '发送短信',
                 label: '发送短信',