| | |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | appType: sessionStorage.getItem('appType'), |
| | | card: null, // 编辑中元素 |
| | | formlist: null, // 表单信息 |
| | | actionlist: null, // 按钮组 |
| | |
| | | const { config } = this.props |
| | | |
| | | let _style = element.style ? fromJS(element.style).toJS() : {} |
| | | let options = ['font', 'border', 'background', 'margin'] |
| | | let options = ['font', 'border', 'background', 'margin', 'padding'] |
| | | |
| | | this.setState({ |
| | | card: element |
| | |
| | | if (usefulFields) { |
| | | try { |
| | | usefulFields = JSON.parse(usefulFields) |
| | | } catch { |
| | | } catch (e) { |
| | | usefulFields = [] |
| | | } |
| | | } else { |
| | |
| | | if (menulist) { |
| | | try { |
| | | menulist = JSON.parse(menulist) |
| | | } catch { |
| | | } catch (e) { |
| | | menulist = [] |
| | | } |
| | | } else { |
| | | menulist = [] |
| | | } |
| | | |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, config.uuid) |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, config.uuid) || [] |
| | | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | | formlist: getActionForm(card, functip, config.setting, usefulFields, this.props.type, menulist, modules, config.columns) |
| | | formlist: getActionForm(card, functip, config, usefulFields, this.props.type, menulist, modules) |
| | | }) |
| | | } |
| | | |
| | |
| | | */ |
| | | deleteElement = (card) => { |
| | | const { config } = this.props |
| | | const { dict } = this.state |
| | | const { dict, appType } = this.state |
| | | let _this = this |
| | | |
| | | confirm({ |
| | |
| | | let _actionlist = fromJS(_this.state.actionlist).toJS() |
| | | |
| | | _actionlist = _actionlist.filter(item => item.uuid !== card.uuid) |
| | | |
| | | if (!card.origin) { |
| | | MKEmitter.emit('delButtons', [card.uuid]) |
| | | } |
| | | |
| | | let btnlog = config.btnlog || [] |
| | | if (card.OpenType === 'popview' || card.verify || card.modal) { |
| | |
| | | }, () => { |
| | | _this.props.updateaction({...config, action: _actionlist, btnlog}) |
| | | }) |
| | | |
| | | if (card.origin || appType === 'mob') return |
| | | if (appType === 'pc' && card.OpenType !== 'popview') return |
| | | |
| | | MKEmitter.emit('delButtons', [card.uuid]) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | } else if (element.OpenType === 'innerpage' && element.pageTemplate === 'linkpage') { |
| | | MKEmitter.emit('changeEditMenu', {MenuID: element.linkmenu}) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '此按钮无子配置项!', |
| | | duration: 5 |
| | | }) |
| | | this.handleAction(element) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { actionlist, visible, card, dict, profVisible } = this.state |
| | | const { config, type } = this.props |
| | | const { actionlist, visible, appType, card, dict, profVisible } = this.state |
| | | |
| | | return ( |
| | | <div className={'model-menu-action-list'}> |
| | | <DragElement |
| | | list={actionlist} |
| | | type={appType === 'mob' ? (type || '') : ''} |
| | | handleList={this.handleList} |
| | | dropButton={this.dropButton} |
| | | handleMenu={this.handleAction} |
| | |
| | | {/* 按钮使用系统存储过程时,验证信息模态框 */} |
| | | <Modal |
| | | wrapClassName="model-table-action-verify-modal" |
| | | title={'验证信息'} |
| | | title={(card && card.label ? card.label + ' - ' : '') + '验证信息'} |
| | | visible={profVisible} |
| | | width={'75vw'} |
| | | maskClosable={false} |
| | | okText={dict['model.submit']} |
| | | onOk={this.verifySubmit} |
| | | onCancel={() => { this.setState({ profVisible: false }) }} |
| | | onCancel={() => { |
| | | if (this.verifyRef.handleCancel) { |
| | | this.verifyRef.handleCancel().then(() => { |
| | | this.setState({ profVisible: false }) |
| | | }) |
| | | } else { |
| | | this.setState({ profVisible: false }) |
| | | } |
| | | }} |
| | | destroyOnClose |
| | | > |
| | | {card && !card.execMode && card.OpenType !== 'excelIn' && card.OpenType !== 'excelOut' ? |