From 76c4adc98ef8e7a3ea0f44d608363e3c0ddacf9b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 03 七月 2024 18:01:35 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/menu/debug/index.jsx |  103 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 101 insertions(+), 2 deletions(-)

diff --git a/src/menu/debug/index.jsx b/src/menu/debug/index.jsx
index be6eaec..91caad6 100644
--- a/src/menu/debug/index.jsx
+++ b/src/menu/debug/index.jsx
@@ -1,4 +1,4 @@
-import React, {Component} from 'react'
+import React, { Component } from 'react'
 import PropTypes from 'prop-types'
 import { fromJS } from 'immutable'
 import { Modal, Button, Drawer, Tooltip } from 'antd'
@@ -26,6 +26,7 @@
 
   sqlList = []
   verSqls = []
+  linkMain = null
 
   trigger = () => {
     let config = fromJS(this.props.config).toJS()
@@ -66,6 +67,7 @@
     }
 
     this.sqlList = []
+    this.linkMain = []
 
     let regs = [
       { reg: /@userName@/ig, value: `'User_Name'` },
@@ -137,8 +139,80 @@
     this.verSqls = sqls
     let that = this
 
+    let formErrors = []
+    if (this.linkMain.length) {
+      let map = new Map()
+      if (config.interfaces) {
+        config.interfaces.forEach(m => {
+          if (m.status !== 'true' || !m.columns) return false
+    
+          map.set(m.uuid, m.columns)
+        })
+      }
+
+      let forEachComs = (components) => {
+        components.forEach(item => {
+          if (item.type === 'tabs') {
+            item.subtabs.forEach(tab => {
+              forEachComs(tab.components)
+            })
+          } else if (item.type === 'group') {
+            forEachComs(item.components)
+          } else if (item.columns && item.columns.length) {
+            map.set(item.uuid, item.columns)
+          }
+        })
+      }
+
+      forEachComs(config.components)
+
+      this.linkMain.forEach(item => {
+        if (item.config.wrap && item.config.wrap.datatype === 'public') return
+
+        let supModule = ''
+        if (item.config.wrap && item.config.wrap.datatype === 'static') {
+          supModule = item.config.wrap.supModule ? item.config.wrap.supModule[item.config.wrap.supModule.length - 1] : ''
+        } else if (item.config.setting && item.config.setting.supModule) {
+          supModule = item.config.setting.supModule[item.config.setting.supModule.length - 1] || ''
+          if (supModule === 'empty') {
+            supModule = ''
+          }
+        }
+
+        if (!supModule) return
+
+        let cols = map.get(supModule)
+
+        if (!cols) {
+          formErrors.push(<div key={item.forms[0].uuid}>
+            缁勪欢<span style={{color: '#1890ff', margin: '0 2px 0 2px'}}>{item.config.name}{item.label ? '-' + item.label : ''}</span>涓〃鍗�<span style={{color: 'orange', margin: '0 2px 0 2px'}}>{item.forms.map(c => c.label + ' (' + c.field + ')').join('銆�')}</span>鏃犳晥
+          </div>)
+        } else {
+          let _forms = []
+          let _cols = cols.map(col => col.field.toLowerCase())
+
+          item.forms.forEach(m => {
+            if (_cols.includes(m.field.toLowerCase())) return
+
+            _forms.push(m.label + ' (' + m.field + ')')
+          })
+
+          if (_forms.length) {
+            formErrors.push(<div key={item.forms[0].uuid}>
+              缁勪欢<span style={{color: '#1890ff', margin: '0 2px 0 2px'}}>{item.config.name}{item.label ? '-' + item.label : ''}</span>涓〃鍗�<span style={{color: 'orange', margin: '0 2px 0 2px'}}>{_forms.join('銆�')}</span>鏃犳晥
+            </div>)
+          }
+        }
+      })
+    }
+
+    formErrors = formErrors.length ? formErrors : ''
+
     Modal.confirm({
-      content: `褰撳墠鑿滃崟鍏�${this.sqlList.length}涓粍浠讹紝${sqls.length}椤硅剼鏈渶瑕佹楠�${sqls.length > 20 ? '锛屾椂闂村ぇ姒傞渶瑕�' + parseInt(sqls.length / 2) + '绉�' : ''}銆俙,
+      content: <div style={{paddingLeft: '38px'}}>
+        {`褰撳墠鑿滃崟鍏�${this.sqlList.length}涓粍浠讹紝${sqls.length}椤硅剼鏈渶瑕佹楠�${sqls.length > 20 ? '锛屾椂闂村ぇ姒傞渶瑕�' + parseInt(sqls.length / 2) + '绉�' : ''}銆俙}
+        {formErrors}
+      </div>,
       onOk() {
         that.setState({visible: true, status: 'loading', sqlList: fromJS(sqls).toJS(), successIds: [], errorIds: [], errorMsg: {}, execId: ''}, () => {
           that.roopSql()
@@ -354,6 +428,18 @@
             if (!group.subButton.Ot) {
               group.subButton.Ot = item.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl'
             }
+
+            if (group.fields) {
+              let cells = group.fields.filter(cell => cell.type === 'linkMain')
+
+              if (cells.length) {
+                this.linkMain.push({
+                  config: item,
+                  forms: cells
+                })
+              }
+            }
+
             let res = this.resetButton(item, group.subButton, process, group)
 
             if (res) {
@@ -380,6 +466,19 @@
 
   resetButton = (item, cell, process, group, isback) => {
     let sql = ''
+    if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
+      if (cell.modal && cell.modal.fields.length) {
+        let cells = cell.modal.fields.filter(n => n.type === 'linkMain')
+  
+        if (cells.length) {
+          this.linkMain.push({
+            config: item,
+            forms: cells,
+            label: cell.label
+          })
+        }
+      }
+    }
     if (['exec', 'prompt', 'pop', 'form', 'formSubmit'].includes(cell.OpenType)) {
       if (cell.intertype === 'system' || cell.procMode === 'system') { // 绯荤粺鎺ュ彛
         if (item.subtype === 'dualdatacard' && isback) {

--
Gitblit v1.8.0