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/commontable/index.jsx |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index a330fc1..c11195d 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/index.jsx
@@ -2,7 +2,7 @@
 import PropTypes from 'prop-types'
 import {connect} from 'react-redux'
 import { is, fromJS } from 'immutable'
-import { notification, Spin, Tabs, Icon, Switch, Row, Col } from 'antd'
+import { notification, Spin, Tabs, Switch, Row, Col } from 'antd'
 
 import Api from '@/api'
 import zhCN from '@/locales/zh-CN/main.js'
@@ -13,6 +13,7 @@
 import { updateCommonTable } from '@/utils/utils-update.js'
 import asyncComponent from '@/utils/asyncComponent'
 import asyncSpinComponent from '@/utils/asyncSpinComponent'
+import MkIcon from '@/components/mk-icon'
 import MKEmitter from '@/utils/events.js'
 import NotFount from '@/components/404'
 import './index.scss'
@@ -399,6 +400,14 @@
         })
       }
 
+      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,
         loadingview: false,
@@ -731,8 +740,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
         }),
@@ -798,6 +814,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 {
@@ -955,7 +972,7 @@
   reloadview = () => {
     this.setState({ loadingview: true, viewlost: false, config: {}, setting: null,
       data: null, total: 0, loading: false, pageIndex: 1, shortcuts: null,
-      pageSize: 10, orderBy: '', search: '', BIDs: {}, pickup: false
+      pageSize: 10, orderBy: '', search: '', BIDs: {}, pickup: false, searchlist: null
     }, () => {
       this.loadconfig()
     })
@@ -1114,7 +1131,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 => {
@@ -1196,7 +1213,7 @@
               return (
                 <TabPane tab={
                   <span id={_tab.uuid}>
-                    {_tab.icon ? <Icon type={_tab.icon} /> : null}
+                    {_tab.icon ? <MkIcon type={_tab.icon} /> : null}
                     {_tab.label}
                   </span>
                 } key={_tab.uuid}>

--
Gitblit v1.8.0