From d2a4eb92547c26388d233d0a1cb3b0c9b902e85c Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Thu, 10 Nov 2022 14:38:16 +0800 Subject: [PATCH] perf: dict --- .../src/hooks/web/useVxeCrudSchemas.ts | 6 +- .../src/hooks/web/useVxeGrid.ts | 10 +- .../src/plugins/vxeTable/index.ts | 3 - .../src/views/system/dict/index.vue | 301 +++++++++--------- .../src/views/system/post/index.vue | 4 +- .../src/views/system/post/post.data.ts | 2 +- 6 files changed, 161 insertions(+), 165 deletions(-) diff --git a/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts b/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts index 57db7578f..4eafbcbdb 100644 --- a/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts +++ b/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts @@ -121,10 +121,10 @@ const filterSearchSchema = (crudSchema: VxeCrudSchema[]): VxeFormItemProps[] => props: { placeholder: t('common.selectText') } } } - const searchSchemaItem = { // 默认为 input - span: 6, + span: 8, + folding: searchSchema.length > 2, itemRender: itemRender, ...schemaItem.search, field: schemaItem.field, @@ -140,7 +140,7 @@ const filterSearchSchema = (crudSchema: VxeCrudSchema[]): VxeFormItemProps[] => const buttons: VxeFormItemProps = { span: 24, align: 'center', - collapseNode: true, + collapseNode: searchSchema.length > 3, itemRender: { name: '$buttons', children: [ diff --git a/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts b/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts index e27ed52be..c13f0ffbb 100644 --- a/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts +++ b/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts @@ -38,7 +38,7 @@ export const useVxeGrid = (config?: UseVxeGridConfig) => { const gridOptions = reactive({ loading: true, size: currentSize as any, - height: 800, + height: 700, rowConfig: { isCurrent: true, // 当鼠标点击行时,是否要高亮当前行 isHover: true // 当鼠标移到行时,是否要高亮当前行 @@ -97,9 +97,11 @@ export const useVxeGrid = (config?: UseVxeGridConfig) => { } }) const delList = (ids: string | number | string[] | number[]) => { - message.delConfirm().then(() => { - config?.delListApi && config?.delListApi(ids) - message.success(t('common.delSuccess')) + return new Promise(async () => { + message.delConfirm().then(() => { + config?.delListApi && config?.delListApi(ids) + message.success(t('common.delSuccess')) + }) }) } return { diff --git a/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts b/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts index 2b5157635..1da528f70 100644 --- a/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts +++ b/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts @@ -7,7 +7,6 @@ import enUS from 'vxe-table/lib/locale/lang/en-US' import { // 全局对象 VXETable, - // 表格功能 Filter, Edit, @@ -15,7 +14,6 @@ import { Export, Keyboard, Validator, - // 可选组件 Icon, Column, @@ -42,7 +40,6 @@ import { Modal, List, Pulldown, - // 表格 Table } from 'vxe-table' diff --git a/yudao-ui-admin-vue3/src/views/system/dict/index.vue b/yudao-ui-admin-vue3/src/views/system/dict/index.vue index 26cc911a3..f9018d6e1 100644 --- a/yudao-ui-admin-vue3/src/views/system/dict/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/dict/index.vue @@ -1,3 +1,152 @@ + - - 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 0f447cbf9..f1f7a7df5 100644 --- a/yudao-ui-admin-vue3/src/views/system/post/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/post/index.vue @@ -60,9 +60,9 @@