From fe227dd3d6c4ff9fd031033c15ae7b873dbf5535 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 31 三月 2022 22:39:47 +0800 Subject: [PATCH] 2022-03-31 --- src/tabviews/custom/components/card/prop-card/index.jsx | 2 src/tabviews/custom/components/chart/antv-scatter/index.jsx | 10 ++ src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx | 11 ++ src/tabviews/custom/components/chart/antv-bar-line/index.jsx | 10 ++ src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx | 11 ++ src/tabviews/custom/components/share/tabtransfer/index.jsx | 2 src/menu/components/card/data-card/options.jsx | 22 ++++- src/tabviews/custom/components/group/normal-group/index.jsx | 2 src/tabviews/custom/components/chart/antv-pie/index.jsx | 10 ++ src/views/appmanage/scriptform/index.jsx | 5 src/views/menudesign/printmenuform/index.jsx | 6 src/menu/components/chart/antv-scatter/chartcompile/formconfig.jsx | 12 +++ src/views/billprint/index.scss | 2 src/tabviews/custom/index.jsx | 2 src/tabviews/custom/index.scss | 3 src/views/billprint/index.jsx | 84 ++++++++++++++++++-- src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx | 12 +++ 17 files changed, 179 insertions(+), 27 deletions(-) diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx index ab2ea6d..9001f8b 100644 --- a/src/menu/components/card/data-card/options.jsx +++ b/src/menu/components/card/data-card/options.jsx @@ -86,9 +86,9 @@ {value: 'grid', label: '鏍呮牸甯冨眬'}, {value: 'flex', label: '寮规�у竷灞�'}, ], - controlFields: [ - {field: 'cardFloat', values: ['grid']}, - ], + controlFields: subtype !== 'propcard' ? [ + {field: 'printHeight', values: ['flex']}, + ] : [], forbid: subtype === 'tablecard' }, { @@ -218,7 +218,19 @@ {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', @@ -358,11 +370,11 @@ } ] - 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 }) } \ No newline at end of file diff --git a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx index 05158b6..51a9e51 100644 --- a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx @@ -419,6 +419,17 @@ 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: '鏌卞舰瀹藉害', diff --git a/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx index 9a90e00..248a75b 100644 --- a/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx @@ -144,6 +144,18 @@ text: '鍚敤' }] }, + // { + // type: 'radio', + // key: 'empty', + // label: '绌哄�奸殣钘�', + // initVal: card.empty || 'show', + // tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�', + // required: false, + // options: [ + // {value: 'show', text: '鍚�'}, + // {value: 'hidden', text: '鏄�'}, + // ], + // }, { type: 'color', key: 'tickColor', diff --git a/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx index aaa4b33..4cf1a15 100644 --- a/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx @@ -296,6 +296,17 @@ 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: '鍒嗛殧绾�', diff --git a/src/menu/components/chart/antv-scatter/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-scatter/chartcompile/formconfig.jsx index cf6c5da..f8135fd 100644 --- a/src/menu/components/chart/antv-scatter/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-scatter/chartcompile/formconfig.jsx @@ -143,6 +143,18 @@ }] }, { + 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杞村崟浣�', diff --git a/src/tabviews/custom/components/card/prop-card/index.jsx b/src/tabviews/custom/components/card/prop-card/index.jsx index 5a8912e..5df7934 100644 --- a/src/tabviews/custom/components/card/prop-card/index.jsx +++ b/src/tabviews/custom/components/card/prop-card/index.jsx @@ -53,7 +53,7 @@ } _sync = false } else if (_sync && initdata) { - _data = initdata || {$$empty: true} + _data = initdata if (Array.isArray(_data)) { _data = _data[0] || {$$empty: true} } diff --git a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx index ec50a3b..2184ac3 100644 --- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx +++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx @@ -1772,8 +1772,16 @@ 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> diff --git a/src/tabviews/custom/components/chart/antv-pie/index.jsx b/src/tabviews/custom/components/chart/antv-pie/index.jsx index 75be8ce..be6d309 100644 --- a/src/tabviews/custom/components/chart/antv-pie/index.jsx +++ b/src/tabviews/custom/components/chart/antv-pie/index.jsx @@ -1045,8 +1045,16 @@ 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> diff --git a/src/tabviews/custom/components/chart/antv-scatter/index.jsx b/src/tabviews/custom/components/chart/antv-scatter/index.jsx index e4d43c3..9a9d578 100644 --- a/src/tabviews/custom/components/chart/antv-scatter/index.jsx +++ b/src/tabviews/custom/components/chart/antv-scatter/index.jsx @@ -438,8 +438,16 @@ 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> diff --git a/src/tabviews/custom/components/group/normal-group/index.jsx b/src/tabviews/custom/components/group/normal-group/index.jsx index f6ac9cd..6faa6d9 100644 --- a/src/tabviews/custom/components/group/normal-group/index.jsx +++ b/src/tabviews/custom/components/group/normal-group/index.jsx @@ -336,7 +336,7 @@ 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> ) } diff --git a/src/tabviews/custom/components/share/tabtransfer/index.jsx b/src/tabviews/custom/components/share/tabtransfer/index.jsx index 39e4bca..2754f25 100644 --- a/src/tabviews/custom/components/share/tabtransfer/index.jsx +++ b/src/tabviews/custom/components/share/tabtransfer/index.jsx @@ -302,7 +302,7 @@ render() { return ( - <Row gutter={8}>{this.getComponents()}</Row> + <Row className="component-wrap" gutter={8}>{this.getComponents()}</Row> ) } } diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 3e41197..c5d426f 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -1216,7 +1216,7 @@ 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} diff --git a/src/tabviews/custom/index.scss b/src/tabviews/custom/index.scss index 6b7e1c7..b01f497 100644 --- a/src/tabviews/custom/index.scss +++ b/src/tabviews/custom/index.scss @@ -8,6 +8,9 @@ padding-right: 16px; background-size: 100%; + .component-wrap >.ant-col { + min-height: 0; + } .box404 { padding-top: 30px; } diff --git a/src/views/appmanage/scriptform/index.jsx b/src/views/appmanage/scriptform/index.jsx index 39bd2ee..be8c9af 100644 --- a/src/views/appmanage/scriptform/index.jsx +++ b/src/views/appmanage/scriptform/index.jsx @@ -224,9 +224,10 @@ 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> )} diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx index ca30872..01b87ed 100644 --- a/src/views/billprint/index.jsx +++ b/src/views/billprint/index.jsx @@ -36,6 +36,7 @@ data: '', tempId: '', config: null, + auto: true } UNSAFE_componentWillMount() { @@ -424,6 +425,12 @@ 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 @@ -444,10 +451,26 @@ } 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++ } @@ -457,11 +480,25 @@ } 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) { _item.added = true page.push(item) } - + if (index + 1 >= length && !_pageover) { pagesover = true } @@ -490,10 +527,26 @@ } 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++ } @@ -501,6 +554,19 @@ 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) { @@ -522,7 +588,7 @@ } } - this.setState({loadingview: false, pages}) + this.setState({loadingview: false, pages, auto}) }) } @@ -648,13 +714,13 @@ } 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} diff --git a/src/views/billprint/index.scss b/src/views/billprint/index.scss index 80dd4f8..a6bfa9e 100644 --- a/src/views/billprint/index.scss +++ b/src/views/billprint/index.scss @@ -46,7 +46,7 @@ border-radius: 0!important; } } -.print-page:last-child { +.print-page.auto:last-child { height: auto!important; } diff --git a/src/views/menudesign/printmenuform/index.jsx b/src/views/menudesign/printmenuform/index.jsx index 12514d8..9b099fc 100644 --- a/src/views/menudesign/printmenuform/index.jsx +++ b/src/views/menudesign/printmenuform/index.jsx @@ -194,7 +194,7 @@ 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}> @@ -207,14 +207,14 @@ 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}> -- Gitblit v1.8.0