From 30068b0366757b6cae3cd6dda25e0622afcae795 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 13 四月 2023 11:17:05 +0800 Subject: [PATCH] 2023-04-13 --- src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 6 +- src/tabviews/custom/components/card/table-card/index.jsx | 9 ++-- src/tabviews/custom/components/card/double-data-card/index.jsx | 28 +++++++++++--- src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx | 4 +- src/tabviews/custom/components/card/data-card/index.jsx | 30 +++++++++++--- src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 2 - 6 files changed, 55 insertions(+), 24 deletions(-) diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index 3202ba0..98f672e 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -80,6 +80,8 @@ } } + _config.$extend = false + _config.subcards.forEach(item => { if (item.setting.click === 'button' && !item.setting.linkbtn) { item.elements.forEach(ele => { @@ -95,8 +97,10 @@ if (item.$cardType !== 'extendCard') { _card = item } else if (!_card) { + _config.$extend = true precards.push(item) } else { + _config.$extend = true nextcards.push(item) } }) @@ -162,6 +166,10 @@ this.loaded = _data !== null let pageOptions = ['10', '25', '50', '100', '500', '1000'] + + if (!_config.setting.laypage) { + _config.wrap.pagestyle = 'none' + } if (_config.wrap.pagestyle === 'page') { let size = (_config.setting.pageSize || 10) + '' @@ -945,15 +953,23 @@ let _total = 0 let switchable = false - if (config.wrap.pagestyle === 'switch' && config.pageable && config.setting.laypage && total > pageSize && data) { + if (config.wrap.pagestyle === 'switch' && total > pageSize && data) { _total = pageSize * pageIndex switchable = true } - let extendData = {$$BID: BID, $$BData: BData, $$selectedData: selectedData, $$type: 'extendCard'} + let extendData = null - if (data && data[0]) { - extendData = {...extendData, ...data[0]} + if (config.$extend) { + extendData = {$$BID: BID, $$BData: BData, $$selectedData: selectedData, $$type: 'extendCard'} + + if (data && data[0]) { + if (selectedData[0]) { + extendData = {...extendData, ...selectedData[0]} + } else { + extendData = {...extendData, ...data[0]} + } + } } let checkAll = '' @@ -1028,10 +1044,10 @@ ))} </Row> {switchable ? <div className={'prev-page ' + (total <= _total ? 'disabled' : '')} onClick={this.nextPage}><div><div><img src={nextImg} alt=""/></div></div></div> : null} - {precards.length === 0 && nextcards.length === 0 && (!data || data.length === 0) ? <Empty description={false}/> : null} + {!config.$extend && (!data || data.length === 0) ? <Empty description={false}/> : null} </div> - {config.wrap.pagestyle === 'page' && config.setting.laypage && data ? <Pagination size="small" total={total} showTotal={(t, range) => total > 0 ? `${range[0]}-${range[1]} 鍏� ${total} 鏉 : `鍏� ${total} 鏉} pageSize={pageSize} showSizeChanger={true} pageSizeOptions={this.state.pageOptions} onChange={this.changePageIndex} onShowSizeChange={this.pageSizeChange} current={pageIndex}/> : null} - {config.wrap.pagestyle === 'more' && config.setting.laypage && data && data.length > 0 ? <div className={'mk-more' + (pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>鏌ョ湅鏇村<DownOutlined/></div> : null} + {config.wrap.pagestyle === 'page' && data ? <Pagination size="small" total={total} showTotal={(t, range) => total > 0 ? `${range[0]}-${range[1]} 鍏� ${total} 鏉 : `鍏� ${total} 鏉} pageSize={pageSize} showSizeChanger={true} pageSizeOptions={this.state.pageOptions} onChange={this.changePageIndex} onShowSizeChange={this.pageSizeChange} current={pageIndex}/> : null} + {config.wrap.pagestyle === 'more' && data && data.length > 0 ? <div className={'mk-more' + (pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>鏌ョ湅鏇村<DownOutlined/></div> : null} </div> ) } diff --git a/src/tabviews/custom/components/card/double-data-card/index.jsx b/src/tabviews/custom/components/card/double-data-card/index.jsx index c0dfa62..b3fc0da 100644 --- a/src/tabviews/custom/components/card/double-data-card/index.jsx +++ b/src/tabviews/custom/components/card/double-data-card/index.jsx @@ -78,6 +78,8 @@ } } + _config.$extend = false + _config.subcards.forEach(item => { if (item.setting.click === 'button' && !item.setting.linkbtn) { item.elements.forEach(ele => { @@ -93,8 +95,10 @@ if (item.$cardType !== 'extendCard') { _card = item } else if (!_card) { + _config.$extend = true precards.push(item) } else { + _config.$extend = true nextcards.push(item) } }) @@ -139,6 +143,10 @@ _config.setting.sub_field = subconfig.columns.map(col => col.field).join(',') let pageOptions = ['10', '25', '50', '100', '500', '1000'] + + if (!_config.setting.laypage) { + _config.wrap.pagestyle = 'none' + } if (_config.wrap.pagestyle === 'page') { let size = (_config.setting.pageSize || 10) + '' @@ -889,10 +897,18 @@ if (config.wrap.empty === 'hidden' && (!data || data.length === 0)) return null - let extendData = {$$BID: BID, $$BData: BData, $$selectedData: selectedData, $$type: 'extendCard'} + let extendData = null - if (data && data[0]) { - extendData = {...extendData, ...data[0]} + if (config.$extend) { + extendData = {$$BID: BID, $$BData: BData, $$selectedData: selectedData, $$type: 'extendCard'} + + if (data && data[0]) { + if (selectedData[0]) { + extendData = {...extendData, ...selectedData[0]} + } else { + extendData = {...extendData, ...data[0]} + } + } } let checkAll = '' @@ -989,11 +1005,11 @@ </Col> ))} </Row> - {precards.length === 0 && nextcards.length === 0 && (!data || data.length === 0) ? <Empty description={false}/> : null} + {!config.$extend && (!data || data.length === 0) ? <Empty description={false}/> : null} </div> </div> - {config.wrap.pagestyle === 'page' && config.setting.laypage && data ? <Pagination size="small" total={total} showTotal={(t, range) => total > 0 ? `${range[0]}-${range[1]} 鍏� ${total} 鏉 : `鍏� ${total} 鏉} pageSize={pageSize} showSizeChanger={true} pageSizeOptions={this.state.pageOptions} onChange={this.changePageIndex} onShowSizeChange={this.pageSizeChange} current={pageIndex}/> : null} - {config.wrap.pagestyle === 'more' && config.setting.laypage && data && data.length > 0 ? <div className={'mk-more' + (pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>鏌ョ湅鏇村<DownOutlined/></div> : null} + {config.wrap.pagestyle === 'page' && data ? <Pagination size="small" total={total} showTotal={(t, range) => total > 0 ? `${range[0]}-${range[1]} 鍏� ${total} 鏉 : `鍏� ${total} 鏉} pageSize={pageSize} showSizeChanger={true} pageSizeOptions={this.state.pageOptions} onChange={this.changePageIndex} onShowSizeChange={this.pageSizeChange} current={pageIndex}/> : null} + {config.wrap.pagestyle === 'more' && data && data.length > 0 ? <div className={'mk-more' + (pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>鏌ョ湅鏇村<DownOutlined/></div> : null} </div> ) } diff --git a/src/tabviews/custom/components/card/table-card/index.jsx b/src/tabviews/custom/components/card/table-card/index.jsx index 47aab12..16fc44e 100644 --- a/src/tabviews/custom/components/card/table-card/index.jsx +++ b/src/tabviews/custom/components/card/table-card/index.jsx @@ -83,13 +83,14 @@ showHeader = true } + _config.wrap.pagestyle = _config.wrap.pagestyle || 'page' + if (_config.setting.laypage) { _config.wrap.contentHeight = showHeader ? 'calc(100% - 85px)' : 'calc(100% - 40px)' } else { + _config.wrap.pagestyle = 'none' _config.wrap.contentHeight = showHeader ? 'calc(100% - 45px)' : '100%' } - - _config.wrap.pagestyle = _config.wrap.pagestyle || 'page' this.loaded = _data !== null @@ -513,8 +514,8 @@ {data && data.length === 0 ? <div className="card-row-list" style={{height: config.wrap.contentHeight}}> <Empty description={false}/> </div> : null} - {config.setting.laypage && config.wrap.pagestyle === 'page' ? <Pagination size="small" current={pageIndex} total={total} onChange={this.changePageIndex} /> : null} - {config.setting.laypage && config.wrap.pagestyle === 'more' && data && data.length > 0 ? <div className={'mk-more' + (config.setting.pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>鏌ョ湅鏇村<DownOutlined/></div> : null} + {config.wrap.pagestyle === 'page' ? <Pagination size="small" current={pageIndex} total={total} onChange={this.changePageIndex} /> : null} + {config.wrap.pagestyle === 'more' && data && data.length > 0 ? <div className={'mk-more' + (config.setting.pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>鏌ョ湅鏇村<DownOutlined/></div> : null} </div> ) } diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index 2192239..34d4cbb 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -899,7 +899,7 @@ defaultSql = btn.verify.defaultSql || 'true' _dataresource = btn.verify.dataresource || '' queryType = btn.verify.queryType - primaryKey = btn.verify.primaryKey || 'ID' + // primaryKey = btn.verify.primaryKey || 'ID' if (/\s/.test(_dataresource)) { _dataresource = '(' + _dataresource + ') tb' @@ -1008,9 +1008,9 @@ if (btn.Ot === 'requiredOnce' && selectedData && selectedData.length > 0) { primaryId = selectedData.map(d => d.$$uuid || '').filter(Boolean).join(',') if (_search && primaryId) { - _search += ` and ${primaryKey} in (select ID from dbo.SplitComma('${primaryId}'))` + _search += ` and ${primaryKey} in (select ${primaryKey} from dbo.SplitComma('${primaryId}'))` } else if (primaryId) { - _search = `where ${primaryKey} in (select ID from dbo.SplitComma('${primaryId}'))` + _search = `where ${primaryKey} in (select ${primaryKey} from dbo.SplitComma('${primaryId}'))` } } diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx index 213f959..04fa4a8 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx @@ -216,13 +216,13 @@ </Radio.Group>)} </Form.Item> </Col> : null} - {dataType === 'custom' && defaultSql === 'true' ? <Col className="short-label" span={8}> + {/* {dataType === 'custom' && defaultSql === 'true' ? <Col className="short-label" span={8}> <Form.Item label="涓婚敭"> {getFieldDecorator('primaryKey', { initialValue: setting.primaryKey || 'ID', })(<Input placeholder={''} autoComplete="off" />)} </Form.Item> - </Col> : null} + </Col> : null} */} {dataType === 'custom' && defaultSql === 'true' ? <Col className="short-label" span={8}> <Form.Item label="鎺掑簭鏂瑰紡"> {getFieldDecorator('order', { diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index 57db645..3473421 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -592,7 +592,6 @@ delete _verify.tableName delete _verify.dataresource delete _verify.queryType - delete _verify.primaryKey delete _verify.defaultSql delete _verify.order @@ -1056,7 +1055,6 @@ verify.tableName = verify.tableName || config.setting.tableName || '' verify.dataresource = verify.dataresource || config.setting.dataresource || '' verify.queryType = verify.queryType || config.setting.queryType || '' - verify.primaryKey = verify.primaryKey || config.setting.primaryKey || '' verify.defaultSql = verify.defaultSql || config.setting.execute || '' verify.order = verify.order || config.setting.order || '' -- Gitblit v1.8.0