From d79b23c8a242432990be431a8c43633bd212c47d Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Fri, 4 Nov 2022 16:43:11 +0800 Subject: [PATCH] feat: add modal component --- .../src/components/XModal/index.ts | 3 + .../src/components/XModal/src/XModal.vue | 62 +++ yudao-ui-admin-vue3/src/components/index.ts | 2 + .../src/hooks/web/useVxeGrid.ts | 1 + .../src/plugins/vxeTable/index.ts | 6 +- .../src/views/system/menu/index.vue | 494 +++++++++--------- .../src/views/system/post/index.vue | 159 +++--- 7 files changed, 386 insertions(+), 341 deletions(-) create mode 100644 yudao-ui-admin-vue3/src/components/XModal/index.ts create mode 100644 yudao-ui-admin-vue3/src/components/XModal/src/XModal.vue diff --git a/yudao-ui-admin-vue3/src/components/XModal/index.ts b/yudao-ui-admin-vue3/src/components/XModal/index.ts new file mode 100644 index 000000000..65a72bd7d --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/XModal/index.ts @@ -0,0 +1,3 @@ +import XModal from './src/XModal.vue' + +export { XModal } diff --git a/yudao-ui-admin-vue3/src/components/XModal/src/XModal.vue b/yudao-ui-admin-vue3/src/components/XModal/src/XModal.vue new file mode 100644 index 000000000..3058c5121 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/XModal/src/XModal.vue @@ -0,0 +1,62 @@ + + + diff --git a/yudao-ui-admin-vue3/src/components/index.ts b/yudao-ui-admin-vue3/src/components/index.ts index d0f448521..b3dfd9411 100644 --- a/yudao-ui-admin-vue3/src/components/index.ts +++ b/yudao-ui-admin-vue3/src/components/index.ts @@ -4,6 +4,7 @@ import { Form } from '@/components/Form' import { Table } from '@/components/Table' import { Search } from '@/components/Search' import { Dialog } from '@/components/Dialog' +import { XModal } from '@/components/XModal' import { DictTag } from '@/components/DictTag' import { ContentWrap } from '@/components/ContentWrap' import { Descriptions } from '@/components/Descriptions' @@ -14,6 +15,7 @@ export const setupGlobCom = (app: App): void => { app.component('Table', Table) app.component('Search', Search) app.component('Dialog', Dialog) + app.component('XModal', XModal) app.component('DictTag', DictTag) app.component('ContentWrap', ContentWrap) app.component('Descriptions', Descriptions) diff --git a/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts b/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts index 16f665f2e..0469a2207 100644 --- a/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts +++ b/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts @@ -4,6 +4,7 @@ import { VxeGridProps } from 'vxe-table' export const useVxeGrid = (allSchemas, getPageApi) => { const gridOptions = reactive({ loading: false, + height: 800, rowConfig: { keyField: 'id', isHover: true diff --git a/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts b/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts index be501037d..b3e3cc8ac 100644 --- a/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts +++ b/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts @@ -114,8 +114,10 @@ VXETable.setup({ titleColon: true // 是否显示标题冒号 }, modal: { - width: 600, // 窗口的宽度 - height: 400, // 窗口的高度 + width: 800, // 窗口的宽度 + height: 600, // 窗口的高度 + minWidth: 460, + minHeight: 320, showZoom: true, // 标题是否标显示最大化与还原按钮 resize: true, // 是否允许窗口边缘拖动调整窗口大小 marginSize: 0, // 只对 resize 启用后有效,用于设置可拖动界限范围,如果为负数则允许拖动超出屏幕边界 diff --git a/yudao-ui-admin-vue3/src/views/system/menu/index.vue b/yudao-ui-admin-vue3/src/views/system/menu/index.vue index fdbee6ca5..d14bd4aae 100644 --- a/yudao-ui-admin-vue3/src/views/system/menu/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/menu/index.vue @@ -1,3 +1,244 @@ + - diff --git a/yudao-ui-admin-vue3/src/views/system/post/index.vue b/yudao-ui-admin-vue3/src/views/system/post/index.vue index f83776320..e518b1c65 100644 --- a/yudao-ui-admin-vue3/src/views/system/post/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/post/index.vue @@ -1,3 +1,76 @@ + -