From d958423116570cb918270ed7b61f7b9c9c2807ba Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 30 十一月 2020 14:11:10 +0800 Subject: [PATCH] 2020-11-30 --- src/templates/modalconfig/index.jsx | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx index ae31bdb..58e2a55 100644 --- a/src/templates/modalconfig/index.jsx +++ b/src/templates/modalconfig/index.jsx @@ -94,7 +94,7 @@ if (subConfig) { _config = subConfig } else { - _config = JSON.parse(JSON.stringify(BaseConfig)) + _config = fromJS(BaseConfig).toJS() } if (!_config.setting.title) { @@ -104,7 +104,7 @@ // 涓昏彍鍗曞凡鏈夐�夋嫨鐨勮〃鍚嶏紝妯℃�佹娌℃湁琛ㄥ悕鏃讹紝澶嶅埗涓昏彍鍗曡〃鍚� _config.tables = _config.tables.length === 0 ? _menu.tables : _config.tables - let _source = JSON.parse(JSON.stringify(SearchItems)) + let _source = fromJS(SearchItems).toJS() if (!!this.props.editTab) { _source.push({ type: 'form', @@ -120,7 +120,7 @@ source: _source, config: _config, selectedTables: _config.tables || [], - originConfig: JSON.parse(JSON.stringify(_config)), + originConfig: fromJS(_config).toJS(), modalformlist: [ { type: 'text', @@ -272,7 +272,7 @@ * 3銆佹柊澧炶〃鍗曟椂锛岀洿鎺ユ墦寮�缂栬緫妗� */ handleList = (list, group, elementId, newcard) => { - let _config = JSON.parse(JSON.stringify(this.state.config)) + let _config = fromJS(this.state.config).toJS() if (!group && !elementId) { // 娌℃湁鍒嗙粍鏃讹紙鎷栨嫿娣诲姞锛� @@ -354,7 +354,7 @@ */ handleForm = (_card) => { const { menu, tabConfig, subTabConfig } = this.props - let card = JSON.parse(JSON.stringify(_card)) + let card = fromJS(_card).toJS() const { config } = this.state let _inputfields = [] let _linkableFields = [] @@ -451,7 +451,7 @@ */ handleSubmit = () => { this.formRef.handleConfirm().then(res => { - let _config = JSON.parse(JSON.stringify(this.state.config)) + let _config = fromJS(this.state.config).toJS() let fieldrepet = false // 瀛楁閲嶅 let labelrepet = false // 鎻愮ず鏂囧瓧閲嶅 @@ -560,7 +560,7 @@ confirm({ content: `纭畾鍒犻櫎<<${card.label}>>鍚楋紵`, onOk() { - let _config = JSON.parse(JSON.stringify(_this.state.config)) + let _config = fromJS(_this.state.config).toJS() if (_config.groups.length > 0) { _config.groups.forEach(group => { @@ -744,7 +744,7 @@ }) } - let _config = JSON.parse(JSON.stringify(this.state.config)) + let _config = fromJS(this.state.config).toJS() let cards = this.refs.searchcard.state.selectCards let columns = new Map() @@ -972,7 +972,7 @@ confirm({ content: `纭畾鍒犻櫎鍒嗙粍<<${group.label}>>鍚楋紵`, onOk() { - let _config = JSON.parse(JSON.stringify(_this.state.config)) + let _config = fromJS(_this.state.config).toJS() _config.groups = _config.groups.filter(item => !(item.uuid === group.uuid)) let _length = _config.groups.length @@ -992,8 +992,8 @@ } handleGroupSave = () => { - let _group = JSON.parse(JSON.stringify(this.state.curgroup)) - let config = JSON.parse(JSON.stringify(this.state.config)) + let _group = fromJS(this.state.curgroup).toJS() + let config = fromJS(this.state.config).toJS() this.groupRef.handleConfirm().then(res => { _group = {..._group, ...res.target} @@ -1076,6 +1076,7 @@ this.setState({ config: res.content }) + this.handleForm(res.newform) } } -- Gitblit v1.8.0