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/subtable/index.jsx | 38 ++++++++++++++++++++++++++++++-------- 1 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index 03dd628..aed40e9 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/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, Modal, Button} from 'antd' import moment from 'moment' @@ -16,7 +17,7 @@ const SubTabTable = asyncComponent(() => import('@/tabviews/subtabtable')) -export default class SubTabViewTable extends Component { +class SubTabViewTable extends Component { static propTpyes = { Tab: PropTypes.object, // 鏍囩淇℃伅 BID: PropTypes.string, // 涓婄骇鏁版嵁ID @@ -64,6 +65,8 @@ * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅 */ async loadconfig () { + const { permAction } = this.props + console.log(permAction) let param = { func: 'sPC_Get_LongParam', MenuID: this.props.MenuID @@ -103,6 +106,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) { @@ -135,16 +141,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, @@ -191,6 +196,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 } @@ -643,4 +653,16 @@ </div> ) } -} \ No newline at end of file +} + +const mapStateToProps = (state) => { + return { + permAction: state.permAction + } +} + +const mapDispatchToProps = () => { + return {} +} + +export default connect(mapStateToProps, mapDispatchToProps)(SubTabViewTable) \ No newline at end of file -- Gitblit v1.8.0