From 316877c1d9e5b6d92334f30b03d97d7e833cd934 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 02 二月 2021 16:01:57 +0800
Subject: [PATCH] 2021-02-02

---
 src/templates/subtableconfig/index.jsx |   36 ++++++++++++++++++++++++++++++------
 1 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx
index 3acb99e..7676116 100644
--- a/src/templates/subtableconfig/index.jsx
+++ b/src/templates/subtableconfig/index.jsx
@@ -11,7 +11,7 @@
 import zhCN from '@/locales/zh-CN/model.js'
 import enUS from '@/locales/en-US/model.js'
 import Utils from '@/utils/utils.js'
-import UtilsUpdate from '@/utils/utils-update.js'
+import { updateSubTable } from '@/utils/utils-update.js'
 
 import asyncComponent from '@/utils/asyncComponent'
 import SearchComponent from '@/templates/sharecomponent/searchcomponent'
@@ -106,7 +106,7 @@
     let _activeKey =  editSubTab ? editSubTab.activeKey : editTab.activeKey
 
     // 鐗堟湰鍏煎
-    _config = UtilsUpdate.updateSubTable(_config)
+    _config = updateSubTable(_config)
 
     this.setState({
       openEdition: editSubTab ? (editSubTab.open_edition || '') : (editTab.open_edition || ''),
@@ -195,7 +195,7 @@
     if (editSubTab) {
       _subconfig = tabConfig
       if (editTab.hasOwnProperty('OpenType')) {
-        _tabview = editTab.tabType
+        _tabview = editTab.tabType || 'SubTable'
       } else {
         _tabview = editTab.type
       }
@@ -669,7 +669,7 @@
         if (btn.OpenType === 'pop') {
           _view = 'Modal'             // 琛ㄥ崟椤甸潰
         } else if (btn.OpenType === 'popview') {
-          _view = btn.tabType        // 鏂板脊绐楁爣绛炬ā鏉�
+          _view = btn.tabType || 'SubTable' // 鏂板脊绐楁爣绛炬ā鏉� tabType 灞炴�у凡鍘婚櫎
           _subtab = btn
 
           if (editSubTab) {
@@ -816,8 +816,32 @@
       }
     })
 
-    if (config.setting.interType === 'system' && config.setting.default !== 'false' && !config.setting.dataresource) {
-      return '灏氭湭璁剧疆鏁版嵁婧愶紝涓嶅彲鍚敤锛�'
+    config.action && config.action.forEach((btn) => {
+      if (['prompt', 'exec', 'pop'].includes(btn.OpenType) && btn.Ot === 'required' && btn.verify && btn.verify.scripts && btn.verify.scripts.length > 0) {
+        let hascheck = false
+        btn.verify.scripts.forEach(item => {
+          if (item.status === 'false') return
+    
+          if (/\$check@|@check\$/ig.test(item.sql)) {
+            hascheck = true
+          }
+        })
+        if (hascheck) {
+          notification.warning({
+            top: 92,
+            message: `鍙�夋嫨澶氳鐨勬寜閽��${btn.label}銆嬩腑 $check@ 鎴� @check$ 灏嗕笉浼氱敓鏁堬紒`,
+            duration: 5
+          })
+        }
+      }
+    })
+
+    if ((config.setting.interType === 'system' || config.setting.requestMode === 'system') && config.setting.default === 'false' && config.setting.scripts && config.setting.scripts.filter(item => item.status !== 'false').length === 0) {
+      return '鏁版嵁婧愪腑涓嶆墽琛岄粯璁ql锛屼笖鏈坊鍔犺嚜瀹氫箟鑴氭湰锛屼笉鍙惎鐢紒'
+    } else if (config.setting.interType === 'custom' && config.setting.procMode !== 'inner' && config.setting.preScripts && config.setting.preScripts.filter(item => item.status !== 'false').length === 0) {
+      return '鏁版嵁婧愭湭璁剧疆鍓嶇疆鑴氭湰锛屼笉鍙惎鐢紒'
+    } else if (config.setting.interType === 'custom' && config.setting.callbackType === 'script' && config.setting.cbScripts && config.setting.cbScripts.filter(item => item.status !== 'false').length === 0) {
+      return '鏁版嵁婧愭湭璁剧疆鍥炶皟鑴氭湰锛屼笉鍙惎鐢紒'
     } else if (!config.setting.primaryKey) {
       return '灏氭湭璁剧疆涓婚敭锛屼笉鍙惎鐢紒'
     }  else if (config.columns.length === 0) {

--
Gitblit v1.8.0