From 306eb5f035302baef95995437e2dc735110b6536 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 23 二月 2023 17:38:37 +0800
Subject: [PATCH] Merge branch 'master' into positec

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

diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx
index 9fa8f51..d868d58 100644
--- a/src/tabviews/zshare/actionList/printbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -2013,7 +2013,20 @@
         this.setState({
           visible: true
         })
+
+        if (btnconfig.setting.display === 'modal' && btnconfig.setting.moveable === 'true') {
+          setTimeout(() => {
+            this.setMove()
+          }, 100)
+        }
       }
+    } else if (!btn.$old) {
+      notification.warning({
+        top: 92,
+        message: '鏈幏鍙栧埌鎸夐挳閰嶇疆淇℃伅锛�',
+        duration: 5
+      })
+      this.setState({ loading: false })
     } else {
       Api.getCacheConfig({
         func: 'sPC_Get_LongParam',
@@ -2208,10 +2221,11 @@
         title={title}
         maskClosable={clickouter}
         getContainer={container}
-        wrapClassName='action-modal'
+        wrapClassName={'action-modal' + (btnconfig.setting.moveable === 'true' ? ' moveable-modal modal-' + btn.uuid : '')}
         visible={this.state.visible}
         confirmLoading={this.state.confirmLoading}
         width={width}
+        maskStyle={btnconfig.setting.moveable === 'true' ?  {backgroundColor: 'rgba(0, 0, 0, 0.15)'} : null}
         onOk={this.handleOk}
         onCancel={this.handleCancel}
         destroyOnClose
@@ -2229,6 +2243,43 @@
     )
   }
 
+  setMove = () => {
+    const { btn } = this.props
+    let wrap = document.getElementsByClassName('modal-' + btn.uuid)[0]
+
+    if (!wrap) return
+
+    let node = wrap.getElementsByClassName('ant-modal-header')[0]
+
+    if (!node) return
+
+    node.onmousedown = function(e) {
+      let orileft = 0
+      let oritop = 0
+      let oleft = e.clientX
+      let otop = e.clientY
+
+      if (node.parentNode.style.left) {
+        orileft = parseFloat(node.parentNode.style.left)
+      }
+      if (node.parentNode.style.top) {
+        oritop = parseFloat(node.parentNode.style.top)
+      }
+
+      document.onmousemove = function(e) {
+        let left = e.clientX - oleft
+        let top = e.clientY - otop
+
+        node.parentNode.style.left = (orileft + left) + 'px'
+        node.parentNode.style.top = (oritop + top) + 'px'
+      }
+    }
+
+    document.onmouseup = function() {
+      document.onmousemove = null
+    }
+  }
+
   render() {
     const { btn } = this.props
     const { loading, disabled, hidden } = this.state

--
Gitblit v1.8.0