342 lines
12 KiB
JavaScript
342 lines
12 KiB
JavaScript
export default function makeRule() {
|
|
return [
|
|
{
|
|
"type": "radio",
|
|
"field": "type",
|
|
"title": "组件类型",
|
|
"effect": {
|
|
"fetch": ""
|
|
},
|
|
"$required": false,
|
|
"props": {
|
|
"type": "button"
|
|
},
|
|
"options": [
|
|
{
|
|
"label": "表单组件",
|
|
"value": "2"
|
|
},
|
|
{
|
|
"label": "选项类表单组件",
|
|
"value": "3"
|
|
},
|
|
{
|
|
"label": "辅助组件",
|
|
"value": "1"
|
|
}
|
|
],
|
|
"_fc_id": "id_F89qm5ulpnp9adc",
|
|
"name": "ref_Fsdxm5ulpnp9aec",
|
|
"_fc_drag_tag": "radio",
|
|
"display": true,
|
|
"hidden": false
|
|
},
|
|
{
|
|
"type": "input",
|
|
"field": "name",
|
|
"title": "组件名称",
|
|
"$required": false,
|
|
"_fc_id": "id_F1njm5ultg7fajc",
|
|
"name": "ref_Fgcnm5ultg7fakc",
|
|
"_fc_drag_tag": "input",
|
|
"display": true,
|
|
"hidden": false
|
|
},
|
|
{
|
|
"type": "input",
|
|
"field": "label",
|
|
"title": "组件别名",
|
|
"$required": false,
|
|
"_fc_id": "id_F1nxm5uluzpfamc",
|
|
"name": "ref_Ftxnm5uluzpfanc",
|
|
"_fc_drag_tag": "input",
|
|
"display": true,
|
|
"hidden": false
|
|
},
|
|
{
|
|
"type": "tableForm",
|
|
"field": "options",
|
|
"title": "选择项",
|
|
"props": {
|
|
"columns": [
|
|
{
|
|
"label": "名称",
|
|
"required": false,
|
|
"style": {
|
|
"width": "auto"
|
|
},
|
|
"rule": [
|
|
{
|
|
"type": "input",
|
|
"field": "label",
|
|
"title": "输入框",
|
|
"$required": false,
|
|
"_fc_id": "id_F0xkm5umkj3abyc",
|
|
"name": "ref_Fu3am5umbd2obsc",
|
|
"_fc_drag_tag": "input",
|
|
"display": true,
|
|
"hidden": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"label": "值",
|
|
"required": false,
|
|
"style": {
|
|
"width": "auto"
|
|
},
|
|
"rule": [
|
|
{
|
|
"type": "input",
|
|
"field": "value",
|
|
"title": "值",
|
|
"$required": false,
|
|
"_fc_id": "id_Fg4xm5unpihhcec",
|
|
"name": "ref_Fhrsm5unpihhcgc",
|
|
"_fc_drag_tag": "input",
|
|
"display": true,
|
|
"hidden": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"_fc_id": "id_F1n2m5umkj3abzc",
|
|
"name": "ref_Ff4dm5umkj3abxc",
|
|
"_fc_drag_tag": "tableForm",
|
|
"display": true,
|
|
"hidden": false,
|
|
"computed": {
|
|
"hidden": {
|
|
"mode": "AND",
|
|
"group": [
|
|
{
|
|
"field": "type",
|
|
"condition": "==",
|
|
"value": "3"
|
|
}
|
|
],
|
|
"invert": true
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "checkbox",
|
|
"field": "validate",
|
|
"title": "Value的数据类型",
|
|
"effect": {
|
|
"fetch": ""
|
|
},
|
|
"$required": false,
|
|
"props": {
|
|
"type": "button"
|
|
},
|
|
"options": [
|
|
{
|
|
"label": "字符串",
|
|
"value": "string"
|
|
},
|
|
{
|
|
"label": "数字",
|
|
"value": "number"
|
|
},
|
|
{
|
|
"label": "数组",
|
|
"value": "array"
|
|
}
|
|
],
|
|
"_fc_id": "id_Fs4dm5ulyrpmazc",
|
|
"name": "ref_F7q3m5ulyrpmb0c",
|
|
"_fc_drag_tag": "checkbox",
|
|
"display": true,
|
|
"hidden": false,
|
|
"computed": {
|
|
"hidden": {
|
|
"mode": "OR",
|
|
"group": [
|
|
{
|
|
"field": "type",
|
|
"condition": "!=",
|
|
"value": "1"
|
|
}
|
|
],
|
|
"invert": true
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "tableForm",
|
|
"field": "event",
|
|
"title": "事件",
|
|
"props": {
|
|
"columns": [
|
|
{
|
|
"label": "事件名称",
|
|
"required": false,
|
|
"style": {
|
|
"width": "auto"
|
|
},
|
|
"rule": [
|
|
{
|
|
"type": "input",
|
|
"field": "name",
|
|
"title": "事件",
|
|
"$required": false,
|
|
"_fc_id": "id_Ffl9m5ulxopqawc",
|
|
"name": "ref_Fn0om5ulxopqaxc",
|
|
"_fc_drag_tag": "input",
|
|
"display": true,
|
|
"hidden": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"_fc_id": "id_Fwcmm5ulxatsasc",
|
|
"name": "ref_Fwzrm5ulxatsatc",
|
|
"_fc_drag_tag": "tableForm",
|
|
"display": true,
|
|
"hidden": false
|
|
},
|
|
{
|
|
"type": "group",
|
|
"field": "props",
|
|
"title": "配置项",
|
|
"$required": false,
|
|
"props": {
|
|
"expand": 1,
|
|
"rule": [
|
|
{
|
|
"type": "input",
|
|
"field": "field",
|
|
"title": "字段名",
|
|
"$required": false,
|
|
"_fc_id": "id_Fl1ym5um4ygwb6c",
|
|
"name": "ref_F28mm5um4ygwb7c",
|
|
"_fc_drag_tag": "input",
|
|
"display": true,
|
|
"hidden": false
|
|
},
|
|
{
|
|
"type": "input",
|
|
"field": "name",
|
|
"title": "配置名称",
|
|
"$required": false,
|
|
"_fc_id": "id_Fl1ym5um4ygwb6c",
|
|
"name": "ref_F28mm5um4ygwb7c",
|
|
"_fc_drag_tag": "input",
|
|
"display": true,
|
|
"hidden": false
|
|
},
|
|
{
|
|
"type": "radio",
|
|
"field": "props_type",
|
|
"title": "配置类型",
|
|
"effect": {
|
|
"fetch": ""
|
|
},
|
|
"$required": false,
|
|
"props": {
|
|
"type": "button"
|
|
},
|
|
"options": [
|
|
{
|
|
"label": "输入框",
|
|
"value": "input"
|
|
},
|
|
{
|
|
"label": "数字",
|
|
"value": "inputNumber"
|
|
},
|
|
{
|
|
"label": "布尔",
|
|
"value": "switch"
|
|
},
|
|
{
|
|
"label": "选项",
|
|
"value": "select"
|
|
}
|
|
],
|
|
"_fc_id": "id_Fl8zm5um9v76bkc",
|
|
"name": "ref_Fnaim5um9v76blc",
|
|
"_fc_drag_tag": "radio",
|
|
"display": true,
|
|
"hidden": false
|
|
},
|
|
{
|
|
"type": "tableForm",
|
|
"field": "options",
|
|
"title": "选择项",
|
|
"props": {
|
|
"columns": [
|
|
{
|
|
"label": "名称",
|
|
"required": false,
|
|
"style": {
|
|
"width": "auto"
|
|
},
|
|
"rule": [
|
|
{
|
|
"type": "input",
|
|
"field": "label",
|
|
"title": "名称",
|
|
"$required": false,
|
|
"_fc_id": "id_Fffzm5umbd2obrc",
|
|
"name": "ref_Fu3am5umbd2obsc",
|
|
"_fc_drag_tag": "input",
|
|
"display": true,
|
|
"hidden": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"label": "值",
|
|
"required": false,
|
|
"style": {
|
|
"width": "auto"
|
|
},
|
|
"rule": [
|
|
{
|
|
"type": "input",
|
|
"field": "value",
|
|
"title": "值",
|
|
"$required": false,
|
|
"_fc_id": "id_Fbzcm5umprcqc2c",
|
|
"name": "ref_Fzc0m5umprcqc4c",
|
|
"_fc_drag_tag": "input",
|
|
"display": true,
|
|
"hidden": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"_fc_id": "id_Fx1am5umaxcibnc",
|
|
"name": "ref_F5c0m5umaxciboc",
|
|
"_fc_drag_tag": "tableForm",
|
|
"display": true,
|
|
"hidden": false,
|
|
"computed": {
|
|
"hidden": {
|
|
"mode": "AND",
|
|
"group": [
|
|
{
|
|
"field": "props_type",
|
|
"condition": "==",
|
|
"value": "select"
|
|
}
|
|
],
|
|
"invert": true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"_fc_id": "id_Fg4ym5um923gbec",
|
|
"name": "ref_Fzo9m5um923gbfc",
|
|
"_fc_drag_tag": "group",
|
|
"display": true,
|
|
"hidden": false
|
|
}
|
|
];
|
|
} |