U 优化发布配置克隆

pull/161/head
vapao 2020-07-29 22:05:40 +08:00
parent fbb33b96db
commit c88074959a
2 changed files with 7 additions and 1 deletions

View File

@ -49,6 +49,7 @@ class CloneConfirm extends React.Component {
<Form.Item required label="应用及环境" help="克隆配置,将基于选择对象的配置来创建新的发布配置。">
<Cascader
options={options}
placeholder="请选择目标应用及环境"
loadData={this.handleLoadData}
onChange={this.props.onChange}/>
</Form.Item>

View File

@ -18,7 +18,7 @@ import lds from 'lodash';
class ComTable extends React.Component {
constructor(props) {
super(props);
this.cloneObj = {};
this.cloneObj = null;
}
componentDidMount() {
@ -60,11 +60,16 @@ class ComTable extends React.Component {
handleClone = (e, id) => {
e.stopPropagation();
this.cloneObj = null;
Modal.confirm({
icon: 'exclamation-circle',
title: '选择克隆对象',
content: <CloneConfirm onChange={v => this.cloneObj = v[1]}/>,
onOk: () => {
if (!this.cloneObj) {
message.error('请选择目标应用及环境')
return Promise.reject()
}
const info = JSON.parse(this.cloneObj);
store.showExtForm(null, id, info, true)
},