From a6be5cfd9c6fb084af584b77f79100fe32b385c1 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 30 十一月 2023 16:20:54 +0800
Subject: [PATCH] 2023-11-30

---
 src/tabviews/custom/popview/index.jsx |   87 +++++++++++++++++++++++--------------------
 1 files changed, 46 insertions(+), 41 deletions(-)

diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx
index 0048ca1..eb22032 100644
--- a/src/tabviews/custom/popview/index.jsx
+++ b/src/tabviews/custom/popview/index.jsx
@@ -125,7 +125,7 @@
 
     if (Tab.$process && window.GLOB.UserCacheMap.has(Tab.$flowId)) {
       let flow = window.GLOB.UserCacheMap.get(Tab.$flowId)
-      regs.push({ reg: /@works_flow_code@/ig, value: flow.flow_code || '' })
+      regs.push({ reg: /@works_flow_code@/ig, value: `'${flow.flow_code || ''}'` })
     }
 
     config.components = this.filterComponent(config.components, roleId, balMap, param, Tab, Tab.uuid, Tab.uuid)
@@ -136,7 +136,7 @@
 
       if (param.$searchkey) {
         component.search = component.search.map(item => {
-          if (['text', 'select', 'link'].includes(item.type) && param.$searchkey === item.field) {
+          if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param.$searchkey === item.field) {
             item.initval = param.$searchval
           }
 
@@ -190,7 +190,7 @@
         delete item.style.shadowColor
       }
 
-      item.$menuname = (Tab.label || '') + '-' + (item.name || '')
+      item.$menuname = (Tab.logLabel || Tab.label || '') + '-' + (item.name || '')
 
       if (item.type === 'tabs') {
         if (
@@ -405,6 +405,10 @@
               col.linkThdMenu = ''
             }
 
+            if (col.marks && col.marks.length === 0) {
+              col.marks = null
+            }
+
             return true
           })
         }
@@ -504,25 +508,14 @@
       } else if (item.type === 'form') {
         item.subcards = item.subcards.map(group => {
           group.subButton.uuid = group.uuid
-          group.subButton.$menuId = group.uuid
-          group.subButton.$MenuID = Tab.$MenuID
           group.subButton.OpenType = 'formSubmit'
           group.subButton.execError = 'never'
-          group.subButton.logLabel = item.$menuname + '-' + group.subButton.label
-          group.subButton.$tabId = Tab.uuid
 
           if (!group.subButton.Ot) {
             group.subButton.Ot = item.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl'
           }
 
-          group.subButton.syncComponentId = group.subButton.syncComponent ? (group.subButton.syncComponent.pop() || '') : ''
-
-          if (group.subButton.syncComponentId && group.subButton.syncComponentId === item.setting.supModule) {
-            group.subButton.syncComponentId = ''
-            if (group.subButton.execSuccess === 'grid') {
-              group.subButton.execSuccess = 'mainline'
-            }
-          }
+          group.subButton = this.resetButton(item, group.subButton, Tab)
 
           group.fields = group.fields.map(cell => {
             // 鏁版嵁婧恠ql璇彞锛岄澶勭悊锛屾潈闄愰粦鍚嶅崟瀛楁璁剧疆涓洪殣钘忚〃鍗�
@@ -628,6 +621,30 @@
       }
     }
 
+    if (cell.verify && cell.verify.invalid === 'true') {
+      if (item.wrap && item.wrap.datatype === 'static') {
+        cell.verify.invalid = 'false'
+      } else if (item.setting && item.setting.maxScript && item.setting.maxScript >= 300) {
+        cell.verify.invalid = 'false'
+      } else if (cell.sqlType === 'insert') {
+        cell.verify.invalid = 'false'
+      } else if (cell.Ot === 'notRequired') {
+        cell.verify.invalid = 'false'
+      } else if (cell.intertype !== 'system' && cell.procMode !== 'system') {
+        cell.verify.invalid = 'false'
+      }
+    }
+
+    if (cell.verify && cell.verify.preHandle === 'true') {
+      try {
+        // eslint-disable-next-line
+        let func = new Function('btn', 'systemType', cell.verify.pre_func)
+        func(cell, window.GLOB.systemType)
+      } catch (e) {
+        console.warn(e)
+      }
+    }
+
     if (cell.syncComponentId) {
       if (cell.syncComponentId === item.setting.supModule) {
         cell.syncComponentId = ''
@@ -662,6 +679,10 @@
 
     if (cell.style.display === 'inline-block') {
       cell.style.verticalAlign = 'top'
+    }
+
+    if (cell.marks && cell.marks.length === 0) {
+      cell.marks = null
     }
 
     if (['text', 'number', 'formula'].includes(cell.eleType)) {
@@ -699,24 +720,6 @@
     return cell
   }
 
-  getPrinter = (item, parentId) => {
-    let _item = window.GLOB.UserCacheMap.get(parentId + item.uuid)
-
-    if (_item) {
-      item.printer = _item.printer || ''
-      item.verify.defaultPrinter = _item.printer || ''
-      if (item.verify.printerTypeList && _item.printerList) {
-        item.verify.printerTypeList = item.verify.printerTypeList.map(cell => {
-          cell.printer = _item.printerList[cell.Value] || ''
-
-          return cell
-        })
-      }
-    }
-
-    return item
-  }
-
   // 鏍煎紡鍖栭粯璁よ缃�
   formatSetting = (components, params, regs, balMap) => {
     let delay = 20
@@ -730,12 +733,8 @@
       } else if (component.type === 'group') {
         component.components = this.formatSetting(component.components, params, regs, balMap)
         return component
-      } else if (component.wrap && component.wrap.datatype === 'public') {
-        component.setting.useMSearch = false
-        component.setting.sync = 'false'
-
-        return component
-      } else if (component.wrap && component.wrap.datatype === 'static') {
+      } else if (component.wrap && (component.wrap.datatype === 'static' || component.wrap.datatype === 'public')) {
+        component.wrap.datatype = 'static'
         component.format = ''
         component.setting = component.setting || {}
         component.setting.useMSearch = false
@@ -748,6 +747,8 @@
 
       component.setting.arr_field = component.columns ? component.columns.map(col => col.field).join(',') : ''
       component.setting.useMSearch = component.setting.useMSearch === 'true'
+      component.setting.laypage = component.setting.laypage === 'true'   // 鏄惁鍒嗛〉锛岃浆涓篵oolean 缁熶竴鏍煎紡
+
       if (component.setting.useMSearch) {
         if (!window.GLOB.SearchBox.has(component.$searchId)) {
           component.setting.useMSearch = false
@@ -756,9 +757,14 @@
         }
       }
 
+      if (component.format === 'object') {
+        component.setting.laypage = false
+        component.setting.$top = true
+      }
+
       if (component.setting.interType !== 'system') { // 涓嶄娇鐢ㄧ郴缁熷嚱鏁版椂
         component.setting.sync = 'false'
-        component.setting.laypage = component.setting.laypage === 'true'
+        component.setting.dataresource = ''
         return component
       }
 
@@ -779,7 +785,6 @@
       delete component.scripts
       component.setting.$name = component.$menuname || ''
       component.setting.execute = component.setting.execute !== 'false'  // 榛樿sql鏄惁鎵ц锛岃浆涓篵oolean 缁熶竴鏍煎紡
-      component.setting.laypage = component.setting.laypage === 'true'   // 鏄惁鍒嗛〉锛岃浆涓篵oolean 缁熶竴鏍煎紡
 
       if (!component.setting.execute) {
         component.setting.dataresource = ''

--
Gitblit v1.8.0