From 0c439ced2c97905cb2b02f5f689a37b19369fb8a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 22 七月 2022 15:00:58 +0800
Subject: [PATCH] 2022-07-22

---
 src/tabviews/scriptmanage/actionList/index.jsx |   42 ++++++++++++++++--------------------------
 1 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/src/tabviews/scriptmanage/actionList/index.jsx b/src/tabviews/scriptmanage/actionList/index.jsx
index 83f24ac..6ddf524 100644
--- a/src/tabviews/scriptmanage/actionList/index.jsx
+++ b/src/tabviews/scriptmanage/actionList/index.jsx
@@ -2,28 +2,28 @@
 import PropTypes from 'prop-types'
 import moment from 'moment'
 import { Button, Modal, notification, message } from 'antd'
-import MutilForm from '@/tabviews/zshare/mutilform'
+
+import asyncSpinComponent from '@/utils/asyncSpinComponent'
 import options from '@/store/options.js'
 import Utils from '@/utils/utils.js'
 import Api from '@/api'
 import './index.scss'
 
 const { confirm } = Modal
+const MutilForm = asyncSpinComponent(() => import('@/tabviews/zshare/mutilform'))
 
 class MainAction extends Component {
   static propTpyes = {
     BID: PropTypes.string,            // 涓昏〃ID
     BData: PropTypes.any,             // 涓昏〃鏁版嵁
     Tab: PropTypes.any,               // 濡傛灉褰撳墠鍏冪礌涓烘爣绛炬椂锛宼ab涓烘爣绛句俊鎭�
-    type: PropTypes.string,           // 鍒ゆ柇褰撳墠涓轰富琛紙main锛夈�佸瓙琛紙sub锛夈�佸瓙琛ㄦ爣绛撅紙subtab锛�
     MenuID: PropTypes.string,         // 鑿滃崟ID
     actions: PropTypes.array,         // 鎸夐挳缁�
-    logcolumns: PropTypes.array,      // 鏄剧ず鍒�
     dict: PropTypes.object,           // 瀛楀吀椤�
     setting: PropTypes.any,           // 椤甸潰閫氱敤璁剧疆
     ContainerId: PropTypes.any,       // tab椤甸潰ID锛岀敤浜庡脊绐楁帶鍒�
     refreshdata: PropTypes.func,      // 鎵ц瀹屾垚鍚庢暟鎹埛鏂�
-    gettableselected: PropTypes.func  // 鑾峰彇琛ㄦ牸涓暟鎹�
+    selectedData: PropTypes.array     // 琛ㄦ牸閫変腑鏁版嵁
   }
 
   state = {
@@ -35,18 +35,14 @@
     configMap: {}
   }
 
-  refreshdata = (item, type) => {
-    this.props.refreshdata(item, type)
-  }
-  
   /**
    * @description 瑙﹀彂鎸夐挳鎿嶄綔
    */
   actionTrigger = (item, record) => {
-    const { setting } = this.props
+    const { setting, selectedData } = this.props
 
     let _this = this
-    let data = this.props.gettableselected() || []
+    let data = selectedData || []
     
     if (record) { // 琛ㄦ牸涓Е鍙戞寜閽�
       data = [record]
@@ -57,7 +53,7 @@
       notification.warning({
         top: 92,
         message: this.props.dict['main.action.confirm.selectline'],
-        duration: 10
+        duration: 5
       })
       return
     } else if (item.Ot === 'requiredSgl' && data.length !== 1) {
@@ -65,7 +61,7 @@
       notification.warning({
         top: 92,
         message: this.props.dict['main.action.confirm.selectSingleLine'],
-        duration: 10
+        duration: 5
       })
       return
     } else if (item.Ot !== 'notRequired' && !setting.primaryKey) {
@@ -73,7 +69,7 @@
       notification.warning({
         top: 92,
         message: '鏈缃富閿紒',
-        duration: 10
+        duration: 5
       })
       return
     }
@@ -126,8 +122,6 @@
       LText: values.LongParam
     }
 
-    param.LText = Utils.formatOptions(param.LText)
-
     if (btn.sqlType === 'delete') {
       param.LText = window.GLOB.appkey || ''
       param.Remark = ''
@@ -135,7 +129,7 @@
       param.func_param = ''
     }
     
-    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
+    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
     param.secretkey = Utils.encrypt(param.LText, param.timestamp)
 
     if (options.cloudServiceApi) {
@@ -181,7 +175,9 @@
       })
     }
 
-    this.refreshdata(btn, 'success')
+    if (btn.execSuccess !== 'never') {
+      this.props.refreshdata()
+    }
   }
 
   /**
@@ -199,20 +195,18 @@
       notification.error({
         top: 92,
         message: res.message || res.ErrMesg,
-        duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 15
+        duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 10
       })
     } else if (res.ErrCode === 'F') {
       notification.error({
         className: 'notification-custom-error',
         top: 92,
         message: res.message || res.ErrMesg,
-        duration: btn.verify && btn.verify.ftime ? btn.verify.ftime : 15
+        duration: btn.verify && btn.verify.ftime ? btn.verify.ftime : 10
       })
     } else if (res.ErrCode === 'NM') {
       message.error(res.message || res.ErrMesg)
     }
-    
-    this.refreshdata(btn, 'error')
   }
 
 
@@ -269,10 +263,6 @@
       }
     }
 
-    if (this.props.type === 'subtab') {
-      container = document.body
-    }
-
     return (
       <Modal
         title={title}
@@ -301,7 +291,7 @@
 
   render() {
     return (
-      <div className="button-list toolbar-button">
+      <div className="script-button-list script-toolbar-button">
         {this.props.actions.map((item, index) => {
           return (
             <Button

--
Gitblit v1.8.0