From e4666c46c685ec7eabff25af9890d54c0ff2952b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 16 六月 2023 17:55:56 +0800 Subject: [PATCH] 2023-06-16 --- src/tabviews/custom/components/table/edit-table/index.jsx | 28 +++++++++++++++++++++++++++- 1 files changed, 27 insertions(+), 1 deletions(-) diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx index b2d83f8..f21a620 100644 --- a/src/tabviews/custom/components/table/edit-table/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/index.jsx @@ -79,6 +79,7 @@ let _columns = [] setting.initId = '' let triMap = new Map() + setting.hasSubmit = false let getColumns = (cols) => { return cols.filter(item => { @@ -115,6 +116,7 @@ } if (item.editable === 'true') { + setting.hasSubmit = true if (!setting.initId) { setting.initId = item.uuid } @@ -500,6 +502,28 @@ } } + refreshLineData = (menuId, btn, uuid, count) => { + const { config } = this.state + + if (config.uuid !== menuId) return + + let _data = fromJS(this.state.data).toJS().forEach(item => { + if (item.$$uuid === uuid) { + item[btn.field] = count + } + }) + let _selectedData = fromJS(this.state.selectedData).toJS().forEach(item => { + if (item.$$uuid === uuid) { + item[btn.field] = count + } + }) + + this.setState({ + data: _data, + selectedData: _selectedData + }) + } + UNSAFE_componentWillReceiveProps(nextProps) { const { config } = this.state @@ -518,6 +542,7 @@ MKEmitter.addListener('reloadData', this.reloadData) MKEmitter.addListener('resetSelectLine', this.resetParentParam) MKEmitter.addListener('queryModuleParam', this.queryModuleParam) + MKEmitter.addListener('refreshLineData', this.refreshLineData) MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult) } @@ -531,6 +556,7 @@ MKEmitter.removeListener('reloadData', this.reloadData) MKEmitter.removeListener('resetSelectLine', this.resetParentParam) MKEmitter.removeListener('queryModuleParam', this.queryModuleParam) + MKEmitter.removeListener('refreshLineData', this.refreshLineData) MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult) } @@ -543,7 +569,7 @@ } return ( - <div className="custom-edit-table" id={'anchor' + config.uuid} style={style}> + <div className={'custom-edit-table' + (setting.hasSubmit ? '' : ' withnot-submit')} id={'anchor' + config.uuid} style={style}> <NormalHeader config={config}/> {config.search && config.search.length ? <MainSearch BID={BID} config={config} refreshdata={this.refreshbysearch}/> : null -- Gitblit v1.8.0