合并字典bug修复

This commit is contained in:
Cain 2025-03-13 14:25:51 +08:00
commit 0d046eae37
4 changed files with 305 additions and 20 deletions

View File

@ -71,16 +71,6 @@ export const generatedRoutes: GeneratedRoute[] = [
keepAlive: false keepAlive: false
}, },
children: [ children: [
{
name: 'dictionary_data',
path: '/dictionary/data',
component: 'view.dictionary_data',
meta: {
title: 'dictionary_data',
i18nKey: 'route.dictionary_data',
icon: 'carbon:batch-job'
}
},
{ {
name: 'dictionary_type', name: 'dictionary_type',
path: '/dictionary/type', path: '/dictionary/type',
@ -90,6 +80,16 @@ export const generatedRoutes: GeneratedRoute[] = [
i18nKey: 'route.dictionary_type', i18nKey: 'route.dictionary_type',
icon: 'octicon:tasklist' icon: 'octicon:tasklist'
} }
},
{
name: 'dictionary_data',
path: '/dictionary/data',
component: 'view.dictionary_data',
meta: {
title: 'dictionary_data',
i18nKey: 'route.dictionary_data',
icon: 'carbon:batch-job'
}
} }
] ]
}, },

View File

@ -1369,9 +1369,9 @@ declare namespace Api {
// type CategoryType = '1' | '2'; // type CategoryType = '1' | '2';
type CategorySearchParams = { type CategorySearchParams = {
categoryName?: string | null, categoryName?: string | null;
categoryType?: string | null categoryType?: string | null;
} };
type Category = { type Category = {
id: number; id: number;

View File

@ -6,7 +6,7 @@ import { $t } from '@/locales';
import { useAppStore } from '@/store/modules/app'; import { useAppStore } from '@/store/modules/app';
const appStore = useAppStore(); const appStore = useAppStore();
const model = defineModel<Api.DictionaryType.DictionaryTypeSearchParams>('model', { required: true }); const model = defineModel<Api.DictionaryData.DictionaryDataSearchParams>('model', { required: true });
const btnSpan = computed(() => (appStore.isMobile ? '7' : '7')); const btnSpan = computed(() => (appStore.isMobile ? '7' : '7'));
@ -29,10 +29,24 @@ async function updateOptions() {
} }
function translateOptions(dictTypes: Api.DictionaryType.DictionaryType[]) { function translateOptions(dictTypes: Api.DictionaryType.DictionaryType[]) {
return dictTypes.map(dictType => ({ type dictOpt = {
value: dictType.dictType, value: string;
label: dictType.dictName label: string;
})); };
const dictOpts: Array<dictOpt> = [
{
value: '',
label: ''
}
];
dictOpts.push(
...dictTypes.map(dictType => ({
value: dictType.dictType,
label: dictType.dictName
}))
);
return dictOpts;
} }
function search() { function search() {
@ -58,9 +72,9 @@ function reset() {
:placeholder="$t('page.dictionaryType.form.dictionaryName')" :placeholder="$t('page.dictionaryType.form.dictionaryName')"
/> />
</NFormItemGi> </NFormItemGi>
<!-- 字典类型 --> <!-- 字典标签 -->
<NFormItemGi span="m:7" :label="$t('page.dictionaryData.form.dictLabel')" path="dictType" class="pr-0px"> <NFormItemGi span="m:7" :label="$t('page.dictionaryData.form.dictLabel')" path="dictType" class="pr-0px">
<NInput v-model:value="model.dictName" :placeholder="$t('page.dictionaryData.form.dictLabel')" clearable /> <NInput v-model:value="model.dictLabel" :placeholder="$t('page.dictionaryData.form.dictLabel')" clearable />
</NFormItemGi> </NFormItemGi>
<!-- 按钮 --> <!-- 按钮 -->

File diff suppressed because one or more lines are too long