From 3f0c8bc06066c01ad921aa75b1f86b48c97b5bcb Mon Sep 17 00:00:00 2001
From: wangxiaohua <1214073490@qq.com>
Date: Mon, 22 Nov 2021 16:10:04 +0800
Subject: [PATCH 1/3] init
---
src/views/Statistics/BuildingContrast.vue | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/views/Statistics/BuildingContrast.vue b/src/views/Statistics/BuildingContrast.vue
index dea30c0..9c42f86 100644
--- a/src/views/Statistics/BuildingContrast.vue
+++ b/src/views/Statistics/BuildingContrast.vue
@@ -375,6 +375,7 @@ export default {
pamaet.dateType=this.TimetoAhoose
}
this.$api.http.houseData(pamaet).then((res) => {
+ console.log(res)
let arr=[]
res.data.list.map(item=>{
let obj={}
@@ -382,6 +383,7 @@ export default {
obj.zxl=item.prohibitedCustomer
arr.push(obj)
})
+ console.log(arr)
arr=this.dealData(arr)
this.objList3={
avg: res.data.avg || 0,
@@ -389,6 +391,7 @@ export default {
sum:res.data.sum || 0,
list:arr || []
}
+ console.log(this.objList3)
})
},
houseData4(){
@@ -479,7 +482,7 @@ export default {
dealData(arr){
let num=Math.max.apply(Math, arr.map(function (o) { return o.zxl })) //结果:3
arr.map(item=>{
- item.zxl1=Math.floor(item.zxl/num*100)
+ item.zxl1=Math.floor(item.zxl/num*100) || 0;
})
return arr
},
From 4f515ffa49f77271fb291dc03d7f78c84cf3e883 Mon Sep 17 00:00:00 2001
From: wangxiaohua <1214073490@qq.com>
Date: Mon, 22 Nov 2021 16:49:56 +0800
Subject: [PATCH 2/3] init
---
src/views/Statistics/ConsultantBrand.vue | 17 ++++++++++++++++-
src/views/Statistics/ReceptionStatistical.vue | 18 +++++++++++++++++-
src/views/Statistics/trend.vue | 8 +++++++-
3 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/src/views/Statistics/ConsultantBrand.vue b/src/views/Statistics/ConsultantBrand.vue
index 374e5f0..357fb35 100644
--- a/src/views/Statistics/ConsultantBrand.vue
+++ b/src/views/Statistics/ConsultantBrand.vue
@@ -88,6 +88,9 @@
'+params[0].seriesName+':'+params[0].data+'%'+'
'+''+params[1].seriesName+':'+ params[1].data+'%'+'
'; + return src + } + }; + option.yAxis={ + type: 'value', + splitNumber:5, + max:100, + min:0, + axisLabel: { //重点在这一块,其余可以忽略 + textStyle: { + color: '#212121', //更改坐标轴文字颜色 + } + }, + axisLine: { + lineStyle: { + ype: 'solid', + color: '#DDE1EE',//x线的颜色 + width:'1'//坐标线的宽度 + } + }, + splitLine: { + lineStyle: { + type: 'dashed' // y轴分割线类型 + } + }, + axisTick: { //y轴刻度线 + show: false + }, + } + }else{ + option.tooltip={ + trigger: 'axis', + } + option.yAxis={ + type: 'value', + splitNumber:5, + min:0, + minInterval: 1, + axisLabel: { //重点在这一块,其余可以忽略 + textStyle: { + color: '#212121', //更改坐标轴文字颜色 + } + }, + axisLine: { + lineStyle: { + ype: 'solid', + color: '#DDE1EE',//x线的颜色 + width:'1'//坐标线的宽度 + } + }, + splitLine: { + lineStyle: { + type: 'dashed' // y轴分割线类型 + } + }, + axisTick: { //y轴刻度线 + show: false + }, + }; + } + + option && myChart.setOption(option); window.addEventListener("resize", () => { myChart.resize(); diff --git a/src/views/Statistics/TrendAnalysis.vue b/src/views/Statistics/TrendAnalysis.vue index 9e5fa6f..d9d565d 100644 --- a/src/views/Statistics/TrendAnalysis.vue +++ b/src/views/Statistics/TrendAnalysis.vue @@ -798,6 +798,7 @@ export default { option = { tooltip: { trigger: "axis", + formatter: '{b0}: {c0}'+'%' }, legend: { data: ["起始时间"], @@ -828,7 +829,9 @@ export default { }, yAxis: { type: "value", - splitNumber: 4, + splitNumber:5, + max:100, + min:0, axisLabel: { //重点在这一块,其余可以忽略 textStyle: { @@ -876,6 +879,10 @@ export default { option = { tooltip: { trigger: "axis", + formatter: function (params) { + let src= ''+params[0].seriesName+':'+params[0].data+'%'+'
'+''+params[1].seriesName+':'+ params[1].data+'%'+'
'; + return src + } }, legend: { data: ["起始时间","对比时间"], @@ -906,7 +913,9 @@ export default { }, yAxis: { type: "value", - splitNumber: 4, + splitNumber:5, + max:100, + min:0, axisLabel: { //重点在这一块,其余可以忽略 textStyle: { diff --git a/src/views/Statistics/trend.vue b/src/views/Statistics/trend.vue index 7bbf888..f8333e8 100644 --- a/src/views/Statistics/trend.vue +++ b/src/views/Statistics/trend.vue @@ -689,15 +689,15 @@ export default { }, //卡片下折线图 SwitchCARDS(arr, str, timeDate, Strname) { - // console.log(arr,str,timeDate,Strname); + echarts.init(document.getElementById(str)).dispose(); // 销毁实例 var chartDom = document.getElementById(str); var myChart = echarts.init(chartDom); var option; option = { - tooltip: { - trigger: "axis", - }, + // tooltip: { + // trigger: "axis", + // }, legend: { data: Strname, bottom: "10", @@ -725,7 +725,57 @@ export default { }, }, }, - yAxis: { + + series: arr, + }; + if(this.secindex=='fraction'){ + if(this.selectTime1){ + option.tooltip={ + trigger: 'axis', + formatter: function (params) { + let src= ''+params[0].seriesName+':'+params[0].data+'%'+'
'+''+params[1].seriesName+':'+ params[1].data+'%'+'
'; + return src + } + }; + }else{ + option.tooltip={ + trigger: 'axis', + formatter: '{b0}:{c0}'+'%' + } + } + + option.yAxis={ + type: 'value', + splitNumber:5, + max:100, + min:0, + axisLabel: { //重点在这一块,其余可以忽略 + textStyle: { + color: '#212121', //更改坐标轴文字颜色 + } + }, + axisLine: { + lineStyle: { + ype: 'solid', + color: '#DDE1EE',//x线的颜色 + width:'1'//坐标线的宽度 + } + }, + splitLine: { + lineStyle: { + type: 'dashed' // y轴分割线类型 + } + }, + axisTick: { //y轴刻度线 + show: false + }, + } + + }else{ + option.tooltip={ + trigger: "axis", + } + option.yAxis={ type: "value", splitNumber: 4, axisLabel: { @@ -750,9 +800,11 @@ export default { //y轴刻度线 show: false, }, - }, - series: arr, - }; + } + } + + + option && myChart.setOption(option); window.addEventListener("resize", () => { myChart.resize(); diff --git a/vue.config.js b/vue.config.js index db6248b..f361a46 100644 --- a/vue.config.js +++ b/vue.config.js @@ -3,8 +3,8 @@ * https://cli.vuejs.org/zh/config/ */ // const url = 'http://pigx-gateway' -const url = 'http://39.97.167.65:9999' //测试 -// const url = 'http://192.168.31.169:9999' //长龙 +// const url = 'http://39.97.167.65:9999' //测试 +const url = 'http://192.168.31.169:9999' //长龙 // const url = 'http://192.168.31.134:9999' //嘉豪 // const url = 'http://192.168.31.100:9999' //王笑 // const url = 'http://nitu5e.natappfree.cc' //王笑