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

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

View File

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