king
2021-05-08 6afdec0062dacbded57e166230eb22cc55ced0c1
src/views/billprint/index.jsx
@@ -26,7 +26,7 @@
class BillPrint extends Component {
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    loadingview: true,
    printing: false,
    pages: null,
@@ -147,6 +147,11 @@
        config.width = pageParam[config.pageSize][config.pageLayout]
        config.style.height = Math.floor(config.width * pageParam[config.pageSize][config.pageLayout + config.pagePadding])
        if (config.printCustom === 'true' && config.printWidth && config.printHeight) {
          config.width = config.printWidth
          config.style.height = config.printHeight
        }
        let params = []
        let _pars = []
@@ -196,6 +201,12 @@
          } else {
            component.setting.dataresource = component.setting.dataresource.replace(/@\$|\$@/ig, '')
            _customScript = _customScript.replace(/@\$|\$@/ig, '')
          }
          // 外联数据库替换
          if (window.GLOB.externalDatabase !== null) {
            component.setting.dataresource = component.setting.dataresource.replace(/@db@/ig, window.GLOB.externalDatabase)
            _customScript = _customScript.replace(/@db@/ig, window.GLOB.externalDatabase)
          }
    
          component.setting.customScript = _customScript // 整理后自定义脚本
@@ -496,6 +507,7 @@
      let linkList = document.getElementsByTagName('link')     // 获取父窗口link标签对象列表
      let styleList = document.getElementsByTagName('style')   // 获取父窗口style标签对象列表
      iframe.style.marginTop = '600px'
      document.body.appendChild(iframe)
      let doc = iframe.contentWindow.document