update
This commit is contained in:
parent
6f7aee4906
commit
850fa0a868
@ -110,8 +110,7 @@
|
||||
"path": "formatPortrait",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"disableScroll": true
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@ -86,7 +86,7 @@
|
||||
|
||||
<p class="title">{{thisMonth?thisMonth:'-'}}月车辆归属地</p>
|
||||
<div v-if="homePlace.length>0">
|
||||
<home-place :homeData="homePlace" :homeCity="cityPlace" />
|
||||
<home-place :homeData="homePlace" :homeCity="cityPlace" @getHomeDate="getHomeData"/>
|
||||
<div class="selectType">
|
||||
<div :class="item.select?'item itemSelect':'item itemUnSelect'" v-for="(item,index) in carTypeList" :key="index" @click="handleCarType(item)">
|
||||
<div class="text">{{item.name}}</div>
|
||||
@ -192,6 +192,7 @@ export default {
|
||||
addAllEntry:'',//相较上月增加的入区率
|
||||
endData:'',//截止日期
|
||||
isFirst:true,//是不是第一次调用
|
||||
carType:'',// 车辆类型
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@ -287,8 +288,7 @@ export default {
|
||||
type = item.value
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
this.carType = type
|
||||
this.getHomeData(type)
|
||||
},
|
||||
//获取服务区基本信息
|
||||
@ -583,6 +583,7 @@ export default {
|
||||
this.carTypeList =list
|
||||
this.isFirst = false
|
||||
}
|
||||
console.log('服务区',res)
|
||||
|
||||
// 因为只让接口调用一次 所以要把全部和不同区域的内容要放在同一个列表里面 然后通过选项卡的点击来切换展示哪一块的数据
|
||||
let result = res.Result_Data.List
|
||||
@ -612,6 +613,7 @@ export default {
|
||||
})
|
||||
//城市
|
||||
this.cityPlaceAll = cityList
|
||||
console.log('cityList',cityList)
|
||||
this.cityPlace = cityList[this.selectTab]?cityList[this.selectTab]:[]
|
||||
//省份
|
||||
this.homePlaceAll = dataList
|
||||
@ -619,6 +621,38 @@ export default {
|
||||
|
||||
})
|
||||
},
|
||||
getCityList(ProvinceName,allCount){
|
||||
uni.showLoading({
|
||||
title: '正在加载...'
|
||||
})
|
||||
const date = new Date(this.endTime?this.endTime:this.time)
|
||||
let y = date.getFullYear()
|
||||
let m = date.getMonth() + 1
|
||||
if (m<10){
|
||||
m='0'+m
|
||||
}
|
||||
let statistic = `${y}${m}`
|
||||
const req = {
|
||||
StatisticsMonth:statistic,
|
||||
ProvinceName:ProvinceName,
|
||||
Serverpart_ID:this.serviceInfo.Serverpart_ID,
|
||||
VehicleType: this.carType,
|
||||
isExclude:ProvinceName.indexOf(',') !== -1
|
||||
}
|
||||
console.log('req',req)
|
||||
request.$webGet('CommercialApi/Revenue/GetBayonetProvinceOAList',req).then(res=>{
|
||||
console.log('res',res)
|
||||
let result = res.Result_Data.List
|
||||
result.forEach(item=>{
|
||||
item.OwnerCityList.forEach(subItem=>{
|
||||
subItem.value = Number(subItem.value)
|
||||
subItem.rate = ((Number(subItem.value) / allCount)*100)
|
||||
})
|
||||
})
|
||||
this.cityPlace = res.Result_Data.List[0] ? res.Result_Data.List[0].OwnerCityList : []
|
||||
})
|
||||
uni.hideLoading()
|
||||
},
|
||||
getCarTypeTime(){
|
||||
request.$webGet('CommercialApi/Revenue/GetBayonetSTAList',{
|
||||
StatisticsDate:this.endTime?this.endTime:this.time,
|
||||
@ -780,6 +814,7 @@ export default {
|
||||
.main{
|
||||
width:100%;
|
||||
background: #fff;
|
||||
min-height: 100vh;
|
||||
.header{
|
||||
width: 100%;
|
||||
height: calc(1.056 * 100vw);
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
<div style="min-height: 100px;">
|
||||
<div class="main" >
|
||||
<div class="homePlace">
|
||||
<canvas v-if="!homePlacePath" canvas2d="true" class="carNum" canvas-id="homePlace" id="homePlace" @tap="handleTap"/>
|
||||
<image v-if="homePlacePath" class="carNum" :src="homePlacePath"></image>
|
||||
<canvas canvas2d="true" class="carNum" canvas-id="homePlace" id="homePlace" @tap="handleTap"/>
|
||||
<!-- <image v-if="homePlacePath" class="carNum" :src="homePlacePath"></image>-->
|
||||
</div>
|
||||
<div class="homeCity">
|
||||
<!-- <div class="dashed box1"></div>-->
|
||||
@ -74,12 +74,14 @@ export default {
|
||||
handler(value) {
|
||||
this.homePlacePath = ''
|
||||
this.handleCarData(value)
|
||||
console.log('val',value)
|
||||
},
|
||||
immediate:true,
|
||||
deep:true
|
||||
},
|
||||
homeCity:{
|
||||
handler(value){
|
||||
console.log('homeCity',value)
|
||||
value.forEach(item=>{
|
||||
item.rate = item.rate.toFixed(2) + '%'
|
||||
})
|
||||
@ -96,8 +98,27 @@ export default {
|
||||
},
|
||||
//点击事件
|
||||
handleTap(e){
|
||||
console.log('e',e)
|
||||
uChartsInstance[e.target.id].showToolTip(e,{
|
||||
formatter: (item, category, index, opts) =>{
|
||||
if (item.name.split(' ')[0] === '其他'){
|
||||
let str = ''
|
||||
this.homeData.forEach(item=>{
|
||||
if (item.name.split(' ')[0]!=='其他'){
|
||||
if (str===''){
|
||||
str = item.name.split(' ')[0]
|
||||
}else{
|
||||
str+=`,${item.name.split(' ')[0]}`
|
||||
}
|
||||
}
|
||||
})
|
||||
this.$parent.getCityList(str,item.value)
|
||||
}else{
|
||||
this.$parent.getCityList(item.name.split(' ')[0],item.value)
|
||||
}
|
||||
console.log('item',item)
|
||||
console.log('homeCity',this.homeCity)
|
||||
|
||||
return item.name + ":" + item.data + '辆';
|
||||
}
|
||||
});
|
||||
@ -183,7 +204,9 @@ export default {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.main{
|
||||
width: 100%;
|
||||
.homePlace{
|
||||
height: 160px;
|
||||
width: 100%;
|
||||
.carNum{
|
||||
width: 100%;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user