| | |
| | | let _options = this.getOptions(openType, this.state.interType, value, pageTemplate, procMode, Ot) |
| | | let _fieldval = {} |
| | | |
| | | if (value === 'print') { |
| | | _fieldval.label = '打印' |
| | | } else if (value === 'closetab') { |
| | | _fieldval.label = '关闭' |
| | | } |
| | | |
| | | this.setState({ |
| | | formlist: this.state.formlist.map(item => { |
| | | item.hidden = !_options.includes(item.key) |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, initdata, BID } = this.props |
| | | const { data, initdata, BID, BData } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | |
| | | let _card = null |
| | |
| | | item.key = index |
| | | item.$$uuid = item[_config.setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = index + 1 + '' |
| | | return item |
| | | }) |
| | |
| | | sync: _sync, |
| | | data: _data, |
| | | BID: BID || '', |
| | | BData: BData || '', |
| | | config: _config, |
| | | card: _card, |
| | | search: Utils.initMainSearch(_config.search), |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { sync, config, BID, selected } = this.state |
| | | const { sync, config, BID, BData, selected } = this.state |
| | | |
| | | if (sync && !is(fromJS(this.props.data), fromJS(nextProps.data))) { |
| | | let _data = [] |
| | |
| | | item.key = index |
| | | item.$$uuid = item[config.setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = index + 1 + '' |
| | | return item |
| | | }) |
| | |
| | | sync: false, // 是否统一请求数据 |
| | | data: {}, // 数据 |
| | | timer: null, // 定时器时间间隔 |
| | | BData: null |
| | | BData: '' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, initdata, BID } = this.props |
| | | const { data, initdata, BID, BData } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | let _cols = new Map() |
| | | |
| | |
| | | |
| | | if (_data) { |
| | | _data.$$BID = BID || '' |
| | | _data.$$BData = BData || '' |
| | | } |
| | | |
| | | _config.columns.forEach(item => { |
| | |
| | | sync: _sync, |
| | | data: _data, |
| | | BID: BID || '', |
| | | BData: BData || '', |
| | | config: _config, |
| | | arr_field: _config.columns.map(col => col.field).join(','), |
| | | }, () => { |
| | |
| | | * @description 图表数据更新,刷新内容 |
| | | */ |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { sync, config, BID } = this.state |
| | | const { sync, config, BID, BData } = this.state |
| | | |
| | | if (sync && !is(fromJS(this.props.data), fromJS(nextProps.data))) { |
| | | let _data = {} |
| | |
| | | |
| | | if (_data) { |
| | | _data.$$BID = BID || '' |
| | | _data.$$BData = BData || '' |
| | | } |
| | | |
| | | this.setState({sync: false, data: _data}) |
| | |
| | | total: 0, // 总数 |
| | | sync: false, // 是否统一请求数据 |
| | | data: null, // 数据 |
| | | BData: null |
| | | BData: '' |
| | | } |
| | | |
| | | /** |
| | |
| | | * 1、 initdata 为打印时使用的数据集 |
| | | */ |
| | | UNSAFE_componentWillMount () { |
| | | const { data, initdata, BID } = this.props |
| | | const { data, initdata, BID, BData } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | let _cols = new Map() |
| | | |
| | |
| | | this.setState({ |
| | | sync: _sync, |
| | | BID: BID || '', |
| | | BData: BData || '', |
| | | data: _data, |
| | | config: _config, |
| | | search: Utils.initMainSearch(_config.search), |
| | |
| | | * @description 图表数据更新,刷新内容 |
| | | */ |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { sync, config, BID } = this.state |
| | | const { sync, config, BID, BData } = this.state |
| | | |
| | | if (sync && !is(fromJS(this.props.data), fromJS(nextProps.data))) { |
| | | let _data = [] |
| | |
| | | item.key = index |
| | | item.$$uuid = item[config.setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = index + 1 + '' |
| | | return item |
| | | }) |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, initdata, BID } = this.props |
| | | const { data, initdata, BID, BData } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | let _card = _config.subcards[0] |
| | | let _cols = new Map() |
| | |
| | | sync: _sync, |
| | | data: _data, |
| | | BID: BID || '', |
| | | BData: BData || '', |
| | | config: _config, |
| | | card: _card, |
| | | arr_field: _config.columns.map(col => col.field).join(','), |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { sync, config, BID } = this.state |
| | | const { sync, config, BID, BData } = this.state |
| | | |
| | | if (sync && !is(fromJS(this.props.data), fromJS(nextProps.data))) { |
| | | let _data = [] |
| | |
| | | item.key = index |
| | | item.$$uuid = item[config.setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = index + 1 |
| | | return item |
| | | }) |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, initdata, BID } = this.props |
| | | const { data, initdata, BID, BData } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | let _cols = new Map() |
| | | |
| | |
| | | |
| | | if (_data) { |
| | | _data.$$BID = BID || '' |
| | | _data.$$BData = BData || '' |
| | | } |
| | | |
| | | _config.columns.forEach(item => { |
| | |
| | | sync: _sync, |
| | | data: _data, |
| | | BID: BID || '', |
| | | BData: BData || '', |
| | | config: _config, |
| | | arr_field: _config.columns.map(col => col.field).join(','), |
| | | }, () => { |
| | |
| | | * @description 图表数据更新,刷新内容 |
| | | */ |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { sync, config, BID } = this.state |
| | | const { sync, config, BID, BData } = this.state |
| | | |
| | | if (sync && !is(fromJS(this.props.data), fromJS(nextProps.data))) { |
| | | let _data = {} |
| | |
| | | |
| | | if (_data) { |
| | | _data.$$BID = BID || '' |
| | | _data.$$BData = BData || '' |
| | | } |
| | | |
| | | this.setState({sync: false, data: _data}) |
| | |
| | | |
| | | return config.components.map(item => { |
| | | let _bid = BID || '' |
| | | let BData = '' |
| | | if (item.setting && item.setting.supModule) { |
| | | _bid = bids ? bids[item.setting.supModule] || '' : '' |
| | | BData = bids ? bids[item.setting.supModule + '_data'] || '' : '' |
| | | } |
| | | |
| | | if (item.type === 'bar' || item.type === 'line') { |
| | |
| | | } else if (item.type === 'carousel' && item.subtype === 'datacard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <CarouselDataCard config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> |
| | | <CarouselDataCard config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'carousel' && item.subtype === 'propcard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <CarouselPropCard config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> |
| | | <CarouselPropCard config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'card' && item.subtype === 'datacard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <DataCard config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> |
| | | <DataCard config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'card' && item.subtype === 'propcard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <PropCard config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> |
| | | <PropCard config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'table' && item.subtype === 'tablecard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <TableCard config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> |
| | | <TableCard config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'table' && item.subtype === 'normaltable') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <NormalTable config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} /> |
| | | <NormalTable config={item} data={data} BID={_bid} BData={BData} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'tree') { |
| | |
| | | |
| | | return config.components.map(item => { |
| | | let BID = this.props.BID || '' |
| | | let BData = '' |
| | | if (item.setting && item.setting.supModule) { |
| | | BID = bids[item.setting.supModule] || '' |
| | | BData = bids[item.setting.supModule + '_data'] || '' |
| | | } |
| | | |
| | | if (item.type === 'bar' || item.type === 'line') { |
| | |
| | | } else if (item.type === 'card' && item.subtype === 'datacard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <DataCard config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} /> |
| | | <DataCard config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'card' && item.subtype === 'propcard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <PropCard config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} /> |
| | | <PropCard config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'carousel' && item.subtype === 'datacard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <CarouselDataCard config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} /> |
| | | <CarouselDataCard config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'carousel' && item.subtype === 'propcard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <CarouselPropCard config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} /> |
| | | <CarouselPropCard config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'table' && item.subtype === 'tablecard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <TableCard config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} /> |
| | | <TableCard config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'table' && item.subtype === 'normaltable') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <NormalTable config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} /> |
| | | <NormalTable config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'group' && item.subtype === 'normalgroup') { |
| | |
| | | * 1、 initdata 为打印时使用的数据集 |
| | | */ |
| | | UNSAFE_componentWillMount () { |
| | | const { data, initdata, BID } = this.props |
| | | const { data, initdata, BID, BData } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | let _cols = new Map() |
| | | let _data = null |
| | |
| | | item.key = index |
| | | item.$$uuid = item[_config.setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = index + 1 + '' |
| | | return item |
| | | }) |
| | |
| | | |
| | | this.setState({ |
| | | BID: BID || '', |
| | | BData: BData || '', |
| | | title: _config.wrap.title, |
| | | sync: _sync, |
| | | data: _data, |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | const { sync, config, setting, BID } = this.state |
| | | const { sync, config, setting, BID, BData } = this.state |
| | | |
| | | if (sync && !is(fromJS(this.props.data), fromJS(nextProps.data))) { |
| | | let _data = [] |
| | |
| | | item.key = index |
| | | item.$$uuid = item[config.setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = index + 1 + '' |
| | | return item |
| | | }) |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { BID, setting, searchlist, actions, config, columns, selectedData } = this.state |
| | | const { BID, setting, searchlist, actions, config, columns, selectedData, BData } = this.state |
| | | |
| | | return ( |
| | | <div className="custom-normal-table" style={config.style}> |
| | |
| | | BID={BID} |
| | | setting={setting} |
| | | actions={actions} |
| | | BData={this.state.BData} |
| | | BData={BData} |
| | | columns={config.columns} |
| | | selectedData={selectedData} |
| | | /> |
| | |
| | | BID={BID} |
| | | setting={setting} |
| | | actions={actions} |
| | | BData={this.state.BData} |
| | | BData={BData} |
| | | columns={config.columns} |
| | | selectedData={selectedData} |
| | | /> |
| | |
| | | MKEmitter.removeListener('resetSelectLine', this.resetParentParam) |
| | | } |
| | | |
| | | resetParentParam = (MenuID, id) => { |
| | | resetParentParam = (MenuID, id, data) => { |
| | | const { parentIds, bids } = this.state |
| | | |
| | | if (!parentIds.includes(MenuID)) return |
| | | |
| | | this.setState({ |
| | | bids: {...bids, [MenuID]: id} |
| | | bids: {...bids, [MenuID]: id, [MenuID + '_data']: data} |
| | | }) |
| | | } |
| | | |
| | |
| | | * @description 显示模态框 |
| | | */ |
| | | getModels = () => { |
| | | const { setting, BID, btn } = this.props |
| | | const { setting, BID, btn, BData } = this.props |
| | | const { btnconfig, visible } = this.state |
| | | |
| | | if (!btnconfig || !btnconfig.setting) return null |
| | |
| | | action={btnconfig} |
| | | inputSubmit={this.handleOk} |
| | | data={this.state.tabledata[0]} |
| | | BData={this.props.BData} |
| | | BData={BData} |
| | | wrappedComponentRef={(inst) => this.formRef = inst} |
| | | /> |
| | | <div style={{ position: 'absolute', zIndex: 1, right: 0, bottom: 0, width: '100%', borderTop: '1px solid #e9e9e9', padding: '10px 16px', background: '#fff', textAlign: 'right'}}> |
| | |
| | | action={btnconfig} |
| | | inputSubmit={this.handleOk} |
| | | data={this.state.tabledata[0]} |
| | | BData={this.props.BData} |
| | | BData={BData} |
| | | wrappedComponentRef={(inst) => this.formRef = inst} |
| | | /> |
| | | </Modal> |
| | |
| | | style.fontSize = setting.fontSize |
| | | } |
| | | |
| | | let loading = this.props.loading |
| | | if (setting.mask === 'hidden') { |
| | | loading = false |
| | | } |
| | | |
| | | return ( |
| | | <div className={'normal-data-table mingke-table ' + (height ? 'fixed-height' : '')}> |
| | | {offset && <Affix offsetTop={offset} className="fix-header"> |
| | |
| | | |
| | | return className |
| | | }} |
| | | loading={this.props.loading} |
| | | loading={loading} |
| | | scroll={{ x: '100%', y: height }} |
| | | onRow={(record, index) => { |
| | | if (setting.tableMode === 'fast') { |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <Select dropdownClassName="print-template-setting" onChange={this.changeTemplate}> |
| | | <Select |
| | | showSearch |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | dropdownClassName="print-template-setting" |
| | | onChange={this.changeTemplate} |
| | | > |
| | | {this.state.templates.map((option, key) => |
| | | <Select.Option id={key} key={key} value={option.value}> |
| | | {option.text} |
| | |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="数据加载时,是否显示加载中的遮罩。"> |
| | | <Icon type="question-circle" /> |
| | | 遮罩 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('mask', { |
| | | initialValue: setting.mask || 'show' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="show">显示</Radio> |
| | | <Radio value="hidden">隐藏</Radio> |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="高级搜索弹窗的宽度,注:当宽度值小于100时表示占窗口的百分比,大于100时表示宽度的绝对值。"> |
| | | <Icon type="question-circle" /> |
| | | 高级搜索 |