This commit is contained in:
cclu 2023-06-25 19:22:42 +08:00
parent 6f7aee4906
commit 850fa0a868
3 changed files with 71 additions and 14 deletions

View File

@ -110,8 +110,7 @@
"path": "formatPortrait", "path": "formatPortrait",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationStyle": "custom", "navigationStyle": "custom"
"disableScroll": true
} }
}, },
{ {

View File

@ -86,7 +86,7 @@
<p class="title">{{thisMonth?thisMonth:'-'}}月车辆归属地</p> <p class="title">{{thisMonth?thisMonth:'-'}}月车辆归属地</p>
<div v-if="homePlace.length>0"> <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="selectType">
<div :class="item.select?'item itemSelect':'item itemUnSelect'" v-for="(item,index) in carTypeList" :key="index" @click="handleCarType(item)"> <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> <div class="text">{{item.name}}</div>
@ -192,6 +192,7 @@ export default {
addAllEntry:'',// addAllEntry:'',//
endData:'',// endData:'',//
isFirst:true,// isFirst:true,//
carType:'',//
} }
}, },
components: { components: {
@ -287,8 +288,7 @@ export default {
type = item.value type = item.value
} }
}) })
this.carType = type
this.getHomeData(type) this.getHomeData(type)
}, },
// //
@ -583,6 +583,7 @@ export default {
this.carTypeList =list this.carTypeList =list
this.isFirst = false this.isFirst = false
} }
console.log('服务区',res)
// //
let result = res.Result_Data.List let result = res.Result_Data.List
@ -612,6 +613,7 @@ export default {
}) })
// //
this.cityPlaceAll = cityList this.cityPlaceAll = cityList
console.log('cityList',cityList)
this.cityPlace = cityList[this.selectTab]?cityList[this.selectTab]:[] this.cityPlace = cityList[this.selectTab]?cityList[this.selectTab]:[]
// //
this.homePlaceAll = dataList 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(){ getCarTypeTime(){
request.$webGet('CommercialApi/Revenue/GetBayonetSTAList',{ request.$webGet('CommercialApi/Revenue/GetBayonetSTAList',{
StatisticsDate:this.endTime?this.endTime:this.time, StatisticsDate:this.endTime?this.endTime:this.time,
@ -780,6 +814,7 @@ export default {
.main{ .main{
width:100%; width:100%;
background: #fff; background: #fff;
min-height: 100vh;
.header{ .header{
width: 100%; width: 100%;
height: calc(1.056 * 100vw); height: calc(1.056 * 100vw);

View File

@ -2,8 +2,8 @@
<div style="min-height: 100px;"> <div style="min-height: 100px;">
<div class="main" > <div class="main" >
<div class="homePlace"> <div class="homePlace">
<canvas v-if="!homePlacePath" canvas2d="true" class="carNum" canvas-id="homePlace" id="homePlace" @tap="handleTap"/> <canvas canvas2d="true" class="carNum" canvas-id="homePlace" id="homePlace" @tap="handleTap"/>
<image v-if="homePlacePath" class="carNum" :src="homePlacePath"></image> <!-- <image v-if="homePlacePath" class="carNum" :src="homePlacePath"></image>-->
</div> </div>
<div class="homeCity"> <div class="homeCity">
<!-- <div class="dashed box1"></div>--> <!-- <div class="dashed box1"></div>-->
@ -74,12 +74,14 @@ export default {
handler(value) { handler(value) {
this.homePlacePath = '' this.homePlacePath = ''
this.handleCarData(value) this.handleCarData(value)
console.log('val',value)
}, },
immediate:true, immediate:true,
deep:true deep:true
}, },
homeCity:{ homeCity:{
handler(value){ handler(value){
console.log('homeCity',value)
value.forEach(item=>{ value.forEach(item=>{
item.rate = item.rate.toFixed(2) + '%' item.rate = item.rate.toFixed(2) + '%'
}) })
@ -96,8 +98,27 @@ export default {
}, },
// //
handleTap(e){ handleTap(e){
console.log('e',e)
uChartsInstance[e.target.id].showToolTip(e,{ uChartsInstance[e.target.id].showToolTip(e,{
formatter: (item, category, index, opts) =>{ 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 + '辆'; return item.name + ":" + item.data + '辆';
} }
}); });
@ -183,7 +204,9 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.main{ .main{
width: 100%;
.homePlace{ .homePlace{
height: 160px;
width: 100%; width: 100%;
.carNum{ .carNum{
width: 100%; width: 100%;