From 8da28a3ca520a8df958052b58174519fcc462300 Mon Sep 17 00:00:00 2001 From: dengyu <3233891353@qq.com> Date: Tue, 19 Dec 2023 17:18:30 +0800 Subject: [PATCH] =?UTF-8?q?refractor(message):=20=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=85=A8=E9=83=A8=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deliver-front/vue/components.d.ts | 4 ++ .../vue/src/components/Drawer/index.vue | 27 +++++--- .../vue/src/components/List/index.vue | 22 ++++--- .../vue/src/components/SearchForm/index.vue | 6 +- .../Table/components/TableHeader/index.vue | 13 ++-- .../vue/src/components/Table/index.vue | 49 +++++++-------- deliver-front/vue/src/config/table.ts | 15 ++++- deliver-front/vue/src/types/mitt/index.d.ts | 1 + deliver-front/vue/src/types/table/index.d.ts | 2 +- deliver-front/vue/src/utils/request.ts | 2 +- .../src/views/Channel/components/addApp.vue | 23 ++++--- deliver-front/vue/src/views/Channel/index.vue | 23 +++---- deliver-front/vue/src/views/Message/index.vue | 63 ++++++++++++++----- 13 files changed, 152 insertions(+), 98 deletions(-) diff --git a/deliver-front/vue/components.d.ts b/deliver-front/vue/components.d.ts index c1a0491a..9c81a5d5 100644 --- a/deliver-front/vue/components.d.ts +++ b/deliver-front/vue/components.d.ts @@ -13,6 +13,7 @@ declare module 'vue' { ACard: typeof import('ant-design-vue/es')['Card'] ACardMeta: typeof import('ant-design-vue/es')['CardMeta'] ACol: typeof import('ant-design-vue/es')['Col'] + ADivider: typeof import('ant-design-vue/es')['Divider'] ADrawer: typeof import('ant-design-vue/es')['Drawer'] AForm: typeof import('ant-design-vue/es')['Form'] AFormItem: typeof import('ant-design-vue/es')['FormItem'] @@ -29,18 +30,21 @@ declare module 'vue' { AMenu: typeof import('ant-design-vue/es')['Menu'] AMenuItem: typeof import('ant-design-vue/es')['MenuItem'] AModal: typeof import('ant-design-vue/es')['Modal'] + APagination: typeof import('ant-design-vue/es')['Pagination'] APopconfirm: typeof import('ant-design-vue/es')['Popconfirm'] ARadioButton: typeof import('ant-design-vue/es')['RadioButton'] ARadioGroup: typeof import('ant-design-vue/es')['RadioGroup'] ARangePicker: typeof import('ant-design-vue/es')['RangePicker'] ARow: typeof import('ant-design-vue/es')['Row'] ASelect: typeof import('ant-design-vue/es')['Select'] + ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] AStatistic: typeof import('ant-design-vue/es')['Statistic'] ASubMenu: typeof import('ant-design-vue/es')['SubMenu'] ASwitch: typeof import('ant-design-vue/es')['Switch'] ATable: typeof import('ant-design-vue/es')['Table'] ATag: typeof import('ant-design-vue/es')['Tag'] ATooltip: typeof import('ant-design-vue/es')['Tooltip'] + AUploadDragger: typeof import('ant-design-vue/es')['UploadDragger'] Banner: typeof import('./src/components/Banner/index.vue')['default'] Code: typeof import('./src/components/Code/index.vue')['default'] Drawer: typeof import('./src/components/Drawer/index.vue')['default'] diff --git a/deliver-front/vue/src/components/Drawer/index.vue b/deliver-front/vue/src/components/Drawer/index.vue index ffda1569..ea504273 100644 --- a/deliver-front/vue/src/components/Drawer/index.vue +++ b/deliver-front/vue/src/components/Drawer/index.vue @@ -9,7 +9,7 @@ interface Props { _options: any } interface EmitEvent { - (e: 'submit', params: any): void + (e: 'submit', params: any, callback: (err: boolean) => void): void } const props = defineProps() const emit = defineEmits() @@ -109,9 +109,12 @@ const submit = () => { formRef.value .validate() .then(() => { - emit('submit', drawerModel.value) - resetForm() - open.value = false + const callback = (err: boolean) => { + if (err) return + resetForm() + open.value = false + } + emit('submit', drawerModel.value, callback) }) .catch((err: any) => { console.log('errot', err) @@ -123,11 +126,17 @@ const submit = () => { {{ config.title }} - - + +