Skip to content

Commit c82ef63

Browse files
committed
fix: 🐛 字典和菜单打包警告问题修复
1 parent 96519a6 commit c82ef63

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

src/api/system/dict.api.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ const DictAPI = {
2121
});
2222
},
2323

24+
getList() {
25+
return request<any, OptionType[]>({
26+
url: `${DICT_BASE_URL}`,
27+
method: "get",
28+
});
29+
},
30+
2431
/**
2532
* 字典表单数据
2633
*

src/views/codegen/index.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -656,10 +656,7 @@ async function handleOpenDialog(tableName: string) {
656656
currentTableName.value = tableName;
657657
// 获取字典数据
658658
DictAPI.getList().then((data) => {
659-
dictOptions.value = data.map((item) => ({
660-
label: item.name,
661-
value: item.dictCode,
662-
}));
659+
dictOptions.value = data;
663660
loading.value = true;
664661
GeneratorAPI.getGenConfig(tableName)
665662
.then((data) => {

src/views/demo/table-select/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function handleConfirm(data: IUser[]) {
2222
}
2323
const text = computed(() => {
2424
// 获取字典数据
25-
const dictData = dictStore.getDictionary("gender");
25+
const dictData = dictStore.getDictItems("gender");
2626
const genderLabel = dictData.find((item: any) => item.value == selectedUser.value?.gender)?.label;
2727
return selectedUser.value
2828
? `${selectedUser.value.username} - ${genderLabel} - ${selectedUser.value.deptName}`

src/views/system/menu/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ function handleSubmit() {
465465
handleQuery();
466466
});
467467
} else {
468-
MenuAPI.add(formData.value).then(() => {
468+
MenuAPI.create(formData.value).then(() => {
469469
ElMessage.success("新增成功");
470470
handleCloseDialog();
471471
handleQuery();

0 commit comments

Comments
 (0)