From 532eed6c748070725550fa740bca825e3b8bab74 Mon Sep 17 00:00:00 2001 From: chuan <2256222053@qq.com> Date: Wed, 8 Dec 2021 17:51:34 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BF=AE=E6=94=B9=E9=83=A8?= =?UTF-8?q?=E9=97=A8Options=E7=9A=84=E6=96=B9=E5=BC=8F=E4=B8=BAsetup?= =?UTF-8?q?=E8=AF=AD=E6=B3=95=E7=B3=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改部门Options的方式为setup语法糖 --- src/api/system/dept.ts | 10 +- src/main.ts | 4 +- src/views/system/dept/index.vue | 470 ++++++++++++++++---------------- 3 files changed, 236 insertions(+), 248 deletions(-) diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts index d84b7058..9dc3bb45 100644 --- a/src/api/system/dept.ts +++ b/src/api/system/dept.ts @@ -8,16 +8,16 @@ export const listDept = (queryParams?: object) => { }) } -export const getDept = (deptId: any) => { +export const getDept = (id: any) => { return request({ - url: '/youlai-admin/api/v1/depts/'+deptId, + url: '/youlai-admin/api/v1/depts/'+id, method: 'get' }) } -export const delDept = (deptId: any) => { +export const delDept = (id: any) => { return request({ - url: '/youlai-admin/api/v1/depts/'+deptId, + url: '/youlai-admin/api/v1/depts/'+id, method: 'delete', }) } @@ -32,7 +32,7 @@ export const addDept = (data: any) => { } // 修改部门 -export const updateDept = (id:string,data: any) => { +export const updateDept = (id:number,data: any) => { return request({ url: '/youlai-admin/api/v1/depts/'+id, method: 'put', diff --git a/src/main.ts b/src/main.ts index eb056434..088ce8ad 100644 --- a/src/main.ts +++ b/src/main.ts @@ -16,7 +16,7 @@ import '@/permission' import Pagination from '@/components/Pagination/index.vue' -import {listDictItems} from '@/api/system/dict.ts' +import {listDictItems} from '@/api/system/dict' const app = createApp(App) @@ -34,4 +34,4 @@ app .use(router) .use(store, key) .use(ElementPlus, {locale}) - .mount('#app') \ No newline at end of file + .mount('#app') diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index c22b3db3..728d176d 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -1,17 +1,17 @@ -