cool-admin-vue/build/cool/lib/menu/rules.ts

215 lines
3.1 KiB
TypeScript
Raw Normal View History

2021-12-05 23:09:33 +08:00
export default [
{
test: ["avatar", "img", "image", "pic", "photo", "picture", "head", "icon"],
table: {
name: "cl-image",
props: {
size: 60
}
},
form: {
name: "cl-upload"
}
},
{
test: ["avatars", "imgs", "images", "pics", "photos", "pictures", "heads", "icons"],
table: {
name: "cl-image",
props: {
size: 60
}
},
form: {
name: "cl-upload",
props: {
listType: "picture-card",
multiple: true
}
}
},
{
test: ["file", "attachment", "attach", "url", "video", "music"],
table: {
name: "cl-link"
},
form: {
name: "cl-upload",
props: {
listType: "text",
limit: 1
}
}
},
{
test: ["files", "attachments", "attachs", "urls", "videos", "musics"],
table: {
name: "cl-link"
},
form: {
name: "cl-upload",
props: {
listType: "text",
multiple: true
}
}
},
{
test: ["enable", "status"],
table: {
name: "cl-switch"
},
form: {
name: "el-switch"
}
},
{
test: ["type", "classify", "category"],
handler: "dict"
},
{
test: ["types", "classifys", "categorys"],
handler: "dict_multiple"
},
{
test: ["date"],
2021-12-06 23:59:41 +08:00
table: {
2022-04-02 22:50:51 +08:00
name: "cl-date-text",
2021-12-06 23:59:41 +08:00
props: {
format: "YYYY-MM-DD"
}
},
2021-12-05 23:09:33 +08:00
form: {
name: "el-date-picker",
props: {
2021-12-06 15:00:06 +08:00
type: "date",
valueFormat: "YYYY-MM-DD"
2021-12-05 23:09:33 +08:00
}
}
},
{
test: ["dates", "dateRange", "dateScope"],
2021-12-06 23:59:41 +08:00
table: {
2022-04-02 22:50:51 +08:00
name: "cl-date-text",
2021-12-06 23:59:41 +08:00
props: {
format: "YYYY-MM-DD"
}
},
2021-12-05 23:09:33 +08:00
form: {
2021-12-06 15:00:06 +08:00
component: {
name: "el-date-picker",
props: {
type: "daterange",
valueFormat: "YYYY-MM-DD"
}
2021-12-05 23:09:33 +08:00
}
}
},
{
test: ["time"],
form: {
name: "el-date-picker",
props: {
2021-12-06 15:00:06 +08:00
type: "datetime",
valueFormat: "YYYY-MM-DD HH:mm:ss"
2021-12-05 23:09:33 +08:00
}
}
},
{
test: ["times", "timeRange", "timeScope"],
form: {
2021-12-06 15:00:06 +08:00
component: {
name: "el-date-picker",
props: {
type: "datetimerange",
2021-12-06 23:59:41 +08:00
valueFormat: "YYYY-MM-DD HH:mm:ss",
defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]
2021-12-06 15:00:06 +08:00
}
2021-12-05 23:09:33 +08:00
}
}
},
{
test: ["star", "stars"],
table: {
name: "el-rate",
props: {
disabled: true
}
},
form: {
name: "el-rate"
}
},
{
test: ["progress", "rate", "ratio"],
table: {
name: "el-progress"
},
form: {
name: "el-slider",
props: {
style: {
width: "200px"
}
}
}
},
{
test: ["num", "price", "age", "amount"],
form: {
name: "el-input-number",
props: {
min: 0
}
}
},
{
test: ["remark", "desc"],
table: {
showOverflowTooltip: true
},
form: {
name: "el-input",
props: {
type: "textarea",
rows: 4
}
}
},
{
2021-12-07 09:49:23 +08:00
test: ["rich", "text", "html", "content", "introduce", "description", "desc"],
2021-12-07 12:26:56 +08:00
table: {
name: "cl-editor-quill"
},
2021-12-05 23:09:33 +08:00
form: {
2021-12-06 15:00:06 +08:00
name: "cl-editor-quill",
2021-12-05 23:09:33 +08:00
props: {
height: 400
}
}
},
{
test: ["code", "codes"],
2021-12-07 12:26:56 +08:00
table: {
name: "cl-codemirror"
},
2021-12-05 23:09:33 +08:00
form: {
2021-12-06 15:00:06 +08:00
name: "cl-codemirror",
2021-12-05 23:09:33 +08:00
props: {
height: 400
}
}
},
{
test: ["createTime"],
table: {
sortable: "desc"
}
},
{
test: ["updateTime"],
table: {
sortable: "custom"
}
}
];