From d1f19b794216b37417e114b71c1cd7a2ac3d7748 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 02 三月 2023 01:14:29 +0800
Subject: [PATCH] 2023-03-02

---
 src/tabviews/zshare/mutilform/index.jsx |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx
index 3dc4393..445b601 100644
--- a/src/tabviews/zshare/mutilform/index.jsx
+++ b/src/tabviews/zshare/mutilform/index.jsx
@@ -41,6 +41,7 @@
 
   state = {
     formlist: [],    // 琛ㄥ崟椤�
+    ID: ''
   }
 
   record = {}
@@ -506,7 +507,7 @@
 
     this.record = record
 
-    this.setState({ formlist }, () => {
+    this.setState({ formlist, ID: this.props.data ? this.props.data.$$uuid || '' : '' }, () => {
       if (unload) return
       
       if (action.setting && action.setting.focus && fieldMap.has(action.setting.focus)) {
@@ -544,6 +545,10 @@
       if (item.database === 'sso') {
         let sql = _sso + item.base_sql
         _sso = ''
+
+        sql = sql.replace(/@ID@/ig, `'${this.state.ID || ''}'`)
+        sql = sql.replace(/@BID@/ig, `'${BID}'`)
+
         if (debug) {
           console.info(sql)
         }
@@ -551,6 +556,10 @@
       } else {
         let sql = _sql + item.base_sql
         _sql = ''
+
+        sql = sql.replace(/@ID@/ig, `'${this.state.ID || ''}'`)
+        sql = sql.replace(/@BID@/ig, `'${BID}'`)
+
         if (debug) {
           console.info(sql)
         }
@@ -564,8 +573,7 @@
       LText: localItems.join(' union all '),
       obj_name: '',
       arr_field: '',
-      table_type: 'Y',
-      BID: BID || ''
+      table_type: 'Y'
     }
 
     if (param.LText) {
@@ -599,8 +607,7 @@
       LText: mainItems.join(' union all '),
       obj_name: '',
       arr_field: '',
-      table_type: 'Y',
-      BID: BID || ''
+      table_type: 'Y'
     }
 
     if (mainparam.LText) {
@@ -660,10 +667,12 @@
         func: 'sPC_Get_SelectedList',
         LText: _sql + form.base_sql,
         obj_name: form.field,
-        arr_field: form.arr_field,
-        BID: this.props.BID || ''
+        arr_field: form.arr_field
       }
 
+      param.LText = param.LText.replace(/@ID@/ig, `'${this.state.ID || ''}'`)
+      param.LText = param.LText.replace(/@BID@/ig, `'${this.props.BID || ''}'`)
+
       if (debug) {
         console.info(param.LText)
       }

--
Gitblit v1.8.0