From 84804b405cb88f659d055b16eb3bd00b813ccb4a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 10 十二月 2020 10:58:38 +0800 Subject: [PATCH] 2020-12-10 --- src/templates/subtableconfig/index.jsx | 18 ++++-------------- 1 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx index 5a2cebe..131aabb 100644 --- a/src/templates/subtableconfig/index.jsx +++ b/src/templates/subtableconfig/index.jsx @@ -19,7 +19,6 @@ import ColumnComponent from '@/templates/sharecomponent/columncomponent' import MenuForm from './menuform' -import EditComponent from '@/templates/zshare/editcomponent' import SourceElement from '@/templates/zshare/dragsource' import Source from './source' import './index.scss' @@ -27,6 +26,7 @@ const { Panel } = Collapse const { confirm } = Modal +const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent')) const SettingComponent = asyncComponent(() => import('@/templates/sharecomponent/settingcomponent')) const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent')) const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent')) @@ -930,17 +930,7 @@ config: res.config }) } else if (res.type === 'paste') { - let config = fromJS(this.state.config).toJS() - if (res.content.copyType === 'search') { - config.search.push(res.content) - } else if (res.content.copyType === 'action') { - config.action.push(res.content) - } else if (res.content.copyType === 'columns' && res.content.columns && res.content.columns.length > 0) { - config.columns = config.columns.filter(col => !col.origin) - config.columns = [...config.columns, ...res.content.columns] - } - - this.setState({config}) + this.setState({config: res.config}) } } @@ -1101,8 +1091,8 @@ </div> } bordered={false} extra={ <div> - <EditComponent dict={this.state.dict} type="subtable" config={this.state.config} thawButtons={this.state.thawButtons} refresh={this.updateConfig}/> - <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={this.state.config.enabled} onChange={this.onEnabledChange} /> + <EditComponent dict={this.state.dict} options={['search', 'action', 'columns']} config={config} MenuID={config.uuid} thawButtons={this.state.thawButtons} refresh={this.updateConfig}/> + <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={config.enabled} onChange={this.onEnabledChange} /> <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button> </div> -- Gitblit v1.8.0