| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import {connect} from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import { notification, Spin} from 'antd' |
| | | import moment from 'moment' |
| | |
| | | import Utils from '@/utils/utils.js' |
| | | import './index.scss' |
| | | |
| | | export default class NormalTable extends Component { |
| | | class SubTabModalTable extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.string, // 上级数据ID |
| | | MenuID: PropTypes.string, // 菜单Id |
| | |
| | | * @description 获取页面配置信息 |
| | | */ |
| | | async loadconfig () { |
| | | const { permAction } = this.props |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: this.props.MenuID |
| | |
| | | let _hideCol = [] // 隐藏及合并列中字段的uuid集 |
| | | let colMap = new Map() |
| | | |
| | | // 权限过滤 |
| | | config.action = config.action.filter(item => permAction[item.uuid]) |
| | | |
| | | // 1、筛选字段集,2、过滤隐藏列及合并列中的字段uuid |
| | | config.columns.forEach(col => { |
| | | if (col.field) { |
| | |
| | | } |
| | | }) |
| | | |
| | | // 添加操作列(存在时)(未经过权限过滤) |
| | | if (config.gridBtn && config.gridBtn.display) { |
| | | let _actions = config.action.filter(item => item.position === 'toolbar') // 过滤工具栏按钮 |
| | | let _operations = config.action.filter(item => item.position === 'grid') // 添加操作列(存在时) |
| | | |
| | | if (config.gridBtn && config.gridBtn.display && _operations.length > 0) { |
| | | _columns.push({ |
| | | ...config.gridBtn, |
| | | operations: config.action.filter(item => item.position === 'grid') |
| | | operations: _operations |
| | | }) |
| | | } |
| | | |
| | | // 过滤工具栏按钮(未经过权限过滤) |
| | | let _actions = config.action.filter(item => item.position === 'toolbar') |
| | | |
| | | this.setState({ |
| | | loadingview: false, |
| | |
| | | |
| | | if (item.resourceType === '1' && item.dataSource) { |
| | | let arrfield = item.valueField + ',' + item.valueText |
| | | |
| | | if (item.valueField === item.valueText) { // value 与 text 字段相同时 |
| | | arrfield = item.valueField |
| | | } |
| | | |
| | | if (item.type === 'link') { |
| | | arrfield = arrfield + ',' + item.linkField |
| | | } |
| | |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | } |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | permAction: state.permAction |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = () => { |
| | | return {} |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(SubTabModalTable) |