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