mirror of
https://gitee.com/bootx/dax-pay-ui.git
synced 2025-09-10 05:59:35 +00:00
style ESline规则更新
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { MockMethod } from 'vite-plugin-mock';
|
||||
import { resultSuccess, resultError } from '../_util';
|
||||
import { ResultEnum } from '../../src/enums/httpEnum';
|
||||
import { MockMethod } from 'vite-plugin-mock'
|
||||
import { resultSuccess, resultError } from '../_util'
|
||||
import { ResultEnum } from '../../src/enums/httpEnum'
|
||||
|
||||
const userInfo = {
|
||||
name: 'Vben',
|
||||
@@ -41,7 +41,7 @@ const userInfo = {
|
||||
country: 'China',
|
||||
address: 'Xiamen City 77',
|
||||
phone: '0592-268888888',
|
||||
};
|
||||
}
|
||||
|
||||
export default [
|
||||
{
|
||||
@@ -49,7 +49,7 @@ export default [
|
||||
timeout: 1000,
|
||||
method: 'get',
|
||||
response: () => {
|
||||
return resultSuccess(userInfo);
|
||||
return resultSuccess(userInfo)
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -57,7 +57,7 @@ export default [
|
||||
method: 'post',
|
||||
statusCode: 401,
|
||||
response: () => {
|
||||
return resultError();
|
||||
return resultError()
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -65,7 +65,7 @@ export default [
|
||||
method: 'post',
|
||||
statusCode: 200,
|
||||
response: () => {
|
||||
return resultError('Token Expired!', { code: ResultEnum.TIMEOUT as number });
|
||||
return resultError('Token Expired!', { code: ResultEnum.TIMEOUT as number })
|
||||
},
|
||||
},
|
||||
] as MockMethod[];
|
||||
] as MockMethod[]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { MockMethod } from 'vite-plugin-mock';
|
||||
import { resultSuccess } from '../_util';
|
||||
import { MockMethod } from 'vite-plugin-mock'
|
||||
import { resultSuccess } from '../_util'
|
||||
|
||||
const areaList: any[] = [
|
||||
{
|
||||
@@ -308,18 +308,18 @@ const areaList: any[] = [
|
||||
customized: false,
|
||||
usable: true,
|
||||
},
|
||||
];
|
||||
]
|
||||
export default [
|
||||
{
|
||||
url: '/basic-api/cascader/getAreaRecord',
|
||||
timeout: 1000,
|
||||
method: 'post',
|
||||
response: ({ body }) => {
|
||||
const { parentCode } = body || {};
|
||||
const { parentCode } = body || {}
|
||||
if (!parentCode) {
|
||||
return resultSuccess(areaList.filter((it) => it.code === '430000'));
|
||||
return resultSuccess(areaList.filter((it) => it.code === '430000'))
|
||||
}
|
||||
return resultSuccess(areaList.filter((it) => it.parentCode === parentCode));
|
||||
return resultSuccess(areaList.filter((it) => it.parentCode === parentCode))
|
||||
},
|
||||
},
|
||||
] as MockMethod[];
|
||||
] as MockMethod[]
|
||||
|
@@ -1,18 +1,18 @@
|
||||
import { MockMethod } from 'vite-plugin-mock';
|
||||
import { resultSuccess } from '../_util';
|
||||
import { MockMethod } from 'vite-plugin-mock'
|
||||
import { resultSuccess } from '../_util'
|
||||
|
||||
const demoList = (keyword, count = 20) => {
|
||||
const result = {
|
||||
list: [] as any[],
|
||||
};
|
||||
}
|
||||
for (let index = 0; index < count; index++) {
|
||||
result.list.push({
|
||||
name: `${keyword ?? ''}选项${index}`,
|
||||
id: `${index}`,
|
||||
});
|
||||
})
|
||||
}
|
||||
return result;
|
||||
};
|
||||
return result
|
||||
}
|
||||
|
||||
export default [
|
||||
{
|
||||
@@ -20,9 +20,9 @@ export default [
|
||||
timeout: 1000,
|
||||
method: 'get',
|
||||
response: ({ query }) => {
|
||||
const { keyword, count } = query;
|
||||
console.log(keyword);
|
||||
return resultSuccess(demoList(keyword, count));
|
||||
const { keyword, count } = query
|
||||
console.log(keyword)
|
||||
return resultSuccess(demoList(keyword, count))
|
||||
},
|
||||
},
|
||||
] as MockMethod[];
|
||||
] as MockMethod[]
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { MockMethod } from 'vite-plugin-mock';
|
||||
import { resultError, resultPageSuccess, resultSuccess } from '../_util';
|
||||
import { MockMethod } from 'vite-plugin-mock'
|
||||
import { resultError, resultPageSuccess, resultSuccess } from '../_util'
|
||||
|
||||
const accountList = (() => {
|
||||
const result: any[] = [];
|
||||
const result: any[] = []
|
||||
for (let index = 0; index < 20; index++) {
|
||||
result.push({
|
||||
id: `${index}`,
|
||||
@@ -13,13 +13,13 @@ const accountList = (() => {
|
||||
createTime: '@datetime',
|
||||
remark: '@cword(10,20)',
|
||||
'status|1': ['0', '1'],
|
||||
});
|
||||
})
|
||||
}
|
||||
return result;
|
||||
})();
|
||||
return result
|
||||
})()
|
||||
|
||||
const roleList = (() => {
|
||||
const result: any[] = [];
|
||||
const result: any[] = []
|
||||
for (let index = 0; index < 4; index++) {
|
||||
result.push({
|
||||
id: index + 1,
|
||||
@@ -30,13 +30,13 @@ const roleList = (() => {
|
||||
remark: '@cword(10,20)',
|
||||
menu: [['0', '1', '2'], ['0', '1'], ['0', '2'], ['2']][index],
|
||||
'status|1': ['0', '1'],
|
||||
});
|
||||
})
|
||||
}
|
||||
return result;
|
||||
})();
|
||||
return result
|
||||
})()
|
||||
|
||||
const deptList = (() => {
|
||||
const result: any[] = [];
|
||||
const result: any[] = []
|
||||
for (let index = 0; index < 3; index++) {
|
||||
result.push({
|
||||
id: `${index}`,
|
||||
@@ -46,7 +46,7 @@ const deptList = (() => {
|
||||
remark: '@cword(10,20)',
|
||||
'status|1': ['0', '0', '1'],
|
||||
children: (() => {
|
||||
const children: any[] = [];
|
||||
const children: any[] = []
|
||||
for (let j = 0; j < 4; j++) {
|
||||
children.push({
|
||||
id: `${index}-${j}`,
|
||||
@@ -57,17 +57,17 @@ const deptList = (() => {
|
||||
'status|1': ['0', '1'],
|
||||
parentDept: `${index}`,
|
||||
children: undefined,
|
||||
});
|
||||
})
|
||||
}
|
||||
return children;
|
||||
return children
|
||||
})(),
|
||||
});
|
||||
})
|
||||
}
|
||||
return result;
|
||||
})();
|
||||
return result
|
||||
})()
|
||||
|
||||
const menuList = (() => {
|
||||
const result: any[] = [];
|
||||
const result: any[] = []
|
||||
for (let index = 0; index < 3; index++) {
|
||||
result.push({
|
||||
id: `${index}`,
|
||||
@@ -80,7 +80,7 @@ const menuList = (() => {
|
||||
createTime: '@datetime',
|
||||
'status|1': ['0', '0', '1'],
|
||||
children: (() => {
|
||||
const children: any[] = [];
|
||||
const children: any[] = []
|
||||
for (let j = 0; j < 4; j++) {
|
||||
children.push({
|
||||
id: `${index}-${j}`,
|
||||
@@ -88,28 +88,20 @@ const menuList = (() => {
|
||||
menuName: ['菜单1', '菜单2', '菜单3', '菜单4'][j],
|
||||
icon: 'ion:document',
|
||||
permission: ['menu1:view', 'menu2:add', 'menu3:update', 'menu4:del'][index],
|
||||
component: [
|
||||
'/dashboard/welcome/index',
|
||||
'/dashboard/analysis/index',
|
||||
'/dashboard/workbench/index',
|
||||
'/dashboard/test/index',
|
||||
][j],
|
||||
component: ['/dashboard/welcome/index', '/dashboard/analysis/index', '/dashboard/workbench/index', '/dashboard/test/index'][j],
|
||||
orderNo: j + 1,
|
||||
createTime: '@datetime',
|
||||
'status|1': ['0', '1'],
|
||||
parentMenu: `${index}`,
|
||||
children: (() => {
|
||||
const children: any[] = [];
|
||||
const children: any[] = []
|
||||
for (let k = 0; k < 4; k++) {
|
||||
children.push({
|
||||
id: `${index}-${j}-${k}`,
|
||||
type: '2',
|
||||
menuName: '按钮' + (j + 1) + '-' + (k + 1),
|
||||
icon: '',
|
||||
permission:
|
||||
['menu1:view', 'menu2:add', 'menu3:update', 'menu4:del'][index] +
|
||||
':btn' +
|
||||
(k + 1),
|
||||
permission: ['menu1:view', 'menu2:add', 'menu3:update', 'menu4:del'][index] + ':btn' + (k + 1),
|
||||
component: [
|
||||
'/dashboard/welcome/index',
|
||||
'/dashboard/analysis/index',
|
||||
@@ -121,18 +113,18 @@ const menuList = (() => {
|
||||
'status|1': ['0', '1'],
|
||||
parentMenu: `${index}-${j}`,
|
||||
children: undefined,
|
||||
});
|
||||
})
|
||||
}
|
||||
return children;
|
||||
return children
|
||||
})(),
|
||||
});
|
||||
})
|
||||
}
|
||||
return children;
|
||||
return children
|
||||
})(),
|
||||
});
|
||||
})
|
||||
}
|
||||
return result;
|
||||
})();
|
||||
return result
|
||||
})()
|
||||
|
||||
export default [
|
||||
{
|
||||
@@ -140,8 +132,8 @@ export default [
|
||||
timeout: 100,
|
||||
method: 'get',
|
||||
response: ({ query }) => {
|
||||
const { page = 1, pageSize = 20 } = query;
|
||||
return resultPageSuccess(page, pageSize, accountList);
|
||||
const { page = 1, pageSize = 20 } = query
|
||||
return resultPageSuccess(page, pageSize, accountList)
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -149,8 +141,8 @@ export default [
|
||||
timeout: 100,
|
||||
method: 'get',
|
||||
response: ({ query }) => {
|
||||
const { page = 1, pageSize = 20 } = query;
|
||||
return resultPageSuccess(page, pageSize, roleList);
|
||||
const { page = 1, pageSize = 20 } = query
|
||||
return resultPageSuccess(page, pageSize, roleList)
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -158,8 +150,8 @@ export default [
|
||||
timeout: 500,
|
||||
method: 'post',
|
||||
response: ({ query }) => {
|
||||
const { id, status } = query;
|
||||
return resultSuccess({ id, status });
|
||||
const { id, status } = query
|
||||
return resultSuccess({ id, status })
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -167,7 +159,7 @@ export default [
|
||||
timeout: 100,
|
||||
method: 'get',
|
||||
response: () => {
|
||||
return resultSuccess(roleList);
|
||||
return resultSuccess(roleList)
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -175,7 +167,7 @@ export default [
|
||||
timeout: 100,
|
||||
method: 'get',
|
||||
response: () => {
|
||||
return resultSuccess(deptList);
|
||||
return resultSuccess(deptList)
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -183,7 +175,7 @@ export default [
|
||||
timeout: 100,
|
||||
method: 'get',
|
||||
response: () => {
|
||||
return resultSuccess(menuList);
|
||||
return resultSuccess(menuList)
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -191,12 +183,12 @@ export default [
|
||||
timeout: 500,
|
||||
method: 'post',
|
||||
response: ({ body }) => {
|
||||
const { account } = body || {};
|
||||
const { account } = body || {}
|
||||
if (account && account.indexOf('admin') !== -1) {
|
||||
return resultError('该字段不能包含admin');
|
||||
return resultError('该字段不能包含admin')
|
||||
} else {
|
||||
return resultSuccess(`${account} can use`);
|
||||
return resultSuccess(`${account} can use`)
|
||||
}
|
||||
},
|
||||
},
|
||||
] as MockMethod[];
|
||||
] as MockMethod[]
|
||||
|
@@ -1,17 +1,17 @@
|
||||
import { MockMethod } from 'vite-plugin-mock';
|
||||
import { Random } from 'mockjs';
|
||||
import { resultPageSuccess } from '../_util';
|
||||
import { MockMethod } from 'vite-plugin-mock'
|
||||
import { Random } from 'mockjs'
|
||||
import { resultPageSuccess } from '../_util'
|
||||
|
||||
function getRandomPics(count = 10): string[] {
|
||||
const arr: string[] = [];
|
||||
const arr: string[] = []
|
||||
for (let i = 0; i < count; i++) {
|
||||
arr.push(Random.image('800x600', Random.color(), Random.color(), Random.title()));
|
||||
arr.push(Random.image('800x600', Random.color(), Random.color(), Random.title()))
|
||||
}
|
||||
return arr;
|
||||
return arr
|
||||
}
|
||||
|
||||
const demoList = (() => {
|
||||
const result: any[] = [];
|
||||
const result: any[] = []
|
||||
for (let index = 0; index < 200; index++) {
|
||||
result.push({
|
||||
id: `${index}`,
|
||||
@@ -34,10 +34,10 @@ const demoList = (() => {
|
||||
time: `@time('HH:mm')`,
|
||||
'no|100000-10000000': 100000,
|
||||
'status|1': ['normal', 'enable', 'disable'],
|
||||
});
|
||||
})
|
||||
}
|
||||
return result;
|
||||
})();
|
||||
return result
|
||||
})()
|
||||
|
||||
export default [
|
||||
{
|
||||
@@ -45,8 +45,8 @@ export default [
|
||||
timeout: 100,
|
||||
method: 'get',
|
||||
response: ({ query }) => {
|
||||
const { page = 1, pageSize = 20 } = query;
|
||||
return resultPageSuccess(page, pageSize, demoList);
|
||||
const { page = 1, pageSize = 20 } = query
|
||||
return resultPageSuccess(page, pageSize, demoList)
|
||||
},
|
||||
},
|
||||
] as MockMethod[];
|
||||
] as MockMethod[]
|
||||
|
@@ -1,28 +1,28 @@
|
||||
import { MockMethod } from 'vite-plugin-mock';
|
||||
import { resultSuccess } from '../_util';
|
||||
import { MockMethod } from 'vite-plugin-mock'
|
||||
import { resultSuccess } from '../_util'
|
||||
|
||||
const demoTreeList = (keyword) => {
|
||||
const result = {
|
||||
list: [] as Recordable[],
|
||||
};
|
||||
}
|
||||
for (let index = 0; index < 5; index++) {
|
||||
const children: Recordable[] = [];
|
||||
const children: Recordable[] = []
|
||||
for (let j = 0; j < 3; j++) {
|
||||
children.push({
|
||||
title: `${keyword ?? ''}选项${index}-${j}`,
|
||||
value: `${index}-${j}`,
|
||||
key: `${index}-${j}`,
|
||||
});
|
||||
})
|
||||
}
|
||||
result.list.push({
|
||||
title: `${keyword ?? ''}选项${index}`,
|
||||
value: `${index}`,
|
||||
key: `${index}`,
|
||||
children,
|
||||
});
|
||||
})
|
||||
}
|
||||
return result;
|
||||
};
|
||||
return result
|
||||
}
|
||||
|
||||
export default [
|
||||
{
|
||||
@@ -30,9 +30,9 @@ export default [
|
||||
timeout: 1000,
|
||||
method: 'get',
|
||||
response: ({ query }) => {
|
||||
const { keyword } = query;
|
||||
console.log(keyword);
|
||||
return resultSuccess(demoTreeList(keyword));
|
||||
const { keyword } = query
|
||||
console.log(keyword)
|
||||
return resultSuccess(demoTreeList(keyword))
|
||||
},
|
||||
},
|
||||
] as MockMethod[];
|
||||
] as MockMethod[]
|
||||
|
Reference in New Issue
Block a user