Commit d342e223 by xinla

会话分析UI

1 parent e253ac8b
......@@ -4,7 +4,7 @@ import { echartColors } from '@/utils/index'
import merge from 'lodash.merge'
export default {
// 柱状图
name: 'CchartBar',
name: 'ChartBar',
components: {},
props: {
// X轴坐标数据
......@@ -122,7 +122,6 @@ export default {
{
type: 'category',
data: this.xData,
boundaryGap: true,
axisLine: {
lineStyle: {
color: '#ccc'
......@@ -135,7 +134,8 @@ export default {
},
axisTick: {
// 横坐标刻度
show: false
alignWithLabel: true,
show: true
}
}
],
......@@ -146,6 +146,11 @@ export default {
lineStyle: {
color: '#ccc'
}
},
axisTick: {
// 横坐标刻度
alignWithLabel: true,
show: true
}
}
],
......@@ -164,13 +169,13 @@ export default {
</script>
<template>
<div ref="chart" class="c-chart-bar chart"></div>
<div ref="chart" class="chart-bar chart"></div>
</template>
<style lang="scss" scoped>
.chart {
height: 100%;
min-width: 200px;
min-height: 200px;
min-width: 400px;
min-height: 400px;
}
</style>
......@@ -169,7 +169,6 @@ export default {
{
type: 'category',
data: this.xData,
boundaryGap: false,
offset: 5,
axisLine: {
lineStyle: {
......@@ -183,6 +182,7 @@ export default {
},
axisTick: {
// 横坐标刻度
alignWithLabel: true,
show: true
}
}
......
<script>
import * as echarts from 'echarts'
import { echartColors } from '@/utils/index'
import merge from 'lodash.merge'
export default {
// 折线图
name: 'ChartPie',
components: {},
props: {
// 图例
legend: {
type: Array,
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: () => [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
},
// 自定义图表配置项,使用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 = {
color: echartColors,
// title: {
// text: 'Stacked Area Chart',
// left: 'center',
// top: 'bottom'
// },
tooltip: {
textStyle: {
color: '#FFF', // 设置文字颜色
fontSize: 12
},
trigger: 'item',
backgroundColor: '#505050',
borderWidth: 0,
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
legend: {
x: 'center',
y: '88%',
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: '20px',
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)'
}
}
}
]
}
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-pie chart"></div>
</template>
<style lang="scss" scoped>
.chart {
height: 100%;
min-width: 200px;
min-height: 200px;
}
</style>
<script>
import ChartPie from '@/components/ChartPie'
import TabContent from '../components/TabContent'
export default {
name: '',
components: { TabContent },
components: { TabContent, ChartPie },
data() {
return {
cardData: [
......@@ -56,6 +57,16 @@ export default {
<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>
......@@ -70,4 +81,8 @@ export default {
</div>
</template>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
.chart-pie {
height: 400px;
}
</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 },
components: { ChartBar, SelectUser },
props: {
type: {
type: String,
......@@ -200,14 +199,17 @@ export default {
</div>
<el-row :gutter="10">
<el-col :span="12">
<ChartLine :xData="xData" :legend="legend['customerGroup']" :series="series"></ChartLine>
<ChartBar :xData="xData" :legend="legend['customerGroup']" :series="series"></ChartBar>
</el-col>
<el-col :span="12">
<ChartLine
:xData="xData"
<ChartBar
:legend="legend['customerGroupMember']"
:series="series"
></ChartLine>
:option="{
xAxis: [{ type: 'value' }],
yAxis: [{ type: 'category', data: [1, 2, 3, 4, 5] }]
}"
></ChartBar>
</el-col>
</el-row>
</div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!