fix:字典页面按标签搜索

This commit is contained in:
rashstarfish 2025-03-13 12:06:25 +08:00
parent 7f805412d9
commit 76d443a5cb
5 changed files with 308 additions and 23 deletions

View File

@ -2,5 +2,5 @@ VITE_BASE_URL=/
# backend service base url, test environment
# VITE_SERVICE_BASE_URL=http://localhost:8080/snail-job
# VITE_SERVICE_BASE_URL=http://10.18.190.195:8080/snail-job
VITE_SERVICE_BASE_URL=http://10.21.21.29:8080/snail-job
VITE_SERVICE_BASE_URL=http://10.18.190.195:8080/snail-job
# VITE_SERVICE_BASE_URL=http://10.21.21.29:8080/snail-job

View File

@ -71,16 +71,6 @@ export const generatedRoutes: GeneratedRoute[] = [
keepAlive: false
},
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',
path: '/dictionary/type',
@ -90,6 +80,16 @@ export const generatedRoutes: GeneratedRoute[] = [
i18nKey: 'route.dictionary_type',
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 CategorySearchParams = {
categoryName?: string | null,
categoryType?: string | null
}
categoryName?: string | null;
categoryType?: string | null;
};
type Category = {
id: number;
@ -1380,7 +1380,7 @@ declare namespace Api {
level: string;
createTime: string;
categoryType: CategoryType;
}
};
type RowData = Category & {
children?: RowData[];

View File

@ -6,7 +6,7 @@ import { $t } from '@/locales';
import { useAppStore } from '@/store/modules/app';
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'));
@ -29,10 +29,24 @@ async function updateOptions() {
}
function translateOptions(dictTypes: Api.DictionaryType.DictionaryType[]) {
return dictTypes.map(dictType => ({
type dictOpt = {
value: string;
label: string;
};
const dictOpts: Array<dictOpt> = [
{
value: '',
label: ''
}
];
dictOpts.push(
...dictTypes.map(dictType => ({
value: dictType.dictType,
label: dictType.dictName
}));
}))
);
return dictOpts;
}
function search() {
@ -58,9 +72,9 @@ function reset() {
:placeholder="$t('page.dictionaryType.form.dictionaryName')"
/>
</NFormItemGi>
<!-- 字典类型 -->
<!-- 字典标签 -->
<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>
<!-- 按钮 -->

File diff suppressed because one or more lines are too long