| | |
| | | import PropTypes from 'prop-types' |
| | | import md5 from 'md5' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Table, Affix, Typography, Col } from 'antd' |
| | | import { Table, Typography, Col } from 'antd' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import MKEmitter from '@/utils/events.js' |
| | |
| | | const TabButton = asyncComponent(() => import('@/tabviews/zshare/actionList/tabbutton')) |
| | | const NewPageButton = asyncComponent(() => import('@/tabviews/zshare/actionList/newpagebutton')) |
| | | const Video = asyncComponent(() => import('@/components/video')) |
| | | const MkPicture = asyncComponent(() => import('@/components/mkPicture')) |
| | | |
| | | const PicRadio = { |
| | | '4:3': '75%', '3:2': '66.67%', '16:9': '56.25%', '2:1': '50%', '3:1': '33.33%', '4:1': '25%', |
| | |
| | | pickup: PropTypes.any, // 数据收起 |
| | | columns: PropTypes.array, // 表格列 |
| | | fields: PropTypes.array, // 组件字段集 |
| | | ContainerId: PropTypes.any, // 标签页外层Id |
| | | BData: PropTypes.any, // 主表数据 |
| | | data: PropTypes.any, // 表格数据 |
| | | total: PropTypes.any, // 总数 |
| | |
| | | let tabmenu = item.linkThdMenu |
| | | tabmenu.param = __param |
| | | |
| | | if (['linkage_navigation', 'linkage', 'menu_board'].includes(window.GLOB.navBar)) { |
| | | MKEmitter.emit('modifyTabs', tabmenu, 'replace') |
| | | } else { |
| | | MKEmitter.emit('modifyTabs', tabmenu, 'plus', true) |
| | | } |
| | | MKEmitter.emit('modifyTabs', tabmenu, true) |
| | | } else if (item.linkurl) { |
| | | let src = item.linkurl |
| | | |
| | |
| | | return ( |
| | | <div className="picture-col"> |
| | | {photos.map((url, i) => (<Col key={i} span={item.span || 24}> |
| | | <div |
| | | className={'mk-picture' + (scale ? ' image-scale' : '')} |
| | | onClick={(e) => { |
| | | if (!scale) return |
| | | |
| | | e.stopPropagation() |
| | | |
| | | MKEmitter.emit('mkImageScale', url, photos) |
| | | }} |
| | | style={{...style, backgroundImage: `url('${url}')`}} |
| | | ></div> |
| | | <MkPicture style={style} scale={scale} url={url} urls={photos}/> |
| | | </Col>))} |
| | | </div> |
| | | ) |
| | |
| | | BData={this.props.BData} |
| | | setting={this.props.setting} |
| | | columns={this.props.fields || this.props.columns} |
| | | ContainerId={this.props.ContainerId} |
| | | /> |
| | | ) |
| | | } else if (btn.OpenType === 'popview') { |
| | |
| | | btn={btn} |
| | | disabled={record.$disabled} |
| | | selectedData={[record]} |
| | | BID={record.$$BID} |
| | | BData={this.props.BData} |
| | | MenuID={this.props.MenuID} |
| | | setting={this.props.setting} |
| | | /> |
| | | ) |
| | | } else if (btn.OpenType === 'innerpage' || btn.OpenType === 'outerpage') { |
| | |
| | | disabled={record.$disabled} |
| | | selectedData={[record]} |
| | | BData={this.props.BData} |
| | | setting={this.props.setting} |
| | | /> |
| | | ) |
| | | } |
| | |
| | | } |
| | | |
| | | changedata = (index) => { |
| | | const { data, setting, tableId, ContainerId } = this.props |
| | | const { data, setting, tableId } = this.props |
| | | |
| | | if (!tableId || !ContainerId) return |
| | | if (!tableId || !setting.ContainerId) return |
| | | |
| | | let _id = '' |
| | | let _data = '' |
| | |
| | | _data = data[index] || '' |
| | | } |
| | | |
| | | MKEmitter.emit('changeTableLine', ContainerId, tableId, _id, _data) |
| | | MKEmitter.emit('changeTableLine', setting.ContainerId, tableId, _id, _data) |
| | | } |
| | | |
| | | resetTable = (id, repage) => { |
| | |
| | | |
| | | render() { |
| | | const { setting, pickup, statFValue } = this.props |
| | | const { selectedRowKeys, lineMarks, activeIndex, pageOptions } = this.state |
| | | const { selectedRowKeys, lineMarks, activeIndex, pageOptions, columns } = this.state |
| | | |
| | | let components = { |
| | | body: {} |
| | |
| | | selectedRowKeys, |
| | | type: (setting.tableType === 'radio') ? 'radio' : 'checkbox', |
| | | onChange: this.onSelectChange |
| | | } |
| | | } |
| | | |
| | | // 表格头部固定于顶部时,判断距顶部高度 |
| | | let offset = null |
| | | if (this.props.tableId === 'mainTable' && setting.columnfixed) { |
| | | if (!setting.actionfixed) { |
| | | offset = 48 |
| | | } else { |
| | | let box = document.getElementById(this.props.MenuID + 'mainaction') |
| | | if (box) { |
| | | offset = 48 + box.offsetHeight |
| | | } else { |
| | | offset = 105 |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | return ( |
| | | <div className={'normal-data-table mingke-table ' + (height ? 'fixed-height' : '')}> |
| | | {offset && <Affix offsetTop={offset} className="fix-header"> |
| | | <Table |
| | | size={setting.size || 'middle'} |
| | | style={style} |
| | | bordered={setting.bordered !== 'false'} |
| | | rowSelection={rowSelection} |
| | | columns={this.state.columns.map(column => { |
| | | return { |
| | | align: column.align, |
| | | dataIndex: column.dataIndex, |
| | | title: column.title, |
| | | width: column.width |
| | | } |
| | | })} |
| | | /> |
| | | </Affix>} |
| | | <div className={'normal-data-table mingke-table ' + (height ? 'fixed-height' : '') + ` table-col-${columns.length}`}> |
| | | <Table |
| | | components={components} |
| | | size={setting.size || 'middle'} |
| | | style={style} |
| | | bordered={setting.bordered !== 'false'} |
| | | rowSelection={rowSelection} |
| | | columns={this.state.columns} |
| | | columns={columns} |
| | | dataSource={_data} |
| | | rowClassName={(record) => { |
| | | let className = '' |