From 21167ece56edd628e6f6546d1d642947cc3a048f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 12 八月 2024 22:17:33 +0800
Subject: [PATCH] 2024-08-12

---
 src/tabviews/custom/components/table/normal-table/index.jsx |   53 +++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 45 insertions(+), 8 deletions(-)

diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx
index fe39799..12f76e9 100644
--- a/src/tabviews/custom/components/table/normal-table/index.jsx
+++ b/src/tabviews/custom/components/table/normal-table/index.jsx
@@ -1,7 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { Collapse } from 'antd'
+import { Collapse, notification } from 'antd'
 import moment from 'moment'
 
 import Api from '@/api'
@@ -432,8 +432,18 @@
 
       if (col.supField) {
         names = []
-        if (BData && BData[col.supField]) {
-          names = BData[col.supField].split(',')
+        let val = ''
+        if (BData) {
+          let field = col.supField.toLowerCase()
+          Object.keys(BData).forEach(key => {
+            if (key.toLowerCase() === field) {
+              val = BData[key] + ''
+            }
+          })
+        }
+
+        if (val) {
+          names = val.split(',')
 
           if (names.length > fields.length) {
             names.length = fields.length
@@ -519,6 +529,10 @@
       reset && MKEmitter.emit('resetTable', config.uuid, 'true') // 鍒楄〃閲嶇疆
       if (setting.$hasSyncModule) {
         MKEmitter.emit('syncBalconyData', config.uuid, [], false)
+      }
+      if (config.$hasTopModule) {
+        window.GLOB.CacheData.set(config.uuid + 'tb', { $$empty: true, $$uuid: '' })
+        MKEmitter.emit('mkPublicData', config.uuid + 'tb', { $$empty: true, $$uuid: '' })
       }
 
       this.loaded = true
@@ -643,6 +657,11 @@
         loading: false
       })
 
+      if (config.$hasTopModule) {
+        window.GLOB.CacheData.set(config.uuid + 'tb', data[0] || { $$empty: true, $$uuid: '' })
+        MKEmitter.emit('mkPublicData', config.uuid + 'tb', data[0] || { $$empty: true, $$uuid: '' })
+      }
+      
       if (config.timer && config.clearField && result.data && result.data[0]) {
         let vals = (config.clearValue || '').split(',')
         if (vals.includes(result.data[0][config.clearField])) {
@@ -705,6 +724,12 @@
         _data.$$uuid = _data[setting.primaryKey] || ''
         _data.$$BID = BID || ''
         _data.$$BData = BData || ''
+
+        if (setting.controlField) {
+          if (setting.controlVal.includes(_data[setting.controlField] + '')) {
+            _data.$disabled = true
+          }
+        }
   
         if (config.absFields) {
           config.absFields.forEach(f => {
@@ -793,6 +818,20 @@
    * 鍚湁鍒濆涓嶅姞杞界殑椤甸潰锛屼慨鏀硅缃�
    */
   refreshbysearch = (searches) => {
+    const { setting, BID } = this.state
+
+    if (setting.supModule && !BID && setting.supKey !== 'false') {
+      notification.warning({
+        top: 92,
+        message: window.GLOB.dict['sup_key_req'] || '闇�瑕佷笂绾т富閿�硷紒',
+        duration: 5
+      })
+      this.setState({
+        search: searches
+      })
+      return
+    }
+
     this.setState({
       pageIndex: 1,
       search: searches
@@ -941,7 +980,7 @@
         })
       } else {
         if (position === 'line' || position === 'line_grid') {
-          if (lines && lines.length === 1) {
+          if (lines && lines.length === 1 && !config.forbidLine) {
             this.loadLinedata(lines[0].$$uuid, position)
           } else {
             this.reloadtable(btn, id)
@@ -952,7 +991,7 @@
       }
     } else {
       if (position === 'line' || position === 'line_grid') {
-        if (lines && lines.length === 1) {
+        if (lines && lines.length === 1 && !config.forbidLine) {
           this.loadLinedata(lines[0].$$uuid, position)
         } else {
           this.reloadtable(btn, id)
@@ -994,9 +1033,7 @@
 
     if (config.$searchId !== searchId) return
     
-    this.setState({pageIndex: 1}, () => {
-      this.reloadtable()
-    })
+    this.reloadtable()
   }
 
   render() {

--
Gitblit v1.8.0