| | |
| | | {value: 'grid', label: '栅格布局'}, |
| | | {value: 'flex', label: '弹性布局'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'cardFloat', values: ['grid']}, |
| | | ], |
| | | controlFields: subtype !== 'propcard' ? [ |
| | | {field: 'printHeight', values: ['flex']}, |
| | | ] : [], |
| | | forbid: subtype === 'tablecard' |
| | | }, |
| | | { |
| | |
| | | {value: 'content', label: '内容'}, |
| | | {value: 'headerOrfooter', label: '页眉/页脚'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'printHeight', values: ['content']}, |
| | | ], |
| | | forbid: subtype !== 'propcard' || MenuType !== 'billPrint' |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'printHeight', |
| | | label: '换算高度', |
| | | initval: wrap.printHeight || '', |
| | | tooltip: subtype !== 'propcard' ? '当前数据卡高度相当于几条数据。' : '当前属性卡高度相当于几条数据。', |
| | | required: false, |
| | | forbid: subtype === 'tablecard' || MenuType !== 'billPrint' |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | } |
| | | ] |
| | | |
| | | return cardWrapForm.map(item => { |
| | | return cardWrapForm.filter(item => { |
| | | if (['pagestyle'].includes(item.field)) { |
| | | item.options = item.options.filter(option => !option.forbid) |
| | | } |
| | | |
| | | return item |
| | | return !item.forbid |
| | | }) |
| | | } |
| | |
| | | text: '启用' |
| | | }] |
| | | }, { |
| | | type: 'radio', |
| | | key: 'empty', |
| | | label: '空值隐藏', |
| | | initVal: card.empty || 'show', |
| | | tooltip: '当查询数据为空时,隐藏该组件。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'show', text: '否'}, |
| | | {value: 'hidden', text: '是'}, |
| | | ], |
| | | }, { |
| | | type: 'number', |
| | | key: 'barSize', |
| | | label: '柱形宽度', |
| | |
| | | text: '启用' |
| | | }] |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | | // key: 'empty', |
| | | // label: '空值隐藏', |
| | | // initVal: card.empty || 'show', |
| | | // tooltip: '当查询数据为空时,隐藏该组件。', |
| | | // required: false, |
| | | // options: [ |
| | | // {value: 'show', text: '否'}, |
| | | // {value: 'hidden', text: '是'}, |
| | | // ], |
| | | // }, |
| | | { |
| | | type: 'color', |
| | | key: 'tickColor', |
| | |
| | | text: '启用' |
| | | }] |
| | | }, { |
| | | type: 'radio', |
| | | key: 'empty', |
| | | label: '空值隐藏', |
| | | initVal: card.empty || 'show', |
| | | tooltip: '当查询数据为空时,隐藏该组件。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'show', text: '否'}, |
| | | {value: 'hidden', text: '是'}, |
| | | ], |
| | | }, { |
| | | type: 'number', |
| | | key: 'splitLine', |
| | | label: '分隔线', |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'empty', |
| | | label: '空值隐藏', |
| | | initVal: card.empty || 'show', |
| | | tooltip: '当查询数据为空时,隐藏该组件。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'show', text: '否'}, |
| | | {value: 'hidden', text: '是'}, |
| | | ], |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'Xunit', |
| | | label: 'X轴单位', |
| | |
| | | } |
| | | _sync = false |
| | | } else if (_sync && initdata) { |
| | | _data = initdata || {$$empty: true} |
| | | _data = initdata |
| | | if (Array.isArray(_data)) { |
| | | _data = _data[0] || {$$empty: true} |
| | | } |
| | |
| | | render() { |
| | | const { config, loading, empty, BID } = this.state |
| | | |
| | | let style = {...config.style} |
| | | if (empty && config.plot.empty === 'hidden') { |
| | | style.opacity = 0 |
| | | style.position = 'absolute' |
| | | style.zIndex = -1 |
| | | style.width = '100%' |
| | | } |
| | | |
| | | return ( |
| | | <div className="custom-line-chart-plot-box" style={config.style}> |
| | | <div className="custom-line-chart-plot-box" style={style}> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | <div className="ant-spin-blur"></div> |
| | |
| | | render() { |
| | | const { config, loading, empty, BID } = this.state |
| | | |
| | | let style = {...config.style} |
| | | if (empty && config.plot.empty === 'hidden') { |
| | | style.opacity = 0 |
| | | style.position = 'absolute' |
| | | style.zIndex = -1 |
| | | style.width = '100%' |
| | | } |
| | | |
| | | return ( |
| | | <div className="custom-pie-chart-plot-box" style={config.style}> |
| | | <div className="custom-pie-chart-plot-box" style={style}> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | <div className="ant-spin-blur"></div> |
| | |
| | | render() { |
| | | const { config, loading, empty, BID } = this.state |
| | | |
| | | let style = {...config.style} |
| | | if (empty && config.plot.empty === 'hidden') { |
| | | style.opacity = 0 |
| | | style.position = 'absolute' |
| | | style.zIndex = -1 |
| | | style.width = '100%' |
| | | } |
| | | |
| | | return ( |
| | | <div className="custom-scatter-plot-box" style={config.style}> |
| | | <div className="custom-scatter-plot-box" style={style}> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | <div className="ant-spin-blur"></div> |
| | |
| | | return ( |
| | | <div className="normal-group-wrap" id={config.uuid} style={config.style}> |
| | | {config.setting && config.setting.print === 'true' ? <Button className="print-button" icon="printer" loading={printing} onClick={this.print}></Button> : null} |
| | | <Row>{this.getComponents()}</Row> |
| | | <Row className="component-wrap">{this.getComponents()}</Row> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | |
| | | render() { |
| | | return ( |
| | | <Row gutter={8}>{this.getComponents()}</Row> |
| | | <Row className="component-wrap" gutter={8}>{this.getComponents()}</Row> |
| | | ) |
| | | } |
| | | } |
| | |
| | | return ( |
| | | <div className={'custom-page-wrap ' + (loadingview || loading ? 'loading' : '')} id={this.state.ContainerId} style={config ? config.style : null}> |
| | | {(loadingview || loading) ? <Spin className="view-spin" size="large" /> : null} |
| | | <Row>{this.getComponents()}</Row> |
| | | <Row className="component-wrap">{this.getComponents()}</Row> |
| | | {menuType !== 'HS' && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null} |
| | | {menuType !== 'HS' && shortcuts ? <SettingComponent config={config} dict={this.state.dict} shortcuts={shortcuts} permAction={this.props.permAction}/> : null} |
| | | {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} |
| | |
| | | padding-right: 16px; |
| | | background-size: 100%; |
| | | |
| | | .component-wrap >.ant-col { |
| | | min-height: 0; |
| | | } |
| | | .box404 { |
| | | padding-top: 30px; |
| | | } |
| | |
| | | message: '请选择页面!' |
| | | }] |
| | | })( |
| | | <Select> |
| | | <Select showSearch filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0 || |
| | | option.props.extra.toLowerCase().indexOf(input.toLowerCase()) >= 0}> |
| | | {views.map(item => { |
| | | return <Select.Option key={item.MenuID} value={item.MenuID}>{item.MenuName}</Select.Option> |
| | | return <Select.Option key={item.MenuID} extra={item.MenuNo || ''} value={item.MenuID}>{item.MenuName}</Select.Option> |
| | | })} |
| | | </Select> |
| | | )} |
| | |
| | | data: '', |
| | | tempId: '', |
| | | config: null, |
| | | auto: true |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | |
| | | this.setState({loadingview: false, pages}) |
| | | } |
| | | |
| | | let auto = true |
| | | |
| | | if (comps[comps.length - 1].wrap && comps[comps.length - 1].wrap.printHeight) { |
| | | auto = false |
| | | } |
| | | |
| | | while (!over) { |
| | | let page = [] |
| | | let count = 0 |
| | |
| | | } else if (_pageover) { |
| | | return |
| | | } else if (item.subtype === 'datacard' || item.type === 'table') { |
| | | if (_item.dataArray && _item.dataArray.length > 0) { |
| | | if (!_item.dataArray || _item.dataArray.length === 0) return |
| | | |
| | | if (item.subtype === 'datacard' && item.wrap.layout === 'flex') { |
| | | if (!item.added && item.wrap.printHeight) { |
| | | count += item.wrap.printHeight |
| | | if (count >= limit) { |
| | | _pageover = true |
| | | } |
| | | if (count <= limit) { |
| | | _item.added = true |
| | | page.push(item) |
| | | } |
| | | } else if (!item.added) { |
| | | _item.added = true |
| | | page.push(item) |
| | | } |
| | | } else { |
| | | item.data = [] |
| | | |
| | | while (count < limit && _item.dataArray.length > 0) { |
| | | while (count + 1 <= limit && _item.dataArray.length > 0) { |
| | | item.data.push(_item.dataArray.shift()) |
| | | count++ |
| | | } |
| | |
| | | if (count >= limit) { |
| | | _pageover = true |
| | | } |
| | | page.push(item) |
| | | } |
| | | } else if (!item.added && item.wrap && item.wrap.printHeight) { |
| | | if (item.wrap.empty === 'hidden' && (!item.data || item.data.length === 0)) { |
| | | _item.added = true |
| | | return |
| | | } |
| | | |
| | | count += item.wrap.printHeight |
| | | if (count >= limit) { |
| | | _pageover = true |
| | | } |
| | | if (count <= limit) { |
| | | _item.added = true |
| | | page.push(item) |
| | | } |
| | | } else if (!item.added) { |
| | |
| | | } else if (_pageover) { |
| | | return |
| | | } else if (item.subtype === 'datacard' || item.type === 'table') { |
| | | if (_item.dataArray && _item.dataArray.length > 0) { |
| | | if (!_item.dataArray || _item.dataArray.length === 0) return |
| | | |
| | | if (item.subtype === 'datacard' && item.wrap.layout === 'flex') { |
| | | if (!item.added && item.wrap.printHeight) { |
| | | count += item.wrap.printHeight |
| | | if (count >= limit) { |
| | | _pageover = true |
| | | } |
| | | if (count <= limit) { |
| | | _item.added = true |
| | | page.push(item) |
| | | } |
| | | } else if (!item.added) { |
| | | _item.added = true |
| | | page.push(item) |
| | | } |
| | | } else { |
| | | item.data = [] |
| | | |
| | | while (count < limit && _item.dataArray.length > 0) { |
| | | while (count + 1 <= limit && _item.dataArray.length > 0) { |
| | | item.data.push(_item.dataArray.shift()) |
| | | count++ |
| | | } |
| | |
| | | if (count >= limit) { |
| | | _pageover = true |
| | | } |
| | | page.push(item) |
| | | } |
| | | } else if (!item.added && item.wrap && item.wrap.printHeight) { |
| | | if (item.wrap.empty === 'hidden' && (!item.data || item.data.length === 0)) { |
| | | _item.added = true |
| | | return |
| | | } |
| | | count += item.wrap.printHeight |
| | | if (count >= limit) { |
| | | _pageover = true |
| | | } |
| | | if (count <= limit) { |
| | | _item.added = true |
| | | page.push(item) |
| | | } |
| | | } else if (!item.added) { |
| | |
| | | } |
| | | } |
| | | |
| | | this.setState({loadingview: false, pages}) |
| | | this.setState({loadingview: false, pages, auto}) |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { loadingview, viewlost, config, pages } = this.state |
| | | const { loadingview, viewlost, config, pages, auto } = this.state |
| | | |
| | | return ( |
| | | <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, overflow: 'hidden', boxSizing: 'border-box'}}><Row>{this.getComponents(components)}</Row></div>))} |
| | | {pages.map((components, index) => (<div className={'print-page' + (auto ? ' auto' : '')} key={index} style={{...config.style, overflow: 'hidden', boxSizing: 'border-box'}}><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} |
| | |
| | | border-radius: 0!important; |
| | | } |
| | | } |
| | | .print-page:last-child { |
| | | .print-page.auto:last-child { |
| | | height: auto!important; |
| | | } |
| | | |
| | |
| | | message: dict['mob.required.input'] + '首页数!' |
| | | } |
| | | ] |
| | | })(<InputNumber min={1} max={1000} precision={0} onChange={this.changeFirstCount}/>)} |
| | | })(<InputNumber min={1} max={1000} precision={1} onChange={this.changeFirstCount}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | |
| | | message: dict['mob.required.input'] + '每页数!' |
| | | } |
| | | ] |
| | | })(<InputNumber min={1} max={1000} precision={0} onChange={this.changeCount}/>)} |
| | | })(<InputNumber min={1} max={1000} precision={1} onChange={this.changeCount}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label="尾页数(条)"> |
| | | {getFieldDecorator('lastCount', { |
| | | initialValue: config.lastCount |
| | | })(<InputNumber min={1} max={1000} precision={0} onChange={this.changeLastCount}/>)} |
| | | })(<InputNumber min={1} max={1000} precision={1} onChange={this.changeLastCount}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |