From 46f79b491173d284a4900d19e7aecf7509481438 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 21 一月 2022 17:21:25 +0800 Subject: [PATCH] 2022-01-21 --- src/tabviews/subtable/index.jsx | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index 6067557..d872d45 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -2,7 +2,7 @@ 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' @@ -13,6 +13,7 @@ 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' @@ -318,6 +319,14 @@ config.setting.selected = 'false' } else if (config.setting.selected === 'init' && config.setting.onload === 'false') { 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({ @@ -629,8 +638,15 @@ } item.key = index item.$$uuid = item[setting.primaryKey] || '' + item.$$key = '' + item.key + item.$$uuid item.$$BID = BID || '' item.$Index = start + index + '' + + if (setting.controlField) { + if (setting.controlVal.includes(item[setting.controlField])) { + item.$disabled = true + } + } return item }), @@ -694,6 +710,7 @@ data = data.map(item => { if (item.$$uuid === _data.$$uuid) { _data.key = item.key + _data.$$key = '' + item.key + item.$$uuid _data.$Index = item.$Index return _data } else { @@ -979,7 +996,7 @@ {/* 瑙嗗浘缁� */} {!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 => { -- Gitblit v1.8.0