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/normalbutton/index.jsx | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 53 insertions(+), 1 deletions(-) diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 3a5c539..2271803 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -2424,7 +2424,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', @@ -2677,15 +2690,17 @@ width = btnconfig.setting.width > 100 ? btnconfig.setting.width : btnconfig.setting.width + '%' container = () => document.getElementById(btn.ContainerId) } + return ( <Modal title={title} maskClosable={clickouter} getContainer={container} - wrapClassName='action-modal' + wrapClassName={'action-modal' + (btnconfig.setting.moveable === 'true' ? ' moveable-modal modal-' + btn.uuid : '')} visible={visible} width={width} onOk={this.handleOk} + maskStyle={btnconfig.setting.moveable === 'true' ? {backgroundColor: 'rgba(0, 0, 0, 0.15)'} : null} confirmLoading={this.state.confirmLoading} onCancel={this.handleCancel} destroyOnClose @@ -2704,6 +2719,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 { loadingNumber, loadingTotal, loading, disabled, hidden, check } = this.state -- Gitblit v1.8.0