From 71d4765ba3cdc4a004687cd37a529b565e9ea9fd Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 06 七月 2021 16:26:29 +0800 Subject: [PATCH] 2021-07-06 --- src/mob/modalconfig/index.jsx | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mob/modalconfig/index.jsx b/src/mob/modalconfig/index.jsx index a91737d..fc634fd 100644 --- a/src/mob/modalconfig/index.jsx +++ b/src/mob/modalconfig/index.jsx @@ -12,7 +12,6 @@ import enUS from '@/locales/en-US/model.js' import { getModalForm } from '@/templates/zshare/formconfig' -import ModalForm from '@/templates/zshare/modalform' import SourceElement from '@/templates/modalconfig/dragelement/source' import SettingForm from '@/templates/modalconfig/settingform' import asyncComponent from '@/utils/asyncComponent' @@ -23,6 +22,7 @@ const { confirm } = Modal const CommonDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS const PasteComponent = asyncComponent(() => import('./pastecomponent')) +const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform')) const DragElement = asyncComponent(() => import('@/mob/components/formdragelement')) const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent')) @@ -365,6 +365,14 @@ }) } + insert = (config) => { + this.setState({ + config + }, () => { + this.handleForm(config.fields[config.fields.length - 1]) + }) + } + render () { const { config, dict } = this.state @@ -391,7 +399,7 @@ <Button icon="setting" onClick={this.changeSetting}>璁剧疆</Button> <Button type="primary" onClick={this.submitConfig}>淇濆瓨</Button> <Button onClick={this.cancelConfig}>杩斿洖</Button> - <PasteComponent type="menu" Tab={null} insert={this.insert} /> + <PasteComponent config={config} updateConfig={this.insert} /> <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> </div> <div className="setting"> -- Gitblit v1.8.0