From 220e0316e07a0842664db4355b3c921104c67e22 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Tue, 1 Nov 2022 14:36:18 +0800 Subject: [PATCH] feat: vxe demo --- .../src/api/system/post/types.ts | 8 +- .../src/plugins/vxeTable/index.ts | 32 ++ .../src/views/system/post/index.vue | 409 ++++++++++++------ .../src/views/system/post/indexd.vue | 194 +++++++++ 4 files changed, 504 insertions(+), 139 deletions(-) create mode 100644 yudao-ui-admin-vue3/src/views/system/post/indexd.vue diff --git a/yudao-ui-admin-vue3/src/api/system/post/types.ts b/yudao-ui-admin-vue3/src/api/system/post/types.ts index 261553514..5d6a70c85 100644 --- a/yudao-ui-admin-vue3/src/api/system/post/types.ts +++ b/yudao-ui-admin-vue3/src/api/system/post/types.ts @@ -1,5 +1,5 @@ export type PostVO = { - id: number + id?: number name: string code: string sort: number @@ -11,11 +11,13 @@ export type PostVO = { export type PostPageReqVO = { code: string name: string - status: number + status?: number + pageSize?: number + pageNo?: number } export type PostExportReqVO = { code: string name: string - status: number + status?: number } diff --git a/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts b/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts index 53a9aad17..40831feee 100644 --- a/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts +++ b/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts @@ -53,14 +53,46 @@ VXETable.setup({ version: 0, // 版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置数据 zIndex: 1008, // 全局 zIndex 起始值,如果项目的的 z-index 样式值过大时就需要跟随设置更大,避免被遮挡 loadingText: '加载中...', // 全局loading提示内容,如果为null则不显示文本 + height: 600, table: { + border: 'inner', // 自动监听父元素的变化去重新计算表格 autoResize: true, emptyText: '暂无数据', // 鼠标移到行是否要高亮显示 highlightHoverRow: true }, + grid: { + toolbarConfig: { + refresh: true, + import: true, + export: true, + print: true, + zoom: true, + custom: true + }, + pagerConfig: { + border: false, + background: true, + autoHidden: true, + perfect: true, + pageSize: 10, + pagerCount: 7, + pageSizes: [5, 10, 15, 20, 50, 100, 200, 500], + layouts: [ + 'PrevJump', + 'PrevPage', + 'Jump', + 'PageCount', + 'NextPage', + 'NextJump', + 'Sizes', + 'Total' + ] + } + }, pager: { + background: true, autoHidden: false, perfect: true, pageSize: 10, 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 4275ec15b..0b58abd8f 100644 --- a/yudao-ui-admin-vue3/src/views/system/post/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/post/index.vue @@ -1,139 +1,270 @@ -