| | |
| | | } |
| | | |
| | | config.style = config.style || {} |
| | | config.zoom = 1 |
| | | |
| | | if (config.pageSize === 'A0') { |
| | | if (config.pageSize === 'A3') { |
| | | if (config.pageLayout === 'horizontal') { |
| | | config.style.height = 1305 |
| | | config.zoom = 1.35 |
| | | config.style.height = 845 |
| | | } else { |
| | | config.style.height = 1305 |
| | | } |
| | | } else if (config.pageSize === 'A1') { |
| | | if (config.pageLayout === 'horizontal') { |
| | | config.style.height = 1305 |
| | | } else { |
| | | config.style.height = 1305 |
| | | } |
| | | } else if (config.pageSize === 'A2') { |
| | | if (config.pageLayout === 'horizontal') { |
| | | config.style.height = 1305 |
| | | } else { |
| | | config.style.height = 1305 |
| | | } |
| | | } else if (config.pageSize === 'A3') { |
| | | if (config.pageLayout === 'horizontal') { |
| | | config.style.height = 1305 |
| | | } else { |
| | | config.style.height = 1305 |
| | | config.style.height = 1695 |
| | | } |
| | | } else if (config.pageSize === 'A5') { |
| | | config.zoom = 0.7 |
| | | if (config.pageLayout === 'horizontal') { |
| | | config.style.height = 1305 |
| | | config.style.height = 840 |
| | | } else { |
| | | config.style.height = 1305 |
| | | config.style.height = 1700 |
| | | } |
| | | } else { |
| | | if (config.pageLayout === 'horizontal') { |
| | | config.style.height = 895 |
| | | config.style.height = 845 |
| | | } else { |
| | | config.style.height = 1305 |
| | | config.style.height = 1680 |
| | | } |
| | | } |
| | | |
| | | // config.style.height = 895 |
| | | |
| | | let params = [] |
| | | let _pars = [] |
| | |
| | | component.setting.dataresource = component.setting.dataresource.replace(/@\$|\$@/ig, '') |
| | | _customScript = _customScript.replace(/@\$|\$@/ig, '') |
| | | } |
| | | |
| | | component.setting.dataresource = component.setting.dataresource.replace(/@BID@/ig, BID) |
| | | _customScript = _customScript.replace(/@BID@/ig, BID) |
| | | |
| | | component.setting.customScript = _customScript // 整理后自定义脚本 |
| | | |
| | |
| | | } |
| | | |
| | | getFormatParam = (params) => { |
| | | const { BID } = this.state |
| | | |
| | | if (!params || params.length === 0) return '' |
| | | let LText_field = [] |
| | | let LText = params.map((item, index) => { |
| | |
| | | let param = { |
| | | func: 'sPC_Get_structured_data', |
| | | LText: LText.join(' union all '), |
| | | LText_field: LText_field.join(' union all ') |
| | | LText_field: LText_field.join(' union all '), |
| | | BID: BID || '' |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | |
| | | this.setState({loadingview: false, pages}) |
| | | } |
| | | |
| | | // everyPCount, firstCount, lastCount |
| | | while (!over) { |
| | | let page = [] |
| | | let count = 0 |
| | |
| | | } |
| | | |
| | | print = () => { |
| | | let bdhtml = window.document.body.innerHTML |
| | | const { config } = this.state |
| | | |
| | | let jubuData = document.getElementById('bill-print').innerHTML |
| | | window.document.body.innerHTML = jubuData |
| | | document.getElementsByTagName('body')[0].style.zoom = 0.8 |
| | | document.getElementsByTagName('body')[0].style.width = '1200px' |
| | | document.getElementsByTagName('body')[0].style.margin = '0 auto' |
| | | document.getElementsByTagName('body')[0].style.zoom = config.zoom |
| | | |
| | | try { |
| | | if (window.ActiveXObject) { |
| | |
| | | } else { |
| | | window.print() |
| | | } |
| | | |
| | | document.getElementsByTagName('body')[0].style.zoom = 1 |
| | | |
| | | setTimeout(() => { |
| | | window.close() |
| | | }, 2000) |
| | | } catch (e) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | duration: 5 |
| | | }) |
| | | } |
| | | |
| | | window.document.body.innerHTML = bdhtml |
| | | window.location.reload() |
| | | } |
| | | |
| | | getComponents = (components) => { |
| | |
| | | <div className="bill-print-wrap" > |
| | | {loadingview && <Spin size="large" />} |
| | | {pages ? <div id="bill-print"> |
| | | {pages.map((components, index) => (<div className="print-page" key={index} style={config.style}><Row>{this.getComponents(components)}</Row></div>))} |
| | | {pages.map((components, index) => (<div className="print-page" key={index} style={{...config.style, overflow: 'hidden'}}><Row>{this.getComponents(components)}</Row></div>))} |
| | | </div> : null} |
| | | {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} |
| | | {pages && !loadingview && !viewlost ? <div className="print-button"><Button icon="printer" size="large" shape="circle" onClick={this.print}></Button></div> : null} |