From efb4cf0c66798fcd774266655f109538dbc163fb Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Mon, 7 Nov 2022 14:58:53 +0800 Subject: [PATCH] fix: print Params --- yudao-ui-admin-vue3/src/hooks/web/useMessage.ts | 16 ++++++++++++++-- .../src/hooks/web/useVxeCrudSchemas.ts | 9 +++++++-- .../src/plugins/vxeTable/index.ts | 1 - .../src/views/system/post/index.vue | 13 ++++++------- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/yudao-ui-admin-vue3/src/hooks/web/useMessage.ts b/yudao-ui-admin-vue3/src/hooks/web/useMessage.ts index b5e3960aa..c9879aedf 100644 --- a/yudao-ui-admin-vue3/src/hooks/web/useMessage.ts +++ b/yudao-ui-admin-vue3/src/hooks/web/useMessage.ts @@ -52,13 +52,25 @@ export const useMessage = () => { ElNotification.warning(content) }, // 确认窗体 - confirm(content: string, tip: string) { - return ElMessageBox.confirm(content, tip, { + confirm(content: string, tip?: string) { + return ElMessageBox.confirm(content, tip ? tip : t('common.confirmTitle'), { confirmButtonText: t('common.ok'), cancelButtonText: t('common.cancel'), type: 'warning' }) }, + // 删除窗体 + delConfirm(content?: string, tip?: string) { + return ElMessageBox.confirm( + content ? content : t('common.delMessage'), + tip ? tip : t('common.confirmTitle'), + { + confirmButtonText: t('common.ok'), + cancelButtonText: t('common.cancel'), + type: 'warning' + } + ) + }, // 提交内容 prompt(content: string, tip: string) { return ElMessageBox.prompt(content, tip, { diff --git a/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts b/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts index b70140743..f590e9e44 100644 --- a/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts +++ b/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts @@ -18,7 +18,7 @@ export type VxeCrudSchema = Omit & { table?: CrudTableParams form?: CrudFormParams detail?: CrudDescriptionsParams - print?: boolean + print?: CrudPrintParams children?: VxeCrudSchema[] dictType?: string } @@ -42,6 +42,11 @@ type CrudDescriptionsParams = { show?: boolean } & Omit +type CrudPrintParams = { + // 是否显示表单项 + show?: boolean +} & Omit + interface VxeAllSchemas { searchSchema: VxeFormItemProps[] tableSchema: VxeGridPropTypes.Columns @@ -233,7 +238,7 @@ const filterPrintSchema = (crudSchema: VxeCrudSchema[]): any[] => { eachTree(crudSchema, (schemaItem: VxeCrudSchema) => { // 判断是否显示 - if (schemaItem?.detail?.show !== false) { + if (schemaItem?.print?.show !== false) { const printSchemaItem = { field: schemaItem.field } diff --git a/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts b/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts index b3e3cc8ac..2b5157635 100644 --- a/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts +++ b/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts @@ -72,7 +72,6 @@ VXETable.setup({ grid: { toolbarConfig: { refresh: true, - import: true, export: true, print: true, zoom: true, 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 d22035da1..b84e06676 100644 --- a/yudao-ui-admin-vue3/src/views/system/post/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/post/index.vue @@ -79,24 +79,23 @@