mirror of
https://gitee.com/bootx/dax-pay-ui.git
synced 2025-09-09 21:49:28 +00:00
feat: add dept management page
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { MockMethod } from 'vite-plugin-mock';
|
||||
import { resultPageSuccess } from '../_util';
|
||||
import { resultPageSuccess, resultSuccess } from '../_util';
|
||||
|
||||
const list = (() => {
|
||||
const accountList = (() => {
|
||||
const result: any[] = [];
|
||||
for (let index = 0; index < 20; index++) {
|
||||
result.push({
|
||||
@@ -10,8 +10,40 @@ const list = (() => {
|
||||
email: '@email',
|
||||
nickname: '@cname()',
|
||||
role: '@first',
|
||||
updateTime: '@datetime',
|
||||
remark: '@cword(0,20)',
|
||||
createTime: '@datetime',
|
||||
remark: '@cword(10,20)',
|
||||
'status|1': ['0', '1'],
|
||||
});
|
||||
}
|
||||
return result;
|
||||
})();
|
||||
|
||||
const deptList = (() => {
|
||||
const result: any[] = [];
|
||||
for (let index = 0; index < 3; index++) {
|
||||
result.push({
|
||||
id: `${index}`,
|
||||
deptName: ['华东分部', '华南分部', '西北分部'][index],
|
||||
orderNo: index + 1,
|
||||
createTime: '@datetime',
|
||||
remark: '@cword(10,20)',
|
||||
'status|1': ['0', '0', '1'],
|
||||
children: (() => {
|
||||
const children: any[] = [];
|
||||
for (let j = 0; j < 4; j++) {
|
||||
children.push({
|
||||
id: `${index}-${j}`,
|
||||
deptName: ['研发部', '市场部', '商务部', '财务部'][j],
|
||||
orderNo: j + 1,
|
||||
createTime: '@datetime',
|
||||
remark: '@cword(10,20)',
|
||||
'status|1': ['0', '1'],
|
||||
parentDept: `${index}`,
|
||||
children: undefined,
|
||||
});
|
||||
}
|
||||
return children;
|
||||
})(),
|
||||
});
|
||||
}
|
||||
return result;
|
||||
@@ -24,7 +56,15 @@ export default [
|
||||
method: 'get',
|
||||
response: ({ query }) => {
|
||||
const { page = 1, pageSize = 20 } = query;
|
||||
return resultPageSuccess(page, pageSize, list);
|
||||
return resultPageSuccess(page, pageSize, accountList);
|
||||
},
|
||||
},
|
||||
{
|
||||
url: '/api/system/getDeptList',
|
||||
timeout: 100,
|
||||
method: 'get',
|
||||
response: () => {
|
||||
return resultSuccess(deptList);
|
||||
},
|
||||
},
|
||||
] as MockMethod[];
|
||||
|
Reference in New Issue
Block a user