|
@@ -0,0 +1,198 @@
|
|
1
|
+<template>
|
|
2
|
+ <div v-loading="loading">
|
|
3
|
+ <!-- <div class="screenBox" style="align-items: center;padding-right:16px">
|
|
4
|
+ <div class="flex-align-center" style="flex:1;flex-wrap: wrap;">
|
|
5
|
+ </div>
|
|
6
|
+ </div> -->
|
|
7
|
+ <div class="tableInfo">
|
|
8
|
+ <div>
|
|
9
|
+ <div class="flex">
|
|
10
|
+ <div class="totalCustom">共有<span>{{ total }}</span>条记录</div>
|
|
11
|
+ </div>
|
|
12
|
+ </div>
|
|
13
|
+ <div class="flex">
|
|
14
|
+ <!-- <el-button type="primary" plain size="mini" @click="init(1, 'export')">导出Excel</el-button> -->
|
|
15
|
+ </div>
|
|
16
|
+ </div>
|
|
17
|
+ <!-- table -->
|
|
18
|
+ <el-table ref="multipleTable" :height='height' :data="tableData" tooltip-effect="dark" style="width: 100%">
|
|
19
|
+ <el-table-column prop="name" label="配置名称" show-overflow-tooltip align="center">
|
|
20
|
+ <template slot-scope="scope">
|
|
21
|
+ <div>{{ scope.row.device_title}}</div>
|
|
22
|
+ </template>
|
|
23
|
+ </el-table-column>
|
|
24
|
+ <el-table-column label="设备ID" align="center">
|
|
25
|
+ <template slot-scope="scope">
|
|
26
|
+ <div class="customerServiceTagBox">
|
|
27
|
+ <div class="customerServiceTag">{{ scope.row.device_id }}</div>
|
|
28
|
+ </div>
|
|
29
|
+ </template>
|
|
30
|
+ </el-table-column>
|
|
31
|
+ <el-table-column prop="user_name" label="转发人" show-overflow-tooltip align="center"></el-table-column>
|
|
32
|
+ <el-table-column min-width="80" label="已入群总数" show-overflow-tooltip align="center">
|
|
33
|
+ <template slot-scope="scope">
|
|
34
|
+ <div>{{ scope.row.chat_group_total }}</div>
|
|
35
|
+ </template>
|
|
36
|
+ </el-table-column>
|
|
37
|
+ <el-table-column prop="forward_total" label="已转发群数" show-overflow-tooltip align="center"></el-table-column>
|
|
38
|
+ <el-table-column prop="time_interval" label="近十次转发间隔(单位: 秒)" align="center" style="white-space: pre-wrap;overflow-wrap: break-word;"></el-table-column>
|
|
39
|
+ <el-table-column prop="created_at" label="转发开始时间" show-overflow-tooltip align="center"></el-table-column>
|
|
40
|
+ <el-table-column prop="updated_at" label="上一次执行时间" show-overflow-tooltip align="center"></el-table-column>
|
|
41
|
+ </el-table>
|
|
42
|
+ <div class="pagination" v-show="total > 0">
|
|
43
|
+ <el-pagination background :current-page="page" @current-change="handleCurrentChange" layout="prev, pager, next"
|
|
44
|
+ :page-count='Number(pages)'>
|
|
45
|
+ </el-pagination>
|
|
46
|
+ </div>
|
|
47
|
+ </div>
|
|
48
|
+ </template>
|
|
49
|
+ <script>
|
|
50
|
+ import { getCurrentCorpInfo } from '@/assets/js/common'
|
|
51
|
+
|
|
52
|
+ export default {
|
|
53
|
+ data () {
|
|
54
|
+ return {
|
|
55
|
+ detialFlag: false,
|
|
56
|
+ loading: false,
|
|
57
|
+ page: 1,
|
|
58
|
+ pages: 0,
|
|
59
|
+ total: 0,
|
|
60
|
+ page_size: 20,
|
|
61
|
+ tableData: [],
|
|
62
|
+ resetFlag: false,//重置
|
|
63
|
+ height: '',
|
|
64
|
+ detail_chat_id: '',
|
|
65
|
+ user_id_list: '',
|
|
66
|
+ input_keyword: '',
|
|
67
|
+ uniqueMemberCount: '',
|
|
68
|
+ uniqueMemberCountLoading: false
|
|
69
|
+ }
|
|
70
|
+ },
|
|
71
|
+ created () {
|
|
72
|
+ this.height = document.documentElement.clientHeight - 260 > 400 ? document.documentElement.clientHeight - 260 : 400
|
|
73
|
+ this.init(1)
|
|
74
|
+ },
|
|
75
|
+ methods: {
|
|
76
|
+ init (page, type) {
|
|
77
|
+ if (type != 'export') {
|
|
78
|
+ this.page = page ? page : this.page;
|
|
79
|
+ } else {
|
|
80
|
+ if (this.total == 0) {
|
|
81
|
+ this.$message({
|
|
82
|
+ message: '暂无数据可导出',
|
|
83
|
+ type: "warning"
|
|
84
|
+ })
|
|
85
|
+ return
|
|
86
|
+ }
|
|
87
|
+ }
|
|
88
|
+ this.loading = true
|
|
89
|
+ this.$axios.get(this.URL.BASEURL + this.URL.forward_msg_record_list, {
|
|
90
|
+ params: {
|
|
91
|
+ page: type == 'export' ? 1 : this.page,
|
|
92
|
+ page_size: type == 'export' ? this.$store.state.exportNumber : this.page_size,
|
|
93
|
+ }
|
|
94
|
+ }).then((res) => {
|
|
95
|
+ var res = res.data
|
|
96
|
+ this.loading = false
|
|
97
|
+ if (res && res.errno == 0) {
|
|
98
|
+ if (type == 'export') {
|
|
99
|
+ this.exportEvent(res.rst.data)
|
|
100
|
+ } else {
|
|
101
|
+ this.tableData = res.rst.data;
|
|
102
|
+ this.total = res.rst.pageInfo.total;
|
|
103
|
+ this.pages = res.rst.pageInfo.pages;
|
|
104
|
+ }
|
|
105
|
+ } else if (res.errno != 4002) {
|
|
106
|
+ this.$message({
|
|
107
|
+ message: res.err,
|
|
108
|
+ type: "warning"
|
|
109
|
+ })
|
|
110
|
+ }
|
|
111
|
+ }).catch((err) => {
|
|
112
|
+ this.loading = false
|
|
113
|
+ });
|
|
114
|
+ },
|
|
115
|
+ handleCurrentChange (val) {
|
|
116
|
+ this.init(val)
|
|
117
|
+ },
|
|
118
|
+ exportEvent (data) {
|
|
119
|
+ let list = data;
|
|
120
|
+ let tHeader = ['群名称', '群主', '群人数', '群公告', '创建时间', '群状态',]
|
|
121
|
+ let filterVal = ['name', 'owner_name', 'member_count', 'notice', 'create_time', 'self_status']
|
|
122
|
+ list.forEach((item) => {
|
|
123
|
+ item.self_status = item.status == 1 ? '正常' : item.status == 2 ? '解散' : '';
|
|
124
|
+ })
|
|
125
|
+ let excelDatas = [
|
|
126
|
+ {
|
|
127
|
+ tHeader: tHeader, // sheet表一头部
|
|
128
|
+ filterVal: filterVal, // 表一的数据字段
|
|
129
|
+ tableDatas: list, // 表一的整体json数据
|
|
130
|
+ sheetName: ''// 表一的sheet名字
|
|
131
|
+ }
|
|
132
|
+ ]
|
|
133
|
+ this.$exportOrder({ excelDatas, name: `客户群管理(导出时间:${this.$getDay(0)})` })
|
|
134
|
+ },
|
|
135
|
+ // 监听点击"复制ID"
|
|
136
|
+ async onClickCopyID(row) {
|
|
137
|
+ try {
|
|
138
|
+ await this.$copyText(row.share_chatid)
|
|
139
|
+ this.$message.success('复制成功')
|
|
140
|
+ } catch (error) {
|
|
141
|
+ this.$message.error('复制失败,请重试')
|
|
142
|
+ }
|
|
143
|
+ },
|
|
144
|
+
|
|
145
|
+ // 监听点击“同步企微客户群”
|
|
146
|
+ async onClickSyncGroup() {
|
|
147
|
+ try {
|
|
148
|
+ const { corp_name, corpid } = getCurrentCorpInfo() || {}
|
|
149
|
+ await this.$confirm(`确定同步${corp_name ? '【'+corp_name+'】' : '当前企微'}的客户群数据吗?`, '提示', {
|
|
150
|
+ confirmButtonText: '确定',
|
|
151
|
+ cancelButtonText: '取消',
|
|
152
|
+ type: 'warning'
|
|
153
|
+ })
|
|
154
|
+ this.handleSyncGroup({ corp_name, corpid })
|
|
155
|
+ } catch (error) {
|
|
156
|
+ console.log('error => ', error)
|
|
157
|
+ }
|
|
158
|
+ },
|
|
159
|
+ async handleSyncGroup({ corp_name, corpid }) {
|
|
160
|
+ try {
|
|
161
|
+ this.loading = true
|
|
162
|
+ const url = `${this.URL.BASEURL}${this.URL.tagManage_syncCorpChatGroup}`
|
|
163
|
+ const params = { corpid }
|
|
164
|
+ const { data: res = {} } = await this.$axios.get(url, { params })
|
|
165
|
+ if (res && res.errno == 0) {
|
|
166
|
+ this.$message.success({
|
|
167
|
+ message: '后台数据同步中,请稍候查看',
|
|
168
|
+ duration: 6000
|
|
169
|
+ })
|
|
170
|
+ } else if (res.errno != 4002) {
|
|
171
|
+ this.$message.warning(res.err)
|
|
172
|
+ }
|
|
173
|
+ } catch (error) {
|
|
174
|
+ console.log(error)
|
|
175
|
+ } finally {
|
|
176
|
+ this.loading = false
|
|
177
|
+ }
|
|
178
|
+ },
|
|
179
|
+ }
|
|
180
|
+ }
|
|
181
|
+ </script>
|
|
182
|
+ <style lang="scss" scoped>
|
|
183
|
+ @import "@/style/list.scss";
|
|
184
|
+
|
|
185
|
+ .screenBox .common-screen-item {
|
|
186
|
+ width: inherit;
|
|
187
|
+ }
|
|
188
|
+
|
|
189
|
+ .tableInfo {
|
|
190
|
+ height: 50px;
|
|
191
|
+ }
|
|
192
|
+
|
|
193
|
+ .table_button {
|
|
194
|
+ margin: 0 4px;
|
|
195
|
+ min-width: 26px;
|
|
196
|
+ }
|
|
197
|
+ </style>
|
|
198
|
+
|