| | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { BaseConfig, SearchItems } from './source' |
| | | import { updateForm } from '@/utils/utils-update.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | const { Panel } = Collapse |
| | |
| | | |
| | | const Versions = asyncComponent(() => import('@/menu/versions')) |
| | | const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) |
| | | const StyleController = asyncComponent(() => import('@/menu/stylecontroller')) |
| | | const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform')) |
| | | const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent')) |
| | | const DragElement = asyncComponent(() => import('./dragelement')) |
| | |
| | | } |
| | | |
| | | componentDidMount() { |
| | | MKEmitter.addListener('submitStyle', this.getStyle) |
| | | document.onkeydown = (event) => { |
| | | let e = event || window.event |
| | | let keyCode = e.keyCode || e.which || e.charCode |
| | |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | | componentWillUnmount () { |
| | | MKEmitter.removeListener('submitStyle', this.getStyle) |
| | | this.setState = () => { |
| | | return |
| | | } |
| | |
| | | } |
| | | |
| | | this.props.handleView(param) |
| | | } |
| | | |
| | | getStyle = (comIds, style) => { |
| | | const { config } = this.state |
| | | |
| | | if (comIds[0] !== 'form') return |
| | | |
| | | let Index = config.fields.findIndex(n => n.uuid === comIds[1]) |
| | | |
| | | if (Index === -1) return |
| | | |
| | | let _config = fromJS(config).toJS() |
| | | |
| | | _config.fields[Index].style = style |
| | | |
| | | this.setState({ |
| | | config: _config |
| | | }) |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | if (item.uuid === res.uuid) { |
| | | if (item.style) { |
| | | res.style = item.style |
| | | } |
| | | return res |
| | | } else { |
| | | return item |
| | |
| | | <Modal |
| | | title={dict['model.edit']} |
| | | visible={this.state.visible} |
| | | width={850} |
| | | width={950} |
| | | maskClosable={false} |
| | | onCancel={this.editModalCancel} |
| | | onOk={this.handleSubmit} |
| | |
| | | > |
| | | {dict['header.menu.config.placeholder']} |
| | | </Modal> |
| | | <StyleController /> |
| | | </div> |
| | | ) |
| | | } |