Commit cfb29020 by 姜鹏凯

Merge branch 'develop' of https://e.coding.net/linkwechat/linkwechat-cloud/linkw…

…echat-ui into develop
2 parents 39945e85 542a354f
......@@ -76,8 +76,7 @@ export function dataExportGroup(params) {
*/
export function getAnalysisGroup() {
return request({
url: service + '/group/getAnalysis',
params
url: service + '/group/getAnalysis'
})
}
......
......@@ -11,46 +11,46 @@ export function getAnalysis() {
}
/**
* 客群数据-客群实时数据
* @param {*}
* 客群数据-客群总数
* @param {*} params
* chatIds 否[]群聊id
ownerIds 否[]群主id
beginTime 是 开始时间
endTime 是 结束时间
*/
export function getRealCnt(params) {
export function getTotalCnt(params) {
return request({
url: service + '/getRealCnt',
url: service + '/getTotalCnt',
params
})
}
/**
* 客群数据-客群总数
* 客群数据-客群成员总数
* @param {*} params
* chatIds 否[]群聊id
ownerIds 否[]群主id
beginTime 是 开始时间
endTime 是 结束时间
*/
export function getTotalCnt(params) {
export function getTotalCntMember(params) {
return request({
url: service + '/getTotalCnt',
url: service + '/member/getTotalCnt',
params
})
}
/**
* 客群数据-客群实时数据-导出
* @param {*} params
* 客群数据-客群实时数据
* @param {*}
* chatIds 否[]群聊id
ownerIds 否[]群主id
beginTime 是 开始时间
endTime 是 结束时间
*/
export function realDataExport(params) {
export function getRealCnt(params) {
return request({
url: service + '/real/export',
url: service + '/getRealCnt',
params
})
}
......@@ -71,16 +71,16 @@ export function getRealCntMember(params) {
}
/**
* 客群数据-客群成员总数
* 客群数据-客群实时数据-导出
* @param {*} params
* chatIds 否[]群聊id
ownerIds 否[]群主id
beginTime 是 开始时间
endTime 是 结束时间
*/
export function getTotalCntMember(params) {
export function realDataExport(params) {
return request({
url: service + '/member/getTotalCnt',
url: service + '/real/export',
params
})
}
......
......@@ -23,7 +23,7 @@ export default {
// 图例
legend: {
type: Array,
default: () => ['已推送']
default: () => []
},
// 展示数据集
// 注:二位数组, 其一维数组顺序需要和图例顺序一致,其二维数组顺序需要和X轴数组顺序一致
......
......@@ -26,9 +26,9 @@ export default {
'2021-12-06'
]
},
// 图例
// 图例; 单个图例可传字符串,实际转换成单元素数组[string]
legend: {
type: Array,
type: [Array, String],
default: () => ['新增客户']
},
// 展示数据集
......@@ -71,11 +71,13 @@ export default {
this.myChart = echarts.init(this.$refs.chart)
let option
let series = []
let legend = Array.isArray(this.legend) ? this.legend : [this.legend]
let seriesData = this.series
Array.isArray(this.series[0]) || (seriesData = [seriesData])
seriesData.forEach((data, index) => {
let obj = {
name: this.legend[index],
name: legend[index],
type: 'line',
smooth: true,
symbol: 'circle', // 数值点类型
......@@ -132,7 +134,7 @@ export default {
}
},
legend: {
data: this.legend,
data: legend,
// lineStyle: {
// width: 0
// },
......@@ -178,7 +180,7 @@ export default {
},
axisLabel: {
// 坐标轴刻度标签的相关设置。
interval: 0,
// interval: 0,
color: 'rgba(153, 153, 153, 1)' // 横坐标字体颜色
},
axisTick: {
......
......@@ -2,21 +2,24 @@
import ChartBar from '@/components/ChartBar'
import ChartLine from '@/components/ChartLine'
import SelectUser from '@/components/SelectUser'
import * as customerApi from '@/api/operateCenter/customerAnalysis'
import * as groupApi from '@/api/operateCenter/groupAnalysis'
import * as conversationApi from '@/api/operateCenter/conversationAnalysis'
// import * as customerApi from '@/api/operateCenter/customerAnalysis'
// import * as groupApi from '@/api/operateCenter/groupAnalysis'
// import * as conversationApi from '@/api/operateCenter/conversationAnalysis'
export default {
name: '',
components: { ChartLine, ChartBar, SelectUser },
props: {
// 图表类型
type: {
type: String,
default: ''
},
// 图表图例; 单个图例可传字符串,多个图例传数组
legend: {
type: Array,
type: [Array, String],
default: null
},
// 接口请求
request: {
type: Function,
default: () => {}
......@@ -29,35 +32,10 @@ export default {
total: 0,
// 表格数据
list: [
{
time: '2021-12-01',
num: 120
},
{
time: '2021-12-01',
num: 120
},
{
time: '2021-12-01',
num: 120
},
{
time: '2021-12-01',
num: 120
},
{
time: '2021-12-01',
num: 120
}
],
list: [],
xData: [],
series: [],
legendDict: {
customerTotalChart: ['客户总数'],
realDataChart: ['新增客户数', '流失客户数', '净增客户数', '发送申请数'],
customerGroupTotalChart: ['客群总数'],
customerGroupMemberTotalChart: ['客群成员总数'],
customerTotalChart: ['客群总数'],
customerTotalChart: ['客群总数']
},
......@@ -77,40 +55,43 @@ export default {
// 群聊
groupChats: [],
tableProps: {
// 客户数据报表
customerTotalTable: [
{ prop: '', label: '日期' },
{ prop: '', label: '客户总数' },
{ prop: '', label: '新增客户数' },
{ prop: '', label: '流失客户数' },
{ prop: '', label: '净增客户数' },
{ prop: '', label: '昨日发送申请数' }
{ prop: 'xtime', label: '日期' },
{ prop: 'totalCnt', label: '客户总数' },
{ prop: 'addCnt', label: '新增客户数' },
{ prop: 'lostCnt', label: '流失客户数' },
{ prop: 'netCnt', label: '净增客户数' },
{ prop: 'applyCnt', label: '昨日发送申请数' }
],
// 客群数据报表
customerGroupTotalTable: [
{ prop: '', label: '日期' },
{ prop: '', label: '客群总数' },
{ prop: '', label: '新增客群数' },
{ prop: '', label: '解散客群数' }
{ prop: 'xtime', label: '日期' },
{ prop: 'totalCnt', label: '客群总数' },
{ prop: 'addCnt', label: '新增客群数' },
{ prop: 'dissolveCnt', label: '解散客群数' }
],
// 客群成员数据报表
customerGroupMemberTotalTable: [
{ prop: '', label: '日期' },
{ prop: '', label: '客群成员总数' },
{ prop: '', label: '新增客群成员数' },
{ prop: '', label: '流失客群成员数' }
{ prop: 'xtime', label: '日期' },
{ prop: 'totalCnt', label: '客群成员总数' },
{ prop: 'addCnt', label: '新增客群成员数' },
{ prop: 'quitCnt', label: '流失客群成员数' }
],
// 客户联系
customerContactTable: [
{ prop: '', label: '日期' },
{ prop: '', label: '单聊总数' },
{ prop: '', label: '发送消息数' },
{ prop: '', label: '已回复聊天占比' },
{ prop: '', label: '平均回复时长(分)' }
{ prop: 'xtime', label: '日期' },
{ prop: 'chatCnt', label: '单聊总数' },
{ prop: 'messageCnt', label: '发送消息数' },
{ prop: 'replyPercentage', label: '已回复聊天占比' },
{ prop: 'avgReplyTime', label: '平均回复时长(分)' }
],
// 客户联系
// 客群联系
customerGroupContactTable: [
{ prop: '', label: '日期' },
{ prop: '', label: '群聊总数' },
{ prop: '', label: '群聊消息数' },
{ prop: '', label: '发送消息群成员数' }
{ prop: 'xtime', label: '日期' },
{ prop: 'chatTotal', label: '群聊总数' },
{ prop: 'msgTotal', label: '群聊消息数' },
{ prop: 'memberHasMsg', label: '发送消息群成员数' }
]
},
userArray: [], // 选择人员
......@@ -136,17 +117,45 @@ export default {
.then(({ rows, total, data }) => {
if (this.type.includes('Chart')) {
this.xData = data.map((e) => e.xtime)
if (
'customerTotalChart,customerGroupTotalChart,customerGroupMemberTotalChart'.includes(
this.type
)
) {
// 客户总数
this.series = data.map((e) => e.totalCnt)
} else if (this.type === 'realDataChart') {
// 实时数据
this.series.push(data.map((e) => e.addCnt))
this.series.push(data.map((e) => e.lostCnt))
this.series.push(data.map((e) => e.netCnt))
this.series.push(data.map((e) => e.applyCnt))
} else {
let dict = {
singleChatTotalChart: 'chatCnt', // 单聊总数
sendMessageNumChart: 'messageCnt', // 发送消息数
replySingleChatChart: 'replyPercentage', // 回复单聊占比
averageReplyDurationChart: 'avgReplyTime', // 平均首次回复时长
groupChatTotalChart: 'chatTotal', // 群聊总数
groupChatMessageNumChart: 'msgTotal', // 群聊消息数
sendMessageGroupMemberChart: 'memberHasMsg' // 发送消息群成员数
}
this.series = data.map((e) => e[dict[this.type]])
}
} else if (this.type === 'staffCustomerBar') {
// 员工客户Top10
this.xData = data.map((e) => e.userName)
this.series = data.map((e) => e.totalCnt)
} else if (this.type === 'realDataChart') {
this.xData = data.map((e) => e.time)
this.legendDict[this.type].forEach((element) => {
this.series.push(data.map((e) => e.num))
})
} else if (this.type.includes('Table')) {
this.list = data
this.total = Number(total)
}
this.total = Number(total)
this.loading = false
})
.catch(() => {
.catch((e) => {
console.log(e)
})
.finally(() => {
this.loading = false
})
},
......@@ -174,6 +183,7 @@ export default {
}
},
getSelectUser(data) {
debugger
this.userArray = data
this.query.qrUserName = this.userArray
.map(function (obj, index) {
......@@ -211,13 +221,13 @@ export default {
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="getList"
@change="getList(1)"
></el-date-picker>
<el-select
v-if="type.toLowerCase().includes('group')"
v-model="query.group"
placeholder="请选择群主"
@change="getList"
@change="getList(1)"
>
<el-option
v-for="item in groupOwners"
......@@ -231,7 +241,7 @@ export default {
v-if="['customerGroupMemberTotalChart', 'customerGroupMemberTotalTable'].includes(type)"
v-model="query.group"
placeholder="请选择群聊"
@change="getList"
@change="getList(1)"
>
<el-option
v-for="item in groupChats"
......@@ -248,8 +258,9 @@ export default {
readonly
@focus="dialogVisible = true"
placeholder="请选择部门或员工"
@change="getList(1)"
/>
<el-button v-if="type.includes('Table')" class="fr" type="primary">导出 Exce</el-button>
<el-button v-if="type.includes('Table')" class="fr" type="primary">导出 Excel</el-button>
</div>
<ChartLine
v-if="type.includes('Chart')"
......@@ -261,13 +272,17 @@ export default {
<el-table-column
v-for="(item, index) in tableProps[type]"
:key="index"
:prop="item.label"
:prop="item.prop"
:label="item.label"
align="center"
>
</el-table-column>
</el-table>
<ChartBar v-else-if="'staffCustomerBar'.includes(type)"></ChartBar>
<ChartBar
v-else-if="'staffCustomerBar'.includes(type)"
:xData="xData"
:series="series"
></ChartBar>
<SelectUser
:visible.sync="dialogVisible"
......
<script>
import ChartPie from '@/components/ChartPie'
import CardGroupIndex from '@/components/CardGroupIndex'
import TabContent from '../components/TabContent'
export default {
name: '',
components: { TabContent, ChartPie },
components: { TabContent, CardGroupIndex, ChartPie },
data() {
return {
cardData: [
......
<script>
import TabContent from '../components/TabContent'
import CardGroupIndex from '@/components/CardGroupIndex'
import TabContentstaffContact from './TabContentstaffContact'
import * as api from '@/api/operateCenter/conversationAnalysis'
export default {
name: '',
components: { TabContent, TabContentstaffContact },
components: { TabContent, CardGroupIndex, TabContentstaffContact },
data() {
return {
cardData: [
{
title: '昨日单聊总数',
tips: '企业员工发送过消息的单聊数量',
value: 1222453,
title1: '较前日',
value1: 344,
noArrow: true
},
{
title: '昨日发送消息数',
tips: '企业员工在单聊中发送的消息的数量',
value: 1222453,
title1: '较前日',
value1: 344
},
{
title: '昨日回复单聊占比',
tips: '一个自然日内,客户首先发消息的会话中,成员回复了的会话的占比。若数据展示为“-”代表没有给成员发送消息的客户,该项无法计算',
value: 1222453,
title1: '较前日',
value1: 344
},
{
title: '平均首次回复时长(分)',
tips: '一个自然日内,客户首先发消息至成员回复之间的时长,为首次回复时长。所有的首次回复总时长/已回复单聊总数,即为平均首次回复时长。若数据展示为“-”代表没有给成员发送消息的客户,该项无法计算',
value: 1222453,
title1: '较前日',
value1: 344
}
],
cardData: [],
tabs: [
{
label: '单聊总数',
......@@ -55,26 +27,59 @@ export default {
type: 'averageReplyDurationChart'
}
],
active: 0
active: 0,
api
}
},
computed: {},
watch: {},
created() {
// this.getList()
this.getList()
},
mounted() {},
methods: {
getList() {
this.loading = true
getList(this.query)
.then(({ rows, total }) => {
this.list = rows
this.total = Number(total)
this.loading = false
this.ids = []
api
.getAnalysisCustomer()
.then(({ data }) => {
data || (data = {})
this.cardData = [
{
title: '昨日单聊总数',
tips: '企业员工发送过消息的单聊数量',
value: data.ydChatCnt,
title1: '较前日',
value1: data.bydChatCnt,
noArrow: true
},
{
title: '昨日发送消息数',
tips: '企业员工在单聊中发送的消息的数量',
value: data.ydMessageCnt,
title1: '较前日',
value1: data.bydMessageCnt
},
{
title: '昨日回复单聊占比',
tips: '一个自然日内,客户首先发消息的会话中,成员回复了的会话的占比。若数据展示为“-”代表没有给成员发送消息的客户,该项无法计算',
value: data.ydReplyPercentage,
title1: '较前日',
value1: data.bydReplyPercentage
},
{
title: '平均首次回复时长(分)',
tips: '一个自然日内,客户首先发消息至成员回复之间的时长,为首次回复时长。所有的首次回复总时长/已回复单聊总数,即为平均首次回复时长。若数据展示为“-”代表没有给成员发送消息的客户,该项无法计算',
value: data.ydAvgReplyTime,
title1: '较前日',
value1: data.bydAvgReplyTime
}
]
})
.catch((e) => {
console.log(e)
})
.catch(() => {
.finally(() => {
this.loading = false
})
}
......@@ -90,7 +95,11 @@ export default {
<div>数据趋势</div>
<el-tabs v-model="active">
<el-tab-pane v-for="(item, index) of tabs" :key="index" :label="item.label">
<TabContent :type="item.type" :legend="[item.label]"></TabContent>
<TabContent
:type="item.type"
:legend="[item.label]"
:request="api.getTotalCntCustomer"
></TabContent>
</el-tab-pane>
</el-tabs>
</div>
......@@ -102,7 +111,7 @@ export default {
<div>
<div>数据报表</div>
<TabContent type="customerContactTable"></TabContent>
<TabContent type="customerContactTable" :request="api.getTotalCntCustomer"></TabContent>
</div>
</div>
</template>
......
<script>
import TabContent from '../components/TabContent'
import CardGroupIndex from '@/components/CardGroupIndex'
import * as api from '@/api/operateCenter/conversationAnalysis'
export default {
name: '',
components: { TabContent },
components: { TabContent, CardGroupIndex },
data() {
return {
cardData: [
{
title: '昨日群聊总数',
tips: '企业员工全部客户数量(包含重复)',
value: 1222453,
title1: '较前日',
value1: 344,
noArrow: true
},
{
title: '昨日群聊消息数',
tips: '企业员工今日添加的客户数(包含重复及已流失)',
value: 1222453,
title1: '较前日',
value1: 344
},
{
title: '昨日发送消息群成员数',
tips: '今日删除企业员工的客户数',
value: 1222453,
title1: '较前日',
value1: 344
}
],
cardData: [],
tabs: [
{
label: '群聊总数',
......@@ -43,29 +22,52 @@ export default {
type: 'sendMessageGroupMemberChart'
}
],
active: 0
active: 0,
api
}
},
computed: {},
watch: {},
created() {
// this.getList()
console.log(3)
},
mounted() {
console.log(4)
this.getList()
},
mounted() {},
methods: {
getList() {
this.loading = true
getList(this.query)
.then(({ rows, total }) => {
this.list = rows
this.total = Number(total)
this.loading = false
this.ids = []
api
.getAnalysisGroup()
.then(({ data }) => {
data || (data = {})
this.cardData = [
{
title: '昨日群聊总数',
tips: '企业员工全部客户数量(包含重复)',
value: data.ydChatTotal,
title1: '较前日',
value1: data.bydChatTotal,
noArrow: true
},
{
title: '昨日群聊消息数',
tips: '企业员工今日添加的客户数(包含重复及已流失)',
value: data.ydMsgTotal,
title1: '较前日',
value1: data.bydMsgTotal
},
{
title: '昨日发送消息群成员数',
tips: '今日删除企业员工的客户数',
value: data.ydMemberHasMsg,
title1: '较前日',
value1: data.bydMemberHasMsg
}
]
})
.catch((e) => {
console.log(e)
})
.catch(() => {
.finally(() => {
this.loading = false
})
}
......@@ -81,14 +83,18 @@ export default {
<div>数据趋势</div>
<el-tabs v-model="active">
<el-tab-pane v-for="(item, index) of tabs" :key="index" :label="item.label">
<TabContent :type="item.type" :legend="[item.label]"></TabContent>
<TabContent
:type="item.type"
:legend="[item.label]"
:request="api.getTotalCntGroup"
></TabContent>
</el-tab-pane>
</el-tabs>
</div>
<div>
<div>数据报表</div>
<TabContent type="customerGroupContactTable"></TabContent>
<TabContent type="customerGroupContactTable" :request="api.getTotalCntGroup"></TabContent>
</div>
</div>
</template>
......
......@@ -69,7 +69,10 @@ export default {
}
]
})
.catch(() => {
.catch((e) => {
console.log(e)
})
.finally(() => {
this.loading = false
})
}
......@@ -85,16 +88,24 @@ export default {
<div>数据趋势</div>
<el-tabs v-model="active">
<el-tab-pane label="客户总数">
<TabContent type="customerTotalChart" :request="api.getTotalCnt"></TabContent>
<TabContent
type="customerTotalChart"
legend="客户总数"
:request="api.getTotalCnt"
></TabContent>
</el-tab-pane>
<el-tab-pane label="实时数据">
<TabContent type="realDataChart" :request="api.getRealCnt"></TabContent>
<TabContent
type="realDataChart"
:legend="['新增客户数', '流失客户数', '净增客户数', '发送申请数']"
:request="api.getRealCnt"
></TabContent>
</el-tab-pane>
</el-tabs>
</div>
<div>
<div>员工客户 Top10</div>
<div>员工客户Top10</div>
<TabContent type="staffCustomerBar" :request="api.getRankCnt"></TabContent>
</div>
......
<script>
import TabContent from './components/TabContent'
import CardGroupIndex from '@/components/CardGroupIndex'
import TabContentRealGroupData from './components/TabContentRealGroupData'
import * as api from '@/api/operateCenter/groupAnalysis'
export default {
name: '',
components: { TabContent, TabContentRealGroupData },
components: { TabContent, CardGroupIndex, TabContentRealGroupData },
data() {
return {
cardData: [
{
title: '客群总数',
tips: '企业员工全部客户群数量',
value: 1222453
},
{
title: '今日新增客群',
tips: '今日新创建的客群数',
value: 1222453,
title1: '较昨日',
value1: 344
},
{
title: '今日解散客群',
tips: '今日解散的客户群数',
value: 1222453,
title1: '较昨日',
value1: 344
},
{
title: '客群成员总数',
tips: '全部客群成员的总数,包括企业员工',
value: 1222453,
title1: '含员工',
value1: 344
},
{
title: '今日新增客群成员',
tips: '今日进入群聊的成员数量,包括企业员工',
value: 1222453,
title1: '较昨日',
value1: 344
},
{
title: '今日新增客群成员',
tips: '今日退出群聊的成员数量,包括企业员工',
value: 1222453,
title1: '较前日',
value1: 344
}
],
cardData: [],
activeTrend: 0,
activeSheet: 0
activeSheet: 0,
api
}
},
computed: {},
watch: {},
created() {
// this.getList()
this.getList()
this.$store.dispatch(
'app/setBusininessDesc',
`
......@@ -67,14 +29,56 @@ export default {
methods: {
getList() {
this.loading = true
getList(this.query)
.then(({ rows, total }) => {
this.list = rows
this.total = Number(total)
this.loading = false
this.ids = []
api
.getAnalysis()
.then(({ data }) => {
this.cardData = [
{
title: '客群总数',
tips: '企业员工全部客户群数量',
value: data.totalCnt
},
{
title: '今日新增客群',
tips: '今日新创建的客群数',
value: data.tdGroupAddCnt,
title1: '较昨日',
value1: data.ydGroupAddCnt
},
{
title: '今日解散客群',
tips: '今日解散的客户群数',
value: data.tdGroupDissolveCnt,
title1: '较昨日',
value1: data.ydGroupDissolveCnt
},
{
title: '客群成员总数',
tips: '全部客群成员的总数,包括企业员工',
value: data.memberTotalCnt,
title1: '含员工',
value1: data.memberUserCnt
},
{
title: '今日新增客群成员',
tips: '今日进入群聊的成员数量,包括企业员工',
value: data.tdMemberAddCnt,
title1: '较昨日',
value1: data.ydMemberAddCnt
},
{
title: '今日新增客群成员',
tips: '今日退出群聊的成员数量,包括企业员工',
value: data.tdMemberQuitCnt,
title1: '较前日',
value1: data.ydMemberQuitCnt
}
]
})
.catch((e) => {
console.log(e)
})
.catch(() => {
.finally(() => {
this.loading = false
})
}
......@@ -90,10 +94,18 @@ export default {
<div>数据趋势</div>
<el-tabs v-model="activeTrend">
<el-tab-pane label="客群总数">
<TabContent type="customerGroupTotalChart"></TabContent>
<TabContent
type="customerGroupTotalChart"
legend="客户总数"
:request="api.getTotalCnt"
></TabContent>
</el-tab-pane>
<el-tab-pane label="客群成员总数">
<TabContent type="customerGroupMemberTotalChart"></TabContent>
<TabContent
type="customerGroupMemberTotalChart"
legend="客群成员总数"
:request="api.getTotalCntMember"
></TabContent>
</el-tab-pane>
<el-tab-pane label="实时数据">
<TabContentRealGroupData></TabContentRealGroupData>
......@@ -105,10 +117,13 @@ export default {
<div>数据报表</div>
<el-tabs v-model="activeSheet">
<el-tab-pane label="客群总数">
<TabContent type="customerGroupTotalTable"></TabContent>
<TabContent type="customerGroupTotalTable" :request="api.getRealCnt"></TabContent>
</el-tab-pane>
<el-tab-pane label="客群成员总数">
<TabContent type="customerGroupMemberTotalTable"></TabContent>
<TabContent
type="customerGroupMemberTotalTable"
:request="api.getRealCntMember"
></TabContent>
</el-tab-pane>
</el-tabs>
</div>
......
......@@ -188,7 +188,7 @@ import {
getLimitList,
addLimit,
updateLimit
} from '@/api/moneyTool/moneyTool'
} from '@/api/redPacketTool'
function validateAmount(rule, value, callback) {
if (value == '') {
......
......@@ -105,7 +105,7 @@
</template>
<script>
import { getScopList, addScop, updatedScop, removeScop } from '@/api/moneyTool/moneyTool'
import { getScopList, addScop, updatedScop, removeScop } from '@/api/redPacketTool'
import { accSub } from '@/utils/common'
export default {
name: 'member',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!