From bde2916433c7830e2879e6524e32b9f6c8bd0bab Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 02 一月 2022 16:31:32 +0800
Subject: [PATCH] 2022-01-02

---
 src/tabviews/subtable/index.jsx |   27 +++++++++++++++++++++------
 1 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx
index acb7ec1..31c67cd 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'
 
@@ -83,7 +84,7 @@
    * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅
    */
   async loadconfig () {
-    const { permAction, permMenus, Tab, BID, BData } = this.props
+    const { permAction, permMenus, Tab } = this.props
 
     let param = {
       func: 'sPC_Get_LongParam',
@@ -320,10 +321,18 @@
         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({
         pageSize: config.setting.pageSize || 10,
-        BID: BID || '',
-        BData: BData || '',
+        BID: this.props.BID || '',
+        BData: this.props.BData || '',
         loadingview: false,
         chartId,
         config,
@@ -337,7 +346,7 @@
         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()
         }
       })
@@ -631,6 +640,12 @@
           item.$$uuid = item[setting.primaryKey] || ''
           item.$$BID = BID || ''
           item.$Index = start + index + ''
+
+          if (setting.controlField) {
+            if (setting.controlVal.includes(item[setting.controlField])) {
+              item.$disabled = true
+            }
+          }
 
           return item
         }),
@@ -979,7 +994,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