From e91b292d8b2a63ff22f995ae97952c39726d174b Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Tue, 8 Feb 2022 08:59:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AE=E6=92=AD=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/sass/apps/AppCarousel/AppCarousel.vue | 79 +++++++++---------- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/project/sass/apps/AppCarousel/AppCarousel.vue b/project/sass/apps/AppCarousel/AppCarousel.vue index 8c9cd586..89c1f398 100644 --- a/project/sass/apps/AppCarousel/AppCarousel.vue +++ b/project/sass/apps/AppCarousel/AppCarousel.vue @@ -44,7 +44,7 @@ - + @@ -71,27 +71,23 @@ - - - - - - - - {{ dialogInfo.title }} - - - {{ this.dict.getLabel('bannerType', dialogInfo.type) }} - - - {{ dialogInfo.linkUrl }} - - - {{ this.dict.getLabel('bannerPosition', dialogInfo.position) }} - - - - + + + + + + {{ dialogInfo.title }} + + + {{ this.dict.getLabel('bannerType', dialogInfo.type) }} + + + {{ dialogInfo.linkUrl }} + + + {{ this.dict.getLabel('bannerPosition', dialogInfo.position) }} + + @@ -141,10 +137,10 @@ export default { }, // fileList: '', formRules: { - imgUrl: [{required: true, message: '请添加图片', trigger: 'blur'}], + imgUrl: [{required: true, message: '请添加图片', trigger: 'change'}], title: [{required: true, message: '请输入活动名称', trigger: 'blur'}], - type: [{required: true, trigger: 'blur'}], - // linkUrl: [{ required: true, message: '请输入链接', trigger: 'blur' }] + type: [{required: true, message: '请选择链接类型', trigger: 'change'}], + position: [{required: true, message: '请选择位置', trigger: 'change'}] }, colConfigs: [ {prop: 'imgUrl', label: '首页封面', slot: 'imgUrl'}, @@ -229,22 +225,23 @@ export default { }, // 确定新增 addConfirm() { - // console.log('确定') - this.instance - .post(`/app/appbanner/addOrUpdate`, { - imgUrl: this.dialogInfo.imgUrl[0].url, - linkUrl: this.dialogInfo.linkUrl, - status: this.status, - title: this.dialogInfo.title, - type: this.dialogInfo.type, - id: this.dialogInfo.id, - position: this.dialogInfo.position - }) - .then(res => { - if (res?.code == 0) { - this.$message.success('新增成功') - this.visible = false - this.getList() + this.$refs.form.validate((valid) => { + if (valid) { + this.instance.post(`/app/appbanner/addOrUpdate`, { + imgUrl: this.dialogInfo.imgUrl[0].url, + linkUrl: this.dialogInfo.linkUrl, + status: this.status, + title: this.dialogInfo.title, + type: this.dialogInfo.type, + id: this.dialogInfo.id, + position: this.dialogInfo.position + }).then(res => { + if (res?.code == 0) { + this.$message.success('新增成功') + this.visible = false + this.getList() + } + }) } }) },