|
@@ -1,11 +1,47 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <boxCom title="线上问题" @change="tabChange">
|
|
|
- <div>线上问题:{{ active }}</div>
|
|
|
- </boxCom>
|
|
|
- </div>
|
|
|
+ <div>
|
|
|
+ <boxCom v-if="pageData" title="线上问题" page-data @change="tabChange">
|
|
|
+ <!-- <div>线上问题:{{ active }}</div> -->
|
|
|
+ <div class="echarts-wrapper">
|
|
|
+ <div class="pie-wrapper">
|
|
|
+ <div class="total-wrapper">
|
|
|
+ 总数:<span class="total" @click.stop="reportBizName = ''">8</span>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ id="a_tylo_oo_2ppmn_ayghs"
|
|
|
+ class="pir"
|
|
|
+ style="width: 100%; height: 160px"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div v-if="tabData" class="detail-wrapper">
|
|
|
+ <div>{{ tabData.priorityStr }}</div>
|
|
|
+ <div
|
|
|
+ v-for="item in tabData.onlineProblemCopywriters.filter((elm) =>
|
|
|
+ reportBizName ? elm.reportBizName === reportBizName : true
|
|
|
+ )"
|
|
|
+ :key="item.reportBizName"
|
|
|
+ >
|
|
|
+ <div>{{ item.reportBizName }}:{{ item.priorityStr }}</div>
|
|
|
+ <div v-for="(pitem, pIndex) in item.problemDetails" :key="pIndex">
|
|
|
+ <div class="fontWeight">{{ pitem.subClientType }}</div>
|
|
|
+ <div v-for="(dItem, dIndex) in pitem.detail" :key="dIndex">
|
|
|
+ <div>
|
|
|
+ <span class="fontWeight">{{ dIndex + 1 }}、</span
|
|
|
+ ><span class="fontWeight">{{ dItem.priority }}问题:</span
|
|
|
+ >{{ dItem.problem }}
|
|
|
+ </div>
|
|
|
+ <div v-html="dItem.reason" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </boxCom>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<script type="text/javascript">
|
|
|
+import { getOnlineProblemPieChart } from '@/api/qualityMonthlyReport/edit'
|
|
|
+import echarts from 'echarts'
|
|
|
import boxCom from './box'
|
|
|
export default {
|
|
|
name: 'OnlineQuestion',
|
|
@@ -14,13 +50,124 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- active: 'APP'
|
|
|
+ active: 'APP',
|
|
|
+ myChart: null,
|
|
|
+ pageData: null,
|
|
|
+ tabData: null,
|
|
|
+ reportBizName: null,
|
|
|
+ pieData: []
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.init()
|
|
|
+ // this.echartsInit()
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ async init() {
|
|
|
+ const res = await getOnlineProblemPieChart(this.$route.query.reportId)
|
|
|
+
|
|
|
+ console.log(res)
|
|
|
+
|
|
|
+ this.pageData = res.data.map((elm) => {
|
|
|
+ return {
|
|
|
+ ...elm,
|
|
|
+ onlineProblemCopywriters: elm.onlineProblemCopywriters.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ value: item.total,
|
|
|
+ name: item.reportBizName
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ this.tabData = this.pageData.filter(
|
|
|
+ (elm) => elm.clientType === this.active
|
|
|
+ )[0]
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.echartsInit()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ echartsInit() {
|
|
|
+ const option = {
|
|
|
+ color: [
|
|
|
+ '#5470c6',
|
|
|
+ '#91cc75',
|
|
|
+ '#fac858',
|
|
|
+ '#ee6666',
|
|
|
+ '#73c0de',
|
|
|
+ '#3ba272',
|
|
|
+ '#fc8452',
|
|
|
+ '#9a60b4',
|
|
|
+ '#ea7ccc'
|
|
|
+ ],
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'item'
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: '访问来源',
|
|
|
+ type: 'pie',
|
|
|
+ radius: '50%',
|
|
|
+ data: this.tabData.onlineProblemCopywriters,
|
|
|
+ emphasis: {
|
|
|
+ itemStyle: {
|
|
|
+ shadowBlur: 0,
|
|
|
+ shadowOffsetX: 0,
|
|
|
+ shadowColor: 'rgba(0, 0, 0, 0.5)'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ console.log(this.tabData)
|
|
|
+ // 基于准备好的dom,初始化echarts实例
|
|
|
+ this.myChart = echarts.init(
|
|
|
+ document.getElementById('a_tylo_oo_2ppmn_ayghs')
|
|
|
+ )
|
|
|
+ // 绘制图表
|
|
|
+ this.myChart.setOption(option)
|
|
|
+ this.myChart.on('click', (params) => {
|
|
|
+ this.reportBizName = params.data.name
|
|
|
+ })
|
|
|
+ },
|
|
|
tabChange(value) {
|
|
|
this.active = value
|
|
|
+ this.reportBizName = ''
|
|
|
+ this.tabData = this.pageData.filter(
|
|
|
+ (elm) => elm.clientType === this.active
|
|
|
+ )[0]
|
|
|
+ console.log(this.tabData)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
+
|
|
|
+<style scoped lang="less">
|
|
|
+.echarts-wrapper {
|
|
|
+ .fontWeight {
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+ display: flex;
|
|
|
+ color: #333;
|
|
|
+ font-size: 14px;
|
|
|
+ .pie-wrapper {
|
|
|
+ width: 50%;
|
|
|
+ .total-wrapper {
|
|
|
+ color: #666;
|
|
|
+
|
|
|
+ .total {
|
|
|
+ color: #409eff;
|
|
|
+ font-size: 18px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .detail-wrapper {
|
|
|
+ width: 50%;
|
|
|
+ padding: 10px;
|
|
|
+ height: 200px;
|
|
|
+ overflow-y: scroll;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|