From 669839c40c0080786cefa6a8e62d3ada68a39b8e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 14 六月 2022 14:10:50 +0800 Subject: [PATCH] 2022-06-14 --- src/tabviews/custom/components/form/tab-form/index.jsx | 32 ++++++++++++++++++++++++-------- 1 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/tabviews/custom/components/form/tab-form/index.jsx b/src/tabviews/custom/components/form/tab-form/index.jsx index 69100f4..acddb29 100644 --- a/src/tabviews/custom/components/form/tab-form/index.jsx +++ b/src/tabviews/custom/components/form/tab-form/index.jsx @@ -31,12 +31,13 @@ config: null, // 鍥捐〃閰嶇疆淇℃伅 loading: false, // 鏁版嵁鍔犺浇鐘舵�� sync: false, // 鏄惁缁熶竴璇锋眰鏁版嵁 - data: null, // 鏁版嵁 + data: null, + BData: '', group: null, } UNSAFE_componentWillMount () { - const { data, BID } = this.props + const { data, BID, BData } = this.props let config = fromJS(this.props.config).toJS() let _data = null @@ -78,6 +79,7 @@ data: _data, group: config.subcards[0], BID: BID || '', + BData: BData || '', config: config, arr_field: config.columns.map(col => col.field).join(','), }, () => { @@ -168,13 +170,26 @@ this.execSuccess(btn, id) } - resetParentParam = (MenuID, id) => { + resetParentParam = (MenuID, id, data) => { const { config } = this.state - if (config.wrap.datatype === 'static' || !config.setting.supModule || config.setting.supModule !== MenuID) return + if (!config.setting.supModule || config.setting.supModule !== MenuID) return + if (id !== this.state.BID || id !== '') { - this.setState({ BID: id }, () => { - this.loadData() - }) + if (config.wrap.datatype === 'static' || (config.setting.supModule && !id)) { + this.setState({ + data: null, + BID: id, + BData: data + }, () => { + this.setState({ + data: {$$empty: true} + }) + }) + } else { + this.setState({ BID: id, BData: data }, () => { + this.loadData() + }) + } } } @@ -264,7 +279,7 @@ } render() { - const { config, loading, BID, data, group, dict } = this.state + const { config, loading, BID, BData, data, group, dict } = this.state return ( <div className="custom-tab-form-box" id={'anchor' + config.uuid} style={{...config.style}}> @@ -283,6 +298,7 @@ </div> : null} {group && data ? <MutilForm BID={BID} + BData={BData} dict={dict} data={data} action={group} -- Gitblit v1.8.0