| | |
| | | message: item.label + '不可为空!' |
| | | }] |
| | | |
| | | if (typeof(item.min) === 'number' || typeof(item.max) === 'number') { |
| | | if (typeof(item.min) === 'number' || typeof(item.max) === 'number' || item.notZero === 'true') { |
| | | item.rules.push({ |
| | | validator: (rule, value, callback) => { |
| | | if (isNaN(value)) { |
| | | callback() |
| | | } else if (item.notZero === 'true' && value === 0) { |
| | | callback(item.label + '不可为0') |
| | | } else if (typeof(item.min) === 'number' && value < item.min) { |
| | | if (item.min < 1e-6) { |
| | | if (item.min === 1e-6) { |
| | |
| | | item.supInitVal = '' |
| | | |
| | | if (fieldMap.has(item.linkField)) { |
| | | item.supInitVal = fieldMap.get(item.linkField).initval || '' |
| | | let supitem = fieldMap.get(item.linkField) |
| | | item.supInitVal = supitem.initval || '' |
| | | if (supitem.$first) { |
| | | item.$resetSup = true |
| | | } |
| | | } else if (data.hasOwnProperty(item.linkField.toLowerCase())) { |
| | | item.supInitVal = data[item.linkField.toLowerCase()] |
| | | } |
| | |
| | | |
| | | // if (item.type === 'link') { |
| | | if (item.linkField) { |
| | | item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal || option.value === '') |
| | | let supInitVal = item.supInitVal |
| | | if (item.$resetSup) { |
| | | supInitVal = this.record[item.linkField] |
| | | } |
| | | item.options = item.oriOptions.filter(option => option.ParentID === supInitVal || option.value === '') |
| | | // } else if (['select', 'radio', 'checkbox', 'checkcard', 'multiselect'].includes(item.type)) { |
| | | } else { |
| | | item.options = item.oriOptions |
| | |
| | | if (item.hidden) return |
| | | |
| | | if (item.type === 'split') { |
| | | fields.push( |
| | | <Col span={24} key={index}> |
| | | <p className="mk-form-split-line" style={item.style}>{item.label}</p> |
| | | </Col> |
| | | ) |
| | | if (item.opacity === 'false') { |
| | | fields.push( |
| | | <div key={index}></div> |
| | | ) |
| | | } else { |
| | | fields.push( |
| | | <Col span={24} key={index}> |
| | | <p className="mk-form-split-line" style={item.style}>{item.label}</p> |
| | | </Col> |
| | | ) |
| | | } |
| | | } else if (item.type === 'hint') { |
| | | fields.push( |
| | | <Col span={item.span || 24} key={index}> |