| | |
| | | MKEmitter.addListener('modalStatus', this.modalStatus) |
| | | MKEmitter.addListener('triggerMenuSave', this.submitConfig) |
| | | MKEmitter.addListener('changeEditMenu', this.changeEditMenu) |
| | | MKEmitter.addListener('submitComponentStyle', this.updateComponentStyle) |
| | | MKEmitter.addListener('updateCustomComponent', this.updateCustomComponent) |
| | | setTimeout(() => { |
| | | if (sessionStorage.getItem('app_custom_components')) { |
| | |
| | | MKEmitter.removeListener('modalStatus', this.modalStatus) |
| | | MKEmitter.removeListener('triggerMenuSave', this.submitConfig) |
| | | MKEmitter.removeListener('changeEditMenu', this.changeEditMenu) |
| | | MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle) |
| | | MKEmitter.removeListener('updateCustomComponent', this.updateCustomComponent) |
| | | } |
| | | |
| | |
| | | this.setState({customComponents: coms}) |
| | | } |
| | | |
| | | updateComponentStyle = (parentId, keys, style) => { |
| | | const { config } = this.state |
| | | |
| | | if (config.uuid !== parentId) return |
| | | |
| | | let components = config.components.map(item => { |
| | | if (keys.includes(item.uuid)) { |
| | | item.style = {...item.style, ...style} |
| | | } |
| | | return item |
| | | }) |
| | | |
| | | this.setState({ |
| | | config: {...config, components}, |
| | | comloading: true |
| | | }, () => { |
| | | this.setState({ |
| | | comloading: false |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | closeView = () => { |
| | | const { oriConfig, config } = this.state |
| | | |
| | |
| | | backElements: [] |
| | | } |
| | | ], |
| | | headerStyle: {}, parentId: '', width: 24, scripts: [], pageable: false, |
| | | headerStyle: {}, width: 24, scripts: [], pageable: false, |
| | | wrap: {name: 'logo', width: 24, datatype: 'static', cardType: '', blacklist: []}, |
| | | name: 'logo', floor: 1, switchable: true, |
| | | setting:{interType: 'system'}, tabId: '', style:{paddingTop: '8vh', paddingBottom: '10vh'}, format: 'object', subtype: 'propcard', type: 'card', uuid: Utils.getuuid(), columns: [] |
| | | setting:{interType: 'system'}, style:{paddingTop: '8vh', paddingBottom: '10vh'}, format: 'object', subtype: 'propcard', type: 'card', uuid: Utils.getuuid(), columns: [] |
| | | }) |
| | | |
| | | config.components.push({ |
| | | uuid: Utils.getuuid(), |
| | | type: 'login', |
| | | floor: 1, |
| | | tabId: '', |
| | | parentId: '', |
| | | width: 24, |
| | | name: '用户绑定', |
| | | subtype: 'bindlogin', |
| | |
| | | backElements: [] |
| | | } |
| | | ], |
| | | headerStyle: {}, parentId: '', width: 24, scripts: [], pageable: false, |
| | | headerStyle: {}, width: 24, scripts: [], pageable: false, |
| | | wrap: {name: 'Power', width: 24, datatype: 'static', cardType: '', blacklist: []}, |
| | | name: 'Power', floor: 1, switchable: true, |
| | | setting:{interType: 'system'}, tabId: '', style:{}, format: 'object', subtype: 'propcard', type: 'card', uuid: Utils.getuuid(), columns: [] |
| | | setting:{interType: 'system'}, style:{}, format: 'object', subtype: 'propcard', type: 'card', uuid: Utils.getuuid(), columns: [] |
| | | }) |
| | | } |
| | | |