From 99a1733bd8952b081724d8cc832f3f663b563117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E5=90=AF=E9=BE=99?= Date: Mon, 2 Sep 2024 14:58:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A3=B8=E9=87=91=E5=B1=9E=E5=88=9B?= =?UTF-8?q?=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ctstack/page/bareMetal/addBareMetal.vue | 436 ++++++++++++++---- .../ctstack/page/bareMetal/addPageOne.vue | 186 -------- .../ctstack/page/bareMetal/addPageThree.vue | 27 -- .../ctstack/page/bareMetal/addPageTwo.vue | 197 -------- .../ctstack/page/bareMetal/assign.vue | 180 -------- .../resource/ctstack/page/bareMetal/index.vue | 73 ++- 6 files changed, 387 insertions(+), 712 deletions(-) delete mode 100644 webs/cmp-web/src/views/resource/ctstack/page/bareMetal/addPageOne.vue delete mode 100644 webs/cmp-web/src/views/resource/ctstack/page/bareMetal/addPageThree.vue delete mode 100644 webs/cmp-web/src/views/resource/ctstack/page/bareMetal/addPageTwo.vue delete mode 100644 webs/cmp-web/src/views/resource/ctstack/page/bareMetal/assign.vue 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 22daed6..9c334b5 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 @@ -1,117 +1,393 @@ - + + diff --git a/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/addPageOne.vue b/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/addPageOne.vue deleted file mode 100644 index c917df0..0000000 --- a/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/addPageOne.vue +++ /dev/null @@ -1,186 +0,0 @@ - - - diff --git a/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/addPageThree.vue b/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/addPageThree.vue deleted file mode 100644 index 51ba119..0000000 --- a/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/addPageThree.vue +++ /dev/null @@ -1,27 +0,0 @@ - - - diff --git a/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/addPageTwo.vue b/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/addPageTwo.vue deleted file mode 100644 index 68a12ba..0000000 --- a/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/addPageTwo.vue +++ /dev/null @@ -1,197 +0,0 @@ - - - - diff --git a/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/assign.vue b/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/assign.vue deleted file mode 100644 index 221af5f..0000000 --- a/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/assign.vue +++ /dev/null @@ -1,180 +0,0 @@ - - - diff --git a/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/index.vue b/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/index.vue index da2ea9b..463eb3b 100644 --- a/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/index.vue +++ b/webs/cmp-web/src/views/resource/ctstack/page/bareMetal/index.vue @@ -97,6 +97,7 @@ import { bareMetalState, bareMetalColor } from 'filters' import { getBareMetalList, modifyBareMetal, bmsReboot, bmsBootUp, bmsStop, bmsedt, getDisk, getCombo, bmsReload } from 'views/resource/ctstack/services/bms.js' import { removeVmUsers } from 'views/resource/ctstack/services/vm.js' +import { getRegion } from 'services/platform/index' const columns = [ { type: 'selection' @@ -169,6 +170,21 @@ export default { } } }, + mounted() { + this.getRegion() + }, + watch: { + platformObject: { + handler(newVal, oldVal) { + this.searchConfigs = [ + { type: 'Input', label: '名称', value: 'name' }, + { type: 'Select', label: '所属地域', data: [], value: 'regionId', props: { value: 'regionId' } }, + { type: 'Const', value: 'vendorId', initValue: this.platformObject.vendorId } + ] + }, + deep: true + } + }, data() { return { columns, @@ -180,7 +196,11 @@ export default { }, data: [], total: 0, - searchConfigs: [{ type: 'Const', value: 'vendorId', initValue: this.platformObject.vendorId }], + searchConfigs: [ + { type: 'Input', label: '名称', value: 'name' }, + { type: 'Select', label: '所属地域', data: [], value: 'regionId', props: { value: 'regionId' } }, + { type: 'Const', value: 'vendorId', initValue: this.platformObject.vendorId } + ], // 编辑数据 editData: { dialog: false, @@ -210,11 +230,7 @@ export default { row: {} }, comboData: '', - selectCombo: {}, - assignData: { - dialog: false, - data: {} - } + selectCombo: {} } }, methods: { @@ -407,34 +423,6 @@ export default { }) } }, - assign(row) { - this.assignData = { - dialog: true, - data: { - type: 'tenant', - ids: [row.id], - resourceCategory: 'Bms', - vendorType: 'CTSTACK' - } - } - }, - recycle(row) { - this.$confirm('确认回收该资源嘛?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - const params = { - ids: [row.id], - resourceCategory: 'Bms', - vendorType: 'CTSTACK' - } - removeVmUsers(params).then(data => { - this.$message.success(data.message) - this.getList() - }) - }) - }, getList() { this.loading = true // const params = { @@ -457,14 +445,15 @@ export default { .finally(() => { this.loading = false }) - } - }, - watch: { - platformObject: { - handler(newVal, oldVal) { - this.searchConfigs = [{ type: 'Const', value: 'vendorId', initValue: this.platformObject.vendorId }] - }, - deep: true + }, + // 获取域 + getRegion() { + getRegion({ vendorId: this.platformObject.vendorId }).then(data => { + if (data.success) { + this.regionList = data.data + this.searchConfigs[1].data = data.data + } + }) } } }