1
This commit is contained in:
parent
4fa3075e33
commit
04ef09e010
@ -10,14 +10,14 @@ export function addMail(data) {
|
|||||||
|
|
||||||
export function getMailList() {
|
export function getMailList() {
|
||||||
return request({
|
return request({
|
||||||
url: '/email/list',
|
url: '/mail/list',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateMail(data) {
|
export function updatmail(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/email/update',
|
url: '/mail/update',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@ -25,7 +25,7 @@ export function updateMail(data) {
|
|||||||
|
|
||||||
export function delMail(mailid) {
|
export function delMail(mailid) {
|
||||||
return request({
|
return request({
|
||||||
url: '/email/delete/' + mailid,
|
url: '/mail/delete/' + mailid,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -19,12 +19,12 @@
|
|||||||
<el-date-picker v-model.number="postForm.expiretime" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" placeholder="Select date and time" required />
|
<el-date-picker v-model.number="postForm.expiretime" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" placeholder="Select date and time" required />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="10" v-show="userRegVisible">
|
<el-col v-show="userRegVisible" :span="10">
|
||||||
<el-form-item label-width="120px" label="注册时间>=:" class="postInfo-container-item" prop="user_reg_start_time">
|
<el-form-item label-width="120px" label="注册时间>=:" class="postInfo-container-item" prop="user_reg_start_time">
|
||||||
<el-date-picker v-model.number="postForm.user_reg_start_time" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" placeholder="Select date and time" required />
|
<el-date-picker v-model.number="postForm.user_reg_start_time" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" placeholder="Select date and time" required />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="10" v-show="userRegVisible">
|
<el-col v-show="userRegVisible" :span="10">
|
||||||
<el-form-item label-width="120px" label="注册时间<=:" class="postInfo-container-item" prop="user_reg_end_time">
|
<el-form-item label-width="120px" label="注册时间<=:" class="postInfo-container-item" prop="user_reg_end_time">
|
||||||
<el-date-picker v-model.number="postForm.user_reg_end_time" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" placeholder="Select date and time" required />
|
<el-date-picker v-model.number="postForm.user_reg_end_time" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" placeholder="Select date and time" required />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -49,7 +49,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item v-show="groupMailVisible" style="margin-bottom: 40px;" prop="to" label="收件人列表:">
|
<el-form-item v-show="groupMailVisible" style="margin-bottom: 40px;" prop="to" label="收件人列表:">
|
||||||
<el-input v-model="postForm.to" type="textarea" :rows="6" required />
|
<el-input v-model="postForm.recipients" type="textarea" :rows="6" required />
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -82,7 +82,7 @@ export default {
|
|||||||
subject: '',
|
subject: '',
|
||||||
content: '',
|
content: '',
|
||||||
attachments: '',
|
attachments: '',
|
||||||
to: '',
|
recipients: ''
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
sendtime: [{ required: true, message: '请选择发送时间', trigger: 'blur' }],
|
sendtime: [{ required: true, message: '请选择发送时间', trigger: 'blur' }],
|
||||||
@ -93,25 +93,25 @@ export default {
|
|||||||
{ required: true, message: '用户注册开始时间', trigger: 'blur' },
|
{ required: true, message: '用户注册开始时间', trigger: 'blur' },
|
||||||
{
|
{
|
||||||
validator: (rule, value, cb, source, options) => {
|
validator: (rule, value, cb, source, options) => {
|
||||||
const errors = [];
|
const errors = []
|
||||||
console.log(this.postForm.mailtype);
|
console.log(this.postForm.mailtype)
|
||||||
cb();
|
cb()
|
||||||
return errors;
|
return errors
|
||||||
},
|
},
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
user_reg_end_time: [
|
user_reg_end_time: [
|
||||||
{ required: true, message: '用户注册结束时间', trigger: 'blur' },
|
{ required: true, message: '用户注册结束时间', trigger: 'blur' },
|
||||||
{
|
{
|
||||||
validator: (rule, value, cb, source, options) => {
|
validator: (rule, value, cb, source, options) => {
|
||||||
const errors = [];
|
const errors = []
|
||||||
console.log(this.postForm.mailtype);
|
console.log(this.postForm.mailtype)
|
||||||
cb();
|
cb()
|
||||||
return errors;
|
return errors
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
userRegVisible: true,
|
userRegVisible: true,
|
||||||
groupMailVisible: true,
|
groupMailVisible: true,
|
||||||
@ -122,18 +122,18 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
'postForm.mailtype'(val) {
|
'postForm.mailtype'(val) {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
case MAIL_TYPE_GROUP:
|
case MAIL_TYPE_GROUP:
|
||||||
{
|
{
|
||||||
this.userRegVisible = true;
|
this.userRegVisible = true
|
||||||
this.groupMailVisible = true;
|
this.groupMailVisible = true
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
case MAIL_TYPE_ALL:
|
case MAIL_TYPE_ALL:
|
||||||
{
|
{
|
||||||
this.userRegVisible = true;
|
this.userRegVisible = true
|
||||||
this.groupMailVisible = false;
|
this.groupMailVisible = false
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
if (this.dialogStatus === 'create' && val === 2) {
|
if (this.dialogStatus === 'create' && val === 2) {
|
||||||
@ -167,10 +167,10 @@ export default {
|
|||||||
data.expiretime = data.expiretime / 1000
|
data.expiretime = data.expiretime / 1000
|
||||||
data.user_reg_start_time = data.user_reg_start_time / 1000
|
data.user_reg_start_time = data.user_reg_start_time / 1000
|
||||||
data.user_reg_end_time = data.user_reg_end_time / 1000
|
data.user_reg_end_time = data.user_reg_end_time / 1000
|
||||||
console.log('valid begin');
|
console.log('valid begin')
|
||||||
try {
|
try {
|
||||||
this.$refs['postForm'].validate((valid) => {
|
this.$refs['postForm'].validate((valid) => {
|
||||||
console.log('valid end', valid);
|
console.log('valid end', valid)
|
||||||
if (valid) {
|
if (valid) {
|
||||||
addMail(data).then(response => {
|
addMail(data).then(response => {
|
||||||
if (response.code === 0) {
|
if (response.code === 0) {
|
||||||
@ -186,7 +186,7 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -8,32 +8,16 @@
|
|||||||
style="width: 100%;"
|
style="width: 100%;"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="mailid"
|
prop="mail_id"
|
||||||
label="mailid"
|
label="邮件id"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="subject"
|
prop="mail_type"
|
||||||
label="subject"
|
label="邮件类型"
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
prop="to"
|
|
||||||
label="To"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
prop="from"
|
|
||||||
label="From"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
prop="mailtype"
|
|
||||||
label="mailtype"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
prop="mailtype"
|
|
||||||
label="mailsubtype"
|
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="sendtime"
|
prop="sendtime"
|
||||||
label="sendtime"
|
label="发送时间"
|
||||||
>
|
>
|
||||||
<template slot-scope="{row}">
|
<template slot-scope="{row}">
|
||||||
<span>
|
<span>
|
||||||
@ -43,7 +27,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="expiretime"
|
prop="expiretime"
|
||||||
label="expiretime"
|
label="过期时间"
|
||||||
>
|
>
|
||||||
<template slot-scope="{row}">
|
<template slot-scope="{row}">
|
||||||
<span>
|
<span>
|
||||||
@ -52,15 +36,24 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="content"
|
prop="to"
|
||||||
label="content"
|
label="收件人"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="attachments" align="center" width="95">
|
|
||||||
<template slot-scope="{row}">
|
|
||||||
<span v-if="row.attachments.length > 0" class="link-type" @click="handleFetchAtta(row.attachments)">查看</span>
|
|
||||||
<el-tag v-else type="info">无</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="subject"
|
||||||
|
label="邮件标题"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="content"
|
||||||
|
label="邮件内容"
|
||||||
|
/>
|
||||||
|
<!-- <el-table-column label="附件" align="center" width="95"> -->
|
||||||
|
<!-- <template slot-scope="{row}"> -->
|
||||||
|
<!-- <span v-if="row.attachments.length > 0" class="link-type" @click="handleFetchAtta(row.attachments)">查看</span> -->
|
||||||
|
<!-- <el-tag v-else type="info">无</el-tag> -->
|
||||||
|
<!-- </template> -->
|
||||||
|
<!-- </el-table-column> -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
fixed="right"
|
fixed="right"
|
||||||
label="操作"
|
label="操作"
|
||||||
@ -82,7 +75,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
// import Pagination from '@/components/Pagination/index.vue'
|
// import Pagination from '@/components/Pagination/index.vue'
|
||||||
import { delEmail, getEmailList } from '@/api/mail'
|
import { delMail, getMailList } from '@/api/mail'
|
||||||
import { parseTime } from '@/utils'
|
import { parseTime } from '@/utils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -92,7 +85,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogAttaVisible: false,
|
dialogAttaVisible: false,
|
||||||
emailList: [],
|
mailList: [],
|
||||||
attaData: []
|
attaData: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -102,9 +95,9 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
parseTime,
|
parseTime,
|
||||||
getList() {
|
getList() {
|
||||||
getEmailList().then(response => {
|
getMailList().then(response => {
|
||||||
if (response.code === 0) {
|
if (response.code === 0) {
|
||||||
this.emailList = response.data
|
this.mailList = response.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -118,7 +111,7 @@ export default {
|
|||||||
this.$router.replace('update/' + row.mailid)
|
this.$router.replace('update/' + row.mailid)
|
||||||
},
|
},
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
delEmail(row.mailid).then((response) => {
|
delMail(row.mailid).then((response) => {
|
||||||
if (response.code === 0) {
|
if (response.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '操作成功',
|
message: '操作成功',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user