| | |
| | | data: PropTypes.any, // 表格数据 |
| | | BID: PropTypes.any, // 主表ID |
| | | BData: PropTypes.any, // 主表数据 |
| | | unload: PropTypes.any, // 下拉菜单不加载数据 |
| | | inputSubmit: PropTypes.func // input回车提交 |
| | | } |
| | | |
| | |
| | | record = {} |
| | | |
| | | componentDidMount () { |
| | | const { action } = this.props |
| | | const { action, unload } = this.props |
| | | |
| | | let data = {} |
| | | let BData = {} |
| | |
| | | }) |
| | | } else if (item.regular === 'email') { |
| | | _rules.push({ |
| | | pattern: /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/, |
| | | pattern: /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/, |
| | | message: item.regularText || '请正确输入邮箱地址' |
| | | }) |
| | | } |
| | |
| | | this.record = record |
| | | |
| | | this.setState({ formlist }, () => { |
| | | if (unload) return |
| | | |
| | | if (action.setting && action.setting.focus && fieldMap.has(action.setting.focus)) { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkFC', 'focus', fieldMap.get(action.setting.focus).uuid) |
| | |
| | | if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect', 'cascader'].includes(item.type) && result[item.field] && result[item.field].length > 0) { |
| | | let options = [] |
| | | let map = new Map() |
| | | let all = false |
| | | result[item.field].forEach(cell => { |
| | | let _cell = { key: Utils.getuuid() , ParentID: ''} |
| | | |
| | |
| | | if (item.type !== 'checkcard') { |
| | | _cell.value = cell[item.valueField] |
| | | _cell.label = cell[item.valueText] + '' |
| | | if (!_cell.label || map.has(_cell.ParentID + _cell.value)) return |
| | | if (map.has(_cell.ParentID + _cell.value)) return |
| | | if (!_cell.label) { |
| | | if (!all) { |
| | | _cell.label = '全部' |
| | | all = true |
| | | } else { |
| | | return |
| | | } |
| | | } |
| | | |
| | | map.set(_cell.ParentID + _cell.value, 0) |
| | | } else { |
| | | _cell.$value = cell[item.cardValField] |
| | | _cell = {..._cell, ...cell} |
| | | |
| | | if (item.urlField) { |
| | | _cell.$url = cell[item.urlField] || '' |
| | | } else if (item.colorField) { |
| | | _cell.$color = cell[item.colorField] || '' |
| | | } |
| | | |
| | | if (map.has(_cell.ParentID + _cell.$value)) return |
| | | |
| | | map.set(_cell.ParentID + _cell.$value, 0) |