This commit is contained in:
yanran200730
2022-03-23 16:51:49 +08:00
parent ed9ac12226
commit 627b4e15cb

View File

@@ -136,7 +136,7 @@ export default {
formRules: { formRules: {
imgUrl: [{required: true, message: '请添加图片', trigger: 'blur'}], imgUrl: [{required: true, message: '请添加图片', trigger: 'blur'}],
title: [{required: true, message: '请输入标题', trigger: 'blur'}], title: [{required: true, message: '请输入标题', trigger: 'blur'}],
type: [{required: true, trigger: 'blur'}], type: [{required: true, trigger: 'change', message: '请选择链接类型'}],
// linkUrl: [{ required: true, message: '请输入链接', trigger: 'blur' }] // linkUrl: [{ required: true, message: '请输入链接', trigger: 'blur' }]
}, },
colConfigs: [ colConfigs: [
@@ -223,20 +223,22 @@ export default {
// 确定新增 // 确定新增
addConfirm() { addConfirm() {
// console.log('确定') // console.log('确定')
this.instance this.$refs.ruleForm.validate((valid) => {
.post(`/app/appbanner/addOrUpdate`, { if (valid) {
imgUrl: this.dialogInfo.imgUrl[0].url, this.instance.post(`/app/appbanner/addOrUpdate`, {
linkUrl: this.dialogInfo.linkUrl, imgUrl: this.dialogInfo.imgUrl[0].url,
status: this.status, linkUrl: this.dialogInfo.linkUrl,
title: this.dialogInfo.title, status: this.status,
type: this.dialogInfo.type, title: this.dialogInfo.title,
id: this.dialogInfo.id, type: this.dialogInfo.type,
}) id: this.dialogInfo.id,
.then(res => { }).then(res => {
if (res?.code == 0) { if (res?.code == 0) {
this.$message.success('新增成功') this.$message.success('新增成功')
this.visible = false this.visible = false
this.getList() this.getList()
}
})
} }
}) })
}, },