HistoryMsg.vue
2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<script>
import { appMsg } from '@/api/internalCollaborate/groupRobot'
export default {
name: '',
components: {},
props: {
id: {
type: String | Number,
required: true,
},
},
data() {
return {
query: {
pageNum: 1,
pageSize: 10,
robotId: this.id,
},
total: 0,
list: [],
loading: false,
typeDict: {
text: '文本',
image: '图片',
news: '图文',
video: '视频',
file: '文件',
},
}
},
computed: {},
watch: {},
created() {
this.getList()
},
mounted() {},
methods: {
getList(page) {
// if (this.dateRange) {
// this.query.beginTime = this.dateRange[0]
// this.query.endTime = this.dateRange[1]
// } else {
// this.query.beginTime = ''
// this.query.endTime = ''
// }
page && (this.query.pageNum = page)
this.loading = true
appMsg
.getList(this.query)
.then(({ rows, total }) => {
this.list = rows
this.total = +total
})
.finally(() => {
this.loading = false
})
},
edit(data) {
this.form = Object.assign({}, data || {})
data.weMessageTemplate || (data.weMessageTemplate = data)
this.$emit('edit', data)
},
},
}
</script>
<template>
<div>
<el-table v-loading="loading" :data="list">
<el-table-column label="消息标题" align="center" prop="msgTitle" />
<el-table-column prop="msgType" label="类型" align="center">
<template slot-scope="{ row }">{{ typeDict[row.msgType] }}</template>
</el-table-column>
<el-table-column label="发送时间" align="center" prop="sendTime" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="{ row }">
<el-button type="text" @click="edit(row)">详情</el-button>
<!-- v-hasPermi="['customerManage:tag:remove']" -->
</template>
</el-table-column>
</el-table>
<pagination
style="text-align: center"
class="mt20"
v-show="total > 0"
:total="total"
:background="false"
layout="prev, pager, next"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()" />
</div>
</template>
<style lang="less" scoped></style>