import React, {Component} from 'react'
|
import PropTypes from 'prop-types'
|
import { is, fromJS } from 'immutable'
|
// import { Modal, Button, notification } from 'antd'
|
import { Modal, Button } from 'antd'
|
import { ArrowUpOutlined } from '@ant-design/icons'
|
// import moment from 'moment'
|
|
// import Api from '@/api'
|
// import Utils from '@/utils/utils.js'
|
import './index.scss'
|
|
const { confirm } = Modal
|
|
class UpdateTable extends Component {
|
static propTpyes = {
|
config: PropTypes.object
|
}
|
|
state = {}
|
|
shouldComponentUpdate (nextProps, nextState) {
|
return !is(fromJS(this.state), fromJS(nextState))
|
}
|
|
trigger = () => {
|
const _this = this
|
confirm({
|
title: '确定升级当前菜单吗?',
|
content: '',
|
onOk() {
|
return new Promise(resolve => {
|
_this.execUpdate(resolve)
|
})
|
},
|
onCancel() {}
|
})
|
}
|
|
execUpdate = (_resolve) => {
|
// const { config } = this.props
|
setTimeout(() => {
|
_resolve()
|
}, 5000)
|
}
|
|
render() {
|
return (
|
<div style={{display: 'inline-block'}}>
|
<Button className="mk-border-purple" onClick={this.trigger}><ArrowUpOutlined /> 升级</Button>
|
</div>
|
)
|
}
|
}
|
|
export default UpdateTable
|