|
|
@@ -8,7 +8,8 @@ class CopyBox extends React.Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
this.state = {
|
|
|
- currentDataConnectCode: props.currentDataConnect ? props.currentDataConnect.code : null
|
|
|
+ currentDataConnectCode: props.currentDataConnect ? props.currentDataConnect.code : null,
|
|
|
+ selectedDataConnectCode: props.currentDataConnect ? props.currentDataConnect.code : null,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -22,15 +23,15 @@ class CopyBox extends React.Component {
|
|
|
const { currentDataConnectCode } = this.state;
|
|
|
const { list } = dataConnect;
|
|
|
|
|
|
- return list.filter((l) => l.code !== currentDataConnectCode).map((l) => <SelectOption key={l.code} value={l.code}>{l.name}</SelectOption>);
|
|
|
+ return list.filter((l) => l.code !== currentDataConnectCode).map((l) => <SelectOption key={l.code} value={l.code} title={l.name}>{l.name}</SelectOption>);
|
|
|
}
|
|
|
|
|
|
render() {
|
|
|
const { visibleBox, hideBox, dispatch, currentDashboardCode } = this.props;
|
|
|
- const { currentDataConnectCode } = this.state;
|
|
|
+ const { currentDataConnectCode, selectedDataConnectCode } = this.state;
|
|
|
const formItemLayout = {
|
|
|
- labelCol: { span: 4 },
|
|
|
- wrapperCol: { span: 8 },
|
|
|
+ labelCol: { span: 5 },
|
|
|
+ wrapperCol: { span: 12 },
|
|
|
}
|
|
|
|
|
|
return <Modal
|
|
|
@@ -39,7 +40,7 @@ class CopyBox extends React.Component {
|
|
|
visible={visibleBox}
|
|
|
onCancel={hideBox}
|
|
|
onOk={() => {
|
|
|
- dispatch({ type: 'dashboard/copy', dashboardCode: currentDashboardCode, dataConnectCode: currentDataConnectCode }).then(() => {
|
|
|
+ dispatch({ type: 'dashboard/copy', dashboardCode: currentDashboardCode, dataConnectCode: selectedDataConnectCode }).then(() => {
|
|
|
hideBox();
|
|
|
});
|
|
|
}}
|
|
|
@@ -57,7 +58,7 @@ class CopyBox extends React.Component {
|
|
|
placeholder={currentDataConnectCode ? '不切换...' : '无需选择数据链接'}
|
|
|
onChange={(value) => {
|
|
|
this.setState({
|
|
|
- currentDataConnectCode: value
|
|
|
+ selectedDataConnectCode: value
|
|
|
})
|
|
|
}}
|
|
|
>
|