Commit 9f7c20a0 by 姜鹏凯

客群详情路由更新

1 parent 50150ef9
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
<div class="g-card"> <div class="g-card">
<div class="g-card-title">数据趋势</div> <div class="g-card-title">数据趋势</div>
<search-title :showScene="true" @search="getLineData"></search-title> <search-title :showScene="true" @search="getLineData"></search-title>
<chart-line style="height: 300px" :legend="legend" :xData="xdata" :series="series"></chart-line> <chart-line style="height: 300px;" :legend="legend" :xData="xdata" :series="series"></chart-line>
</div> </div>
<div class="g-card"> <div class="g-card">
<div class="g-card-title">活码客群</div> <div class="g-card-title">活码客群</div>
<el-table v-loading="loading" :data="tableList" style="width: 100%"> <el-table v-loading="loading" :data="tableList" style="width: 100%;">
<el-table-column label="客群名称" align="center" min-width="100" prop="groupName" show-overflow-tooltip /> <el-table-column label="客群名称" align="center" min-width="100" prop="groupName" show-overflow-tooltip />
<el-table-column label="群主" align="center" min-width="100" prop="groupOwner" show-overflow-tooltip /> <el-table-column label="群主" align="center" min-width="100" prop="groupOwner" show-overflow-tooltip />
<el-table-column <el-table-column
...@@ -16,19 +16,22 @@ ...@@ -16,19 +16,22 @@
align="center" align="center"
prop="chatGroupMemberTotalNum" prop="chatGroupMemberTotalNum"
min-width="100" min-width="100"
show-overflow-tooltip></el-table-column> show-overflow-tooltip
></el-table-column>
<el-table-column <el-table-column
label="进群人数" label="进群人数"
align="center" align="center"
prop="joinChatGroupTotalMemberNum" prop="joinChatGroupTotalMemberNum"
min-width="100" min-width="100"
show-overflow-tooltip></el-table-column> show-overflow-tooltip
></el-table-column>
<el-table-column <el-table-column
label="退群人数" label="退群人数"
align="center" align="center"
prop="exitChatGroupTotalMemberNum" prop="exitChatGroupTotalMemberNum"
min-width="100" min-width="100"
show-overflow-tooltip></el-table-column> show-overflow-tooltip
></el-table-column>
<el-table-column label="操作" align="center" width="180"> <el-table-column label="操作" align="center" width="180">
<template #default="{ row }"> <template #default="{ row }">
<el-button <el-button
...@@ -36,12 +39,13 @@ ...@@ -36,12 +39,13 @@
size="mini" size="mini"
@click=" @click="
$router.push({ $router.push({
path: '/groupManage/customerGroupManage/groupDetail', path: '/groupManage/customerGroupManage/group/groupDetail',
query: { query: {
chatId: row.chatId, chatId: row.chatId
}, }
}) })
"> "
>
查看详情 查看详情
</el-button> </el-button>
</template> </template>
...@@ -51,113 +55,113 @@ ...@@ -51,113 +55,113 @@
</div> </div>
</template> </template>
<script> <script>
import ChartLine from '@/components/ChartLine.vue' import ChartLine from '@/components/ChartLine.vue'
import SearchTitle from '../components/SearchTitle.vue' import SearchTitle from '../components/SearchTitle.vue'
import { getLineChartTotal, getTableTotal, getGroupDetail } from '@/api/drainageCode/group.js' import { getLineChartTotal, getTableTotal, getGroupDetail } from '@/api/drainageCode/group.js'
export default { export default {
name: 'group-analyse', name: 'group-analyse',
components: { components: {
SearchTitle, SearchTitle,
ChartLine, ChartLine
},
data() {
return {
id: '',
groupId: '',
exportLoading: false,
legend: ['进群人数', '退群人数'],
xdata: [],
series: [],
cardData: [
{
title: '活码客群数',
tips: '当前群活码所有群聊数量,包括自动建立的群',
value: 0,
noArrow: true,
},
{
title: '群总人数',
tips: '当前群活码全部群的总人数(含员工及重复)',
value: 0,
title1: '较昨日',
value1: 0,
},
{
title: '进群人数',
tips: '通过当前群活码进群的人数(去重)',
value: 0,
title1: '较昨日',
value1: 0,
},
{
title: '退群人数',
tips: '通过当前群活码进群后退群的人数(去重)',
value: 0,
title1: '较昨日',
value1: 0,
},
],
total: 0,
query: {
id: '',
},
tableList: [],
loading: false,
searchData: {},
bar1: [],
bar2: [],
}
},
methods: {
getCardData() {
getGroupDetail(this.groupId).then((res) => {
if (res.code === 200) {
let data = res.data
this.cardData[0].value = data.chatGroupNum
this.cardData[1].value = data.chatGroupMemberTotalNum //群总人数
this.cardData[2].value = data.joinChatGroupTotalMemberNum // 进群
this.cardData[3].value = data.exitChatGroupTotalMemberNum // 退群
this.cardData[1].value1 =
Number(data.newJoinChatGroupTotalMemberNum) - Number(data.oldJoinChatGroupTotalMemberNum)
this.cardData[2].value1 =
Number(data.joinChatGroupTotalMemberNum) - Number(data.oldJoinChatGroupTotalMemberNum)
this.cardData[3].value1 =
Number(data.exitChatGroupTotalMemberNum) - Number(data.oldExitChatGroupTotalMemberNum)
}
})
}, },
getLineData(data) { data() {
this.$forceUpdate() return {
getLineChartTotal({ ...data, state: this.id }).then((res) => { id: '',
this.xdata = [] groupId: '',
this.series = [] exportLoading: false,
let arr1 = [] legend: ['进群人数', '退群人数'],
let arr2 = [] xdata: [],
if (res.data && res.data.length) { series: [],
res.data.forEach((dd) => { cardData: [
this.xdata.push(dd.dateTime) {
arr1.push(dd.joinChatGroupTotalMemberNum) title: '活码客群数',
arr2.push(dd.exitChatGroupTotalMemberNum) tips: '当前群活码所有群聊数量,包括自动建立的群',
}) value: 0,
this.series = [arr1, arr2] noArrow: true
} },
}) {
title: '群总人数',
tips: '当前群活码全部群的总人数(含员工及重复)',
value: 0,
title1: '较昨日',
value1: 0
},
{
title: '进群人数',
tips: '通过当前群活码进群的人数(去重)',
value: 0,
title1: '较昨日',
value1: 0
},
{
title: '退群人数',
tips: '通过当前群活码进群后退群的人数(去重)',
value: 0,
title1: '较昨日',
value1: 0
}
],
total: 0,
query: {
id: ''
},
tableList: [],
loading: false,
searchData: {},
bar1: [],
bar2: []
}
}, },
getTableFn() { methods: {
this.loading = true getCardData() {
getTableTotal(this.groupId).then((res) => { getGroupDetail(this.groupId).then((res) => {
this.tableList = res.data if (res.code === 200) {
this.loading = false let data = res.data
}) this.cardData[0].value = data.chatGroupNum
this.cardData[1].value = data.chatGroupMemberTotalNum //群总人数
this.cardData[2].value = data.joinChatGroupTotalMemberNum // 进群
this.cardData[3].value = data.exitChatGroupTotalMemberNum // 退群
this.cardData[1].value1 =
Number(data.newJoinChatGroupTotalMemberNum) - Number(data.oldJoinChatGroupTotalMemberNum)
this.cardData[2].value1 =
Number(data.joinChatGroupTotalMemberNum) - Number(data.oldJoinChatGroupTotalMemberNum)
this.cardData[3].value1 =
Number(data.exitChatGroupTotalMemberNum) - Number(data.oldExitChatGroupTotalMemberNum)
}
})
},
getLineData(data) {
this.$forceUpdate()
getLineChartTotal({ ...data, state: this.id }).then((res) => {
this.xdata = []
this.series = []
let arr1 = []
let arr2 = []
if (res.data && res.data.length) {
res.data.forEach((dd) => {
this.xdata.push(dd.dateTime)
arr1.push(dd.joinChatGroupTotalMemberNum)
arr2.push(dd.exitChatGroupTotalMemberNum)
})
this.series = [arr1, arr2]
}
})
},
getTableFn() {
this.loading = true
getTableTotal(this.groupId).then((res) => {
this.tableList = res.data
this.loading = false
})
}
}, },
}, created() {
created() { this.id = this.$route.query.id
this.id = this.$route.query.id this.groupId = this.$route.query.groupId
this.groupId = this.$route.query.groupId this.getCardData()
this.getCardData() this.getTableFn()
this.getTableFn() }
}, }
}
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!