| | |
| | | import { Icon, Card, Spin, Empty, Tabs } from 'antd' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncExcelComponent from './asyncButtonComponent' |
| | | import '@/assets/css/table.scss' |
| | | import './index.scss' |
| | | |
| | | const NormalButton = asyncComponent(() => import('@/tabviews/zshare/actionList/normalbutton')) |
| | | const PopupButton = asyncComponent(() => import('@/tabviews/zshare/actionList/popupbutton')) |
| | | const ExcelInButton = asyncExcelComponent(() => import('@/tabviews/zshare/actionList/excelInbutton')) |
| | | const ExcelOutButton = asyncExcelComponent(() => import('@/tabviews/zshare/actionList/exceloutbutton')) |
| | | const TabButton = asyncComponent(() => import('@/tabviews/zshare/actionList/tabbutton')) |
| | | const NewPageButton = asyncComponent(() => import('@/tabviews/zshare/actionList/newpagebutton')) |
| | | const ChangeUserButton = asyncComponent(() => import('@/tabviews/zshare/actionList/changeuserbutton')) |
| | |
| | | loading: PropTypes.bool, |
| | | data: PropTypes.array, |
| | | refreshdata: PropTypes.func, |
| | | getexceloutparam: PropTypes.func, |
| | | handleTableId: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | | card: null, |
| | | colMap: null, |
| | | selectKey: '' |
| | | selectKey: '', |
| | | actionList: null |
| | | } |
| | | |
| | | /** |
| | |
| | | let columns = fromJS(config.columns).toJS() |
| | | let actions = fromJS(config.action).toJS() |
| | | let insertAction = null |
| | | let actionList = [] |
| | | |
| | | columns.forEach(col => { |
| | | if (col.field) { |
| | |
| | | actionMap.set(item.uuid, item) |
| | | } else if (plot.insert === 'true' && !insertAction && item.OpenType === 'pop' && item.sqlType === 'insert' && item.Ot === 'notRequired') { |
| | | insertAction = item |
| | | } else if (plot.actions && plot.actions.length > 0 && plot.actions.includes(item.uuid) && (item.OpenType === 'excelOut' || (item.OpenType === 'excelIn' && item.Ot === 'notRequired'))) { |
| | | actionList.push(item) |
| | | } |
| | | }) |
| | | |
| | |
| | | |
| | | card.insertAction = insertAction // 添加卡片 |
| | | |
| | | this.setState({card: card, colMap: colMap}) |
| | | this.setState({card: card, colMap: colMap, actionList: actionList}) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | |
| | | |
| | | render() { |
| | | const { plot, data, loading, BID, BData, Tab, MenuID, config, logcolumns, ContainerId } = this.props |
| | | const { card, colMap, selectKey } = this.state |
| | | |
| | | const { card, colMap, selectKey, actionList } = this.state |
| | | |
| | | return ( |
| | | <div className="card-row-box mingke-table" ref={(ref) => this.cardRef = ref} style={!plot.title ? {paddingTop: '15px'} : null}> |
| | | {loading ? |
| | |
| | | <Spin /> |
| | | </div> : null |
| | | } |
| | | {plot.title ? <p className="chart-title">{plot.title}</p> : null} |
| | | <div> |
| | | {plot.title ? <p className="chart-title">{plot.title}</p> : null} |
| | | <div style={{float: 'right', marginRight: 10}}> |
| | | {actionList && actionList.map(action => { |
| | | if (action.OpenType === 'excelIn') { |
| | | return ( |
| | | <ExcelInButton |
| | | key={action.uuid} |
| | | BID={BID} |
| | | Tab={Tab} |
| | | btn={action} |
| | | show="icon" |
| | | setting={config.setting} |
| | | updateStatus={() => {}} |
| | | /> |
| | | ) |
| | | } else { |
| | | return ( |
| | | <ExcelOutButton |
| | | key={action.uuid} |
| | | BID={BID} |
| | | Tab={Tab} |
| | | btn={action} |
| | | show="icon" |
| | | setting={config.setting} |
| | | getexceloutparam={this.props.getexceloutparam} |
| | | updateStatus={() => {}} |
| | | /> |
| | | ) |
| | | } |
| | | })} |
| | | </div> |
| | | <div style={{clear: 'both'}}></div> |
| | | </div> |
| | | {plot.over !== 'roll' && data && data.length > 0 && |
| | | data.map((item, i) => ( |
| | | <CardCell |