feat: AppModal AppFormModal

pull/134/head
xingyu4j 2025-06-08 18:23:14 +08:00
parent a8f7b925ca
commit 9365549b9a
1 changed files with 7 additions and 8 deletions

View File

@ -22,22 +22,22 @@ function onRefresh() {
gridApi.query(); gridApi.query();
} }
const [AppModal, appModalApi] = useVbenModal({ const [AppFormModal, appFormModalApi] = useVbenModal({
connectedComponent: appFrom, connectedComponent: appFrom,
destroyOnClose: true, destroyOnClose: true,
}); });
const [ChannelModal, channelModalApi] = useVbenModal({ const [ChannelFormModal, channelFormModalApi] = useVbenModal({
connectedComponent: channelFrom, connectedComponent: channelFrom,
destroyOnClose: true, destroyOnClose: true,
}); });
function handleCreate() { function handleCreate() {
appModalApi.setData(null).open(); appFormModalApi.setData(null).open();
} }
function handleEdit(row: Required<PayAppApi.App>) { function handleEdit(row: Required<PayAppApi.App>) {
appModalApi.setData({ id: row.id }).open(); appFormModalApi.setData({ id: row.id }).open();
} }
async function handleDelete(row: Required<PayAppApi.App>) { async function handleDelete(row: Required<PayAppApi.App>) {
@ -101,7 +101,7 @@ function isChannelExists(channels: string[], channelCode: string) {
} }
async function openChannelForm(row: PayAppApi.App, payCode: string) { async function openChannelForm(row: PayAppApi.App, payCode: string) {
channelModalApi.setData({ id: row.id, payCode }).open(); channelFormModalApi.setData({ id: row.id, payCode }).open();
} }
const [Grid, gridApi] = useVbenVxeGrid({ const [Grid, gridApi] = useVbenVxeGrid({
@ -140,9 +140,8 @@ const [Grid, gridApi] = useVbenVxeGrid({
<DocAlert title="支付功能开启" url="https://doc.iocoder.cn/pay/build/" /> <DocAlert title="支付功能开启" url="https://doc.iocoder.cn/pay/build/" />
</template> </template>
<!-- TODO @xingyu建议和别的一致Modal => FormModal --> <AppFormModal @success="onRefresh" />
<AppModal @success="onRefresh" /> <ChannelFormModal @success="onRefresh" />
<ChannelModal @success="onRefresh" />
<Grid> <Grid>
<template #toolbar-tools> <template #toolbar-tools>