4848 <a-form-item name =" zone" ref =" zone" :label =" $t('label.zone')" >
4949 <a-select
5050 v-model:value =" form.zone"
51+ @change =" onZoneChange"
5152 showSearch
5253 optionFilterProp =" label"
5354 :filterOption =" (input, option) => {
105106 <a-form-item name =" zone" ref =" zone" :label =" $t('label.zone')" >
106107 <a-select
107108 v-model:value =" form.zone"
109+ @change =" onZoneChange"
108110 showSearch
109111 optionFilterProp =" label"
110112 :filterOption =" (input, option) => {
@@ -239,7 +241,6 @@ export default {
239241 },
240242 fetchData () {
241243 this .listZones ()
242- this .fetchCopyTemplatesConfig ()
243244 this .checkOtherSecondaryStorages ()
244245 },
245246 closeModal () {
@@ -265,14 +266,18 @@ export default {
265266 })
266267 })
267268 },
269+ onZoneChange (val ) {
270+ this .form .zone = val
271+ this .copyTemplatesTouched = false
272+ this .fetchCopyTemplatesConfig ()
273+ },
268274 listZones () {
269275 api (' listZones' , { showicon: true }).then (json => {
270- if (json? .listzonesresponse ? .zone ) {
271- this .zones = json .listzonesresponse .zone
276+ this .zones = json .listzonesresponse .zone || []
272277
273- if (this .zones .length > 0 ) {
274- this .form .zone = this .zones [0 ].id || ' '
275- }
278+ if (this .zones .length > 0 ) {
279+ this .form .zone = this .zones [0 ].id
280+ this . fetchCopyTemplatesConfig ()
276281 }
277282 })
278283 },
@@ -465,11 +470,6 @@ export default {
465470 reject (error)
466471 })
467472 })
468- },
469- watch: {
470- ' form.zone' () {
471- this .copyTemplatesTouched = false
472- }
473473 }
474474 }
475475}
0 commit comments