| | |
| | | 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)) |
| | | } |
| | | |
| | |
| | | ) |
| | | } else if (col.type === 'custom') { |
| | | style.padding = '0px' |
| | | if (col.style) { |
| | | style = {...style, ...col.style} |
| | | } |
| | | |
| | | resProps.children = ( |
| | | <CardCellComponent data={record} cards={config} elements={col.elements}/> |
| | | ) |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('mkCheckAll', this.mkCheckAll) |
| | | MKEmitter.addListener('resetTable', this.resetTable) |
| | | } |
| | | |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('mkCheckAll', this.mkCheckAll) |
| | | MKEmitter.removeListener('resetTable', this.resetTable) |
| | | } |
| | | |
| | | 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) => { |