diff --git a/src/views/modules/events/veteran-details.vue b/src/views/modules/events/veteran-details.vue index 23e7173..28c197f 100644 --- a/src/views/modules/events/veteran-details.vue +++ b/src/views/modules/events/veteran-details.vue @@ -69,50 +69,50 @@ export default { } } }, - methods: { - init () { - this.visible = true - this.$nextTick(() => { - this.$refs['dataForm'].resetFields() - if (this.dataForm.id) { - this.getInfo() - } - }) - }, - // 获取信息 - getInfo () { - 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 }) => { + methods: { + init () { + this.visible = true + this.$nextTick(() => { + this.$refs['dataForm'].resetFields() + if (this.dataForm.id) { + this.getInfo() + } + }) + }, + // 获取信息 + getInfo () { + this.$http.get(`/events/veterantopic/${this.dataForm.id}`).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') - } - }) + this.dataForm = { + ...this.dataForm, + ...res.data + } }).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 }) + } }