cool-admin-vue/build/cool/lib/eps/config.ts

32 lines
682 B
TypeScript
Raw Normal View History

export default {
entity: {
mapping: [
{
// 自定义匹配
custom: ({ entityName, propertyName, type }) => {
2022-07-21 19:07:32 +08:00
// status 原本是tinyint如果是1的话== true 是可以的,但是不能 === true请谨慎使用
if (propertyName === "status" && type == "tinyint") return "boolean";
2022-06-24 11:10:56 +08:00
// 如果没有返回null或者不返回则继续遍历其他匹配规则
return null;
}
},
{
type: "string",
2022-07-22 12:51:41 +08:00
test: ["varchar", "text"]
},
{
type: "Date",
2022-07-22 12:51:41 +08:00
test: ["datetime", "date"]
},
{
type: "number",
2022-07-22 12:51:41 +08:00
test: ["tinyint", "int", "decimal"]
},
{
type: "BigInt",
2022-07-22 12:51:41 +08:00
test: ["bigint"]
}
]
}
};