Commit dc08bbef by xinla

会话存档分析,升级echart至最新v5.3.0

1 parent 5a0982b5
......@@ -45,7 +45,7 @@
"benz-amr-recorder": "^1.1.3",
"clipboard": "2.0.4",
"core-js": "^3.20.2",
"echarts": "4.2.1",
"echarts": "^5.3.0",
"element-ui": "^2.15.6",
"fabric": "^4.6.0",
"file-saver": "2.0.1",
......
......@@ -109,3 +109,28 @@ export function realDataExportGroup(params) {
params
})
}
/**
* 会话存档同意明细
* @param {*} params
* deptIds 否[]部门
userIds 否[]员工
beginTime 是 开始时间
endTime 是 结束时间
*/
export function getArchiveList(params) {
return request({
url: service + '/archive/details',
params
})
}
/**
* 会话存档数据分析
* @param {*} params
*/
export function getAnalysisArchive() {
return request({
url: service + '/archive/getAnalysis'
})
}
......@@ -14,13 +14,6 @@ export default {
default: () => ['新增客户']
},
// 展示数据集
// [
// { value: 1048, name: 'Search Engine' },
// { value: 735, name: 'Direct' },
// { value: 580, name: 'Email' },
// { value: 484, name: 'Union Ads' },
// { value: 300, name: 'Video Ads' }
// ]
series: {
type: Array,
default: () => [
......@@ -80,7 +73,7 @@ export default {
legend: {
x: 'center',
y: '88%',
selectedMode: false,
// selectedMode: false,
type: 'scroll', // 分页类型
icon: 'circle',
itemWidth: 8,
......@@ -101,20 +94,18 @@ export default {
top: '30px',
containLabel: true
},
series: [
{
type: 'pie',
radius: '50%',
data: this.series,
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
series: {
type: 'pie',
radius: '50%',
data: this.series,
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
]
}
}
this.option && merge(option, this.option)
option && this.myChart.setOption(option)
......
<script>
import ChartPie from '@/components/ChartPie'
import CardGroupIndex from '@/components/CardGroupIndex'
import TabContent from '../components/TabContent'
import { getAnalysisArchive, getArchiveList } from '@/api/operateCenter/conversationAnalysis'
export default {
name: '',
components: { TabContent, CardGroupIndex, ChartPie },
data() {
return {
loading: false,
// 查询参数
query: {
pageNum: undefined,
pageSize: undefined
},
cardData: [],
pieData: {},
total: 0,
// 表格数据
list: []
}
},
computed: {},
watch: {},
created() {
this.getAnalysisArchive()
this.getList()
},
mounted() {},
methods: {
getAnalysisArchive() {
this.loading = true
getAnalysisArchive()
.then(({ data }) => {
data || (data = {})
this.cardData = [
{
title: '开启会话存档员工',
value: data.openUserCnt
},
{
title: '未开启会话存档员工',
value: data.notOpenUserCnt
},
{
title: '已同意会话存档客户',
value: data.openCustomerCnt
},
{
title: '未同意会话存档客户',
value: data.notOpenCustomerCnt
}
]
this.pieData.staff = [
{
name: '开启',
value: (data.openUserCnt / (data.openUserCnt + data.notOpenUserCnt || 1)) * 100
},
{
name: '未开启',
value: (data.notOpenUserCnt / (data.openUserCnt + data.notOpenUserCnt || 1)) * 100
}
]
this.pieData.customer = [
{
name: '已同意',
value:
(data.openCustomerCnt / (data.openCustomerCnt + data.notopenCustomerCnt || 1)) * 100
},
{
name: '未同意',
value:
(data.notOpenCustomerCnt / (data.openCustomerCnt + data.notOpenCustomerCnt || 1)) *
100
}
]
})
.catch((e) => {
console.log(e)
})
.finally(() => {
this.loading = false
})
},
getList() {
this.loading = true
getArchiveList(this.query)
.then(({ rows, total }) => {
this.list = rows
this.total = Number(total)
})
.catch((e) => {
console.log(e)
})
.finally(() => {
this.loading = false
})
}
}
}
</script>
<template>
<div>
<CardGroupIndex :data="cardData"></CardGroupIndex>
<div>
<div>数据占比</div>
<el-row :gutter="10">
<el-col :span="12">
<ChartPie
:series="pieData.staff"
:option="{ series: { tooltip: { valueFormatter: (value) => value + '%' } } }"
></ChartPie>
<div class="ac">会话存档员工开启情况统计</div>
</el-col>
<el-col :span="12">
<ChartPie
:series="pieData.customer"
:option="{ series: { tooltip: { valueFormatter: (value) => value + '%' } } }"
></ChartPie>
<div class="ac">会话存档客户同意情况统计</div>
</el-col>
</el-row>
</div>
<div>
<div>会话存档同意明细</div>
<el-table :data="list" style="width: 100%">
<el-table-column align="center" prop="userName" label="存档员工"> </el-table-column>
<el-table-column align="center" prop="customerName" label="客户"> </el-table-column>
<el-table-column align="center" prop="openChatTime" label="同意时间"> </el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
</div>
</div>
</template>
<style lang="scss" scoped>
.chart-pie {
height: 400px;
}
</style>
<script>
import ChartPie from '@/components/ChartPie'
import CardGroupIndex from '@/components/CardGroupIndex'
import TabContent from '../components/TabContent'
export default {
name: '',
components: { TabContent, CardGroupIndex, ChartPie },
data() {
return {
cardData: [
{
title: '开启会话存档员工',
value: 1222453
},
{
title: '未开启会话存档员工',
value: 1222453
},
{
title: '今日流失客户',
value: 1222453
},
{
title: '未同意会话存档客户',
value: 1222453
}
],
active: 0
}
},
computed: {},
watch: {},
created() {
// 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 = []
})
.catch(() => {
this.loading = false
})
}
}
}
</script>
<template>
<div>
<CardGroupIndex :data="cardData"></CardGroupIndex>
<div>
<div>数据占比</div>
<el-row :gutter="10">
<el-col :span="12">
<ChartPie></ChartPie>
<div class="ac">会话存档员工开启情况统计</div>
</el-col>
<el-col :span="12">
<ChartPie></ChartPie>
<div class="ac">会话存档客户同意情况统计</div>
</el-col>
</el-row>
</div>
<div>
<div>会话存档同意明细</div>
<el-table :data="data" style="width: 100%">
<el-table-column align="center" prop="prop" label="存档员工"> </el-table-column>
<el-table-column align="center" prop="prop" label="客户"> </el-table-column>
<el-table-column align="center" prop="prop" label="同意时间"> </el-table-column>
</el-table>
<el-pagination layout="prev, pager, next" :total="50"> </el-pagination>
</div>
</div>
</template>
<style lang="scss" scoped>
.chart-pie {
height: 400px;
}
</style>
<script>
import CustomerContact from './CustomerContact'
import CustomerGroupContact from './CustomerGroupContact'
import Conversation from './Conversation'
import Archive from './Archive'
export default {
name: '',
components: { CustomerContact, CustomerGroupContact, Conversation },
components: { CustomerContact, CustomerGroupContact, Archive },
data() {
return {
active: 0
......@@ -35,7 +35,7 @@ export default {
<CustomerGroupContact></CustomerGroupContact>
</el-tab-pane>
<el-tab-pane label="会话存档">
<Conversation></Conversation>
<Archive></Archive>
</el-tab-pane>
</el-tabs>
</template>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!