Browse Source

格式化代码

master
mk 1 year ago
parent
commit
0d21792e40
  1. 82
      src/views/modules/events/veteran-details.vue

82
src/views/modules/events/veteran-details.vue

@ -69,50 +69,50 @@ export default {
} }
} }
}, },
methods: { methods: {
init () { init () {
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
if (this.dataForm.id) { if (this.dataForm.id) {
this.getInfo() this.getInfo()
} }
}) })
}, },
// //
getInfo () { getInfo () {
this.$http.get(`/events/veterantopic/${this.dataForm.id}`).then(({ data: res }) => { this.$http.get(`/events/veterantopic/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/events/veterantopic/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.$message({ this.dataForm = {
message: this.$t('prompt.success'), ...this.dataForm,
type: 'success', ...res.data
duration: 500, }
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {}) }).catch(() => {})
}) },
}, 1000, { 'leading': true, 'trailing': false }) //
} dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/events/veterantopic/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false })
}
} }
</script> </script>

Loading…
Cancel
Save