fix: bugs

This commit is contained in:
xingyu4j
2025-06-25 18:22:06 +08:00
parent d94dbe73e1
commit 2855eb4e08
19 changed files with 178 additions and 51 deletions

View File

@@ -1,12 +1,15 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { useUserStore } from '@vben/stores';
import { getAreaTree } from '#/api/system/area';
import { getSimpleUserList } from '#/api/system/user';
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
/** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] {
const userStore = useUserStore();
return [
{
fieldName: 'id',
@@ -47,6 +50,7 @@ export function useFormSchema(): VbenFormSchema[] {
value: 'id',
},
},
defaultValue: userStore.userInfo?.id,
rules: 'required',
},
{

View File

@@ -1,5 +1,6 @@
<script lang="ts" setup>
import { useVbenModal } from '@vben/common-ui';
import { useUserStore } from '@vben/stores';
import { message } from 'ant-design-vue';
@@ -10,6 +11,8 @@ import { $t } from '#/locales';
const emit = defineEmits(['success']);
const userStore = useUserStore();
const [Form, formApi] = useVbenForm({
commonConfig: {
componentProps: {
@@ -39,6 +42,7 @@ const [Form, formApi] = useVbenForm({
value: 'id',
},
},
defaultValue: userStore.userInfo?.id,
rules: 'required',
},
],