Commit d1779481 by xinla

客户分析,客群分析UI

1 parent 67b1f906
......@@ -53,6 +53,7 @@
"js-beautify": "1.10.2",
"js-cookie": "2.2.0",
"jsencrypt": "3.0.0-rc.1",
"lodash.merge": "^4.6.2",
"moment": "^2.29.1",
"normalize.css": "^8.0.1",
"nprogress": "0.2.0",
......
<script>
export default {
// 指标卡片组
name: 'CardGroupIndex',
components: {},
props: {
// 数据列表
data: {
type: Array,
default: () => []
},
// isArrow: {
// type: Boolean,
// default: false
// },
defaultProps: {
type: Object,
default: () => ({
title: 'title',
tips: 'tips',
value: 'value',
title1: 'title1',
value1: 'value1',
noArrow: 'noArrow'
})
}
},
data() {
return {}
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
getClass(value) {
let val = Number(value)
if (val > 0) {
return 'ascend'
} else if (val < 0) {
return 'descend'
}
},
getArrow(value) {
let val = Number(value)
if (val > 0) {
return '↑'
} else if (val < 0) {
return '↓'
} else {
return '-'
}
}
}
}
</script>
<template>
<ul class="card-group-index flex">
<li v-for="(row, index) in data" :key="index" class="card-index-li">
<div class="mb5 label">
<span>{{ row[defaultProps.title] }}</span>
<div class="fr">
<el-popover trigger="hover" :content="row[defaultProps.tips]" placement="top">
<i slot="reference" class="el-icon-question"></i>
</el-popover>
</div>
</div>
<div class="mb15 value">{{ row[defaultProps.value] }}</div>
<div class>
{{ row[defaultProps.title1] }}
<span class="fr" :class="row[defaultProps.noArrow] || getClass(row[defaultProps.value1])">
{{ row[defaultProps.noArrow] ? '' : getArrow(row[defaultProps.value1]) }}
{{ Math.abs(row[defaultProps.value1]) }}
</span>
</div>
</li>
</ul>
</template>
<style lang="scss" scoped>
// 指标卡片
.card-index-li {
position: relative;
width: 200px;
// height: 108px;
// background: linear-gradient(90deg, #f7f8fb 0%, #f1f3f8 100%);
background: #fff;
border-radius: $border-radius;
margin: 0 10px 20px 0;
line-height: 1;
padding: 22px 20px;
.card-icon {
position: absolute;
top: 0;
right: 0;
}
.label {
position: relative;
font-size: $font-size;
}
.value,
.value2 {
font-size: 20px;
font-weight: bold;
}
.value2 {
font-size: $font-size-keydata;
line-height: 1.15;
}
.icon-arrow {
position: absolute;
}
.el-radio,
.el-checkbox {
position: relative;
float: right;
margin-right: 0;
top: -8px;
}
.descend {
color: #ff0000;
}
.ascend {
color: green;
}
}
</style>
<script>
import * as echarts from 'echarts'
import { echartColors } from '@/utils/index'
import merge from 'lodash.merge'
export default {
// 柱状图
name: 'CchartBar',
components: {},
props: {
// X轴坐标数据
xData: {
type: Array,
default: () => [
'腾讯广告',
'巨量引擎',
'京东数坊',
'达摩盘',
'数据银行',
'微信广告',
'企业微信'
]
},
// 图例
legend: {
type: Array,
default: () => ['已推送']
},
// 展示数据集
// 注:二位数组, 其一维数组顺序需要和图例顺序一致,其二维数组顺序需要和X轴数组顺序一致
// 单条数据集:[120, 132, 101, 134, 90, 230, 210],其实会被转换成[[120, 132, 101, 134, 90, 230, 210]]
// 多条数据集:
// [
// [120, 132, 101, 134, 90, 230, 210],
// [220, 182, 191, 234, 290, 330, 310],
// [150, 232, 201, 154, 190, 330, 410],
// [320, 332, 301, 334, 390, 330, 320]
// ]
series: {
type: Array,
default: () => [[120, 132, 101, 134, 90, 230, 210]]
},
// 是否为堆叠柱状图
stack: {
type: Boolean,
default: false
},
// 自定义图表配置项,使用loadsh.merge(origin, option)和原有的配置进行覆盖合并
// loadsh.merge: https://www.html.cn/doc/lodash/#_mergeobject-sources
option: {
type: Object,
default: null
}
},
data() {
return {}
},
computed: {},
watch: {},
created() {},
mounted() {
this.drawChart()
},
methods: {
drawChart() {
// eslint-disable-next-line
this.myChart = echarts.init(this.$refs.chart)
let option
let series = []
let seriesData = this.series
Array.isArray(this.series[0]) || (seriesData = [seriesData])
seriesData.forEach((data, index) => {
let obj = {
name: this.legend[index],
type: 'bar',
stack: this.stack,
barWidth: this.stack ? 40 : 20, // 柱图宽度
emphasis: {
focus: 'series'
},
data
}
series.push(obj)
})
echartColors.slice('1', 1)
option = {
color: echartColors,
// title: {
// text: 'Stacked Area Chart'
// },
tooltip: {
backgroundColor: '#505050',
borderWidth: 0,
textStyle: {
color: '#fff'
},
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
legend: {
data: this.legend,
x: 'center',
y: 'bottom',
icon: 'circle',
itemWidth: 8,
itemHeight: 8
},
grid: {
left: '20px',
right: '20px',
bottom: '40px',
top: '20px',
containLabel: true
},
xAxis: [
{
type: 'category',
data: this.xData,
boundaryGap: true,
axisLine: {
lineStyle: {
color: '#ccc'
}
},
axisLabel: {
// 坐标轴刻度标签的相关设置。
interval: 0,
color: 'rgba(153, 153, 153, 1)' // 横坐标字体颜色
},
axisTick: {
// 横坐标刻度
show: false
}
}
],
yAxis: [
{
type: 'value',
axisLine: {
lineStyle: {
color: '#ccc'
}
}
}
],
series
}
this.option && merge(option, this.option)
option && this.myChart.setOption(option)
new ResizeObserver((entries) => {
this.myChart.resize()
}).observe(this.$refs.chart)
}
}
}
</script>
<template>
<div ref="chart" class="c-chart-bar chart"></div>
</template>
<style lang="scss" scoped>
.chart {
height: 100%;
min-width: 200px;
min-height: 200px;
}
</style>
<script>
import * as echarts from 'echarts'
import { echartColors } from '@/utils/index'
import merge from 'lodash.merge'
export default {
// 折线图
name: 'ChartLine',
components: {},
props: {
// 折线背景渐变色
bgLinearGradient: {
type: Boolean,
default: false
},
// X轴坐标数据
xData: {
type: Array,
default: () => [
'2021-12-01',
'2021-12-02',
'2021-12-03',
'2021-12-03',
'2021-12-04',
'2021-12-05',
'2021-12-06'
]
},
// 图例
legend: {
type: Array,
default: () => ['新增客户']
},
// 展示数据集
// 注:二位数组, 其一维数组顺序需要和图例顺序一致,其二维数组顺序需要和X轴数组顺序一致
// 单条数据集:[120, 132, 101, 134, 90, 230, 210],其实会被转换成[[120, 132, 101, 134, 90, 230, 210]]
// 多条数据集:
// [
// [120, 132, 101, 134, 90, 230, 210],
// [220, 182, 191, 234, 290, 330, 310],
// [150, 232, 201, 154, 190, 330, 410],
// [320, 332, 301, 334, 390, 330, 320]
// ]
series: {
type: Array,
default: () => [120, 132, 101, 134, 90, 230, 210]
},
// 自定义图表配置项,使用loadsh.merge(origin, option)和原有的配置进行覆盖合并
// loadsh.merge: https://www.html.cn/doc/lodash/#_mergeobject-sources
option: {
type: Object,
default: null
}
},
data() {
return {}
},
computed: {},
watch: {
series() {
this.drawChart()
}
},
created() {},
mounted() {
this.drawChart()
},
methods: {
drawChart() {
// eslint-disable-next-line
this.myChart = echarts.init(this.$refs.chart)
let option
let series = []
let seriesData = this.series
Array.isArray(this.series[0]) || (seriesData = [seriesData])
seriesData.forEach((data, index) => {
let obj = {
name: this.legend[index],
type: 'line',
smooth: true,
symbol: 'circle', // 数值点类型
symbolSize: 6, // 数值点大小
emphasis: {
focus: 'series'
},
data
}
this.bgLinearGradient &&
Object.assign(obj, {
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: echartColors[index] // 0% 处的颜色
},
{
offset: 0.8,
color: 'white' // 100% 处的颜色
}
],
global: false // 缺省为 false
}
}
})
series.push(obj)
})
option = {
color: echartColors,
// title: {
// text: 'Stacked Area Chart'
// },
tooltip: {
textStyle: {
color: '#FFF', // 设置文字颜色
fontSize: 12
},
trigger: 'axis',
backgroundColor: '#505050',
borderWidth: 0,
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
legend: {
data: this.legend,
// lineStyle: {
// width: 0
// },
// itemStyle: {
// borderWidth: 10,
// decal: {
// symbol: 'rect'
// }
// }
x: 'center',
y: 'bottom',
selectedMode: false,
type: 'scroll', // 分页类型
icon: 'circle',
itemWidth: 8,
itemHeight: 8,
tooltip: {
show: true
},
textStyle: {
color: '#36363A',
fontSize: 12,
lineHeight: 14
}
},
grid: {
left: '3%',
right: '3%',
bottom: '40px',
top: '30px',
containLabel: true
},
xAxis: [
{
type: 'category',
data: this.xData,
boundaryGap: false,
offset: 5,
axisLine: {
lineStyle: {
color: '#ccc'
}
},
axisLabel: {
// 坐标轴刻度标签的相关设置。
interval: 0,
color: 'rgba(153, 153, 153, 1)' // 横坐标字体颜色
},
axisTick: {
// 横坐标刻度
show: true
}
}
],
yAxis: [
{
type: 'value',
axisLine: {
lineStyle: {
color: '#ccc'
},
show: false
}
}
],
series
}
this.option && merge(option, this.option)
option && this.myChart.setOption(option)
new ResizeObserver((entries) => {
this.myChart.resize()
}).observe(this.$refs.chart)
}
}
}
</script>
<template>
<div ref="chart" class="chart-line chart"></div>
</template>
<style lang="scss" scoped>
.chart {
height: 100%;
min-width: 200px;
min-height: 200px;
}
</style>
......@@ -36,12 +36,6 @@ import {
handleTree
} from '@/utils/common'
import Pagination from '@/components/Pagination'
//自定义表格工具扩展
import RightToolbar from '@/components/RightToolbar'
import Upload from '@/components/Upload'
import ButtonSync from '@/components/ButtonSync'
// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey
......@@ -91,11 +85,19 @@ VueAMap.initAMapApiLoader({
],
v: '1.4.4'
})
// 全局组件挂载
import Pagination from '@/components/Pagination'
//自定义表格工具扩展
import RightToolbar from '@/components/RightToolbar'
import Upload from '@/components/Upload'
import ButtonSync from '@/components/ButtonSync'
import CardGroupIndex from '@/components/CardGroupIndex'
Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar)
Vue.component('Upload', Upload)
Vue.component('ButtonSync', ButtonSync)
Vue.component(CardGroupIndex.name, CardGroupIndex)
Vue.use(directive)
......
......@@ -28,6 +28,9 @@ $subMenuHover: #fafafa;
$sideBarWidth: 200px;
$font-size: 14px;
$font-size-keydata: 24px;
$border-radius: 4px;
// the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
:export {
......
......@@ -227,7 +227,7 @@ export function getTime(type) {
export function debounce(func, wait, immediate) {
let timeout, args, context, timestamp, result
const later = function() {
const later = function () {
// 据上一次触发时间间隔
const last = +new Date() - timestamp
......@@ -244,7 +244,7 @@ export function debounce(func, wait, immediate) {
}
}
return function(...args) {
return function (...args) {
context = this
timestamp = +new Date()
const callNow = immediate && !timeout
......@@ -430,3 +430,25 @@ export const pickerOptions = {
}
]
}
// echart图表配色规范
export const echartColors = [
'#0F68FF',
'#34D7C3',
'#FFBF49',
'#FF5954',
'#52DDFF',
'#34D781',
'#FFE85F',
'#7F47FF',
'#A47D79',
'#7796D7',
'#89C369',
'#B595D4',
'#E4CBCB',
'#7D889B',
'#AAAFB7',
'#DCD7B0',
'#749E84',
'#B0BBDC'
]
<script>
import ChartBar from '@/components/ChartBar'
import ChartLine from '@/components/ChartLine'
import SelectUser from '@/components/SelectUser'
import { getList } from '@/api/drainageCode/staff'
export default {
name: '',
components: { ChartLine, ChartBar, SelectUser },
props: {
type: {
type: String,
default: ''
}
},
data() {
return {
loading: false,
timeRange: 7,
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
}
],
xData: [],
series: [],
legend: {
customerTotalChart: ['客户总数'],
realDataChart: ['新增客户数', '流失客户数', '净增客户数', '发送申请数'],
customerGroupTotalChart: ['客群总数'],
customerGroupMemberTotalChart: ['客群成员总数'],
customerTotalChart: ['客群总数'],
customerTotalChart: ['客群总数']
},
// 日期范围
dateRange: [],
// 查询参数
query: {
group: '',
beginTime: undefined,
endTime: undefined
},
// 群主
groupOwners: [],
// 群聊
groupChats: [],
tableProps: {
customerTotalTable: [
{ prop: '', label: '日期' },
{ prop: '', label: '客户总数' },
{ prop: '', label: '新增客户数' },
{ prop: '', label: '流失客户数' },
{ prop: '', label: '净增客户数' },
{ prop: '', label: '昨日发送申请数' }
],
customerGroupTotalTable: [
{ prop: '', label: '日期' },
{ prop: '', label: '客群总数' },
{ prop: '', label: '新增客群数' },
{ prop: '', label: '解散客群数' }
],
customerGroupMemberTotalTable: [
{ prop: '', label: '日期' },
{ prop: '', label: '客群成员总数' },
{ prop: '', label: '新增客群成员数' },
{ prop: '', label: '流失客群成员数' }
]
},
userArray: [], // 选择人员
dialogVisible: false
}
},
computed: {},
watch: {},
created() {
// this.getSelectList('groupOwners')
// this.getSelectList('groupChats')
this.setTime(7)
},
mounted() {},
methods: {
getList(page) {
this.query.beginTime = this.dateRange && this.dateRange[0]
this.query.endTime = this.dateRange && this.dateRange[1]
this.loading = true
page && (this.query.pageNum = page)
if (this.type.includes('Chart')) {
this.xData = this.list.map((e) => e.time)
this.series = this.list.map((e) => e.num)
} else if (this.type === 'realDataChart') {
this.xData = this.list.map((e) => e.time)
this.legend[this.type].forEach((element) => {
this.series.push(this.list.map((e) => e.num))
})
}
// getList(this.query)
// .then(({ rows, total }) => {
// this.list = rows
// this.total = Number(total)
// this.loading = false
// })
// .catch(() => {
// this.loading = false
// })
},
getSelectList(type) {
getList()
.then(({ rows }) => {
this[type] = rows
})
.catch(() => {})
},
getTime(datePar) {
const d = datePar ? new Date(datePar) : new Date()
d.setMinutes(d.getMinutes() - d.getTimezoneOffset())
return d.toJSON().substr(0, 10)
},
setTime(days) {
this.timeRange = days
if (days) {
let date = new Date()
date.setDate(date.getDate() - days)
this.dateRange = [this.getTime(date), this.getTime()]
this.getList()
} else {
this.dateRange = null
}
},
getSelectUser(data) {
this.userArray = data
this.query.qrUserName = this.userArray
.map(function (obj, index) {
return obj.name
})
.join(',')
}
}
}
</script>
<template>
<div>
<div class="operation">
<el-button-group>
<el-button size="small" type="primary" :plain="timeRange != 7" @click="setTime(7)"
>近一周</el-button
>
<el-button size="small" type="primary" :plain="timeRange != 30" @click="setTime(30)"
>近一月
</el-button>
<el-button size="small" type="primary" :plain="!!timeRange" @click="setTime()"
>自定义
</el-button>
</el-button-group>
<el-date-picker
v-if="!timeRange"
v-model="dateRange"
size="small"
class="ml20"
style="width: 260px"
value-format="yyyy-MM-dd"
type="daterange"
:clearable="false"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="getList"
></el-date-picker>
<el-select
v-if="
[
'customerGroupTotalChart',
'customerGroupMemberTotalChart',
'customerGroupTotalTable',
'customerGroupMemberTotalTable'
].includes(type)
"
v-model="query.group"
placeholder="请选择群主"
@change="getList"
>
<el-option
v-for="item in groupOwners"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-select
v-if="['customerGroupMemberTotalChart', 'customerGroupMemberTotalTable'].includes(type)"
v-model="query.group"
placeholder="请选择群聊"
@change="getList"
>
<el-option
v-for="item in groupChats"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-input
v-if="['customerTotalChart', 'realDataChart'].includes(type)"
style="width: 180px"
:value="query.qrUserName"
readonly
@focus="dialogVisible = true"
placeholder="请选择员工"
/>
</div>
<ChartLine
v-if="type.includes('Chart')"
:xData="xData"
:legend="legend[type]"
:series="series"
></ChartLine>
<el-table
v-else-if="
'customerTotalTable,customerGroupTotalTable,customerGroupMemberTotalTable'.includes(type)
"
:data="list"
style="width: 100%"
>
<el-table-column
v-for="(item, index) in tableProps[type]"
:key="index"
:prop="item.label"
:label="item.label"
align="center"
>
</el-table-column>
</el-table>
<ChartBar v-else-if="'staffCustomerBar'.includes(type)"></ChartBar>
<SelectUser
:visible.sync="dialogVisible"
title="组织架构"
:selected="userArray"
@success="getSelectUser"
></SelectUser>
</div>
</template>
<style lang="scss" scoped></style>
<script>
import ChartBar from '@/components/ChartBar'
import ChartLine from '@/components/ChartLine'
import SelectUser from '@/components/SelectUser'
import { getList } from '@/api/drainageCode/staff'
export default {
name: '',
components: { ChartLine, ChartBar, SelectUser },
props: {
type: {
type: String,
default: ''
}
},
data() {
return {
loading: false,
timeRange: 7,
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
}
],
xData: [],
series: [],
legend: {
customerGroup: ['新增客群数', '解散客群数'],
customerGroupMember: ['新增客群成员数', '流失客群成员数']
},
// 日期范围
dateRange: [],
// 查询参数
query: {
group: '',
beginTime: undefined,
endTime: undefined
},
// 群主
groupOwners: [],
// 群聊
groupChats: []
}
},
computed: {},
watch: {},
created() {
// this.getSelectList('groupOwners')
// this.getSelectList('groupChats')
this.setTime(7)
},
mounted() {},
methods: {
getList(page) {
this.query.beginTime = this.dateRange && this.dateRange[0]
this.query.endTime = this.dateRange && this.dateRange[1]
this.loading = true
page && (this.query.pageNum = page)
this.xData = this.list.map((e) => e.time)
this.legend['customerGroup'].forEach((element) => {
this.series.push(this.list.map((e) => e.num))
})
// getList(this.query)
// .then(({ rows, total }) => {
// this.list = rows
// this.total = Number(total)
// this.loading = false
// })
// .catch(() => {
// this.loading = false
// })
},
getSelectList(type) {
getList()
.then(({ rows }) => {
this[type] = rows
})
.catch(() => {})
},
getTime(datePar) {
const d = datePar ? new Date(datePar) : new Date()
d.setMinutes(d.getMinutes() - d.getTimezoneOffset())
return d.toJSON().substr(0, 10)
},
setTime(days) {
this.timeRange = days
if (days) {
let date = new Date()
date.setDate(date.getDate() - days)
this.dateRange = [this.getTime(date), this.getTime()]
this.getList()
} else {
this.dateRange = null
}
},
getSelectUser(data) {
this.userArray = data
this.query.qrUserName = this.userArray
.map(function (obj, index) {
return obj.name
})
.join(',')
}
}
}
</script>
<template>
<div>
<div class="operation">
<el-button-group>
<el-button size="small" type="primary" :plain="timeRange != 7" @click="setTime(7)"
>近一周</el-button
>
<el-button size="small" type="primary" :plain="timeRange != 30" @click="setTime(30)"
>近一月
</el-button>
<el-button size="small" type="primary" :plain="!!timeRange" @click="setTime()"
>自定义
</el-button>
</el-button-group>
<el-date-picker
v-if="!timeRange"
v-model="dateRange"
size="small"
class="ml20"
style="width: 260px"
value-format="yyyy-MM-dd"
type="daterange"
:clearable="false"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="getList"
></el-date-picker>
<el-select
v-if="
[
'customerGroupTotalChart',
'customerGroupMemberTotalChart',
'customerGroupTotalTable',
'customerGroupMemberTotalTable'
].includes(type)
"
v-model="query.group"
placeholder="请选择群主"
@change="getList"
>
<el-option
v-for="item in groupOwners"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-select
v-if="['customerGroupMemberTotalChart', 'customerGroupMemberTotalTable'].includes(type)"
v-model="query.group"
placeholder="请选择群聊"
@change="getList"
>
<el-option
v-for="item in groupChats"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-input
v-if="['customerTotalChart', 'realDataChart'].includes(type)"
style="width: 180px"
:value="query.qrUserName"
readonly
@focus="dialogVisible = true"
placeholder="请选择员工"
/>
</div>
<el-row :gutter="10">
<el-col :span="12">
<ChartLine :xData="xData" :legend="legend['customerGroup']" :series="series"></ChartLine>
</el-col>
<el-col :span="12">
<ChartLine
:xData="xData"
:legend="legend['customerGroupMember']"
:series="series"
></ChartLine>
</el-col>
</el-row>
</div>
</template>
<style lang="scss" scoped></style>
<script>
import TabContent from './components/TabContent'
export default {
name: '',
components: { TabContent },
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
},
{
title: '昨日发送申请',
tips: '企业员工每天通过搜索手机号、扫一扫等渠道主动向客户发起的好友申请数',
value: 1222453,
title1: '较前日',
value1: 344
}
],
active: 0
}
},
computed: {},
watch: {},
created() {
// this.getList()
this.$store.dispatch(
'app/setBusininessDesc',
`
<div>企业客户相关数据统计与分析</div>
`
)
},
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-tabs v-model="active">
<el-tab-pane label="客户总数">
<TabContent type="customerTotalChart"></TabContent>
</el-tab-pane>
<el-tab-pane label="实时数据">
<TabContent type="realDataChart"></TabContent>
</el-tab-pane>
</el-tabs>
</div>
<div>
<div>员工客户 Top10</div>
<TabContent type="staffCustomerBar"></TabContent>
</div>
<div>
<div>数据报表</div>
<TabContent type="customerTotalTable"></TabContent>
</div>
</div>
</template>
<style lang="scss" scoped></style>
<script>
import TabContent from './components/TabContent'
import TabContentRealGroupData from './components/TabContentRealGroupData'
export default {
name: '',
components: { TabContent, 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
}
],
activeTrend: 0,
activeSheet: 0
}
},
computed: {},
watch: {},
created() {
// this.getList()
this.$store.dispatch(
'app/setBusininessDesc',
`
<div>企业客户群相关数据统计与分析</div>
`
)
},
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-tabs v-model="activeTrend">
<el-tab-pane label="客群总数">
<TabContent type="customerGroupTotalChart"></TabContent>
</el-tab-pane>
<el-tab-pane label="客群成员总数">
<TabContent type="customerGroupMemberTotalChart"></TabContent>
</el-tab-pane>
<el-tab-pane label="实时数据">
<TabContentRealGroupData></TabContentRealGroupData>
</el-tab-pane>
</el-tabs>
</div>
<div>
<div>数据报表</div>
<el-tabs v-model="activeSheet">
<el-tab-pane label="客群总数">
<TabContent type="customerGroupTotalTable"></TabContent>
</el-tab-pane>
<el-tab-pane label="客群成员总数">
<TabContent type="customerGroupMemberTotalTable"></TabContent>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<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!