mirror of https://github.com/openspug/spug
U 优化发布配置克隆
parent
fbb33b96db
commit
c88074959a
|
@ -49,6 +49,7 @@ class CloneConfirm extends React.Component {
|
||||||
<Form.Item required label="应用及环境" help="克隆配置,将基于选择对象的配置来创建新的发布配置。">
|
<Form.Item required label="应用及环境" help="克隆配置,将基于选择对象的配置来创建新的发布配置。">
|
||||||
<Cascader
|
<Cascader
|
||||||
options={options}
|
options={options}
|
||||||
|
placeholder="请选择目标应用及环境"
|
||||||
loadData={this.handleLoadData}
|
loadData={this.handleLoadData}
|
||||||
onChange={this.props.onChange}/>
|
onChange={this.props.onChange}/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
|
@ -18,7 +18,7 @@ import lds from 'lodash';
|
||||||
class ComTable extends React.Component {
|
class ComTable extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.cloneObj = {};
|
this.cloneObj = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
@ -60,11 +60,16 @@ class ComTable extends React.Component {
|
||||||
|
|
||||||
handleClone = (e, id) => {
|
handleClone = (e, id) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
this.cloneObj = null;
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
icon: 'exclamation-circle',
|
icon: 'exclamation-circle',
|
||||||
title: '选择克隆对象',
|
title: '选择克隆对象',
|
||||||
content: <CloneConfirm onChange={v => this.cloneObj = v[1]}/>,
|
content: <CloneConfirm onChange={v => this.cloneObj = v[1]}/>,
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
|
if (!this.cloneObj) {
|
||||||
|
message.error('请选择目标应用及环境')
|
||||||
|
return Promise.reject()
|
||||||
|
}
|
||||||
const info = JSON.parse(this.cloneObj);
|
const info = JSON.parse(this.cloneObj);
|
||||||
store.showExtForm(null, id, info, true)
|
store.showExtForm(null, id, info, true)
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue