From 823c72bc5918bf9d2fdd8415607908b68ebcd399 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 11 五月 2022 08:34:15 +0800 Subject: [PATCH] 2022-05-11 --- src/tabviews/subtable/index.jsx | 64 ++++++++++++++++++++++++++------ 1 files changed, 52 insertions(+), 12 deletions(-) diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index b71b95a..b5fa826 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -160,18 +160,21 @@ return col }) - // 瑙嗗浘鏉冮檺 - config.charts = config.charts.filter(item => { - if (item.Hide === 'true') return false - if (!item.blacklist || item.blacklist.length === 0) return true - return item.blacklist.filter(v => roleId.indexOf(v) > -1).length === 0 - }) - - if (config.charts.length <= 1) { - config.expand = true + let chartId = '' + if (config.charts) { + // 瑙嗗浘鏉冮檺 + config.charts = config.charts.filter(item => { + if (item.Hide === 'true') return false + if (!item.blacklist || item.blacklist.length === 0) return true + return item.blacklist.filter(v => roleId.indexOf(v) > -1).length === 0 + }) + + if (config.charts.length <= 1) { + config.expand = true + } + + chartId = config.charts[0] ? config.charts[0].uuid : '' } - - let chartId = config.charts[0] ? config.charts[0].uuid : '' // 1銆佺瓫閫夊瓧娈甸泦锛�2銆佽繃婊ら殣钘忓垪鍙婂悎骞跺垪涓殑瀛楁uuid config.columns.forEach(col => { @@ -999,7 +1002,7 @@ {searchlist && searchlist.length ? <SubSearch BID={BID} setting={setting} searchlist={searchlist} menuType={this.props.menuType} refreshdata={this.refreshbysearch}/> : null } - {config ? <Row className="chart-view" gutter={16}> + {config && config.charts ? <Row className="chart-view" gutter={16}> {/* 瑙嗗浘缁� */} {!config.expand ? <Tabs activeKey={chartId} onChange={this.changeChart}> {config.charts.map(item => ( @@ -1083,6 +1086,43 @@ } })} </Row> : null } + {config && !config.charts ? <> + <div className="sub-action"> + <SubAction + BID={BID} + BData={BData} + setting={setting} + actions={actions} + columns={columns} + Tab={this.props.Tab} + MenuID={this.props.MenuID} + selectedData={selectedData} + ContainerId={this.props.ContainerId} + /> + </div> + <div className="subtable-box"> + {(setting.tableType === 'radio' || setting.tableType === 'checkbox') && this.state.data && this.state.data.length > 0 ? + <Switch title="鏀惰捣" className="subtable-pickup" checkedChildren="寮�" unCheckedChildren="鍏�" checked={pickup} onChange={this.pickupChange} /> : null + } + <SubTable + BData={BData} + tableId={this.props.Tab.uuid} + pickup={pickup} + setting={setting} + columns={columns} + pageSize={pageSize} + dict={this.state.dict} + data={this.state.data} + total={this.state.total} + MenuID={this.props.MenuID} + loading={this.state.loading} + statFValue={this.state.statFValue} + ContainerId={this.props.ContainerId} + refreshdata={this.refreshbytable} + chgSelectData={this.changeSelectedData} + /> + </div> + </> : null } {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} </div> ) -- Gitblit v1.8.0