fix: 🐛 字典项在 Mock 模式下编辑回显失败

This commit is contained in:
Ray.Hao
2025-03-26 08:58:56 +08:00
parent 35cae9cc3e
commit 03968a6cc1

View File

@@ -276,22 +276,16 @@ export default defineMock([
// 字典映射表数据 // 字典映射表数据
const dictMap: Record<string, any> = { const dictMap: Record<string, any> = {
1: { 1: {
code: "00000",
data: {
id: 1, id: 1,
name: "性别", name: "性别",
dictCode: "gender", dictCode: "gender",
status: 1, status: 1,
}, },
msg: "一切ok",
},
}; };
// 字典项映射表数据 // 字典项映射表数据
const dictItemMap: Record<string, any> = { const dictItemMap: Record<string, any> = {
1: { 1: {
code: "00000",
data: {
id: 1, id: 1,
value: "1", value: "1",
label: "男", label: "男",
@@ -299,11 +293,7 @@ const dictItemMap: Record<string, any> = {
status: 1, status: 1,
tagType: "primary", tagType: "primary",
}, },
msg: "一切ok",
},
2: { 2: {
code: "00000",
data: {
id: 2, id: 2,
value: "2", value: "2",
label: "女", label: "女",
@@ -311,11 +301,7 @@ const dictItemMap: Record<string, any> = {
status: 1, status: 1,
tagType: "danger", tagType: "danger",
}, },
msg: "一切ok",
},
3: { 3: {
code: "00000",
data: {
id: 3, id: 3,
value: "0", value: "0",
label: "保密", label: "保密",
@@ -323,6 +309,4 @@ const dictItemMap: Record<string, any> = {
status: 1, status: 1,
tagType: "info", tagType: "info",
}, },
msg: "一切ok",
},
}; };