| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Icon, Tooltip, Modal, notification } from 'antd' |
| | | |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description 标签组变化时,更新标签 |
| | | */ |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { tabgroups } = this.state |
| | | |
| | | if (!is(fromJS(nextProps.config.tabgroups), fromJS(this.props.config.tabgroups)) && !is(fromJS(nextProps.config.tabgroups), fromJS(tabgroups))) { |
| | | this.setState({tabgroups: fromJS(nextProps.config.tabgroups).toJS()}) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 元素添加或拖动时顺序变化 |
| | | */ |
| | | handleList = (list, card, groupId) => { |
| | |
| | | this.setState({tabgroups: _tabgroups}) |
| | | this.handleTab(card, _group) |
| | | } else { |
| | | this.setState({tabgroups: _tabgroups}) |
| | | this.setState({tabgroups: _tabgroups}, () => { |
| | | this.props.updatetabs({...config, tabgroups: _tabgroups}) |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | group: null, |
| | | tabgroups: tabgroups, |
| | | visible: false |
| | | }) |
| | | }, () => { |
| | | this.props.updatetabs({...config, tabgroups: tabgroups}) |
| | | }) |
| | | }) |
| | | } |
| | | |
| | |
| | | |
| | | _this.setState({ |
| | | tabgroups: tabgroups |
| | | }) |
| | | }, () => { |
| | | _this.props.updatetabs({...config, tabgroups: tabgroups}, [card]) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | |
| | | _this.setState({ |
| | | tabgroups: _tabgroups |
| | | }) |
| | | }, () => { |
| | | _this.props.updatetabs({...config, tabgroups: _tabgroups}) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | okText: this.state.dict['model.confirm'], |
| | | cancelText: this.state.dict['header.cancel'], |
| | | onOk() { |
| | | |
| | | _tabgroups = _tabgroups.filter(_group => _group.uuid !== group.uuid) |
| | | |
| | | _this.setState({ |
| | | tabgroups: _tabgroups |
| | | }) |
| | | }, () => { |
| | | _this.props.updatetabs({...config, tabgroups: _tabgroups}, group.sublist) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | |
| | | this.setState({ |
| | | tabgroups: _tabgroups |
| | | }) |
| | | }, () => { |
| | | this.props.updatetabs({...config, tabgroups: _tabgroups}) |
| | | }) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | |
| | | group: null, |
| | | tabgroups: _tabgroups, |
| | | visible: false |
| | | }) |
| | | }, () => { |
| | | this.props.updatetabs({...config, tabgroups: _tabgroups}) |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | card: null, |