This commit is contained in:
2022-10-09 16:45:03 +08:00
parent 089a6517d3
commit b9ac64ab13
10 changed files with 137 additions and 67 deletions

View File

@@ -122,9 +122,12 @@ export default {
// 备注
remark: ''
},
dataFormRules: {
name: [{ required: true, message: i18n.t('validate.required'), trigger: 'blur' }],
code: [{ required: true, message: i18n.t('validate.required'), trigger: 'blur' }]
},
limit: 5,
page: 1,
dataFormRules: {},
showAttrForm: false
}
},
@@ -287,20 +290,24 @@ export default {
}
},
handleCreateOrUpdate() {
this.$http({
url: this.$http.adornUrl('/monitoring/workshopSection'),
method: this.dataForm.id ? 'put' : 'post',
data: {
...this.dataForm
this.$refs['dataForm'].validate(valid => {
if (valid) {
this.$http({
url: this.$http.adornUrl('/monitoring/workshopSection'),
method: this.dataForm.id ? 'put' : 'post',
data: {
...this.dataForm
}
}).then(({ data: res }) => {
this.$message.success({
message: i18n.t('prompt.success'),
onClose: () => {
this.$emit('refreshDataList')
this.visible = false
}
})
})
}
}).then(({ data: res }) => {
this.$message.success({
message: i18n.t('prompt.success'),
onClose: () => {
this.$emit('refreshDataList')
this.visible = false
}
})
})
}
}