From c45a375e5b4ce0e33c7fc8a1aecdad67d60acc9e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 01 三月 2021 15:09:06 +0800
Subject: [PATCH] 2021-03-01

---
 src/templates/sharecomponent/actioncomponent/index.jsx |   48 ++++++++++++++++++++++++------------------------
 1 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/src/templates/sharecomponent/actioncomponent/index.jsx b/src/templates/sharecomponent/actioncomponent/index.jsx
index a42075a..37ef9f8 100644
--- a/src/templates/sharecomponent/actioncomponent/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/index.jsx
@@ -5,8 +5,7 @@
 import moment from 'moment'
 
 import Api from '@/api'
-import Utils from '@/utils/utils.js'
-import DevUtils from '@/utils/devutils.js'
+import Utils, { FuncUtils } from '@/utils/utils.js'
 import zhCN from '@/locales/zh-CN/model.js'
 import enUS from '@/locales/en-US/model.js'
 import { getActionForm } from '@/templates/zshare/formconfig'
@@ -35,7 +34,7 @@
   }
 
   state = {
-    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
+    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
     card: null,          // 缂栬緫涓厓绱�
     formlist: null,      // 琛ㄥ崟淇℃伅
     actionlist: null,    // 鎸夐挳缁�
@@ -154,7 +153,6 @@
     let ableField = usefulFields.join(', ')
     let functip = <div>
       <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p>
-      <p>{this.state.dict['model.tooltip.func.outface']}</p>
     </div>
 
     let menulist = []
@@ -264,12 +262,12 @@
       new Promise(resolve => {
         if (
           !card.originCard ||
-          (btn.OpenType === 'pop' && card.originCard.OpenType !== 'pop') ||
-          (['tab', 'blank'].includes(btn.OpenType) && !['tab', 'blank'].includes(card.originCard.OpenType)) ||
-          (btn.OpenType === 'popview' && (!btn.createTab || card.originCard.OpenType !== 'popview' || !card.originCard.linkTab))
+          (btn.OpenType !== card.originCard.OpenType) ||
+          (btn.OpenType === 'tab' && btn.tabTemplate !== 'FormTab') ||
+          (btn.OpenType === 'funcbutton' && btn.execMode !== 'pop')
         ) { // 鎸夐挳涓嶆槸澶嶅埗锛屾垨鎸夐挳鍓嶅悗绫诲瀷涓嶄竴鑷存椂锛岀洿鎺ヤ繚瀛�
           resolve('save')
-        } else if (btn.OpenType === 'pop' || btn.OpenType === 'tab' || btn.OpenType === 'blank') {
+        } else if (btn.OpenType === 'pop' || btn.OpenType === 'tab' || btn.execMode === 'pop') {
           resolve('subconf')
         } else if (btn.OpenType === 'popview') {
           resolve('subtab')
@@ -299,20 +297,21 @@
             }
           }
 
+          if (!_LongParam) return 'save'
+
           let _temp = '' // 閰嶇疆淇℃伅绫诲瀷
 
           // 淇敼妯℃�佹鏍囬鍚嶇О
-          if (btn.OpenType === 'pop' && _LongParam && _LongParam.type === 'Modal') {
+          if ((btn.OpenType === 'pop' || btn.execMode === 'pop') && _LongParam.type === 'Modal') {
             try {
               _LongParam.setting.title = btn.label
               _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_LongParam)))
               _temp = 'Modal'
             } catch {
               console.warn('Stringify Failure')
-              _LongParam = ''
               _temp = ''
             }
-          } else if (['tab', 'blank'].includes(btn.OpenType) && _LongParam && _LongParam.type === 'FormTab') {
+          } else if (btn.OpenType === 'tab' && _LongParam.type === 'FormTab') {
             try {
               _LongParam.action = _LongParam.action.map(_btn => {
                 _btn.uuid = Utils.getuuid()
@@ -330,7 +329,6 @@
               _temp = 'FormTab'
             } catch {
               console.warn('Stringify Failure')
-              _LongParam = ''
               _temp = ''
             }
           }
@@ -486,7 +484,7 @@
       _tab.action = _tab.action.map((item, index) => {
         let uuid = Utils.getuuid()
 
-        if (item.OpenType === 'pop') {
+        if (item.OpenType === 'pop' || item.execMode === 'pop') {
           _oriActions.push({
             prebtn: JSON.parse(JSON.stringify(item)),
             curuuid: uuid,
@@ -761,8 +759,8 @@
                 fields: fields,
                 menuNo: menu.MenuNo
               }
-              newLText = Utils.formatOptions(DevUtils.getfunc(_param, btn, menu, _config))
-              DelText = Utils.formatOptions(DevUtils.dropfunc(btn.innerFunc))
+              newLText = Utils.formatOptions(FuncUtils.getfunc(_param, btn, menu, _config))
+              DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
               resolve(true)
             } else {
               notification.warning({
@@ -779,8 +777,8 @@
               funcName: btn.innerFunc,
               menuNo: menu.MenuNo
             }
-            newLText = Utils.formatOptions(DevUtils.getexcelInfunc(_param, btn, menu))
-            DelText = Utils.formatOptions(DevUtils.dropfunc(btn.innerFunc))
+            newLText = Utils.formatOptions(FuncUtils.getexcelInfunc(_param, btn, menu))
+            DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
             resolve(true)
           } else {
             notification.warning({
@@ -795,8 +793,8 @@
             innerFunc: btn.innerFunc
           }
 
-          newLText = Utils.formatOptions(DevUtils.getTableFunc(_param, menu, _config)) // 鍒涘缓瀛樺偍杩囩▼sql
-          DelText = Utils.formatOptions(DevUtils.dropfunc(btn.innerFunc))
+          newLText = Utils.formatOptions(FuncUtils.getTableFunc(_param, menu, _config)) // 鍒涘缓瀛樺偍杩囩▼sql
+          DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
 
           resolve(true)
         } else {
@@ -806,8 +804,8 @@
             fields: '',
             menuNo: menu.MenuNo
           }
-          newLText = Utils.formatOptions(DevUtils.getfunc(_param, btn, menu, _config))
-          DelText = Utils.formatOptions(DevUtils.dropfunc(btn.innerFunc))
+          newLText = Utils.formatOptions(FuncUtils.getfunc(_param, btn, menu, _config))
+          DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
           resolve(true)
         }
       }).then(res => {
@@ -839,9 +837,10 @@
   /**
    * @description 鎸夐挳鍙屽嚮瑙﹀彂瀛愰厤缃�
    */
-  btnDoubleClick = (element) => {
-    if (!element.origin && (element.OpenType === 'pop' || element.OpenType === 'popview' || element.OpenType === 'blank' || (element.OpenType === 'tab' && element.tabTemplate === 'FormTab'))) {
-      this.props.setSubConfig(element)
+  btnDoubleClick = (el) => {
+    // execMode === 'pop' 涓� OpenType === 'funcbutton'
+    if (!el.origin && (el.OpenType === 'pop' || el.execMode === 'pop' || el.OpenType === 'popview' || (el.OpenType === 'tab' && el.tabTemplate === 'FormTab'))) {
+      this.props.setSubConfig(el)
     } else {
       notification.warning({
         top: 92,
@@ -886,6 +885,7 @@
         {/* 缂栬緫鎸夐挳锛氬鍒躲�佺紪杈� */}
         <Modal
           title={dict['model.action'] + '-' + (card && card.copyType === 'action' ? dict['model.copy'] : dict['model.edit'])}
+          wrapClassName="model-table-action-edit-modal"
           visible={visible}
           width={850}
           maskClosable={false}

--
Gitblit v1.8.0