From 9d65dcb2e35f8091f71110c4de7a04215b63b81e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 08 五月 2021 16:59:28 +0800 Subject: [PATCH] 2021-05-08 --- src/tabviews/zshare/topSearch/index.jsx | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx index 056869e..1fbf809 100644 --- a/src/tabviews/zshare/topSearch/index.jsx +++ b/src/tabviews/zshare/topSearch/index.jsx @@ -693,6 +693,20 @@ if (!err) { values = this.addHideFieldValue(values) let searches = this.getFieldsValues(values) + + let requireFields = searches.filter(item => item.required && (!item.value || item.value.length === 0)) + if (requireFields.length > 0) { + let labels = requireFields.map(item => item.label) + labels = Array.from(new Set(labels)) + + notification.warning({ + top: 92, + message: this.state.dict['form.required.input'] + labels.join('銆�') + ' !', + duration: 3 + }) + return + } + this.props.refreshdata(searches) } }) @@ -704,6 +718,12 @@ if (!err) { values = this.addHideFieldValue(values) let searches = this.getFieldsValues(values) + + let requireFields = searches.filter(item => item.required && (!item.value || item.value.length === 0)) + if (requireFields.length > 0) { + return + } + this.props.refreshdata(searches) } }) @@ -735,6 +755,20 @@ this.setState({}, () => { values = this.addHideFieldValue(values) let searches = this.getFieldsValues(values) + + let requireFields = searches.filter(item => item.required && (!item.value || item.value.length === 0)) + if (requireFields.length > 0) { + let labels = requireFields.map(item => item.label) + labels = Array.from(new Set(labels)) + + notification.warning({ + top: 92, + message: this.state.dict['form.required.input'] + labels.join('銆�') + ' !', + duration: 3 + }) + return + } + this.props.refreshdata(searches) }) } -- Gitblit v1.8.0