فهرست منبع

feat(api): 增加menu queryall api

gemercheung 3 سال پیش
والد
کامیت
6180a3395c

+ 1 - 0
.env.development

@@ -6,6 +6,7 @@ VITE_PUBLIC_PATH = /
 
 # Cross-domain proxy, you can configure multiple
 # Please note that no line breaks
+# http://192.168.0.38:8190/shop
 VITE_PROXY = [["/basic-api","http://192.168.0.47:8190"],["/upload","http://localhost:3300/upload"],["/zfb-api","http://192.168.0.47:7081"]]
 # VITE_PROXY=[["/api","https://vvbin.cn/test"]]
 

+ 1 - 3
src/api/sys/menu.ts

@@ -1,8 +1,6 @@
 import { defHttp } from '/@/utils/http/axios';
 import { getMenuListResultModel } from './model/menuModel';
-// sys/user/list
-// /sys/role/list
-// sys/menu/queryAll
+
 enum Api {
   GetMenuList = '/getMenuList',
 }

+ 1 - 1
src/api/sys/user.ts

@@ -5,9 +5,9 @@ import { ErrorMessageMode } from '/#/axios';
 
 enum Api {
   Login = '/basic-api/sys/login',
-  GetPermCode = '/getPermCode',
   Logout = '/logout',
   GetUserInfo = '/basic-api/getUserInfo',
+  GetPermCode = '/getPermCode',
 }
 
 /**

+ 10 - 3
src/api/system/system.ts

@@ -11,13 +11,17 @@ import {
   RoleListGetResultModel,
 } from './model/systemModel';
 import { defHttp } from '/@/utils/http/axios';
-
+// import { ContentTypeEnum } from '/@/enums/httpEnum';
+// sys/user/list
+// /sys/role/list
+// sys/menu/queryAll
+// sys/menu/update
 enum Api {
   AccountList = '/basic-api/system/getAccountList',
   IsAccountExist = '/basic-api/system/accountExist',
   DeptList = '/basic-api/system/getDeptList',
   setRoleStatus = '/basic-api/system/setRoleStatus',
-  MenuList = '/basic-api/system/getMenuList',
+  MenuList = '/basic-api/sys/menu/queryAll',
   RolePageList = '/basic-api/system/getRoleListByPage',
   GetAllRoleList = '/basic-api/system/getAllRoleList',
 }
@@ -29,7 +33,10 @@ export const getDeptList = (params?: DeptListItem) =>
   defHttp.get<DeptListGetResultModel>({ url: Api.DeptList, params });
 
 export const getMenuList = (params?: MenuParams) =>
-  defHttp.get<MenuListGetResultModel>({ url: Api.MenuList, params });
+  defHttp.post<MenuListGetResultModel>({
+    url: Api.MenuList,
+    params: params,
+  });
 
 export const getRoleListByPage = (params?: RolePageParams) =>
   defHttp.get<RolePageListGetResultModel>({ url: Api.RolePageList, params });

+ 1 - 0
src/views/dashboard/system/menu/index.vue

@@ -41,6 +41,7 @@
     name: 'MenuManagement',
     components: { BasicTable, MenuDrawer, TableAction },
     setup() {
+      // collapseAll
       const [registerDrawer, { openDrawer }] = useDrawer();
       const [registerTable, { reload, expandAll }] = useTable({
         title: '菜单列表',

+ 30 - 14
src/views/dashboard/system/menu/menu.data.ts

@@ -4,14 +4,21 @@ import { h } from 'vue';
 import { Tag } from 'ant-design-vue';
 import { Icon } from '/@/components/Icon';
 
+// const label =[]
+
 export const columns: BasicColumn[] = [
   {
     title: '菜单名称',
-    dataIndex: 'menuName',
+    dataIndex: 'name',
     width: 200,
     align: 'left',
   },
   {
+    title: '上级菜单',
+    dataIndex: 'parentName',
+    width: 100,
+  },
+  {
     title: '图标',
     dataIndex: 'icon',
     width: 50,
@@ -19,20 +26,29 @@ export const columns: BasicColumn[] = [
       return h(Icon, { icon: record.icon });
     },
   },
+  // permission
   {
     title: '权限标识',
-    dataIndex: 'permission',
-    width: 180,
+    dataIndex: 'perms',
+    width: 250,
   },
   {
-    title: '组件',
-    dataIndex: 'component',
+    title: '类型',
+    dataIndex: 'type',
+    width: 100,
+    customRender: ({ record }) => {
+      const color = 'green';
+      const type = record.type;
+
+      return h(Tag, { color: color }, () => `目录${type}`);
+    },
   },
   {
     title: '排序',
-    dataIndex: 'orderNo',
+    dataIndex: 'orderNum',
     width: 50,
   },
+
   {
     title: '状态',
     dataIndex: 'status',
@@ -40,14 +56,14 @@ export const columns: BasicColumn[] = [
     customRender: ({ record }) => {
       const status = record.status;
       const enable = ~~status === 0;
-      const color = enable ? 'green' : 'red';
+      const color = enable ? 'warning' : 'red';
       const text = enable ? '启用' : '停用';
       return h(Tag, { color: color }, () => text);
     },
   },
   {
-    title: '创建时间',
-    dataIndex: 'createTime',
+    title: '菜单URL',
+    dataIndex: 'url',
     width: 180,
   },
 ];
@@ -58,7 +74,7 @@ const isButton = (type: string) => type === '2';
 
 export const searchFormSchema: FormSchema[] = [
   {
-    field: 'menuName',
+    field: 'name',
     label: '菜单名称',
     component: 'Input',
     colProps: { span: 8 },
@@ -93,7 +109,7 @@ export const formSchema: FormSchema[] = [
     colProps: { lg: 24, md: 24 },
   },
   {
-    field: 'menuName',
+    field: 'name',
     label: '菜单名称',
     component: 'Input',
     required: true,
@@ -105,7 +121,7 @@ export const formSchema: FormSchema[] = [
     component: 'TreeSelect',
     componentProps: {
       fieldNames: {
-        label: 'menuName',
+        label: 'name',
         key: 'id',
         value: 'id',
       },
@@ -114,7 +130,7 @@ export const formSchema: FormSchema[] = [
   },
 
   {
-    field: 'orderNo',
+    field: 'orderNum',
     label: '排序',
     component: 'InputNumber',
     required: true,
@@ -128,7 +144,7 @@ export const formSchema: FormSchema[] = [
   },
 
   {
-    field: 'routePath',
+    field: 'url',
     label: '路由地址',
     component: 'Input',
     required: true,