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