From 1a67732f77de8afd138b6e75235edcc4c0e9a166 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 16 一月 2020 23:29:57 +0800 Subject: [PATCH] 2020-01-16 --- src/tabviews/subtabtable/index.jsx | 38 ++++++++++++++++++++++++++++++-------- 1 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index 45d97cd..ebc4cf5 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -1,5 +1,6 @@ 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' @@ -13,7 +14,7 @@ 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 @@ -46,6 +47,8 @@ * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅 */ async loadconfig () { + const { permAction } = this.props + let param = { func: 'sPC_Get_LongParam', MenuID: this.props.MenuID @@ -85,6 +88,9 @@ 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) { @@ -117,16 +123,15 @@ } }) - // 娣诲姞鎿嶄綔鍒楋紙瀛樺湪鏃讹級锛堟湭缁忚繃鏉冮檺杩囨护锛� - 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, @@ -173,6 +178,11 @@ 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 } @@ -571,4 +581,16 @@ </div> ) } -} \ No newline at end of file +} + +const mapStateToProps = (state) => { + return { + permAction: state.permAction + } +} + +const mapDispatchToProps = () => { + return {} +} + +export default connect(mapStateToProps, mapDispatchToProps)(SubTabModalTable) \ No newline at end of file -- Gitblit v1.8.0