| | |
| | | type: PropTypes.string, // 菜单类型,主表或子表 |
| | | menu: PropTypes.object, // 菜单信息(菜单id,菜单参数,菜单名称) |
| | | config: PropTypes.object, // 菜单配置信息 |
| | | pasteContent: PropTypes.object, // 粘贴配置信息 |
| | | usefulFields: PropTypes.array, // 自定义函数可用字段 |
| | | tabs: PropTypes.array, // 所有标签 |
| | | setSubConfig: PropTypes.func, // 设置子配置信息 |
| | | updateaction: PropTypes.func // 菜单配置更新 |
| | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { actionlist } = this.state |
| | | |
| | | if (nextProps.pasteContent && nextProps.pasteContent.copyType === 'action') { |
| | | this.setState({actionlist: [...actionlist, nextProps.pasteContent]}) |
| | | this.handleAction(nextProps.pasteContent) |
| | | } else if (!is(fromJS(nextProps.config.action), fromJS(this.props.config.action)) && !is(fromJS(nextProps.config.action), fromJS(actionlist))) { |
| | | if (!is(fromJS(nextProps.config.action), fromJS(this.props.config.action)) && !is(fromJS(nextProps.config.action), fromJS(actionlist))) { |
| | | let len = nextProps.config.action.length |
| | | let item = nextProps.config.action[len - 1] |
| | | if (item.copyType && item.focus) { |
| | | this.handleAction(item) |
| | | } |
| | | this.setState({actionlist: fromJS(nextProps.config.action).toJS()}) |
| | | } |
| | | } |
| | |
| | | */ |
| | | handleAction = (card) => { |
| | | const { menu } = this.props |
| | | let ableField = this.props.usefulFields.join(', ') |
| | | |
| | | let usefulFields = sessionStorage.getItem('permFuncField') |
| | | if (usefulFields) { |
| | | try { |
| | | usefulFields = JSON.parse(usefulFields) |
| | | } catch { |
| | | usefulFields = [] |
| | | } |
| | | } else { |
| | | usefulFields = [] |
| | | } |
| | | |
| | | let ableField = usefulFields.join(', ') |
| | | let functip = <div> |
| | | <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p> |
| | | <p>{this.state.dict['model.tooltip.func.outface']}</p> |
| | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | | formlist: getActionForm(card, functip, this.props.config, this.props.usefulFields, this.props.type, menulist, this.state.printTemps) |
| | | formlist: getActionForm(card, functip, this.props.config, usefulFields, this.props.type, menulist, this.state.printTemps) |
| | | }) |
| | | } |
| | | |
| | |
| | | * @description 取消保存,如果元素为新添元素,则从序列中删除 |
| | | */ |
| | | editModalCancel = () => { |
| | | const { card } = this.state |
| | | const { config } = this.props |
| | | const { card, actionlist } = this.state |
| | | |
| | | if (card.focus) { |
| | | let actionlist = fromJS(this.state.actionlist).toJS() |
| | | |
| | | actionlist = actionlist.filter(item => item.uuid !== card.uuid) |
| | | let _actionlist = actionlist.filter(item => item.uuid !== card.uuid) |
| | | |
| | | this.setState({ |
| | | card: null, |
| | | actionlist: actionlist, |
| | | actionlist: _actionlist, |
| | | visible: false |
| | | }) |
| | | this.props.updateaction({...config, action: _actionlist}) |
| | | } else { |
| | | this.setState({ |
| | | card: null, |