From 79e4981aa6cc9354276fc54cdf6d14eb08ab7fee Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 22 六月 2023 15:59:04 +0800 Subject: [PATCH] Merge branch 'develop' of ssh://121.36.20.145:29418/~jinfei/pc-plat into develop --- src/components/normalform/modalform/index.jsx | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/src/components/normalform/modalform/index.jsx b/src/components/normalform/modalform/index.jsx index c3e3144..7ce6bc5 100644 --- a/src/components/normalform/modalform/index.jsx +++ b/src/components/normalform/modalform/index.jsx @@ -178,7 +178,9 @@ recordChange = (values, item) => { this.record = {...this.record, ...values} - if (item && item.controlFields) { + if (!item) return + + if (item.controlFields) { let map = new Map() this.state.formlist.forEach(cell => { if (!cell.field) return @@ -239,6 +241,24 @@ return item || cell }) }) + } else if (item.reset_source) { + let map = new Map() + this.state.formlist.forEach(cell => { + if (!cell.field) return + map.set(cell.field, cell) + }) + + item.callback(map, this.record) + + this.setState({ + formlist: this.state.formlist.map(cell => { + if (!cell.field) return cell + + let item = map.get(cell.field) + + return item || cell + }) + }) } } -- Gitblit v1.8.0