xaboy / form-create-designer

好用的Vue低代码可视化表单设计器,可以通过拖拽的方式快速创建表单,提高开发者对表单的开发效率。支持PC端和移动端,目前在政务系统、OA系统、ERP系统、电商系统、流程管理等系统中已稳定应用。
https://view.form-create.com/
MIT License
1.67k stars 377 forks source link

自定义校验规则校验一直不通过 #125

Open a847244052 opened 8 months ago

a847244052 commented 8 months ago

选项1和选项2对应两个不同输入框,分别定义了校验规则,都是不通过

image image image image

json:

[ { "type": "FcRow", "children": [ { "type": "col", "props": { "span": 12 }, "children": [ { "type": "select", "field": "Frf8622qi89yz", "title": "选择器", "info": "", "props": { "_optionType": 2 }, "options": [ { "value": "1", "label": "选项1" }, { "value": "2", "label": "选项2" } ], "_fc_drag_tag": "select", "hidden": false, "display": true } ], "_fc_drag_tag": "col", "hidden": false, "display": true } ], "_fc_drag_tag": "row", "hidden": false, "display": true }, { "type": "FcRow", "children": [ { "type": "col", "props": { "span": 12 }, "children": [ { "type": "radio", "field": "F6h41okrd5njr8", "title": "单选框", "info": "", "effect": { "fetch": "" }, "options": [ { "value": "1", "label": "选项1" }, { "value": "2", "label": "选项2" } ], "_fc_drag_tag": "radio", "hidden": false, "display": true, "$required": "aa", "control": [ { "value": "1", "rule": [ "Fu2t1okrd6vken" ] }, { "value": "2", "rule": [ "F4ci1okrgm993u" ] } ] }, { "type": "FcRow", "children": [ { "type": "col", "props": { "span": 12 }, "children": [ { "type": "input", "field": "Fu2t1okrd6vken", "title": "输入框", "info": "value1", "_fc_drag_tag": "input", "hidden": false, "display": true, "$required": false, "props": { "type": "number", "maxlength": null, "minlength": null, "clearable": false }, "validate": [ { "trigger": "change", "mode": "len", "message": "aaa", "len": 3, "type": "number" } ] } ], "_fc_drag_tag": "col", "hidden": false, "display": true } ], "_fc_drag_tag": "row", "hidden": false, "display": true }, { "type": "FcRow", "children": [ { "type": "col", "props": { "span": 12 }, "children": [ { "type": "input", "field": "F4ci1okrgm993u", "title": "输入框", "info": "value2", "props": { "type": "number", "showWordLimit": true, "autofocus": true }, "_fc_drag_tag": "input", "hidden": false, "display": true, "$required": false, "validate": [ { "trigger": "blur", "mode": "min", "message": "最小值是1", "min": 1, "type": "number" } ] } ], "_fc_drag_tag": "col", "hidden": false, "display": true } ], "_fc_drag_tag": "row", "hidden": false, "display": true } ], "_fc_drag_tag": "col", "hidden": false, "display": true } ], "_fc_drag_tag": "row", "hidden": false, "display": true } ]

xaboy commented 8 months ago

input组件的value类型是string,需要选择string