| | |
| | | import { Modal, notification, Switch, message } from 'antd' |
| | | import { CopyOutlined } from '@ant-design/icons' |
| | | |
| | | import { getColumnForm } from '@/templates/zshare/formconfig' |
| | | import { getColumnForm } from './formconfig' |
| | | |
| | | import ColumnForm from './columnform' |
| | | import ColspanForm from './colspanform' |
| | |
| | | */ |
| | | deleteElement = (card) => { |
| | | const { config } = this.props |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: `确定删除 - ${card.label} ?`, |
| | | onOk() { |
| | | let _columnlist = fromJS(_this.state.columnlist).toJS() |
| | | let _columnlist = fromJS(that.state.columnlist).toJS() |
| | | |
| | | _columnlist = _columnlist.filter(item => item.uuid !== card.uuid) |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | _this.setState({ |
| | | that.setState({ |
| | | columnlist: _columnlist |
| | | }, ()=> { |
| | | _this.props.updatecolumn({...config, columns: _columnlist}) |
| | | that.props.updatecolumn({...config, columns: _columnlist}) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | columns: columnlist |
| | | } |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | revert = () => { |
| | | this.setState({ |
| | | columnlist: fromJS(this.props.config.columns).toJS() |
| | | }) |
| | | } |
| | | // revert = () => { |
| | | // this.setState({ |
| | | // columnlist: fromJS(this.props.config.columns).toJS() |
| | | // }) |
| | | // } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('revert', this.revert) |
| | | // MKEmitter.addListener('revert', this.revert) |
| | | MKEmitter.addListener('plusColumns', this.plusColumns) |
| | | } |
| | | |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('revert', this.revert) |
| | | // MKEmitter.removeListener('revert', this.revert) |
| | | MKEmitter.removeListener('plusColumns', this.plusColumns) |
| | | } |
| | | |