| | |
| | | const SandBox = asyncComponent(() => import('@/tabviews/custom/components/code/sand-box')) |
| | | const TimeLine = asyncComponent(() => import('@/tabviews/custom/components/timeline/normal-timeline')) |
| | | const Balcony = asyncComponent(() => import('@/tabviews/custom/components/card/balcony')) |
| | | const AntvG6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-G6')) |
| | | const DebugTable = asyncComponent(() => import('@/tabviews/debugtable')) |
| | | |
| | | class BillPrint extends Component { |
| | |
| | | }) |
| | | } |
| | | |
| | | window.GLOB.CacheData.set(tempId, {$BID: BID}) |
| | | |
| | | config.components = config.components.map(component => { |
| | | if (component.action) component.action = [] |
| | | if (component.search) component.search = [] |
| | |
| | | |
| | | if (component.subtype === 'tablecard') { // 兼容 |
| | | component.type = 'card' |
| | | } |
| | | |
| | | component.$pageId = tempId |
| | | if (component.setting && component.setting.supModule) { |
| | | let pid = component.setting.supModule.pop() |
| | | if (pid && pid !== 'empty') { |
| | | component.setting.supModule = pid |
| | | } else { |
| | | component.setting.supModule = '' |
| | | } |
| | | } |
| | | |
| | | if (component.type === 'table') { |
| | |
| | | component.cols = getColumns(component.cols) |
| | | } |
| | | |
| | | if (component.wrap.datatype === 'static') { |
| | | if (component.wrap && component.wrap.datatype === 'static') { |
| | | component.format = '' |
| | | } |
| | | |
| | |
| | | return image |
| | | } |
| | | |
| | | chartToImage(canvas) { |
| | | let image = new Image() |
| | | image.src = canvas.toDataURL('image/jpg') |
| | | image.style = `width:100%;height:${canvas.style.height || '100%'};` |
| | | return image |
| | | } |
| | | |
| | | print = () => { |
| | | const { config, printing } = this.state |
| | | |
| | |
| | | |
| | | canvas.remove() |
| | | qrcodes[i].append(img) |
| | | } |
| | | } |
| | | |
| | | let charts = document.getElementsByTagName('canvas') |
| | | |
| | | if (charts.length) { |
| | | for (let i = 0; i < charts.length; i++) { |
| | | let img = this.chartToImage(charts[i]) |
| | | let parentNode = charts[i].parentNode |
| | | |
| | | parentNode.append(img) |
| | | } |
| | | |
| | | while (charts[0]) { |
| | | charts[0].remove() |
| | | } |
| | | } |
| | | |
| | |
| | | } else if (item.type === 'timeline') { |
| | | return ( |
| | | <Col span={item.width} style={style} key={item.uuid}> |
| | | <TimeLine config={item} initdata={item.data}/> |
| | | <TimeLine config={item} initdata={item.data} mainSearch={[]}/> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'antvG6') { |
| | | return ( |
| | | <Col span={item.width} style={style} key={item.uuid}> |
| | | <AntvG6 config={item} initdata={item.data} mainSearch={[]}/> |
| | | </Col> |
| | | ) |
| | | } else { |