| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getList, getDetail, add, update, remove, enable, sendEmail } from "@/api/system/email" |
| | | import { getEmailTemplateList, saveEmailTemplateList, updateEmailTemplateList, detailEmailTemplateList, removeEmailTemplateList } from "@/api/system/email" |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | |
| | | menuWidth: 350, |
| | | column: [ |
| | | { |
| | | label: "主题", |
| | | prop: "remark", |
| | | label: "标题", |
| | | prop: "title", |
| | | type: "input", |
| | | align: 'center' |
| | | }, |
| | | { |
| | | label: "正文内容", |
| | | prop: "remark", |
| | | prop: "content", |
| | | type: "input", |
| | | align: 'center' |
| | | }, |
| | | ] |
| | | }, |
| | |
| | | done() |
| | | }, |
| | | rowSave (row, done, loading) { |
| | | add(row).then(() => { |
| | | saveEmailTemplateList(row).then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | |
| | | }) |
| | | }, |
| | | rowUpdate (row, index, done, loading) { |
| | | update(row).then(() => { |
| | | updateEmailTemplateList(row).then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id) |
| | | return removeEmailTemplateList(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page) |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids) |
| | | return removeEmailTemplateList(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page) |
| | |
| | | }, |
| | | beforeOpen (done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | detailEmailTemplateList(this.form.id).then(res => { |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | |
| | | }, |
| | | onLoad (page, params = {}) { |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | getEmailTemplateList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |