adjust mail
This commit is contained in:
parent
829e9f96cd
commit
97e9cae2ff
@ -1,32 +1,32 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function addMail(data) {
|
export function addMail(gameid, data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/mail/add',
|
url: '/mail/add?gameid=' + gameid,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getMailList(cursor, pagesize, data) {
|
export function getMailList(gameid, cursor, pagesize, data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/mail/list?cursor=' + cursor + '&pagesize=' + pagesize,
|
url: '/mail/list?gameid=' + gameid + '&cursor=' + cursor + '&pagesize=' + pagesize,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateEmail(data) {
|
export function updateEmail(gameid, data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/mail/edit',
|
url: '/mail/edit?gameid=' + gameid,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function delMail(mailid) {
|
export function delMail(gameid, mailid) {
|
||||||
return request({
|
return request({
|
||||||
url: '/mail/del/' + mailid,
|
url: '/mail/del/' + mailid + '/?gameid=' + gameid,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,7 @@ export const asyncRoutes = [
|
|||||||
component: () => import('@/views/email/user_group_list'),
|
component: () => import('@/views/email/user_group_list'),
|
||||||
name: 'UserGroupList',
|
name: 'UserGroupList',
|
||||||
meta: { title: '用户组列表', pername: 'emailgroup' },
|
meta: { title: '用户组列表', pername: 'emailgroup' },
|
||||||
hidden: false
|
hidden: true
|
||||||
}, {
|
}, {
|
||||||
path: 'user_group/member',
|
path: 'user_group/member',
|
||||||
component: () => import('@/views/email/group_member'),
|
component: () => import('@/views/email/group_member'),
|
||||||
|
@ -8,6 +8,16 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</sticky>
|
</sticky>
|
||||||
<div class="createPost-main-container">
|
<div class="createPost-main-container">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="5">
|
||||||
|
<el-form-item label-width="120px" label="游戏" class="postInfo-container-item" prop="gameid">
|
||||||
|
<el-select v-model="gameid">
|
||||||
|
<el-option label="2004" value="2004" />
|
||||||
|
<el-option label="2006" value="2006" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
<el-form-item label-width="120px" label="unikey:" class="postInfo-container-item" prop="unikey" required>
|
<el-form-item label-width="120px" label="unikey:" class="postInfo-container-item" prop="unikey" required>
|
||||||
@ -81,6 +91,7 @@ export default {
|
|||||||
components: { MDinput, CommentDropdown, Sticky },
|
components: { MDinput, CommentDropdown, Sticky },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
gameid: '',
|
||||||
postForm: {
|
postForm: {
|
||||||
mailtype: MAIL_TYPE_GROUP,
|
mailtype: MAIL_TYPE_GROUP,
|
||||||
unikey: '',
|
unikey: '',
|
||||||
@ -94,6 +105,7 @@ export default {
|
|||||||
recipients: ''
|
recipients: ''
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
gameid: [{ required: true, validator: '请选择1', trigger: 'blur' }],
|
||||||
sendtime: [{ required: true, message: '请选择发送时间', trigger: 'blur' }],
|
sendtime: [{ required: true, message: '请选择发送时间', trigger: 'blur' }],
|
||||||
expiretime: [{ required: true, message: '请选择过期时间', trigger: 'blur' }],
|
expiretime: [{ required: true, message: '请选择过期时间', trigger: 'blur' }],
|
||||||
subject: [{ required: true, message: 'subject is required', trigger: 'blur' }],
|
subject: [{ required: true, message: 'subject is required', trigger: 'blur' }],
|
||||||
@ -182,12 +194,14 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const mailid = this.$route.params.mailid
|
const mailid = this.$route.params.mailid
|
||||||
|
console.log('gameid:' + this.gameid)
|
||||||
if (mailid) {
|
if (mailid) {
|
||||||
this.mailTypeVisible = false
|
this.mailTypeVisible = false
|
||||||
this.dialogStatus = 'update'
|
this.dialogStatus = 'update'
|
||||||
this.isupdate = true
|
this.isupdate = true
|
||||||
const editEmail = JSON.parse(sessionStorage.getItem('editEmail' + mailid))
|
const editEmail = JSON.parse(sessionStorage.getItem('editEmail' + mailid))
|
||||||
this.postForm = editEmail
|
this.postForm = editEmail
|
||||||
|
this.gameid = sessionStorage.getItem('gameid')
|
||||||
|
|
||||||
let str = ''
|
let str = ''
|
||||||
if (editEmail.attachments != null) {
|
if (editEmail.attachments != null) {
|
||||||
@ -206,6 +220,7 @@ export default {
|
|||||||
this.dialogStatus = 'create'
|
this.dialogStatus = 'create'
|
||||||
this.isupdate = false
|
this.isupdate = false
|
||||||
sessionStorage.removeItem('editEmail' + mailid)
|
sessionStorage.removeItem('editEmail' + mailid)
|
||||||
|
sessionStorage.removeItem('gameid')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -273,7 +288,7 @@ export default {
|
|||||||
this.postForm.user_reg_end_time = ''
|
this.postForm.user_reg_end_time = ''
|
||||||
}
|
}
|
||||||
if (valid) {
|
if (valid) {
|
||||||
addMail(data).then(response => {
|
addMail(this.gameid, data).then(response => {
|
||||||
if (response.code === 0) {
|
if (response.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '发布成功',
|
message: '发布成功',
|
||||||
@ -344,7 +359,7 @@ export default {
|
|||||||
data.attachments = arr
|
data.attachments = arr
|
||||||
this.$refs['postForm'].validate((valid) => {
|
this.$refs['postForm'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
updateEmail(data).then(response => {
|
updateEmail(this.gameid, data).then(response => {
|
||||||
if (response.code === 0) {
|
if (response.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '操作成功',
|
message: '操作成功',
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
<el-form ref="postForm" :model="postForm" :rules="rules" class="form-container">
|
<el-form ref="postForm" :model="postForm" :rules="rules" class="form-container">
|
||||||
<div class="createPost-main-container">
|
<div class="createPost-main-container">
|
||||||
<el-row>
|
<el-row>
|
||||||
|
<el-col :span="5">
|
||||||
|
<el-form-item label-width="120px" label="游戏" class="postInfo-container-item" prop="gameid">
|
||||||
|
<el-select v-model="gameid">
|
||||||
|
<el-option label="2004" value="2004" />
|
||||||
|
<el-option label="2006" value="2006" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="5">
|
<el-col :span="5">
|
||||||
<el-form-item label-width="120px" label="邮件标题" class="postInfo-container-item" prop="subject">
|
<el-form-item label-width="120px" label="邮件标题" class="postInfo-container-item" prop="subject">
|
||||||
<el-input v-model="postForm.subject" />
|
<el-input v-model="postForm.subject" />
|
||||||
@ -152,6 +160,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
gameid: '',
|
||||||
postForm: {
|
postForm: {
|
||||||
subject: '',
|
subject: '',
|
||||||
content: '',
|
content: '',
|
||||||
@ -167,6 +176,13 @@ export default {
|
|||||||
update_address: ''
|
update_address: ''
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
gameid: [{ required: true, validator: (rule, value, callback) => {
|
||||||
|
if (!this.gameid) {
|
||||||
|
callback(new Error('请选择'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
}, trigger: 'blur' }],
|
||||||
subject: [{ required: false, message: '', trigger: 'blur' }],
|
subject: [{ required: false, message: '', trigger: 'blur' }],
|
||||||
content: [{ required: false, message: '', trigger: 'blur' }],
|
content: [{ required: false, message: '', trigger: 'blur' }],
|
||||||
createtime: {
|
createtime: {
|
||||||
@ -243,8 +259,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.querydata = JSON.parse(JSON.stringify(this.postForm))
|
// this.querydata = JSON.parse(JSON.stringify(this.postForm))
|
||||||
this.getList(this.querydata)
|
// this.getList(this.querydata)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
parseUTCTime,
|
parseUTCTime,
|
||||||
@ -265,7 +281,7 @@ export default {
|
|||||||
data.sendtime.start = data.sendtime.start / 1000
|
data.sendtime.start = data.sendtime.start / 1000
|
||||||
data.sendtime.end = data.sendtime.end / 1000
|
data.sendtime.end = data.sendtime.end / 1000
|
||||||
}
|
}
|
||||||
getMailList(this.curpage, this.pagesize, data).then(response => {
|
getMailList(this.gameid, this.curpage, this.pagesize, data).then(response => {
|
||||||
if (response.code === 0) {
|
if (response.code === 0) {
|
||||||
this.mailList = response.data
|
this.mailList = response.data
|
||||||
this.curpage = response.curpage
|
this.curpage = response.curpage
|
||||||
@ -302,11 +318,12 @@ export default {
|
|||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
// this.$store.dispatch('emailView/addEmail', row)
|
// this.$store.dispatch('emailView/addEmail', row)
|
||||||
sessionStorage.setItem('editEmail' + row.mail_id, JSON.stringify(row))
|
sessionStorage.setItem('editEmail' + row.mail_id, JSON.stringify(row))
|
||||||
|
sessionStorage.setItem('gameid', this.gameid)
|
||||||
this.$router.push('update/' + row.mail_id)
|
this.$router.push('update/' + row.mail_id)
|
||||||
},
|
},
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
console.log(row)
|
console.log(row)
|
||||||
delMail(row.mail_id).then((response) => {
|
delMail(this.gameid, row.mail_id).then((response) => {
|
||||||
if (response.code === 0) {
|
if (response.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '操作成功',
|
message: '操作成功',
|
||||||
@ -316,7 +333,7 @@ export default {
|
|||||||
if (this.curpage === this.totalpage && this.mailList.length < 2 && this.curpage > 1) {
|
if (this.curpage === this.totalpage && this.mailList.length < 2 && this.curpage > 1) {
|
||||||
this.curpage--
|
this.curpage--
|
||||||
}
|
}
|
||||||
this.getList()
|
this.getList(this.querydata)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user