| | |
| | | import SearchComponent from '@/templates/sharecomponent/searchcomponent' |
| | | |
| | | import MenuForm from '@/templates/comtableconfig/menuform' |
| | | import EditComponent from '@/templates/zshare/editcomponent' |
| | | import SourceElement from '@/templates/zshare/dragsource' |
| | | import Source from './source' |
| | | import './index.scss' |
| | |
| | | const { Panel } = Collapse |
| | | const { confirm } = Modal |
| | | |
| | | const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent')) |
| | | const SettingComponent = asyncComponent(() => import('@/templates/sharecomponent/settingcalcomponent')) |
| | | const TabComponent = asyncComponent(() => import('./tabcomponent')) |
| | | const CalComponent = asyncComponent(() => import('./calcomponent')) |
| | |
| | | } |
| | | |
| | | state = { |
| | | dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, // 字典 |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, // 字典 |
| | | config: null, // 页面配置 |
| | | visible: false, // 搜索条件、按钮、显示列,模态框显示控制 |
| | | tableFields: [], // 已选表字段集 |
| | | fields: null, // 搜索条件及显示列,可选字段 |
| | | formlist: null, // 搜索条件、按钮、显示列表单字段 |
| | | menuloading: false, // 菜单保存中 |
| | |
| | | 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) |
| | | } |
| | | |
| | | this.setState({config}) |
| | | this.setState({config: res.config}) |
| | | } |
| | | } |
| | | |
| | |
| | | updateconfig = (config) => { |
| | | this.setState({ |
| | | config: config |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 更新常用表信息,快捷添加后更新配置信息 |
| | | */ |
| | | updatetable = (config, fields) => { |
| | | const { tableFields } = this.state |
| | | |
| | | this.setState({ |
| | | config: config, |
| | | tableFields: fields ? fields : tableFields |
| | | }) |
| | | } |
| | | |
| | |
| | | <TableComponent |
| | | config={config} |
| | | containerId="subtable-basedata" |
| | | updatetable={this.updatetable} |
| | | updatetable={this.updateconfig} |
| | | /> |
| | | </Panel> |
| | | {/* 搜索条件添加 */} |
| | |
| | | <FieldsComponent |
| | | config={config} |
| | | type="search" |
| | | tableFields={this.state.tableFields} |
| | | updatefield={this.updateconfig} |
| | | /> |
| | | </Panel> |
| | |
| | | </div> |
| | | } bordered={false} extra={ |
| | | <div> |
| | | <EditComponent dict={this.state.dict} type="calendar" config={this.state.config} refresh={this.updateConfig}/> |
| | | <EditComponent dict={this.state.dict} options={['search']} config={this.state.config} refresh={this.updateConfig}/> |
| | | <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={this.state.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> |
| | |
| | | <SettingComponent |
| | | config={config} |
| | | MenuID={menu.MenuID} |
| | | tableFields={this.state.tableFields} |
| | | updateConfig={this.updateconfig} |
| | | /> |
| | | <SearchComponent |