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 |   39 +++++++++++++++++++++++++++++++++------
 1 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx
index fd31261..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'
@@ -530,6 +530,10 @@
       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
       this.requestId = ''
@@ -653,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])) {
@@ -715,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 => {
@@ -803,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
@@ -951,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)
@@ -962,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)
@@ -1004,9 +1033,7 @@
 
     if (config.$searchId !== searchId) return
     
-    this.setState({pageIndex: 1}, () => {
-      this.reloadtable()
-    })
+    this.reloadtable()
   }
 
   render() {

--
Gitblit v1.8.0