| | |
| | | import md5 from 'md5' |
| | | import { connect } from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Table, Typography, Icon, Col, Switch } from 'antd' |
| | | import { Table, Typography, Icon, Col, Switch, message } from 'antd' |
| | | |
| | | import { modifyTabview } from '@/store/action' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | try { |
| | | originVal = parseFloat(originVal) |
| | | contrastVal = parseFloat(contrastVal) |
| | | } catch { |
| | | } catch (e) { |
| | | originVal = NaN |
| | | } |
| | | |
| | |
| | | try { |
| | | originVal = parseFloat(originVal) |
| | | contrastVal = parseFloat(contrastVal) |
| | | } catch { |
| | | } catch (e) { |
| | | originVal = NaN |
| | | } |
| | | |
| | |
| | | try { |
| | | originVal = parseFloat(originVal) |
| | | contrastVal = parseFloat(contrastVal) |
| | | } catch { |
| | | } catch (e) { |
| | | originVal = NaN |
| | | } |
| | | |
| | |
| | | try { |
| | | originVal = parseFloat(originVal) |
| | | contrastVal = parseFloat(contrastVal) |
| | | } catch { |
| | | } catch (e) { |
| | | originVal = NaN |
| | | } |
| | | |
| | |
| | | if (isNaN(content)) { |
| | | content = '' |
| | | } |
| | | } catch { |
| | | } catch (e) { |
| | | content = '' |
| | | } |
| | | |
| | |
| | | |
| | | let cols = 24 / (col.picSort || 1) |
| | | let paddingTop = '100%' |
| | | let scale = col.scale === 'true' |
| | | |
| | | if (PicRadio[col.lenWidRadio]) { |
| | | paddingTop = PicRadio[col.lenWidRadio] |
| | |
| | | |
| | | resProps.children = ( |
| | | <div> |
| | | {photos.map((url, i) => ( |
| | | {photos && photos.map((url, i) => ( |
| | | <Col key={i} span={cols}> |
| | | <div className="ant-mk-picture" style={{paddingTop, backgroundImage: `url('${url}')`}}></div> |
| | | <div className={'ant-mk-picture' + (scale ? ' scale' : '')} onClick={() => { |
| | | if (!scale) return |
| | | MKEmitter.emit('mkImageScale', url, photos) |
| | | }} style={{paddingTop, backgroundImage: `url('${url}')`}}></div> |
| | | </Col> |
| | | ))} |
| | | </div> |
| | |
| | | |
| | | try { |
| | | _param = window.btoa(_quary) |
| | | } catch { |
| | | } catch (e) { |
| | | _param = window.btoa(window.encodeURIComponent(_quary)) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('mkCheckTopLine', this.mkCheckTopLine) |
| | | MKEmitter.addListener('mkCheckAll', this.mkCheckAll) |
| | | MKEmitter.addListener('resetTable', this.resetTable) |
| | | } |
| | | |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('mkCheckTopLine', this.mkCheckTopLine) |
| | | MKEmitter.removeListener('mkCheckAll', this.mkCheckAll) |
| | | MKEmitter.removeListener('resetTable', this.resetTable) |
| | | } |
| | | |
| | | mkCheckTopLine = (menuId) => { |
| | | const { MenuID, data, setting } = this.props |
| | | |
| | | if (MenuID !== menuId || !data || data.length === 0) return |
| | | |
| | | this.changedata(0) |
| | | this.setState({ selectedRowKeys: [0], activeIndex: 0 }) |
| | | this.props.chgSelectData([data[0]]) |
| | | |
| | | if (setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', MenuID, [data[0]], data.length === 1) |
| | | } |
| | | } |
| | | |
| | | mkCheckAll = (menuId, checked) => { |
| | | const { MenuID, data } = this.props |
| | | |
| | | if (MenuID !== menuId) return |
| | | |
| | | if (checked) { |
| | | this.setState({ |
| | | activeIndex: '', |
| | | selectedRowKeys: data.map((item, index) => index) |
| | | }) |
| | | |
| | | this.props.chgSelectData(data) |
| | | |
| | | MKEmitter.emit('resetSelectLine', MenuID, '', '') |
| | | MKEmitter.emit('syncBalconyData', MenuID, data, data.length > 0) |
| | | if (data.length === 0) { |
| | | message.warning('未获取到数据!') |
| | | } |
| | | } else { |
| | | this.setState({ |
| | | activeIndex: '', |
| | | selectedRowKeys: [], |
| | | }) |
| | | |
| | | this.props.chgSelectData([]) |
| | | |
| | | MKEmitter.emit('resetSelectLine', MenuID, '', '') |
| | | MKEmitter.emit('syncBalconyData', MenuID, [], false) |
| | | } |
| | | } |
| | | |
| | | // 字段透视 |
| | |
| | | _param.User_Name = sessionStorage.getItem('User_Name') |
| | | _param.param = __param |
| | | src = _url + window.btoa(window.encodeURIComponent(JSON.stringify(_param))) |
| | | } catch { |
| | | } catch (e) { |
| | | console.warn('菜单参数解析错误!') |
| | | } |
| | | } else { |
| | |
| | | * |
| | | */ |
| | | onSelectChange = selectedRowKeys => { |
| | | const { setting } = this.props |
| | | const { setting, MenuID, data } = this.props |
| | | |
| | | let index = '' |
| | | let _activeIndex = null |
| | |
| | | let selects = this.props.data.filter((item, _index) => selectedRowKeys.includes(_index)) |
| | | |
| | | this.props.chgSelectData(selects) |
| | | if (setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', MenuID, selects, data.length === selects.length) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 点击整行,触发切换, 判断是否可选,单选或多选,进行对应操作 |
| | | */ |
| | | changeRow = (record, index) => { |
| | | const { setting } = this.props |
| | | const { setting, MenuID, data } = this.props |
| | | |
| | | if (!setting.tableType || this.state.pickup) return |
| | | |
| | |
| | | let selects = this.props.data.filter((item, _index) => newkeys.includes(_index)) |
| | | |
| | | this.props.chgSelectData(selects) |
| | | |
| | | if (setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', MenuID, selects, data.length === selects.length) |
| | | } |
| | | } |
| | | |
| | | changeTable = (pagination, filters, sorter) => { |
| | |
| | | _footer = statFValue.map(f => `${f.label}(合计):${f.value}`).join(';') |
| | | } |
| | | |
| | | let height = setting.height || false |
| | | |
| | | return ( |
| | | <div className={`normal-custom-table ${setting.tableHeader || ''} ${setting.mode || ''}`} id={tableId}> |
| | | <div className={`normal-custom-table ${setting.tableHeader || ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''}`} id={tableId}> |
| | | {(setting.tableType === 'radio' || setting.tableType === 'checkbox') && data && data.length > 0 ? |
| | | <Switch title="收起" className="main-pickup" checkedChildren="开" unCheckedChildren="关" checked={pickup} onChange={this.pickupChange} /> : null |
| | | } |
| | |
| | | columns={this.state.columns} |
| | | dataSource={_data} |
| | | loading={this.props.loading} |
| | | scroll={{ x: '100%', y: false }} |
| | | scroll={{ x: '100%', y: height }} |
| | | onRow={(record, index) => { |
| | | return { |
| | | lineMarks, |