Browse Source

【PC端】群通知违规校验逻辑修改-王公峰-2020-08-05

master
wanggongfeng 5 years ago
parent
commit
290140ec8e
  1. 35
      src/views/modules/master/masternotice-add-or-update.vue

35
src/views/modules/master/masternotice-add-or-update.vue

@ -50,12 +50,14 @@ export default {
createdTime: '',
updatedBy: '',
updatedTime: '',
fileList: ''
fileList: '',
isConReview: false
},
url: '',
num: 0,
fileList: [],
btnAble: false
btnAble: false,
isFirst: true
}
},
computed: {
@ -72,8 +74,10 @@ export default {
},
methods: {
init () {
this.btnAble = false
this.dataForm.isConReview = false
this.isFirst = true
this.visible = true
this.btnAble = false
this.url = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
this.num = 0
this.fileList = []
@ -98,14 +102,32 @@ export default {
},
//
dataFormSubmitHandle: debounce(function () {
this.btnAble = true
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
this.btnAble = false
return false
}
this.btnAble = true
this.$http[!this.dataForm.id ? 'post' : 'put']('/cloudAnalysis/masternotice/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
if (!this.isFirst && res.code === 533) {
//
this.$confirm('您提交的内容再次被判定为违规, 是否继续提交?', '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
}).then(() => {
this.dataForm.isConReview = true
//
this.dataFormSubmitHandle()
}).catch(() => {
this.btnAble = false
})
return false
} else if (res.code === 533) {
this.isFirst = false
this.btnAble = false
return this.$message.error(res.msg)
} else if (res.code !== 0) {
this.btnAble = false
return this.$message.error(res.msg)
}
this.$message({
@ -114,7 +136,6 @@ export default {
duration: 500,
onClose: () => {
this.visible = false
this.btnAble = false
this.$emit('refreshDataList')
}
})

Loading…
Cancel
Save