diff --git a/mock/module/list.ts b/mock/module/list.ts new file mode 100644 index 0000000..0224086 --- /dev/null +++ b/mock/module/list.ts @@ -0,0 +1,28 @@ +import Mock from 'mockjs'; +import { resultSuccess } from '../utils'; + +const userList = Mock.mock({ + 'list|10': [ + { + id: '@id', + name: '@cname', + 'age|20-36': 36, + 'gender|1': ['0', '1', null], + email: '@email("qq.com")', + address: '@county(true) ', + 'role|1': ['super', 'admin', 'user'], + 'disabled|1': true, + }, + ], +}); + +export default [ + { + url: '/mock/userList', + timeout: 1000, + method: 'get', + response: () => { + return resultSuccess(userList.list); + }, + }, +]; diff --git a/src/service/api/mock.ts b/src/service/api/mock.ts new file mode 100644 index 0000000..b20ac78 --- /dev/null +++ b/src/service/api/mock.ts @@ -0,0 +1,5 @@ +import { mockRequest } from '../http'; + +export function fetchUserList() { + return mockRequest.get('/userList'); +} diff --git a/src/views/list/commonList/index.vue b/src/views/list/commonList/index.vue index 65f87cb..d0c3f79 100644 --- a/src/views/list/commonList/index.vue +++ b/src/views/list/commonList/index.vue @@ -27,7 +27,7 @@ - + 搜索 @@ -41,32 +41,122 @@ -
- - - 新建 - - - - 批量导入 - - - - 下载 - -
+ +
+ + + 新建 + + + + 批量导入 + + + + 下载 + +
+ +
-