1818<template >
1919 <a-modal
2020 v-model =" dedicatedDomainModal"
21+ v-ctrl-enter =" handleDedicateForm"
2122 :title =" label"
23+ :closable =" true"
2224 :maskClosable =" false"
23- :okText =" $t('label.ok')"
24- :cancelText =" $t('label.cancel')"
25- @cancel =" closeModal"
26- @ok =" handleDedicateForm" >
25+ :footer =" null"
26+ @cancel =" closeModal" >
2727 <DedicateDomain
2828 @domainChange =" id => domainId = id"
2929 @accountChange =" id => dedicatedAccount = id"
3030 :error =" domainError" />
31+ <div :span =" 24" class =" action-button" >
32+ <a-button @click =" closeModal" >{{ this.$t('label.cancel') }}</a-button >
33+ <a-button type =" primary" @click =" handleDedicateForm" >{{ this.$t('label.ok') }}</a-button >
34+ </div >
3135 </a-modal >
3236</template >
3337
@@ -63,7 +67,8 @@ export default {
6367 dedicatedDomainModal: false ,
6468 domainId: null ,
6569 dedicatedAccount: null ,
66- domainError: false
70+ domainError: false ,
71+ isSubmitted: false
6772 }
6873 },
6974 watch: {
@@ -100,23 +105,27 @@ export default {
100105 this .fetchParentData ()
101106 this .dedicatedDomainId = this .domainId
102107 this .dedicatedDomainModal = false
108+ this .isSubmitted = false
103109 },
104110 errorMessage: this .$t (' error.dedicate.zone.failed' ),
105111 errorMethod : () => {
106112 this .fetchParentData ()
107113 this .dedicatedDomainModal = false
114+ this .isSubmitted = false
108115 },
109116 loadingMessage: this .$t (' message.dedicating.zone' ),
110117 catchMessage: this .$t (' error.fetching.async.job.result' ),
111118 catchMethod : () => {
112119 this .parentFetchData ()
113120 this .fetchParentData ()
114121 this .dedicatedDomainModal = false
122+ this .isSubmitted = false
115123 }
116124 })
117125 }).catch (error => {
118126 this .$notifyError (error)
119127 this .dedicatedDomainModal = false
128+ this .isSubmitted = false
120129 })
121130 },
122131 dedicatePod () {
@@ -138,23 +147,27 @@ export default {
138147 this .fetchParentData ()
139148 this .dedicatedDomainId = this .domainId
140149 this .dedicatedDomainModal = false
150+ this .isSubmitted = false
141151 },
142152 errorMessage: this .$t (' error.dedicate.pod.failed' ),
143153 errorMethod : () => {
144154 this .fetchParentData ()
145155 this .dedicatedDomainModal = false
156+ this .isSubmitted = false
146157 },
147158 loadingMessage: this .$t (' message.dedicating.pod' ),
148159 catchMessage: this .$t (' error.fetching.async.job.result' ),
149160 catchMethod : () => {
150161 this .parentFetchData ()
151162 this .fetchParentData ()
152163 this .dedicatedDomainModal = false
164+ this .isSubmitted = false
153165 }
154166 })
155167 }).catch (error => {
156168 this .$notifyError (error)
157169 this .dedicatedDomainModal = false
170+ this .isSubmitted = false
158171 })
159172 },
160173 dedicateCluster () {
@@ -176,23 +189,27 @@ export default {
176189 this .fetchParentData ()
177190 this .dedicatedDomainId = this .domainId
178191 this .dedicatedDomainModal = false
192+ this .isSubmitted = false
179193 },
180194 errorMessage: this .$t (' error.dedicate.cluster.failed' ),
181195 errorMethod : () => {
182196 this .fetchParentData ()
183197 this .dedicatedDomainModal = false
198+ this .isSubmitted = false
184199 },
185200 loadingMessage: this .$t (' message.dedicating.cluster' ),
186201 catchMessage: this .$t (' error.fetching.async.job.result' ),
187202 catchMethod : () => {
188203 this .parentFetchData ()
189204 this .fetchParentData ()
190205 this .dedicatedDomainModal = false
206+ this .isSubmitted = false
191207 }
192208 })
193209 }).catch (error => {
194210 this .$notifyError (error)
195211 this .dedicatedDomainModal = false
212+ this .isSubmitted = false
196213 })
197214 },
198215 dedicateHost () {
@@ -214,26 +231,34 @@ export default {
214231 this .fetchParentData ()
215232 this .dedicatedDomainId = this .domainId
216233 this .dedicatedDomainModal = false
234+ this .isSubmitted = false
217235 },
218236 errorMessage: this .$t (' error.dedicate.host.failed' ),
219237 errorMethod : () => {
220238 this .fetchParentData ()
221239 this .dedicatedDomainModal = false
240+ this .isSubmitted = false
222241 },
223242 loadingMessage: this .$t (' message.dedicating.host' ),
224243 catchMessage: this .$t (' error.fetching.async.job.result' ),
225244 catchMethod : () => {
226245 this .parentFetchData ()
227246 this .fetchParentData ()
228247 this .dedicatedDomainModal = false
248+ this .isSubmitted = false
229249 }
230250 })
231251 }).catch (error => {
232252 this .$notifyError (error)
233253 this .dedicatedDomainModal = false
254+ this .isSubmitted = false
234255 })
235256 },
236257 handleDedicateForm () {
258+ if (this .isSubmitted ) {
259+ return
260+ }
261+ this .isSubmitted = true
237262 if (this .$route .meta .name === ' zone' ) {
238263 this .dedicateZone ()
239264 }
0 commit comments