| | |
| | | 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' |
| | | |
| | |
| | | // 系统打印数据,校验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 |
| | |
| | | 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 |
| | |
| | | // 外部请求 |
| | | _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') { |
| | |
| | | if (!configParam) { |
| | | error = '打印模板解析错误!' |
| | | } else { |
| | | let control = configParam.elements.map(element => { |
| | | let control = [] |
| | | configParam.elements.forEach(element => { |
| | | let _field = element.field |
| | | |
| | | if (_field === 'other_field') { |
| | |
| | | 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 |
| | |
| | | } |
| | | } |
| | | |
| | | return item |
| | | control.push(item) |
| | | }) |
| | | |
| | | _configparam = { |
| | |
| | | <MutilForm |
| | | BID={BID} |
| | | dict={this.state.dict} |
| | | menuType={this.props.menuType} |
| | | action={btnconfig} |
| | | inputSubmit={this.handleOk} |
| | | data={this.state.selines[0]} |
| | |
| | | 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 : '')} |
| | |
| | | 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 |