From 894347c7107fe5f328601c8b23baab8fbfc3aae1 Mon Sep 17 00:00:00 2001 From: "chen.home" <1147347984@qq.com> Date: Thu, 25 Aug 2022 00:06:07 +0800 Subject: [PATCH] =?UTF-8?q?feat(list):=20=E5=A2=9E=E5=8A=A0=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mock/module/list.ts | 28 +++++++ src/service/api/mock.ts | 5 ++ src/views/list/commonList/index.vue | 124 ++++++++++++++++++++++++---- 3 files changed, 140 insertions(+), 17 deletions(-) create mode 100644 mock/module/list.ts create mode 100644 src/service/api/mock.ts 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 @@ -
- - - 新建 - - - - 批量导入 - - - - 下载 - -
+ +
+ + + 新建 + + + + 批量导入 + + + + 下载 + +
+ +
-