| | |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | const { config, menu } = this.props |
| | | console.log(menu) |
| | | console.log(config) |
| | | |
| | | let _tabs = [] |
| | | let _select = [] |
| | | let _tabMap = new Map() |
| | |
| | | |
| | | try { |
| | | _columns = menu.LongParam.columns.filter(item => item.field && item.type !== 'colspan') |
| | | // config.groups.forEach(group => { |
| | | // if (group.isDefault) { |
| | | // _columns.push() |
| | | // } |
| | | // group.sublist |
| | | // }) |
| | | config.groups.forEach(group => { |
| | | if (group.isDefault) { |
| | | let list = group.sublist.filter(item => !item.origin) |
| | | _columns = [..._columns, ...list] |
| | | } else { |
| | | _columns = [..._columns, ...group.sublist] |
| | | } |
| | | }) |
| | | |
| | | let _colMap = new Map() |
| | | _columns = _columns.filter(item => { |
| | | if (_colMap.has(item.field)) { |
| | | return false |
| | | } else { |
| | | _colMap.set(item.field, true) |
| | | return true |
| | | } |
| | | }) |
| | | _interType = menu.LongParam.setting.interType |
| | | } catch { |
| | | notification.warning({ |
| | |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | values.actionfixed = values.actionfixed === 'true' |
| | | values.columnfixed = values.columnfixed === 'true' |
| | | |
| | | if (values.interType === 'inner' && !values.innerFunc && !values.dataresource) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请自定义函数或填写数据源!', |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | resolve(values) |
| | | } |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | | } |
| | |
| | | onChange = (e) => { |
| | | this.setState({ |
| | | interType: e.target.value |
| | | }) |
| | | } |
| | | |
| | | selectChange = (val) => { |
| | | this.props.form.setFieldsValue({ |
| | | order: `${val} desc` |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label="列数"> |
| | | {getFieldDecorator('cols', { |
| | | initialValue: setting.cols || '2' |
| | | })( |
| | | <Select> |
| | | <Select.Option value="1">1列</Select.Option> |
| | | <Select.Option value="2">2列</Select.Option> |
| | | <Select.Option value="3">3列</Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | |
| | | })( |
| | | <Select |
| | | getPopupContainer={() => document.getElementById('commontable-setting-form')} |
| | | onChange={this.selectChange} |
| | | > |
| | | <Select.Option key='unset' value="">不设置</Select.Option> |
| | | {columns.length === 0 ? |