feat: 完善 post 页面功能

pull/60/MERGE
xingyu4j 2024-12-18 14:40:10 +08:00
parent 1fc3b094d1
commit 02795947ca
3 changed files with 13 additions and 9 deletions

View File

@ -115,15 +115,9 @@ async function handleExport() {
onClick: handleDelete.bind(null, row.id),
},
]"
:drop-down-actions="[
{
type: 'link',
label: $t('page.action.edit'),
},
]"
/>
</template>
</Grid>
<FormModal />
<FormModal @reload="tableApi.query()" />
</Page>
</template>

View File

@ -11,9 +11,18 @@ import { modalSchema } from './post.data';
defineOptions({ name: 'PostModel' });
const emit = defineEmits(['reload']);
const isUpdate = ref(false);
const [Form, formApi] = useVbenForm({
//
commonConfig: {
//
componentProps: {
class: 'w-full',
},
},
schema: modalSchema,
handleSubmit: onSubmit,
showDefaultActions: false,
@ -47,6 +56,7 @@ async function onSubmit(values: Record<string, any>) {
: createPost(values as any));
modalApi.close();
await formApi.resetForm();
emit('reload');
}
</script>
<template>

View File

@ -79,9 +79,9 @@ export const modalSchema: VbenFormSchema[] = [
rules: 'required',
},
{
component: 'ApiDict',
component: 'Select',
componentProps: {
code: DICT_TYPE.COMMON_STATUS,
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
},
fieldName: 'status',
label: '状态',