From b6cbfb08b51e87e6eac995be8e7751815715e6a1 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 29 三月 2022 15:36:21 +0800 Subject: [PATCH] 2022-03-29 --- src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 73 ++++++++++++++++++++++-------------- 1 files changed, 44 insertions(+), 29 deletions(-) diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index c72e73b..9d7eaf9 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -1239,6 +1239,10 @@ setTimeout(() => { this.plusLine() }, 10) + } else if (edData[index]) { + setTimeout(() => { + this.subLine(col, edData[index]) + }, 10) } } @@ -1877,7 +1881,11 @@ if (pickup && setting.tableType === 'checkbox' && keys.length > 0) { this.setState({ data: data, - edData: fromJS(data).toJS().filter(item => keys.includes(item.$$uuid)) + edData: fromJS(data).toJS().filter(item => { + item.$origin = false + + return keys.includes(item.$$uuid) + }) }) } else { this.setState({ @@ -1943,34 +1951,41 @@ let height = setting.height || false return ( - <div className={`edit-custom-table ${pickup ? 'editable' : ''} ${setting.tableHeader || ''} ${setting.operType || ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''}`} id={tableId}> - <Switch title="缂栬緫" className="main-pickup" checkedChildren="寮�" unCheckedChildren="鍏�" disabled={loading || this.props.loading} checked={pickup} onChange={this.pickupChange} /> - {pickup ? <Button style={submit.style} onClick={() => setTimeout(() => {this.checkData()}, 10)} loading={loading} className="submit-table" type="link">鎻愪氦</Button> : null} - <Table - rowKey="$$uuid" - components={components} - style={setting.style} - size={setting.size || 'middle'} - bordered={setting.bordered !== 'false'} - rowSelection={rowSelection} - columns={_columns} - dataSource={_data} - loading={this.props.loading} - scroll={{ x: '100%', y: height }} - onRow={(record, index) => { - return { - lineMarks, - data: record, - onClick: () => {this.changeRow(record.$$uuid)}, - } - }} - onChange={this.changeTable} - pagination={_pagination} - /> - {_footer ? <div className={'normal-table-footer ' + (_pagination ? 'pagination' : '')}>{_footer}</div> : null} - {pickup && setting.addable === 'true' ? <Button className="mk-add-line" onClick={() => this.addLine()} disabled={this.props.loading} type="link"><PlusOutlined /></Button> : null} - {pickup && _data.length > 10 ? <Button style={submit.style} onClick={() => setTimeout(() => {this.checkData()}, 10)} loading={loading} className="submit-footer-table" type="link">鎻愪氦</Button> : null} - </div> + <> + {submit.hasAction && pickup ? <div className="edit-custom-table-leftbtn-wrap"> + <Button style={submit.style} onClick={() => setTimeout(() => {this.checkData()}, 10)} loading={loading} className="submit-table" type="link">鎻愪氦</Button> + </div> : null} + <div className="edit-custom-table-btn-wrap" style={submit.wrapStyle}> + {!submit.hasAction && pickup ? <Button style={submit.style} onClick={() => setTimeout(() => {this.checkData()}, 10)} loading={loading} className="submit-table" type="link">鎻愪氦</Button> : null} + <Switch title="缂栬緫" className="main-pickup" checkedChildren="寮�" unCheckedChildren="鍏�" disabled={loading || this.props.loading} checked={pickup} onChange={this.pickupChange} /> + </div> + <div className={`edit-custom-table ${pickup ? 'editable' : ''} ${setting.tableHeader || ''} ${setting.operType || ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''}`} id={tableId}> + <Table + rowKey="$$uuid" + components={components} + style={setting.style} + size={setting.size || 'middle'} + bordered={setting.bordered !== 'false'} + rowSelection={rowSelection} + columns={_columns} + dataSource={_data} + loading={this.props.loading} + scroll={{ x: '100%', y: height }} + onRow={(record, index) => { + return { + lineMarks, + data: record, + onClick: () => {this.changeRow(record.$$uuid)}, + } + }} + onChange={this.changeTable} + pagination={_pagination} + /> + {_footer ? <div className={'normal-table-footer ' + (_pagination ? 'pagination' : '')}>{_footer}</div> : null} + {pickup && setting.addable === 'true' ? <Button className="mk-add-line" onClick={() => this.addLine()} disabled={this.props.loading} type="link"><PlusOutlined /></Button> : null} + {pickup && _data.length > 10 ? <Button style={submit.style} onClick={() => setTimeout(() => {this.checkData()}, 10)} loading={loading} className="submit-footer-table" type="link">鎻愪氦</Button> : null} + </div> + </> ) } } -- Gitblit v1.8.0