Skip to content

Commit 71734ec

Browse files
committed
menu
1 parent c227e1d commit 71734ec

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

src/pages/sys/menu/data.d.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* @Description:
3+
* @Author: godric
4+
* @Date: 2020-03-29 21:49:11
5+
* @LastEditTime: 2020-03-30 22:55:12
6+
* @LastEditors: godric
7+
*/
8+
export interface MenuListItem {
9+
id: number;
10+
name: string;
11+
parentId: number;
12+
url: string;
13+
type: number;
14+
icon: string;
15+
visible: boolean;
16+
orderNum: number;
17+
createBy: string;
18+
createDate: Date;
19+
updateBy: string;
20+
updateDate: Date;
21+
}
22+
23+
export interface TreeNode {
24+
id: number;
25+
parentId: number;
26+
label: string;
27+
value: string;
28+
level: number;
29+
other: string;
30+
createBy: string;
31+
createDate: Date;
32+
updateBy: string;
33+
updateDate: Date;
34+
}
35+
36+
export interface R<T> {
37+
success: boolean;
38+
ns: string;
39+
code: number;
40+
msg: string;
41+
result: T;
42+
}

src/pages/sys/menu/index.tsx

Whitespace-only changes.

src/pages/sys/menu/service.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import request from '@/utils/request';
2+
import { TreeNode, R, MenuListItem } from './data';
3+
4+
/*
5+
* @Description:
6+
* @Author: godric
7+
* @Date: 2020-03-29 21:49:17
8+
* @LastEditTime: 2020-03-30 23:11:48
9+
* @LastEditors: godric
10+
*/
11+
const URL_PREFIX = '/api/tiangong/menu';
12+
13+
export async function queryAll() {
14+
const data = await request<R<TreeNode>>(`${URL_PREFIX}/all`);
15+
return {
16+
data: data.result,
17+
};
18+
}
19+
20+
export async function add(params: MenuListItem) {
21+
return request(`${URL_PREFIX}/add`, {
22+
data: params,
23+
method: 'POST',
24+
});
25+
}

0 commit comments

Comments
 (0)