| | |
| | | * 生成一条表单条目 |
| | | * @param {String} _label 标签名称 |
| | | * @param {String} _name 字段名称 |
| | | * @param {String} _type 输入类型 (text: 输入框; switch: 切换按钮; picker: 下拉框选项) |
| | | * @param {String} _type 输入类型 (text: 输入框; switch: 切换按钮; picker: 下拉框选项; cascader: 级联选择) |
| | | * @param {Boolean} _required 是否为必填项 |
| | | * @param {Array} _options 当输入类型为picker时,提供可选项 |
| | | */ |
| | |
| | | return { |
| | | required: _required, |
| | | label: _label, |
| | | placeholder: '请输入' + _label, |
| | | placeholder: (_type == 'text' ? '请输入' : '请选择') + _label, |
| | | name: _name, |
| | | value: _type == 'switch' ? false : null, |
| | | value: null, |
| | | status: 'success', |
| | | tips: _label + '不能为空', |
| | | inputType: _type, |
| | | options: _options, |
| | | cascaderTitles: ['1', '2'], |
| | | visible: false, |
| | | }; |
| | | } |
| | | |