|
|
@@ -1,6 +1,6 @@
|
|
|
import React from 'react'
|
|
|
import { connect } from 'dva'
|
|
|
-import { Modal, Form, Select } from 'antd'
|
|
|
+import { Modal, Form, Select, Button, Icon } from 'antd'
|
|
|
const { Item: FormItem } = Form
|
|
|
const { Option: SelectOption } = Select
|
|
|
|
|
|
@@ -10,6 +10,7 @@ class CopyBox extends React.Component {
|
|
|
this.state = {
|
|
|
currentDataConnectCode: props.currentDataConnect ? props.currentDataConnect.code : null,
|
|
|
selectedDataConnectCode: props.currentDataConnect ? props.currentDataConnect.code : null,
|
|
|
+ loading: false,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -28,7 +29,7 @@ class CopyBox extends React.Component {
|
|
|
|
|
|
render() {
|
|
|
const { visibleBox, hideBox, dispatch, currentDashboardCode } = this.props;
|
|
|
- const { currentDataConnectCode, selectedDataConnectCode } = this.state;
|
|
|
+ const { currentDataConnectCode, selectedDataConnectCode, loading } = this.state;
|
|
|
const formItemLayout = {
|
|
|
labelCol: { span: 5 },
|
|
|
wrapperCol: { span: 12 },
|
|
|
@@ -39,12 +40,25 @@ class CopyBox extends React.Component {
|
|
|
title={'复制报表'}
|
|
|
visible={visibleBox}
|
|
|
onCancel={hideBox}
|
|
|
- onOk={() => {
|
|
|
- dispatch({ type: 'dashboard/copy', dashboardCode: currentDashboardCode, dataConnectCode: selectedDataConnectCode }).then(() => {
|
|
|
- hideBox();
|
|
|
- });
|
|
|
- }}
|
|
|
- maskClosable={true}
|
|
|
+ footer={
|
|
|
+ <div>
|
|
|
+ <Button onClick={hideBox}>取 消</Button>
|
|
|
+ <Button disabled={loading} type='primary' onClick={() => {
|
|
|
+ this.setState({
|
|
|
+ loading: true
|
|
|
+ });
|
|
|
+ dispatch({ type: 'dashboard/copy', dashboardCode: currentDashboardCode, dataConnectCode: selectedDataConnectCode }).then(() => {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ }, hideBox);
|
|
|
+ });
|
|
|
+ }}>
|
|
|
+ {loading ? (<Icon type='loading' />) : ''}
|
|
|
+ {loading ? '复制中' : '确 定'}
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ maskClosable={false}
|
|
|
destroyOnClose={true}
|
|
|
>
|
|
|
<div>复制对象包括报表和报表包含的图表</div>
|