From 28ebe609e47b28794450cefc72d3e0f62fd904e7 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 09 五月 2022 01:04:19 +0800 Subject: [PATCH] 2022-05-09 --- src/templates/sharecomponent/settingcomponent/settingform/index.jsx | 51 ++++++++++++++------------------------------------- 1 files changed, 14 insertions(+), 37 deletions(-) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx index 6ef30e6..b60fc7f 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx @@ -20,7 +20,8 @@ dict: PropTypes.object, // 瀛楀吀椤� menu: PropTypes.object, // 鑿滃崟淇℃伅 config: PropTypes.object, // 椤甸潰閰嶇疆淇℃伅 - search: PropTypes.array // 鎼滅储鏉′欢 + search: PropTypes.array, // 鎼滅储鏉′欢 + updRecord: PropTypes.func } state = { @@ -126,6 +127,10 @@ cbScripts: _cbScripts, status }) + } + + componentDidMount () { + this.props.updRecord(this.state.status) } getRegOptions = (searches) => { @@ -257,26 +262,6 @@ if (activeKey === 'setting') { return new Promise((resolve, reject) => { this.settingForm.handleConfirm().then(res => { - if (trigger === 'func' && res.interType !== 'inner') { - notification.warning({ - top: 92, - message: '浣跨敤鍐呴儴鎺ュ彛锛屾墠鍙互鍒涘缓瀛樺偍杩囩▼锛�', - duration: 5 - }) - this.setState({loading: false}) - reject() - return - } else if (trigger === 'interface' && res.interType !== 'system') { - notification.warning({ - top: 92, - message: '浣跨敤绯荤粺鎺ュ彛鏃讹紝鎵嶅彲浠ュ垱寤烘帴鍙o紒', - duration: 5 - }) - this.setState({loading: false}) - reject() - return - } - this.setState({ setting: res }, () => { @@ -295,23 +280,13 @@ }) } else if (activeKey === 'scripts') { return new Promise((resolve, reject) => { - if (trigger === 'func' && setting.interType !== 'inner') { - notification.warning({ - top: 92, - message: '浣跨敤鍐呴儴鎺ュ彛锛屾墠鍙互鍒涘缓瀛樺偍杩囩▼锛�', - duration: 5 - }) + this.sqlverify(() => { + this.setState({loading: false}) + resolve({...setting, scripts, preScripts, cbScripts}) + }, () => { this.setState({loading: false}) reject() - } else { - this.sqlverify(() => { - this.setState({loading: false}) - resolve({...setting, scripts, preScripts, cbScripts}) - }, () => { - this.setState({loading: false}) - reject() - }, 'submit') - } + }, 'submit') }) } else { this.setState({loading: false}) @@ -519,7 +494,9 @@ } updateStatus = (status) => { - this.setState({status: {...this.state.status, ...status}}) + let _status = {...this.state.status, ...status} + this.setState({status: _status}) + this.props.updRecord(_status) } render() { -- Gitblit v1.8.0