fix: 将 dict 放回antd目录下

pull/60/MERGE
xingyu4j 2024-12-18 14:38:41 +08:00
parent b51045cc1b
commit 1fc3b094d1
7 changed files with 18 additions and 40 deletions

View File

@ -4,12 +4,7 @@ import { ref } from 'vue';
import { useRouter } from 'vue-router';
import { DEFAULT_HOME_PATH, LOGIN_PATH } from '@vben/constants';
import {
resetAllStores,
useAccessStore,
useDictStore,
useUserStore,
} from '@vben/stores';
import { resetAllStores, useAccessStore, useUserStore } from '@vben/stores';
import { notification } from 'ant-design-vue';
import { defineStore } from 'pinia';
@ -17,6 +12,7 @@ import { defineStore } from 'pinia';
import { getAuthPermissionInfoApi, loginApi, logoutApi } from '#/api';
import { getSimpleDictDataList } from '#/api/system/dict-data';
import { $t } from '#/locales';
import { useDictStore } from '#/store';
export const useAuthStore = defineStore('auth', () => {
const accessStore = useAccessStore();

View File

@ -1 +1,2 @@
export * from './auth';
export * from './dict';

View File

@ -1,8 +1,9 @@
import type { DefaultOptionType } from 'ant-design-vue/es/select';
import { useDictStore } from '@vben/stores';
import { isObject } from '@vben/utils';
import { useDictStore } from '#/store';
const dictStore = useDictStore();
/**

View File

@ -2,11 +2,11 @@ import type { VxeGridProps } from '#/adapter/vxe-table';
import type { CodegenApi } from '#/api/infra/codegen';
import { type VbenFormProps, z } from '@vben/common-ui';
import { useDictStore, useUserStore } from '@vben/stores';
import { useUserStore } from '@vben/stores';
import { getDataSourceConfigList } from '#/api/infra/data-source-config';
import { $t } from '#/locales';
import { DICT_TYPE } from '#/utils/dict';
import { DICT_TYPE, getDictOptions } from '#/utils/dict';
export namespace CodegenDefaultData {
/**
@ -135,7 +135,7 @@ export namespace CodegenOptionsModalData {
rules: z.string().min(1, { message: '实体类名不能为空' }),
componentProps: {
tooltip:
'默认去除表名的前缀。如果存在重复,则需要手动添加前缀,避免 MyBatis 报 Alias 重复的问题。',
'默认去除表名的前缀。如果存在重复,则需要手动添加前缀,避免 MyBaits 报 Alias 重复的问题。',
placeholder: '请输入实体类名',
},
},
@ -159,15 +159,10 @@ export namespace CodegenOptionsModalData {
{
label: '生成模版',
fieldName: 'template',
component: 'ApiSelect',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE),
class: 'w-full',
placeholder: '请选择生成模版',
api: () => {
return useDictStore().getDictOptions(
DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE,
);
},
},
rules: 'required',
defaultValue: '1',
@ -175,15 +170,10 @@ export namespace CodegenOptionsModalData {
{
label: '前端类型',
fieldName: 'frontType',
component: 'ApiSelect',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_CODEGEN_FRONT_TYPE),
class: 'w-full',
placeholder: '请选择前端类型',
api: () => {
return useDictStore().getDictOptions(
DICT_TYPE.INFRA_CODEGEN_FRONT_TYPE,
);
},
},
rules: 'required',
defaultValue: '31',
@ -191,13 +181,10 @@ export namespace CodegenOptionsModalData {
{
label: '生成场景',
fieldName: 'scene',
component: 'ApiSelect',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_CODEGEN_SCENE),
class: 'w-full',
placeholder: '请选择生成场景',
api: () => {
return useDictStore().getDictOptions(DICT_TYPE.INFRA_CODEGEN_SCENE);
},
},
rules: 'required',
defaultValue: '1',

View File

@ -3,13 +3,11 @@ import type { FileConfigApi } from '#/api/infra/file-config';
import { h } from 'vue';
import { useDictStore } from '@vben/stores';
import { Tag } from 'ant-design-vue';
import { type VbenFormProps, z } from '#/adapter/form';
import { $t } from '#/locales';
import { DICT_TYPE } from '#/utils/dict';
import { DICT_TYPE, getDictOptions } from '#/utils/dict';
/**
*
@ -26,13 +24,11 @@ export const formSchema: VbenFormProps['schema'] = [
{
fieldName: 'storage',
label: '储存器',
component: 'ApiSelect',
component: 'Select',
componentProps: {
class: 'w-full',
placeholder: '请选择储存器',
api: () => {
return useDictStore().getDictOptions(DICT_TYPE.INFRA_FILE_STORAGE);
},
options: getDictOptions(DICT_TYPE.INFRA_FILE_STORAGE),
},
},
{
@ -126,9 +122,7 @@ export const editFormSchema: VbenFormProps['schema'] = [
componentProps: {
class: 'w-full',
placeholder: '请选择储存器',
api: () => {
return useDictStore().getDictOptions(DICT_TYPE.INFRA_FILE_STORAGE);
},
options: getDictOptions(DICT_TYPE.INFRA_FILE_STORAGE),
},
rules: 'required',
defaultValue: '1',

View File

@ -1,5 +1,4 @@
export * from './access';
export * from './dict';
export * from './lock';
export * from './tabbar';
export * from './tenant';