| | |
| | | modules: [], |
| | | usefulFields: [], |
| | | useMSearch: this.props.setting.useMSearch || 'false', |
| | | supModule: this.props.setting.supModule || [] |
| | | supModule: this.props.setting.supModule || [], |
| | | appType: sessionStorage.getItem('appType') |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { appType } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | values.sync = values.sync || 'false' |
| | | |
| | | if (appType === 'mob' && values.useMSearch === 'true') { |
| | | values.syncRefresh = 'true' |
| | | } |
| | | |
| | | // 数据源前端验证 |
| | | if (values.interType === 'system' && values.execute !== 'false' && !values.dataresource) { |
| | | notification.warning({ |
| | |
| | | render() { |
| | | const { setting, columns, config } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { interType, modules, useMSearch, laypage, supModule, usefulFields } = this.state |
| | | const { interType, modules, useMSearch, laypage, supModule, usefulFields, appType } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!['navbar', 'balcony', 'menubar'].includes(config.type) && useMSearch === 'true' ? <Col span={8}> |
| | | {!['navbar', 'balcony', 'menubar'].includes(config.type) && useMSearch === 'true' && appType !== 'mob' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title={'外层搜索条件改变时,是否刷新当前组件数据。'}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | |
| | | } |
| | | |
| | | if (bid !== this.state.BID || bid !== '') { |
| | | this.setState({ BID: bid, BData: _data, pageIndex: 1 }, () => { |
| | | this.setState({ BID: bid, BData: _data, pageIndex: 1, supNodes }, () => { |
| | | this.loadData() |
| | | }) |
| | | } else { |
| | | this.setState({ supNodes }) |
| | | } |
| | | } else { |
| | | if (!config.setting.supModule || config.setting.supModule !== MenuID) return |
| | |
| | | exportExcel = (data) => { |
| | | const { btn } = this.props |
| | | |
| | | let columns = btn.verify.columns.filter(col => col.output !== 'false') |
| | | |
| | | try { |
| | | let imgCol = btn.verify.columns.filter(col => col.type === 'image')[0] |
| | | let imgCol = columns.filter(col => col.type === 'image')[0] |
| | | |
| | | if (imgCol) { |
| | | const column = btn.verify.columns.map(item => { |
| | | const column = columns.map(item => { |
| | | let col = { |
| | | title: item.Text, |
| | | key: item.Column, |
| | |
| | | |
| | | item.$Index = index + 1 + '' |
| | | |
| | | btn.verify.columns.forEach((col, i) => { |
| | | columns.forEach((col, i) => { |
| | | if (item[col.Column] && col.abs === 'true') { |
| | | _row[col.Column] = Math.abs(item[col.Column]) |
| | | } else { |
| | |
| | | let colwidth = [] |
| | | let abses = [] |
| | | |
| | | btn.verify.columns.forEach(col => { |
| | | columns.forEach(col => { |
| | | if (_topRow[col.Column]) return |
| | | |
| | | _header.push(col.Column) |
| | |
| | | min: 5, |
| | | max: 200, |
| | | editable: true, |
| | | width: '20%', |
| | | width: '14%', |
| | | render: (text) => text || 20 |
| | | }, |
| | | { |
| | | title: '类型', |
| | | dataIndex: 'type', |
| | | inputType: 'select', |
| | | inputType: 'radio', |
| | | editable: true, |
| | | required: false, |
| | | width: '20%', |
| | | width: '18%', |
| | | render: (text) => { |
| | | if (text === 'image') { |
| | | return '图片' |
| | |
| | | { |
| | | title: '取绝对值', |
| | | dataIndex: 'abs', |
| | | inputType: 'select', |
| | | inputType: 'radio', |
| | | editable: true, |
| | | required: false, |
| | | width: '20%', |
| | | width: '14%', |
| | | render: (text) => { |
| | | if (text === 'true') { |
| | | return '是' |
| | | } else { |
| | | return '否' |
| | | } |
| | | }, |
| | | options: [ |
| | | {value: 'true', text: '是'}, |
| | | {value: 'false', text: '否'} |
| | | ] |
| | | }, |
| | | { |
| | | title: '导出', |
| | | dataIndex: 'output', |
| | | inputType: 'radio', |
| | | editable: true, |
| | | required: false, |
| | | width: '14%', |
| | | render: (text) => { |
| | | if (text !== 'false') { |
| | | return '是' |
| | | } else { |
| | | return '否' |
| | |
| | | if (card.intertype !== 'system') { |
| | | _verify.enable = 'false' |
| | | } |
| | | if (_verify.columns[0] && !_verify.columns[0].type) { |
| | | if (_verify.columns[0] && (!_verify.columns[0].type || !_verify.columns[0].output)) { |
| | | _verify.columns = _verify.columns.map(col => { |
| | | col.type = col.type || 'text' |
| | | col.output = col.output || 'true' |
| | | return col |
| | | }) |
| | | } |
| | |
| | | } |
| | | values.uuid = Utils.getuuid() |
| | | values.abs = 'false' |
| | | values.output = 'true' |
| | | verify.columns.push(values) |
| | | |
| | | this.setState({ |
| | |
| | | Text: item.label, |
| | | Width: 20, |
| | | abs: 'false', |
| | | output: 'true', |
| | | type: 'text', |
| | | uuid: Utils.getuuid() |
| | | }) |
| | |
| | | Text: col.Text, |
| | | Width: 20, |
| | | abs: 'false', |
| | | output: 'true', |
| | | type: 'text', |
| | | } |
| | | |
| | |
| | | z-index: 1; |
| | | } |
| | | } |
| | | .modal-edit-table { |
| | | .ant-radio-group { |
| | | width: 50px; |
| | | } |
| | | } |
| | | } |
| | |
| | | ) |
| | | } else if (inputType === 'radio') { |
| | | return ( |
| | | <Radio.Group> |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}}> |
| | | {options.map((item, i) => (<Radio key={i} value={item.field || item.value}> {item.label || item.text} </Radio>))} |
| | | </Radio.Group> |
| | | ) |
| | |
| | | type: 'radio', |
| | | key: 'interception', |
| | | label: '截取空格', |
| | | initVal: card.interception || 'false', |
| | | initVal: card.interception || 'true', |
| | | tooltip: '提交时,是否截取首尾的空白字符。', |
| | | options: [{ |
| | | value: 'true', |