From f372053b9ded5756693498e39a63d5af728dd1b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E5=90=AF=E9=BE=99?= Date: Fri, 6 Sep 2024 14:45:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A3=B8=E9=87=91=E5=B1=9E=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ctstack/page/bareMetal/addBareMetal.vue | 58 ++++++++++++++++--- .../ctstack/page/bareMetal/modifyName.vue | 2 +- 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/addBareMetal.vue b/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/addBareMetal.vue index 4815a99..90a1d2a 100644 --- a/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/addBareMetal.vue +++ b/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/addBareMetal.vue @@ -2,6 +2,23 @@
+ + + + + 后付费(按量付费) + 预付费(包年包月) + + + + + + + + + + + @@ -119,7 +136,7 @@ - + @@ -189,6 +206,20 @@ export default { }, data() { 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), required: validate.required, ctstackBMSName: validate.ctstackBMSName, @@ -210,7 +241,7 @@ export default { vpcName: '', // 云管vpc接口的name master: true, // 默认为true subnetUuid: '', // 子网接口的subnetUuid - cycleCount: 0, // 订购时长,按需订购传0 + cycleCount: 1, // 订购时长,按需订购传0 cycleType: 'ondemand', // 订购周期类型 ,取值范围:[MONTH=按月,YEAR=按年,ondemand=按需订购] orderCount: 1 // 订购数量 }, @@ -406,22 +437,31 @@ export default { }) }, getPostData() { - let addData = '' + let result = '' this.$refs.addData.validate(valid => { if (valid) { this.addData.hostname = this.addData.name this.addData.vendorId = this.vendorId if (this.addData.password != this.addData.endPassword && this.keypair == '密码') { - this.$notify({ - title: '提示', - message: '两次密码输入不一致' - }) + this.$message.error('两次密码输入不一致') + result = false 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() { diff --git a/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/modifyName.vue b/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/modifyName.vue index 7aa4690..8c19f46 100644 --- a/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/modifyName.vue +++ b/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/modifyName.vue @@ -8,7 +8,7 @@ - +