king
2023-02-16 fc55bf4131e3056a84ac7bae16540a4e714214b8
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -2424,6 +2424,12 @@
        this.setState({
          visible: true
        })
        if (btnconfig.setting.display === 'modal' && btnconfig.setting.moveable === 'true') {
          setTimeout(() => {
            this.setMove()
          }, 100)
        }
      }
    } else {
      Api.getCacheConfig({
@@ -2677,15 +2683,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 +2712,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