fix: 裸金属修改

develop
时启龙 2024-09-06 14:45:10 +08:00
parent 1ffdcfde72
commit f372053b9d
2 changed files with 50 additions and 10 deletions

View File

@ -2,6 +2,23 @@
<div class="wrapper-container"> <div class="wrapper-container">
<el-card> <el-card>
<cb-form ref="addData" :model="addData" status-icon label-width="110px"> <cb-form ref="addData" :model="addData" status-icon label-width="110px">
<el-col :span="24">
<el-col :span="12">
<cb-form-item label="计费方式: " prop="cycleType" :rules="[required]">
<el-radio-group v-model="addData.cycleType">
<el-radio-button label="ondemand">后付费按量付费</el-radio-button>
<el-radio-button label="MONTH">预付费包年包月</el-radio-button>
</el-radio-group>
</cb-form-item>
</el-col>
<el-col :span="12" v-if="addData.cycleType == 'MONTH'">
<cb-form-item label="购买时长:" prop="cycleCount" :rules="[required]">
<el-select v-model="addData.cycleCount" filterable>
<el-option v-for="(item, index) in periodList" :key="index" :value="item.value" :label="item.name"></el-option>
</el-select>
</cb-form-item>
</el-col>
</el-col>
<el-col :span="12"> <el-col :span="12">
<cb-form-item label="可用地域:" prop="regionId" :rules="[required]"> <cb-form-item label="可用地域:" prop="regionId" :rules="[required]">
<el-select v-model="addData.regionId" @change="regionChange"> <el-select v-model="addData.regionId" @change="regionChange">
@ -119,7 +136,7 @@
</cb-form-item> </cb-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<cb-form-item label=" 描述:" prop="remark" :rules="[required]"> <cb-form-item label=" 描述:" prop="remark">
<el-input v-model="addData.remark"></el-input> <el-input v-model="addData.remark"></el-input>
</cb-form-item> </cb-form-item>
</el-col> </el-col>
@ -189,6 +206,20 @@ export default {
}, },
data() { data() {
return { return {
periodList: [
{ name: '1个月', value: 1 },
{ name: '2个月', value: 2 },
{ name: '3个月', value: 3 },
{ name: '4个月', value: 4 },
{ name: '5个月', value: 5 },
{ name: '6个月', value: 6 },
{ name: '7个月', value: 7 },
{ name: '8个月', value: 8 },
{ name: '9个月', value: 9 },
{ name: '12个月', value: 12 },
{ name: '24个月', value: 24 },
{ name: '36个月', value: 36 }
],
vendorId: parseInt(this.$router.currentRoute.query.vendorId), vendorId: parseInt(this.$router.currentRoute.query.vendorId),
required: validate.required, required: validate.required,
ctstackBMSName: validate.ctstackBMSName, ctstackBMSName: validate.ctstackBMSName,
@ -210,7 +241,7 @@ export default {
vpcName: '', // vpcname vpcName: '', // vpcname
master: true, // true master: true, // true
subnetUuid: '', // subnetUuid subnetUuid: '', // subnetUuid
cycleCount: 0, // 0 cycleCount: 1, // 0
cycleType: 'ondemand', // :[MONTH=,YEAR=,ondemand=] cycleType: 'ondemand', // :[MONTH=,YEAR=,ondemand=]
orderCount: 1 // orderCount: 1 //
}, },
@ -406,22 +437,31 @@ export default {
}) })
}, },
getPostData() { getPostData() {
let addData = '' let result = ''
this.$refs.addData.validate(valid => { this.$refs.addData.validate(valid => {
if (valid) { if (valid) {
this.addData.hostname = this.addData.name this.addData.hostname = this.addData.name
this.addData.vendorId = this.vendorId this.addData.vendorId = this.vendorId
if (this.addData.password != this.addData.endPassword && this.keypair == '密码') { if (this.addData.password != this.addData.endPassword && this.keypair == '密码') {
this.$notify({ this.$message.error('两次密码输入不一致')
title: '提示', result = false
message: '两次密码输入不一致'
})
return return
} }
addData = JSON.parse(JSON.stringify(this.addData)) if (this.systemVolumeLabel && !this.addData.systemVolumeRaidUuid) {
this.$message.error('请选择系统盘raid')
result = false
return
}
if (this.dataVolumeLabel && !this.addData.dataVolumeRaidUuid) {
this.$message.error('请选择数据盘raid')
result = false
return
}
if (this.addData.cycleType === 'ondemand') this.addData.cycleCount = 0
result = JSON.parse(JSON.stringify(this.addData))
} }
}) })
return addData return result
} }
}, },
created() { created() {

View File

@ -8,7 +8,7 @@
</cb-form-item> </cb-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<cb-form-item label="备注:" prop="remark" :rules="[required]" required-message=""> <cb-form-item label="备注:" prop="remark" required-message="">
<el-input v-model="addData.data.remark"></el-input> <el-input v-model="addData.data.remark"></el-input>
</cb-form-item> </cb-form-item>
</el-col> </el-col>