@@ -121,7 +138,7 @@ import HomePlace from "./components/car/homePlace.vue";
import CarTypeTime from "./components/car/carTypeTime.vue";
import timeAnalysis from "./components/car/timeAnalysis.vue";
import PercentEntry from "./components/car/percentEntry.vue";
-import {timestampToTime} from "../../util/dateTime";
+import MonthTotal from "./components/car/monthTotal.vue";
import NoData from "./components/noData.vue";
import Analyse from "./components/analyse.vue";
export default {
@@ -139,8 +156,9 @@ export default {
chartData:{},
selectTab: 0,
tabIsTrue: true,
- tabList:[{name:'全部',value:0},{name:'东',value:1},{name:'西',value:2}],//选项卡列表
+ tabList:[],//选项卡列表
carNumAll : 0,//一共的入区车流数
+ monthTotalList:[],//月累计
carData:[],//入区车流的数据
homePlaceAll:[],//车辆归属地两区总和列表
homePlace:[],//车辆归属地
@@ -159,17 +177,17 @@ export default {
endTime:'',
thisMonth:'',//几月
allEntry:'',//一共的入区率占比
- endData:''//截止日期
+ addAllEntry:'',//相较上月增加的入区率
+ endData:'',//截止日期
}
},
- components: {Analyse, NoData, PercentEntry, CarTypeTime, HomePlace, EntryZone,timeAnalysis},
+ components: {Analyse, NoData, PercentEntry, CarTypeTime, HomePlace, EntryZone,timeAnalysis,MonthTotal},
computed:{
isHaveData(){
return true
}
},
onLoad(option){
- console.log('option',option)
this.backType = option.type
},
onShow(){
@@ -207,7 +225,10 @@ export default {
}else{
this.serviceInfo = storeServiceInfo
}
- console.log('this.serviceInfo',this.serviceInfo)
+ //获取服务区基本信息
+ this.getServiceInfo()
+ //月累计
+ this.getMonthTotalList()
// 入区车流分析
this.getCarData()
// 车辆归属地
@@ -225,6 +246,27 @@ export default {
},
methods:{
+ //获取服务区基本信息
+ async getServiceInfo(){
+ let id = ''
+ let currentService = uni.getStorageSync('currentService')
+ let nearService = uni.getStorageSync('nearService')
+ if (!currentService){
+ id = nearService.Serverpart_ID
+ }else{
+ id = currentService.Serverpart_ID
+ }
+ let req = {
+ ServerpartId:id
+ }
+ const total = await request.$webGet('CommercialApi/BaseInfo/GetServerpartInfo',req)
+ console.log('totalsdskadja',total)
+ let tabList = [{name:'全部',value:0}]
+ total.Result_Data.RegionInfo.forEach((item,index)=>{
+ tabList.push({name:item.SERVERPART_REGIONNAME,value:index+1})
+ })
+ this.tabList = tabList
+ },
// 时间选择器改变的时间
bindDateChange(e){
const date = new Date(e.detail.value)
@@ -325,20 +367,53 @@ export default {
// if (this.tabIsTrue){
this.selectTab = value
// 车辆归属地
- this.homePlace = this.homePlaceAll[this.selectTab]
- this.cityPlace = this.cityPlaceAll[this.selectTab]
+ this.homePlace = this.homePlaceAll[this.selectTab]?this.homePlaceAll[this.selectTab]:[]
+
+ this.cityPlace = this.cityPlaceAll[this.selectTab]?this.cityPlaceAll[this.selectTab]:[]
// 车辆类型占比与停留时间
- this.carTypeTimeData = this.carTypeTimeDataAll[this.selectTab]
+ this.carTypeTimeData = this.carTypeTimeDataAll[this.selectTab]?this.carTypeTimeDataAll[this.selectTab]:[]
// 车辆价值与停留时间分析
this.getTimeAnalysis(Serverpart_Region)
//入区率占比
- this.percentEntryData = this.percentEntryDataAll[this.selectTab]
- // this.tabIsTrue = false
- // setTimeout(()=>{
- // this.tabIsTrue = true
- // },2000)
+ this.getPercentEntry(this.tabList[this.selectTab].name)
// }
+ },
+ async getMonthTotalList(){
+ const req = {
+ StatisticsDate:this.endTime?this.endTime:this.time,
+ Serverpart_ID:this.serviceInfo.Serverpart_ID
+ }
+ const data = await request.$webGet('CommercialApi/BigData/GetMonthAnalysis',req)
+ let monthList = []
+ let carCount = []
+ let moneyCount = []
+ let info = []
+ data.Result_Data.List.forEach(item=>{
+ monthList.push(item.Statistics_Month + '月')
+ carCount.push(Number((item.Vehicle_Count / 10000).toFixed(0)))
+ moneyCount.push(Number((item.RevenueAmount / 10000).toFixed(0)))
+ // showTip要展示的信息
+ info.push({
+ allCarCount : item.Vehicle_Count,
+ region:item.RegionList,
+ rate:item.Entry_Rate,
+ money:item.RevenueAmount
+ })
+ })
+
+ let res = {
+ categories: monthList,
+ series:[{name:'车流量',data:carCount,type:'column',index:0,info:info},
+ {name:'交易金额',data:moneyCount,type:'line',index:1}]
+ }
+
+ this.monthTotalList = res
+ // categories: ["小型车","中型车","大货车","新能源车"],
+ // series: [{name:'新能源',data:[30,38,20,10]},
+ // {name:'燃油车',data:[20,17,23,32]},
+ // {name:'停留时间',data:[62,38,50,84]}]
+
},
getCarData(){
request.$webGet('CommercialApi/Revenue/GetBayonetEntryList',{
@@ -362,6 +437,7 @@ export default {
Serverpart_ID:this.serviceInfo.Serverpart_ID,
ContainWhole:true
}).then(res=>{
+ console.log('resfdkfjdks',res)
// 因为只让接口调用一次 所以要把全部和不同区域的内容要放在同一个列表里面 然后通过选项卡的点击来切换展示哪一块的数据
let result = res.Result_Data.List
result.forEach(item=>{
@@ -390,9 +466,11 @@ export default {
})
//城市
this.cityPlaceAll = cityList
+ console.log('this.cityPlaceAll',this.cityPlaceAll)
this.cityPlace = cityList[this.selectTab]
//省份
this.homePlaceAll = dataList
+ console.log('this.homePlaceAll',this.homePlaceAll)
this.homePlace = dataList[this.selectTab]
})
@@ -456,17 +534,39 @@ export default {
TimeSpan: 2
}).then(res=>{
let result = res.Result_Data.List
- this.timeAnalysisData = result
+ // this.timeAnalysisData = result
+ let categories = [0,2,4,6,8,10,12,14,16,18,20,22]
+ let series = []
+ result.forEach(item=>{
+ let obj = {name:'',data:[]}
+ obj.name = item.name
+ let valueList = []
+ item.data.forEach(subItem=>{
+ valueList.push(Number((subItem[1] * 60).toFixed(0)))
+ })
+ obj.data = valueList
+ series.push(obj)
+ })
+ let list = {
+ categories:categories,
+ series:series
+ }
+ this.timeAnalysisData = list
+ console.log('this.timeAnalysisData',this.timeAnalysisData)
})
- // let res = [
- // {name:'小型车',data:[[3,3,10],[10,1.5,10],[18,0.5,5],[22,2.5,10]]},
- // {name:'中型车',data:[[3,1.5,10],[4,2.7,10],[14,2.3,10],[18,1.4,0.50]]},
- // {name:'大型车',data:[[2,0.7,2],[5,0.2,1],[7,0.7,3],[22,1.9,6]]}
- // ]
+ // res = {
+ // categories: ["2018","2019","2020","2021","2022","2023"],
+ // series: [
+ // {name: "成交量A", data: [35,8,25,37,4,20]},
+ // {name: "成交量B", data: [70,40,65,100,44,68]},
+ // {name: "成交量C", data: [100,80,95,150,112,132]}
+ // ]
+ // }
+
},
- getPercentEntry(){
+ getPercentEntry(type){
const date = new Date(this.single)
const nowDate = new Date()
let nowMonth = nowDate.getMonth() + 1
@@ -479,21 +579,36 @@ export default {
}else{
endTime = this.endTime
}
- request.$webGet('CommercialApi/Revenue/GetSPBayonetList',{
- Statistics_Date: this.endTime?endTime:this.time,
- Province_Code:'340000',
- Serverpart_ID :this.serviceInfo.Serverpart_ID,
- GroupType:2
- }).then(res=>{
- this.percentEntryDataAll = [ res.Result_Data.List, [res.Result_Data.List[0]], [res.Result_Data.List[1]]]
- this.percentEntryData = this.percentEntryDataAll[this.selectTab]
- let Vehicle_CountAll=0
- let SectionFlow_CountAll=0
- this.percentEntryData.forEach(item=>{
- Vehicle_CountAll+= item.Vehicle_Count
- SectionFlow_CountAll+= item.SectionFlow_Count
- })
- this.allEntry = ((Vehicle_CountAll/SectionFlow_CountAll)*100).toFixed(2)
+
+ let req = {}
+ if (type==='全部' || !type){
+ req = {
+ Statistics_Date: this.endTime?endTime:this.time,
+ Province_Code:'340000',
+ Serverpart_ID :this.serviceInfo.Serverpart_ID,
+ GroupType:2,
+ ShowGrowthRate:true
+ }
+ }else{
+ req = {
+ Statistics_Date: this.endTime?endTime:this.time,
+ Province_Code:'340000',
+ Serverpart_ID :this.serviceInfo.Serverpart_ID,
+ GroupType:2,
+ ShowGrowthRate:true,
+ Serverpart_Region:type.slice(0,1)
+ }
+ }
+ request.$webGet('CommercialApi/Revenue/GetSPBayonetList',req).then(res=>{
+ this.percentEntryData = res.Result_Data.List
+ if (this.percentEntryData.length>0){
+ this.allEntry = res.Result_Data.List[0].Entry_Rate
+ this.addAllEntry = res.Result_Data.List[0].Entry_GrowthRate
+ }else{
+ this.allEntry = ''
+ this.addAllEntry = ''
+ }
+
})
}
}
@@ -728,6 +843,54 @@ export default {
line-height: 20px;
}
}
+ .topItem{
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ .title{
+ font-size: 17px;
+ font-family: PingFangSC-Semibold, PingFang SC;
+ font-weight: 600;
+ color: #160002;
+ line-height: 24px;
+ }
+ .box{
+ display: flex;
+ align-items: center;
+ .value{
+ font-size: 16px;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 600;
+ color: #000;
+ line-height: 20px;
+ }
+ .right{
+ margin-left: 4px;
+ display: flex;
+ align-items: center;
+ .arrowTop {
+ width: 14px;
+ height: 14px;
+ margin-right: 4px;
+ }
+ .text {
+ font-size: 14px;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #782717;
+ line-height: 20px;
+ margin-right: 4px;
+ }
+ .compare {
+ font-size: 14px;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #c97e64;
+ line-height: 20px;
+ }
+ }
+ }
+ }
.time{
margin-bottom: 4px;
.thisTime{
diff --git a/pages/commercialBI/components/analyse.vue b/pages/commercialBI/components/analyse.vue
index d607d58..fc58ca2 100644
--- a/pages/commercialBI/components/analyse.vue
+++ b/pages/commercialBI/components/analyse.vue
@@ -25,7 +25,6 @@ export default {
watch:{
analyseInfo:{
handler(value){
- console.log('analyseInfowatch',value)
this.getLabelDetail()
},
immediate:true,
diff --git a/pages/commercialBI/components/car/carTypeTime.vue b/pages/commercialBI/components/car/carTypeTime.vue
index 17bb24b..852e5e3 100644
--- a/pages/commercialBI/components/car/carTypeTime.vue
+++ b/pages/commercialBI/components/car/carTypeTime.vue
@@ -37,7 +37,6 @@ export default {
watch: {
data: {
handler(value) {
- console.log('value232312',value)
this.info = value
this.carTypeTimePath=''
this.handleCarData(value)
@@ -51,10 +50,6 @@ export default {
handleTap(e){
uChartsInstance[e.target.id].showToolTip(e,{
formatter: (item, category, index, opts) =>{
- console.log('item',item)
- console.log('opts',opts)
- console.log('category',category)
- console.log('index',index)
if (this.num===0){
this.num++
return item.name + ":" + opts.series[0].valueList[index] + '辆';
@@ -64,6 +59,7 @@ export default {
}
}
});
+ uChartsInstance[e.target.id].touchLegend(e);
},
// 处理传入的数据
handleCarData(value) {
@@ -113,7 +109,7 @@ export default {
min: 0,
max: 100,
titleOffsetY: -5,
- axisLineColor:"#F2F2F5"
+ axisLineColor:"#F2F2F5"
},
{
title:'单位: 分钟',
diff --git a/pages/commercialBI/components/car/entryZone.vue b/pages/commercialBI/components/car/entryZone.vue
index ca640bd..1f62355 100644
--- a/pages/commercialBI/components/car/entryZone.vue
+++ b/pages/commercialBI/components/car/entryZone.vue
@@ -1,47 +1,47 @@
-
+
-
-
-
- {{month}}月累计:
-
-
-
-
- 入区
- {{allAddUpCount}}辆
-
-
-
- {{item.Serverpart_Region + '区 '}}
- {{item.AddUpCount + '辆' }}
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
- 入区率
- {{ allEntryAddUpRate }}%
-
-
-
- {{item.Serverpart_Region + '区 '}}
- {{item.EntryAddUp_Rate + '%' }}
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -85,7 +85,6 @@ export default {
watch:{
carData:{
handler(value){
- console.log('valuefirst',value)
if (value.length>0){
this.isShowData = true
}
@@ -161,8 +160,6 @@ export default {
title:this.entryRate,
subtitle:"昨日入区率"
}
- console.log('res1111',res)
- console.log('probabilityRes1111',probabilityRes)
this.drawCharts('carNum' , res,configCarNum )
this.drawCharts2('probability',probabilityRes,config)
},
@@ -170,12 +167,10 @@ export default {
const ctx = uni.createCanvasContext(id, this);
let _this = this
let phoneInfo = uni.getStorageSync('phoneInfo')
- this.width = (phoneInfo.screenWidth ) / 2
- console.log('this.width',this.width)
uChartsInstance[id] = new uCharts({
type: "ring",
context: ctx,
- width: _this.width,
+ width: 200,
height: 208,
series: data.series,
animation: false,
@@ -227,7 +222,7 @@ export default {
uChartsInstance[id] = new uCharts({
type: "ring",
context: ctx,
- width: 215,
+ width: 210,
height: 208,
series: data.series,
animation: false,
diff --git a/pages/commercialBI/components/car/homePlace.vue b/pages/commercialBI/components/car/homePlace.vue
index 32eb651..d5f5942 100644
--- a/pages/commercialBI/components/car/homePlace.vue
+++ b/pages/commercialBI/components/car/homePlace.vue
@@ -6,12 +6,12 @@
-
-
-
-
-
-
+
+
+
+
+
+
{{item.name}}
@@ -22,14 +22,14 @@
{{item.value}}辆
-
- 0%
- 20%
- 40%
- 60%
- 80%
- 100%
-
+
+
+
+
+
+
+
+
@@ -104,7 +104,6 @@ export default {
},
// 处理传入的数据
handleCarData(value) {
- console.log('value',value)
let list = []
value.forEach(item=>{
list.push(item.data)
diff --git a/pages/commercialBI/components/car/monthTotal.vue b/pages/commercialBI/components/car/monthTotal.vue
new file mode 100644
index 0000000..2f7cd04
--- /dev/null
+++ b/pages/commercialBI/components/car/monthTotal.vue
@@ -0,0 +1,139 @@
+
+
+
+
+
diff --git a/pages/commercialBI/components/car/percentEntry.vue b/pages/commercialBI/components/car/percentEntry.vue
index ee0cc29..a1ae19a 100644
--- a/pages/commercialBI/components/car/percentEntry.vue
+++ b/pages/commercialBI/components/car/percentEntry.vue
@@ -21,7 +21,7 @@