| | |
| | | import PropTypes from 'prop-types' |
| | | import {connect} from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import { notification, Spin, Switch, Row, Col, Icon, Tabs} from 'antd' |
| | | import { notification, Spin, Switch, Row, Col, Tabs} from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | |
| | | import { updateSubTable } from '@/utils/utils-update.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncSpinComponent from '@/utils/asyncSpinComponent' |
| | | import MkIcon from '@/components/mk-icon' |
| | | import NotFount from '@/components/404' |
| | | import MKEmitter from '@/utils/events.js' |
| | | |
| | |
| | | * @description 获取页面配置信息 |
| | | */ |
| | | async loadconfig () { |
| | | const { permAction, permMenus, Tab, BID, BData } = this.props |
| | | const { permAction, permMenus, Tab } = this.props |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_LongParam', |
| | |
| | | config.setting.selected = 'false' |
| | | } |
| | | |
| | | if (config.setting.controlField) { |
| | | if (config.setting.controlVal) { |
| | | config.setting.controlVal = config.setting.controlVal.split(',') |
| | | } else { |
| | | config.setting.controlVal = [''] |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | BID: BID || '', |
| | | BData: BData || '', |
| | | pageSize: config.setting.pageSize || 10, |
| | | BID: this.props.BID || '', |
| | | BData: this.props.BData || '', |
| | | loadingview: false, |
| | | chartId, |
| | | config, |
| | |
| | | search: Utils.initMainSearch(config.search), |
| | | hasReqFields |
| | | }, () => { |
| | | if (config.setting.onload !== 'false' && (!Tab.supMenu || BID || Tab.isTreeNode)) { // 初始化可加载 |
| | | if (config.setting.onload !== 'false' && (!Tab.supMenu || this.props.BID || Tab.isTreeNode)) { // 初始化可加载 |
| | | this.loadData() |
| | | } |
| | | }) |
| | |
| | | item.$$BID = BID || '' |
| | | item.$Index = start + index + '' |
| | | |
| | | if (setting.controlField) { |
| | | if (setting.controlVal.includes(item[setting.controlField])) { |
| | | item.$disabled = true |
| | | } |
| | | } |
| | | |
| | | return item |
| | | }), |
| | | total: result.total, |
| | |
| | | * @param {*} position // 刷新位置 |
| | | * @param {*} btn // 执行的按钮 |
| | | */ |
| | | refreshByButtonResult = (menuId, position, btn) => { |
| | | refreshByButtonResult = (menuId, position, btn, id, lines) => { |
| | | const { MenuID } = this.props |
| | | |
| | | if (MenuID !== menuId) return |
| | |
| | | const { Tab, SupMenuID } = this.props |
| | | const { BID } = this.state |
| | | |
| | | if (position === 'grid' || position === 'view') { |
| | | if (position === 'line' && lines && lines.length === 1) { |
| | | this.loadmainLinedata(lines[0].$$uuid) |
| | | } else if (position === 'grid' || position === 'view') { |
| | | this.reloadtable(btn) |
| | | } else if (position === 'maingrid' || position === 'mainline') { |
| | | this.reloadtable(btn) |
| | |
| | | |
| | | changeTableLine = (ContainerId, tableId, id, data) => { |
| | | const { Tab } = this.props |
| | | const { setting } = this.state |
| | | |
| | | if (!Tab.supMenu || tableId !== Tab.supMenu) return |
| | | |
| | | this.setState({BData: data, BID: id}) |
| | | |
| | | if (!setting) return |
| | | |
| | | if (id !== this.state.BID || id !== '') { |
| | | MKEmitter.emit('resetTable', this.props.Tab.uuid) // 列表重置 |
| | |
| | | {/* 视图组 */} |
| | | {!config.expand ? <Tabs activeKey={chartId} onChange={this.changeChart}> |
| | | {config.charts.map(item => ( |
| | | <TabPane tab={<Icon type={item.icon} />} key={item.uuid}></TabPane> |
| | | <TabPane tab={<MkIcon type={item.icon} />} key={item.uuid}></TabPane> |
| | | ))} |
| | | </Tabs> : null} |
| | | {config.charts.map(item => { |