From 342d3498191f1683059fe586209ec920545e0bf9 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 28 九月 2021 13:38:09 +0800
Subject: [PATCH] 2021-09-28

---
 src/tabviews/zshare/actionList/printbutton/index.jsx |   38 +++++++++++++-------------------------
 1 files changed, 13 insertions(+), 25 deletions(-)

diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx
index ec7be3e..ffed630 100644
--- a/src/tabviews/zshare/actionList/printbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -91,21 +91,6 @@
     }
     MKEmitter.removeListener('triggerBtnId', this.actionTrigger)
   }
-
-  /**
-   * @description 鎸夐挳鐘舵�佹敼鍙�
-   */
-  updateStatus = (type) => {
-    if (type === 'start') {
-      this.setState({
-        loading: true
-      })
-    } else if (type === 'over') {
-      this.setState({
-        loading: false
-      })
-    }
-  }
   
   /**
    * @description 瑙﹀彂鎸夐挳鎿嶄綔
@@ -166,27 +151,27 @@
     }
 
     if (btn.execMode === 'pop') {
-      this.updateStatus('start')
       let modal = this.state.btnconfig
       if (!modal && btn.modal) {
         modal = this.handleModelConfig(btn.modal)
       }
 
       this.setState({
+        loading: true,
         tabledata: data,
         btnconfig: modal
       }, () => {
         this.improveAction()
       })
     } else if (btn.execMode === 'prompt') {
-      this.updateStatus('start')
+      this.setState({ loading: true })
       confirm({
         title: this.state.dict['main.action.confirm.tip'],
         onOk() {
           _this.triggerPrint(data)
         },
         onCancel() {
-          _this.updateStatus('over')
+          _this.setState({ loading: false })
         }
       })
     } else {
@@ -1348,14 +1333,14 @@
             message: res.message,
             duration: 5
           })
-          this.updateStatus('over')
+          this.setState({ loading: false })
         } else if (!_LongParam || (btn.execMode === 'pop' && _LongParam.type !== 'Modal')) {
           notification.warning({
             top: 92,
             message: '鏈幏鍙栧埌鎸夐挳閰嶇疆淇℃伅锛�',
             duration: 5
           })
-          this.updateStatus('over')
+          this.setState({ loading: false })
         } else {
           _LongParam = updateForm(_LongParam)
           _LongParam = this.handleModelConfig(_LongParam)
@@ -1380,10 +1365,13 @@
    * @description 妯℃�佹锛堣〃鍗曪級锛岀‘璁�
    */
   handleOk = () => {
+    const { btnconfig } = this.state
     this.formRef.handleConfirm().then(res => {
-      this.setState({
-        visible: false
-      })
+      if (btnconfig.setting.finish !== 'unclose') {
+        this.setState({
+          visible: false
+        })
+      }
       this.triggerPrint(this.state.tabledata, res)
     })
   }
@@ -1393,9 +1381,9 @@
    */
   handleCancel = () => {
     this.setState({
+      loading: false,
       visible: false
     })
-    this.updateStatus('over')
   }
 
   modelconfirm = () => {
@@ -1452,7 +1440,7 @@
         _this.triggerPrint(tabledata, result)
       },
       onCancel() {
-        _this.updateStatus('over')
+        _this.setState({ loading: false })
       }
     })
   }

--
Gitblit v1.8.0