cmc-web/webs/cmp-web/src/views/resource/ctstack/page/container/modifyCluster.vue

67 lines
1.7 KiB
Vue

<template>
<div>
<el-dialog title="编辑集群" width="40%" :close-on-click-modal="false" v-if="addData.dialog" :visible.sync="addData.dialog">
<cb-form :model="addData.data" ref="data">
<el-row :gutter="10">
<el-col :span="24">
<cb-form-item label="名称:" prop="remark" validate="required" required-message="" maxlength="60">
<el-input v-model="addData.data.remark"></el-input>
</cb-form-item>
</el-col>
</el-row>
</cb-form>
<div slot="footer" class="dialog-footer">
<el-button type="ghost" @click.native="addData.dialog = false">取消</el-button>
<el-button type="primary" @click.native="ok">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { modifyInstance } from 'views/resource/ctstack/services/tke.js'
export default {
props: {
addData: {
type: Object,
default: function () {
return {
data: {
remark: '',
vendorId: -1
},
dialog: false
}
}
},
vendorId: {
type: Number,
default: 0
}
},
data() {
return {}
},
methods: {
ok() {
this.$refs.data.validate(valid => {
if (valid) {
const param = {
id: this.addData.data.id,
remark: this.addData.data.remark
}
modifyInstance(param).then(data => {
if (data.success) {
this.$message.success(data.message)
this.$emit('back')
this.addData.dialog = false
}
})
}
})
}
},
created() {}
}
</script>