fix: 🐛 字典和菜单打包警告问题修复

This commit is contained in:
Ray.Hao
2025-03-24 10:36:52 +08:00
parent 96519a69c2
commit c82ef63c62
4 changed files with 10 additions and 6 deletions

View File

@@ -21,6 +21,13 @@ const DictAPI = {
}); });
}, },
getList() {
return request<any, OptionType[]>({
url: `${DICT_BASE_URL}`,
method: "get",
});
},
/** /**
* 字典表单数据 * 字典表单数据
* *

View File

@@ -656,10 +656,7 @@ async function handleOpenDialog(tableName: string) {
currentTableName.value = tableName; currentTableName.value = tableName;
// 获取字典数据 // 获取字典数据
DictAPI.getList().then((data) => { DictAPI.getList().then((data) => {
dictOptions.value = data.map((item) => ({ dictOptions.value = data;
label: item.name,
value: item.dictCode,
}));
loading.value = true; loading.value = true;
GeneratorAPI.getGenConfig(tableName) GeneratorAPI.getGenConfig(tableName)
.then((data) => { .then((data) => {

View File

@@ -22,7 +22,7 @@ function handleConfirm(data: IUser[]) {
} }
const text = computed(() => { const text = computed(() => {
// 获取字典数据 // 获取字典数据
const dictData = dictStore.getDictionary("gender"); const dictData = dictStore.getDictItems("gender");
const genderLabel = dictData.find((item: any) => item.value == selectedUser.value?.gender)?.label; const genderLabel = dictData.find((item: any) => item.value == selectedUser.value?.gender)?.label;
return selectedUser.value return selectedUser.value
? `${selectedUser.value.username} - ${genderLabel} - ${selectedUser.value.deptName}` ? `${selectedUser.value.username} - ${genderLabel} - ${selectedUser.value.deptName}`

View File

@@ -465,7 +465,7 @@ function handleSubmit() {
handleQuery(); handleQuery();
}); });
} else { } else {
MenuAPI.add(formData.value).then(() => { MenuAPI.create(formData.value).then(() => {
ElMessage.success("新增成功"); ElMessage.success("新增成功");
handleCloseDialog(); handleCloseDialog();
handleQuery(); handleQuery();