mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-12 21:52:48 +00:00
后端使用此两个类型后,创建eps.d.ts会把这两个类型直接指定为成员类型,但是由于该两种类型并未ts原生类型。所以前端创建eps总是失败,导致一系列问题。增加这两个转换的配置即可解决该问题。
36 lines
756 B
TypeScript
36 lines
756 B
TypeScript
export default {
|
||
entity: {
|
||
mapping: [
|
||
{
|
||
// 自定义匹配
|
||
custom: ({ entityName, propertyName, type }) => {
|
||
// status 原本是tinyint,如果是1的话,== true 是可以的,但是不能 === true,请谨慎使用
|
||
if (propertyName === "status" && type == "tinyint") return "boolean";
|
||
// 如果没有,返回null或者不返回,则继续遍历其他匹配规则
|
||
return null;
|
||
}
|
||
},
|
||
{
|
||
type: "string",
|
||
test: ["varchar", "text","simple-json"]
|
||
},
|
||
{
|
||
type: "string[]",
|
||
test: ["simple-array"]
|
||
},
|
||
{
|
||
type: "Date",
|
||
test: ["datetime", "date"]
|
||
},
|
||
{
|
||
type: "number",
|
||
test: ["tinyint", "int", "decimal"]
|
||
},
|
||
{
|
||
type: "BigInt",
|
||
test: ["bigint"]
|
||
}
|
||
]
|
||
}
|
||
};
|