| | |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | appType: sessionStorage.getItem('appType'), |
| | | card: null, // 编辑中元素 |
| | | formlist: null, // 表单信息 |
| | | visible: false, // 模态框控制 |
| | |
| | | const { group } = this.props |
| | | |
| | | let _style = element.style ? fromJS(element.style).toJS() : {} |
| | | let options = ['font', 'border', 'padding', 'margin', 'backgroundColor'] |
| | | let options = ['font', 'border', 'padding', 'margin', 'backgroundColor', 'width'] |
| | | |
| | | this.setState({ |
| | | card: element |
| | |
| | | if (usefulFields) { |
| | | try { |
| | | usefulFields = JSON.parse(usefulFields) |
| | | } catch { |
| | | } catch (e) { |
| | | usefulFields = [] |
| | | } |
| | | } else { |
| | |
| | | }) |
| | | } |
| | | |
| | | changeMenu = () => { |
| | | const { appType } = this.state |
| | | const { group } = this.props |
| | | |
| | | if (appType !== 'pc' && appType !== 'mob') return |
| | | if (!group.subButton.linkmenu) return |
| | | |
| | | MKEmitter.emit('changeEditMenu', { |
| | | MenuID: group.subButton.linkmenu, |
| | | copyMenuId: '', |
| | | MenuNo: '', |
| | | MenuName: '', |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { group, config } = this.props |
| | | const { visible, profVisible, card, dict } = this.state |
| | | |
| | | return ( |
| | | <div className="mk-form-action"> |
| | | {group.sort !== 1 ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | {group.prevButton && group.prevButton.enable !== 'false' && group.sort !== 1 ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="edit" title="编辑" type="edit" onClick={() => this.handleAction(group.prevButton)} /> |
| | | <Icon className="style" title="调整样式" onClick={() => this.handleStyle(group.prevButton)} type="font-colors" /> |
| | |
| | | <Icon className="profile" title="setting" type="profile" onClick={() => this.profileAction()} /> |
| | | </div> |
| | | } trigger="hover"> |
| | | <Button type="link" className="submit mk-primary" style={resetStyle(group.subButton.style)}>{group.subButton.label}</Button> |
| | | <Button type="link" className="submit mk-primary" onDoubleClick={this.changeMenu} style={resetStyle(group.subButton.style)}>{group.subButton.label}</Button> |
| | | </Popover> |
| | | {group.sort !== config.subcards.length ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | {group.nextButton && group.nextButton.enable !== 'false' && group.sort !== config.subcards.length ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="edit" title="编辑" type="edit" onClick={() => this.handleAction(group.nextButton)} /> |
| | | <Icon className="style" title="调整样式" onClick={() => this.handleStyle(group.nextButton)} type="font-colors" /> |
| | | </div> |
| | | } trigger="hover"> |
| | | <Button type="link" className={'skip ' + group.nextButton.enable} style={resetStyle(group.nextButton.style)}>{group.nextButton.label}</Button> |
| | | <Button type="link" className="skip" style={resetStyle(group.nextButton.style)}>{group.nextButton.label}</Button> |
| | | </Popover> : null} |
| | | {/* 编辑按钮:复制、编辑 */} |
| | | <Modal |