diff --git a/frontend/src/business/components/settings/system/TestResourcePool.vue b/frontend/src/business/components/settings/system/TestResourcePool.vue index e01d094084..645396711c 100644 --- a/frontend/src/business/components/settings/system/TestResourcePool.vue +++ b/frontend/src/business/components/settings/system/TestResourcePool.vue @@ -47,14 +47,14 @@ + ref="testResourcePoolForm"> @@ -137,105 +137,15 @@ - - - - - - - - - - - - - - - - - Node - Kubernetes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + v-if="form.id" + @cancel="dialogVisible = false" + @confirm="updateTestResourcePool()"/> + v-else + @cancel="dialogVisible = false" + @confirm="createTestResourcePool()"/> - @@ -245,7 +155,7 @@ import MsTablePagination from "../../common/pagination/TablePagination"; import MsTableHeader from "../../common/components/MsTableHeader"; import MsTableOperator from "../../common/components/MsTableOperator"; import MsDialogFooter from "../../common/components/MsDialogFooter"; -import {listenGoBack, removeGoBackListener} from "../../../../common/js/utils"; +import {listenGoBack, removeGoBackListener} from "@/common/js/utils"; export default { name: "MsTestResourcePool", @@ -253,9 +163,8 @@ export default { data() { return { result: {}, - createVisible: false, + dialogVisible: false, infoList: [], - updateVisible: false, queryPath: "testresourcepool/list", condition: {}, items: [], @@ -340,11 +249,11 @@ export default { this.initTableData(); }, create() { - this.createVisible = true; + this.dialogVisible = true; listenGoBack(this.closeFunc); }, edit(row) { - this.updateVisible = true; + this.dialogVisible = true; this.form = JSON.parse(JSON.stringify(row)); this.convertResources(); listenGoBack(this.closeFunc); @@ -374,8 +283,8 @@ export default { this.$info(this.$t('commons.delete_cancel')); }); }, - createTestResourcePool(createTestResourcePoolForm) { - this.$refs[createTestResourcePoolForm].validate(valid => { + createTestResourcePool() { + this.$refs.testResourcePoolForm.validate(valid => { if (valid) { let vri = this.validateResourceInfo(); if (vri.validate) { @@ -385,7 +294,7 @@ export default { type: 'success', message: this.$t('commons.save_success') }, - this.createVisible = false, + this.dialogVisible = false, this.initTableData()); }); } else { @@ -411,8 +320,8 @@ export default { }); this.form.resources = resources; }, - updateTestResourcePool(updateTestResourcePoolForm) { - this.$refs[updateTestResourcePoolForm].validate(valid => { + updateTestResourcePool() { + this.$refs.testResourcePoolForm.validate(valid => { if (valid) { let vri = this.validateResourceInfo(); if (vri.validate) { @@ -422,7 +331,7 @@ export default { type: 'success', message: this.$t('commons.modify_success') }, - this.updateVisible = false, + this.dialogVisible = false, this.initTableData(), self.loading = false); }); @@ -437,8 +346,7 @@ export default { }, closeFunc() { this.form = {}; - this.updateVisible = false; - this.createVisible = false; + this.dialogVisible = false; removeGoBackListener(this.closeFunc); }, changeSwitch(row) {