From 4a18149d7ca9a0ea3ad569297f34e928c59e2025 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 21 三月 2020 20:30:08 +0800 Subject: [PATCH] 2020-03-21 --- src/templates/modalconfig/index.jsx | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx index 32f5fe2..a1d9d59 100644 --- a/src/templates/modalconfig/index.jsx +++ b/src/templates/modalconfig/index.jsx @@ -20,7 +20,7 @@ import GroupForm from './groupform' import EditCard from './editcard' import MenuForm from './menuform' -import Source from './source' +import { BaseConfig, SearchItems } from './source' import './index.scss' const { Panel } = Collapse @@ -64,7 +64,8 @@ originConfig: null, // 鍘熷鑿滃崟 groupVisible: false, // 鍏ㄥ眬閰嶇疆妯℃�佹 curgroup: null, // 褰撳墠缁勶紝鏂板缓鎴栫紪杈� - optionLibs: null // 鑷畾涔変笅鎷夐�夐」搴� + optionLibs: null, // 鑷畾涔変笅鎷夐�夐」搴� + sources: null // 琛ㄥ崟绫诲瀷 } /** @@ -127,7 +128,7 @@ }) } } else { - _config = JSON.parse(JSON.stringify((Source.baseConfig))) + _config = JSON.parse(JSON.stringify(BaseConfig)) } if (!_config.setting.title) { @@ -137,8 +138,19 @@ // 涓昏彍鍗曞凡鏈夐�夋嫨鐨勮〃鍚嶏紝妯℃�佹娌℃湁琛ㄥ悕鏃讹紝澶嶅埗涓昏彍鍗曡〃鍚� _config.tables = _config.tables.length === 0 ? _menu.tables : _config.tables + let _source = JSON.parse(JSON.stringify(SearchItems)) + if (!!this.props.editTab) { + _source.push({ + type: 'form', + label: this.state.dict['header.form.linkMain'], + subType: 'linkMain', + url: '' + }) + } + this.setState({ menu: _menu, + source: _source, optionLibs: optionLibs, config: _config, selectedTables: _config.tables || [], @@ -1126,7 +1138,7 @@ } render () { - const { config } = this.state + const { config, source } = this.state return ( <div className="modal-form-board"> @@ -1173,7 +1185,7 @@ </Panel> <Panel header={this.state.dict['header.menu.form']} key="1"> <div className="search-element"> - {Source.searchItems.map((item, index) => { + {source.map((item, index) => { return (<SourceElement key={index} content={item}/>) })} </div> -- Gitblit v1.8.0