From 62fa196679de386f8078637070dd3567224be7f1 Mon Sep 17 00:00:00 2001 From: aeizzz Date: Thu, 2 Feb 2023 13:05:15 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20Introducing=20new=20features.=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A7=92=E8=89=B2=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 1 - src/api/admin/role.ts | 8 + src/hooks/table.ts | 8 +- .../system/menu/{dialog.vue => form.vue} | 0 src/views/system/menu/index.vue | 12 +- src/views/system/role/dialog.vue | 236 ------------------ src/views/system/role/form.vue | 164 ++++++++++++ src/views/system/role/index.vue | 171 ++++++------- src/views/system/user/index.vue | 8 +- 9 files changed, 257 insertions(+), 351 deletions(-) rename src/views/system/menu/{dialog.vue => form.vue} (100%) delete mode 100644 src/views/system/role/dialog.vue create mode 100644 src/views/system/role/form.vue diff --git a/src/App.vue b/src/App.vue index b3480246..1d4cfc9b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -23,7 +23,6 @@ import setIntroduction from '/@/utils/setIconfont'; const LockScreen = defineAsyncComponent(() => import('/@/layout/lockScreen/index.vue')); const Setings = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/setings.vue')); const CloseFull = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/closeFull.vue')); -const Upgrade = defineAsyncComponent(() => import('/@/layout/upgrade/index.vue')); // 定义变量内容 const { messages, locale } = useI18n(); diff --git a/src/api/admin/role.ts b/src/api/admin/role.ts index a35846f6..1cdbaed7 100644 --- a/src/api/admin/role.ts +++ b/src/api/admin/role.ts @@ -8,3 +8,11 @@ export const list = (params?: Object) => { params }) } + +export const pageList = (params?: Object) => { + return request({ + url: '/admin/role/page', + method: "get", + params + }) +} diff --git a/src/hooks/table.ts b/src/hooks/table.ts index e4fb0027..a47c7234 100644 --- a/src/hooks/table.ts +++ b/src/hooks/table.ts @@ -1,4 +1,4 @@ -import {onMounted} from "vue"; +import {defineAsyncComponent, onMounted} from "vue"; import {ElMessage} from "element-plus"; export interface BasicTableProps{ @@ -130,11 +130,17 @@ export function useTable(options?: BasicTableProps) { query() } + const pagination = defineAsyncComponent(() => import('/@/components/Pagination/index.vue')) + + const RightToolBar = defineAsyncComponent(() => import('/@/components/RightToolbar/index.vue')) + return { + RightToolBar, getDataList, sizeChangeHandle, currentChangeHandle, sortChangeHandle, + pagination } } diff --git a/src/views/system/menu/dialog.vue b/src/views/system/menu/form.vue similarity index 100% rename from src/views/system/menu/dialog.vue rename to src/views/system/menu/form.vue diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index 9d6942c3..6cac95b7 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -3,16 +3,10 @@ @@ -60,7 +54,7 @@ import { ElMessageBox, ElMessage } from 'element-plus'; import { pageList } from '/@/api/admin/menu' import type { menuData } from './menu' // 引入组件 -const MenuDialog = defineAsyncComponent(() => import('/@/views/system/menu/dialog.vue')); +const MenuDialog = defineAsyncComponent(() => import('./form.vue')); // 定义变量内容 const menuDialogRef = ref>(); diff --git a/src/views/system/role/dialog.vue b/src/views/system/role/dialog.vue deleted file mode 100644 index b39d6fa4..00000000 --- a/src/views/system/role/dialog.vue +++ /dev/null @@ -1,236 +0,0 @@ - - - - - diff --git a/src/views/system/role/form.vue b/src/views/system/role/form.vue new file mode 100644 index 00000000..3a8f5b19 --- /dev/null +++ b/src/views/system/role/form.vue @@ -0,0 +1,164 @@ + + + + + diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index 730d282a..a3ce3f72 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -1,110 +1,94 @@