处理邮箱日志列表页面的初始化数据

This commit is contained in:
renpy 2023-08-17 11:15:11 +08:00
parent 51165b42a3
commit 41e97ed2e9

View File

@ -6,7 +6,7 @@
<div style="display: flex;align-items: center;"> <div style="display: flex;align-items: center;">
<span class="item-label">Email</span> <span class="item-label">Email</span>
<a-select style="width:160px" <a-select style="width:160px"
v-model="email" v-model="emailId"
placeholder="select..." placeholder="select..."
:filter-option="filterOption" :filter-option="filterOption"
show-arrow show-arrow
@ -203,7 +203,7 @@ export default {
emailStatus: null, emailStatus: null,
emailTotal: {}, emailTotal: {},
emailSpace: {}, emailSpace: {},
email: undefined, emailId: "",
emailToday: [], emailToday: [],
emailOptions: [], emailOptions: [],
date: 7, date: 7,
@ -239,13 +239,25 @@ export default {
this.startDate = this.getBeforeDate(6) this.startDate = this.getBeforeDate(6)
}, },
mounted() { mounted() {
this.currId = this.$route.query.emailId
this.getEmailList() this.getEmailList()
// if (this.$route.query.emailId) {
// this.currId = this.emailId = this.$route.query.emailId
// this.getEmailStatus()
// this.getEmailTotal()
// this.getEmailSpace()
// this.getEmailToday()
// this.getEmailStatistics()
// }
},
watch: {
emailId(newValue, oldValue) {
this.currId = newValue
this.getEmailStatus() this.getEmailStatus()
this.getEmailTotal() this.getEmailTotal()
this.getEmailSpace() this.getEmailSpace()
this.getEmailToday() this.getEmailToday()
this.getEmailStatistics() this.getEmailStatistics()
}
}, },
methods: { methods: {
moment, moment,
@ -257,6 +269,9 @@ export default {
getEmailList() { getEmailList() {
getAction("/sysEmail/sourceList").then(res => { getAction("/sysEmail/sourceList").then(res => {
if (res.success) { if (res.success) {
// if (!this.$route.query.emailId) {
this.emailId = this.$route.query.emailId || res.result[0].sourceId
// }
this.emailOptions = res.result.map(item => { this.emailOptions = res.result.map(item => {
return { return {
label: item.sourceName, label: item.sourceName,