From 7cabf0ead5ba81586de20d360bac7e5379f97aec Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 17 Nov 2022 20:20:09 +0800 Subject: [PATCH] feat: dept vxe table --- yudao-ui-admin-vue3/package.json | 2 +- yudao-ui-admin-vue3/pnpm-lock.yaml | 14 +- .../src/api/system/dept/index.ts | 40 +- .../src/views/system/dept/dept.data.ts | 2 +- .../src/views/system/dept/index.vue | 413 ++++++++++-------- yudao-ui-admin-vue3/vite.config.ts | 2 +- 6 files changed, 271 insertions(+), 202 deletions(-) diff --git a/yudao-ui-admin-vue3/package.json b/yudao-ui-admin-vue3/package.json index 0ff954347..ad95b164d 100644 --- a/yudao-ui-admin-vue3/package.json +++ b/yudao-ui-admin-vue3/package.json @@ -43,7 +43,7 @@ "lodash-es": "^4.17.21", "mitt": "^3.0.0", "nprogress": "^0.2.0", - "pinia": "^2.0.23", + "pinia": "^2.0.24", "qrcode": "^1.5.1", "qs": "^6.11.0", "url": "^0.11.0", diff --git a/yudao-ui-admin-vue3/pnpm-lock.yaml b/yudao-ui-admin-vue3/pnpm-lock.yaml index 5f86e4bd7..d422aa95e 100644 --- a/yudao-ui-admin-vue3/pnpm-lock.yaml +++ b/yudao-ui-admin-vue3/pnpm-lock.yaml @@ -42,7 +42,7 @@ specifiers: lodash-es: ^4.17.21 mitt: ^3.0.0 nprogress: ^0.2.0 - pinia: ^2.0.23 + pinia: ^2.0.24 plop: ^3.1.1 postcss: ^8.4.19 postcss-html: ^1.5.0 @@ -99,7 +99,7 @@ dependencies: lodash-es: 4.17.21 mitt: 3.0.0 nprogress: 0.2.0 - pinia: 2.0.23_zwu2zepfy3m6u2gunxlolp35gi + pinia: 2.0.24_zwu2zepfy3m6u2gunxlolp35gi qrcode: 1.5.1 qs: 6.11.0 url: 0.11.0 @@ -1565,10 +1565,6 @@ packages: /@vue/devtools-api/6.4.3: resolution: {integrity: sha512-9WCRwdROJvWcHAdyrR7SZMM/qUvllDZnpndHXokThkUsjnJ2xe4/pvsH9FZrxFe22L+JmDKczL79HjLJ7DK9rg==} - /@vue/devtools-api/6.4.4: - resolution: {integrity: sha512-Ku31WzpOV/8cruFaXaEZKF81WkNnvCSlBY4eOGtz5WMSdJvX1v1WWlSMGZeqUwPtQ27ZZz7B62erEMq8JDjcXw==} - dev: false - /@vue/devtools-api/6.4.5: resolution: {integrity: sha512-JD5fcdIuFxU4fQyXUu3w2KpAJHzTVdN+p4iOX2lMWSHMOoQdMAcpFLZzm9Z/2nmsoZ1a96QEhZ26e50xLBsgOQ==} dev: false @@ -5564,8 +5560,8 @@ packages: dev: true optional: true - /pinia/2.0.23_zwu2zepfy3m6u2gunxlolp35gi: - resolution: {integrity: sha512-N15hFf4o5STrxpNrib1IEb1GOArvPYf1zPvQVRGOO1G1d74Ak0J0lVyalX/SmrzdT4Q0nlEFjbURsmBmIGUR5Q==} + /pinia/2.0.24_zwu2zepfy3m6u2gunxlolp35gi: + resolution: {integrity: sha512-DDLd4Iphyc+6PYYYbx7jkb6WP9gecgu9bz9huyB5rb7CdJI3DhzYiZI+/Ih8MLewRrP9DSpslF/BgSNrJtZU7A==} peerDependencies: '@vue/composition-api': ^1.4.0 typescript: '>=4.4.4' @@ -5576,7 +5572,7 @@ packages: typescript: optional: true dependencies: - '@vue/devtools-api': 6.4.4 + '@vue/devtools-api': 6.4.5 typescript: 4.8.4 vue: 3.2.45 vue-demi: 0.13.11_vue@3.2.45 diff --git a/yudao-ui-admin-vue3/src/api/system/dept/index.ts b/yudao-ui-admin-vue3/src/api/system/dept/index.ts index 5e602d067..30785c269 100644 --- a/yudao-ui-admin-vue3/src/api/system/dept/index.ts +++ b/yudao-ui-admin-vue3/src/api/system/dept/index.ts @@ -1,32 +1,46 @@ import request from '@/config/axios' -import type { DeptVO, DeptListReqVO } from './types' +export type DeptVO = { + id: number + name: string + parentId: number + status: number + sort: number + leaderUserId: number + phone: string + email: string +} + +export interface DeptPageReqVO { + name?: string + status?: number +} // 查询部门(精简)列表 -export const listSimpleDeptApi = () => { - return request.get({ url: '/system/dept/list-all-simple' }) +export const listSimpleDeptApi = async () => { + return await request.get({ url: '/system/dept/list-all-simple' }) } // 查询部门列表 -export const getDeptPageApi = (params: DeptListReqVO) => { - return request.get({ url: '/system/dept/list', params }) +export const getDeptPageApi = async (params: DeptPageReqVO) => { + return await request.get({ url: '/system/dept/list', params }) } // 查询部门详情 -export const getDeptApi = (id: number) => { - return request.get({ url: '/system/dept/get?id=' + id }) +export const getDeptApi = async (id: number) => { + return await request.get({ url: '/system/dept/get?id=' + id }) } // 新增部门 -export const createDeptApi = (data: DeptVO) => { - return request.post({ url: '/system/dept/create', data: data }) +export const createDeptApi = async (data: DeptVO) => { + return await request.post({ url: '/system/dept/create', data: data }) } // 修改部门 -export const updateDeptApi = (params: DeptVO) => { - return request.put({ url: '/system/dept/update', data: params }) +export const updateDeptApi = async (params: DeptVO) => { + return await request.put({ url: '/system/dept/update', data: params }) } // 删除部门 -export const deleteDeptApi = (id: number) => { - return request.delete({ url: '/system/dept/delete?id=' + id }) +export const deleteDeptApi = async (id: number) => { + return await request.delete({ url: '/system/dept/delete?id=' + id }) } diff --git a/yudao-ui-admin-vue3/src/views/system/dept/dept.data.ts b/yudao-ui-admin-vue3/src/views/system/dept/dept.data.ts index 87dccfd57..c22da6d6a 100644 --- a/yudao-ui-admin-vue3/src/views/system/dept/dept.data.ts +++ b/yudao-ui-admin-vue3/src/views/system/dept/dept.data.ts @@ -49,7 +49,7 @@ export const modelSchema = reactive([ { label: '显示排序', field: 'sort', - component: 'InputNumber' + component: 'Input' }, { label: '状态', diff --git a/yudao-ui-admin-vue3/src/views/system/dept/index.vue b/yudao-ui-admin-vue3/src/views/system/dept/index.vue index f50d338f1..e728f34a9 100644 --- a/yudao-ui-admin-vue3/src/views/system/dept/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/dept/index.vue @@ -1,229 +1,288 @@ - - diff --git a/yudao-ui-admin-vue3/vite.config.ts b/yudao-ui-admin-vue3/vite.config.ts index 17c1804db..c33a46208 100644 --- a/yudao-ui-admin-vue3/vite.config.ts +++ b/yudao-ui-admin-vue3/vite.config.ts @@ -13,7 +13,7 @@ import { createHtmlPlugin } from 'vite-plugin-html' import viteCompression from 'vite-plugin-compression' import VueMarcos from 'unplugin-vue-macros/vite' -// 当前执行node命令时文件夹的地址(工作目录) +// 当前执行node命令时文件夹的地址(工作目录) const root = process.cwd() // 路径查找