From 31871ca836e6fcbea9b1c54e2ec15f49667bf093 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 23 十二月 2022 14:14:04 +0800
Subject: [PATCH] 2022-12-23

---
 src/utils/utils-custom.js |   64 +++++++++++++++++++++++++-------
 1 files changed, 50 insertions(+), 14 deletions(-)

diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js
index eb23ab6..35123de 100644
--- a/src/utils/utils-custom.js
+++ b/src/utils/utils-custom.js
@@ -623,6 +623,9 @@
         if (em) {
           item.setting.supModule = ''
         }
+        if (item.wrap && item.wrap.supModule) {
+          item.wrap.supModule = item.setting.supModule
+        }
       }
 
       if (item.wrap && item.wrap.doubleClick) {
@@ -830,19 +833,10 @@
     }
 
     if (item.setting && item.setting.supModule && item.setting.supModule[0] !== 'empty') {
-      let em = false
-      item.setting.supModule = item.setting.supModule.map(c => {
-        if (!uuids[c]) {
-          em = true
-        }
-        return uuids[c] || ''
-      })
-      if (em) {
-        item.setting.supModule = ''
-      }
-      if (item.wrap && item.wrap.supModule) {
-        item.wrap.supModule = item.setting.supModule
-      }
+      item.setting.supModule = ''
+    }
+    if (item.wrap && item.wrap.supModule) {
+      item.wrap.supModule = ''
     }
 
     if (item.wrap && item.wrap.doubleClick) {
@@ -878,6 +872,25 @@
 }
 
 /**
+ * @description 鑾峰彇鍥捐〃楂樺害
+ */
+export function getHeight (val) {
+  if (typeof(val) === 'string') {
+    if (val.indexOf('px') > -1) {
+      val = parseFloat(val)
+    } else if (val.indexOf('vw') > -1) {
+      val = parseFloat(val)
+      val = document.body.clientWidth * val / 100
+    } else if (val.indexOf('vh') > -1) {
+      val = parseFloat(val)
+      val = document.body.clientHeight * val / 100
+    }
+  }
+
+  return parseInt(val || 400) - 30
+}
+
+/**
  * @description 鑾峰彇琛ㄥ悕
  */
 export function getTables (config, pops) {
@@ -888,7 +901,7 @@
 
   if (config.setting && (!config.wrap || !config.wrap.datatype || config.wrap.datatype === 'dynamic')) {
     if (config.setting.interType === 'system') {
-      if (config.setting.execute !== 'false') {
+      if (config.setting.execute !== 'false' && config.setting.dataresource) {
         let tbs = config.setting.dataresource.match(cutreg)
         tbs && cuts.push(...tbs)
       }
@@ -930,6 +943,8 @@
         if (cell.eleType !== 'button') return
         if (['form', 'pop', 'prompt', 'exec', 'excelIn', 'excelOut'].includes(cell.OpenType)) {
           action.push(cell)
+        } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) {
+          action.push(cell)
         } else if (cell.OpenType === 'popview') {
           if (pops) {
             pops.push({...cell, parentId: config.uuid})
@@ -943,6 +958,8 @@
         item.backElements.forEach(cell => {
           if (cell.eleType !== 'button') return
           if (['form', 'pop', 'prompt', 'exec', 'excelIn', 'excelOut'].includes(cell.OpenType)) {
+            action.push(cell)
+          } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) {
             action.push(cell)
           } else if (cell.OpenType === 'popview') {
             if (pops) {
@@ -961,6 +978,8 @@
       col.elements.forEach(cell => {
         if (['form', 'pop', 'prompt', 'exec', 'excelIn', 'excelOut'].includes(cell.OpenType)) {
           action.push(cell)
+        } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) {
+          action.push(cell)
         } else if (cell.OpenType === 'popview') {
           if (pops) {
             pops.push({...cell, parentId: config.uuid})
@@ -976,6 +995,8 @@
     if (cell.eleType !== 'button') return
     if (['form', 'pop', 'prompt', 'exec', 'excelIn', 'excelOut'].includes(cell.OpenType)) {
       action.push(cell)
+    } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) {
+      action.push(cell)
     } else if (cell.OpenType === 'popview') {
       if (pops) {
         pops.push({...cell, parentId: config.uuid})
@@ -987,6 +1008,8 @@
 
   config.action && config.action.forEach(cell => {
     if (['pop', 'prompt', 'exec', 'excelIn', 'excelOut'].includes(cell.OpenType)) {
+      action.push(cell)
+    } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) {
       action.push(cell)
     } else if (cell.OpenType === 'popview') {
       if (pops) {
@@ -1013,6 +1036,19 @@
           tbs && cuts.push(...tbs)
         })
       }
+    } else if (btn.OpenType === 'funcbutton') {
+      if (btn.intertype !== 'system' || !btn.verify || !btn.verify.setting) return
+      if (btn.verify.dataType === 'custom') {
+        if (btn.verify.setting.defaultSql !== 'false') {
+          let tbs = btn.verify.setting.dataresource.match(cutreg)
+          tbs && cuts.push(...tbs)
+        }
+        btn.verify.scripts && btn.verify.scripts.forEach(script => {
+          if (script.status === 'false') return
+          let tbs = script.sql.match(cutreg)
+          tbs && cuts.push(...tbs)
+        })
+      }
     } else if (btn.OpenType === 'excelOut') {
       if (btn.intertype !== 'system' || !btn.verify) return
       if (btn.verify.dataType === 'custom') {

--
Gitblit v1.8.0