king
2022-07-22 0c439ced2c97905cb2b02f5f689a37b19369fb8a
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -1,7 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import moment from 'moment'
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import { Button, Modal, notification, message } from 'antd'
@@ -320,9 +319,9 @@
              // 系统打印数据,校验data字段
              if (btn.verify.printMode !== 'custom' && (!cell.data || cell.data.length === 0)) return
              cell.templateID = baseTemp
              cell.printType = baseType
              cell.printCount = 0
              let templateID = baseTemp
              let printType = baseType
              let printCount = 0
              Object.keys(cell).forEach(key => {
                if (!cell[key]) return
@@ -330,13 +329,17 @@
                let _key = key.toLowerCase()
                if (_key === 'templateid') {
                  cell.templateID = cell[key]
                  templateID = cell[key]
                } else if (_key === 'printtype') {
                  cell.printType = cell[key]
                  printType = cell[key]
                } else if (_key === 'printcount') {
                  cell.printCount = +cell[key]
                  printCount = +cell[key]
                }
              })
              cell.templateID = templateID
              cell.printType = printType
              cell.printCount = printCount
              if (isNaN(cell.printCount) || cell.printCount < 1) {
                cell.printCount = baseCount
@@ -812,7 +815,7 @@
      // 外部请求
      _outParam = JSON.parse(JSON.stringify(res))
      if (this.props.menuType === 'HS') {
      if (window.GLOB.mkHS) {
        if (btn.sysInterface === 'true' && options.cloudServiceApi) {
          res.rduri = options.cloudServiceApi
        } else if (btn.sysInterface !== 'true') {
@@ -927,7 +930,8 @@
      if (!configParam) {
        error = '打印模板解析错误!'
      } else {
        let control = configParam.elements.map(element => {
        let control = []
        configParam.elements.forEach(element => {
          let _field = element.field
          if (_field === 'other_field') {
@@ -963,11 +967,12 @@
            item.Trimming = ''
            if (!item.Width) {
              item.Width = item.BorderSize
              item.Left = item.Left - item.Width
              item.Left = item.Left - item.Width + 0.1
            } else if (!item.Height) {
              item.Height = item.BorderSize
              item.Top = item.Top - item.Height
              item.Top = item.Top - item.Height + 0.1
            }
            item.BackColor = element.borderColor
            item.BorderSize = 0
          } else if (item.Type === 'image') {
            item.ImageWidth = element.imgWidth
@@ -1007,7 +1012,7 @@
            }
          }
          return item
          control.push(item)
        })
        _configparam = {
@@ -1635,7 +1640,6 @@
        <MutilForm
          BID={BID}
          dict={this.state.dict}
          menuType={this.props.menuType}
          action={btnconfig}
          inputSubmit={this.handleOk}
          data={this.state.selines[0]}
@@ -1676,7 +1680,7 @@
      className = 'mk-btn mk-' + btn.class
    }
    return <div style={{display: 'inline-block'}} onClick={(e) => e.stopPropagation()}>
    return <>
      <Button
        type={type}
        title={disabled ? (btn.reason || '') : (btn.show === 'icon' ? btn.label : '')}
@@ -1685,21 +1689,11 @@
        style={btn.style || null}
        icon={icon}
        className={className}
        onClick={() => {this.actionTrigger()}}
        onClick={(e) => {e.stopPropagation(); this.actionTrigger()}}
      >{label}</Button>
      {this.getModels()}
    </div>
    </>
  }
}
const mapStateToProps = (state) => {
  return {
    menuType: state.editLevel
  }
}
const mapDispatchToProps = () => {
  return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(PrintButton)
export default PrintButton