feat: 完善 post 页面功能
parent
1fc3b094d1
commit
02795947ca
|
|
@ -115,15 +115,9 @@ async function handleExport() {
|
||||||
onClick: handleDelete.bind(null, row.id),
|
onClick: handleDelete.bind(null, row.id),
|
||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
:drop-down-actions="[
|
|
||||||
{
|
|
||||||
type: 'link',
|
|
||||||
label: $t('page.action.edit'),
|
|
||||||
},
|
|
||||||
]"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</Grid>
|
</Grid>
|
||||||
<FormModal />
|
<FormModal @reload="tableApi.query()" />
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,18 @@ import { modalSchema } from './post.data';
|
||||||
|
|
||||||
defineOptions({ name: 'PostModel' });
|
defineOptions({ name: 'PostModel' });
|
||||||
|
|
||||||
|
const emit = defineEmits(['reload']);
|
||||||
|
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
|
|
||||||
const [Form, formApi] = useVbenForm({
|
const [Form, formApi] = useVbenForm({
|
||||||
|
// 所有表单项共用,可单独在表单内覆盖
|
||||||
|
commonConfig: {
|
||||||
|
// 所有表单项
|
||||||
|
componentProps: {
|
||||||
|
class: 'w-full',
|
||||||
|
},
|
||||||
|
},
|
||||||
schema: modalSchema,
|
schema: modalSchema,
|
||||||
handleSubmit: onSubmit,
|
handleSubmit: onSubmit,
|
||||||
showDefaultActions: false,
|
showDefaultActions: false,
|
||||||
|
|
@ -47,6 +56,7 @@ async function onSubmit(values: Record<string, any>) {
|
||||||
: createPost(values as any));
|
: createPost(values as any));
|
||||||
modalApi.close();
|
modalApi.close();
|
||||||
await formApi.resetForm();
|
await formApi.resetForm();
|
||||||
|
emit('reload');
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -79,9 +79,9 @@ export const modalSchema: VbenFormSchema[] = [
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'ApiDict',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
code: DICT_TYPE.COMMON_STATUS,
|
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
|
||||||
},
|
},
|
||||||
fieldName: 'status',
|
fieldName: 'status',
|
||||||
label: '状态',
|
label: '状态',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue