feat:【ele】【pay 支付】pay/app 代码优化 3/4(对齐 ele 和 antd)

This commit is contained in:
YunaiV
2025-10-05 20:13:32 +08:00
parent b2e2fe7ccb
commit 22b0496428
9 changed files with 673 additions and 957 deletions

View File

@@ -11,14 +11,14 @@ import { ElMessage } from 'element-plus';
import { useVbenForm } from '#/adapter/form';
import { createApp, getApp, updateApp } from '#/api/pay/app';
import { useFormSchema } from '../data';
import { useAppFormSchema } from '../data';
const emit = defineEmits(['success']);
const formData = ref<PayAppApi.App>();
const title = computed(() => {
return formData.value?.id
? $t('ui.actionTitle.edit', '应用')
: $t('ui.actionTitle.create', '应用');
? $t('ui.actionTitle.edit', ['应用'])
: $t('ui.actionTitle.create', ['应用']);
});
const [Form, formApi] = useVbenForm({
@@ -30,7 +30,7 @@ const [Form, formApi] = useVbenForm({
labelWidth: 160,
},
layout: 'horizontal',
schema: useFormSchema(),
schema: useAppFormSchema(),
showDefaultActions: false,
});
@@ -53,7 +53,7 @@ const [Modal, modalApi] = useVbenModal({
modalApi.unlock();
}
},
onOpenChange: async (isOpen) => {
async onOpenChange(isOpen: boolean) {
if (!isOpen) {
formData.value = undefined;
return;
@@ -77,7 +77,7 @@ const [Modal, modalApi] = useVbenModal({
});
</script>
<template>
<Modal :close-on-click-modal="false" :title="title" class="w-2/5">
<Modal :title="title" class="w-2/5">
<Form />
</Modal>
</template>