From 993618706000da55907ab68c2ab83227b0c3e76a Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 10 Aug 2021 14:26:12 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20=E4=BF=AE=E6=94=B9=20assetBox=20?= =?UTF-8?q?location=20=E6=A0=A1=E9=AA=8C=E5=BF=85=E5=A1=AB=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/rightBox/asset/assetBox.vue | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue b/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue index 773b99663..c1b114dd4 100644 --- a/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue +++ b/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue @@ -55,7 +55,7 @@ style="width: 100%;" > - + @@ -350,7 +350,8 @@ export default { { required: true, message: this.$t('validate.required'), trigger: 'change' } ], location: [ - { required: true, message: this.$t('validate.required'), trigger: 'blur' } + // { required: true, message: this.$t('validate.required'), trigger: 'blur' } + { validator: this.checkLocation, trigger: 'blur' } ] }, cabRules: { @@ -718,6 +719,19 @@ export default { resolve() }) }) + }, + checkLocation (rule, value, callback) { + setTimeout(() => { + if (this.editAsset.cabinetId) { + callback() + } else if (this.editAsset.dcId) { + callback() + } else if (this.editAsset.cabinetStart && this.editAsset.cabinetEnd) { + callback() + } else { + callback(new Error(vm.$t('validate.required'))) + } + }, 100) } } }