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",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom",
"disableScroll": true
"navigationStyle": "custom"
}
},
{

View File

@ -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>
@ -154,7 +154,7 @@ import Analyse from "./components/analyse.vue";
import CommercialType from "./commercialType.vue";
export default {
name: "carPortrait",
data(){
data(){
const lastDay = this.$util.cutDate(new Date(), 'YYYY-MM-DD', -1)
return {
menu:{}, //
@ -192,6 +192,7 @@ export default {
addAllEntry:'',//
endData:'',//
isFirst:true,//
carType:'',//
}
},
components: {
@ -287,9 +288,8 @@ export default {
type = item.value
}
})
this.getHomeData(type)
this.carType = type
this.getHomeData(type)
},
//
async getServiceInfo(){
@ -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);

View File

@ -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,16 +74,18 @@ export default {
handler(value) {
this.homePlacePath = ''
this.handleCarData(value)
console.log('val',value)
},
immediate:true,
deep:true
},
homeCity:{
handler(value){
value.forEach(item=>{
item.rate = item.rate.toFixed(2) + '%'
})
this.progressList = value
console.log('homeCity',value)
value.forEach(item=>{
item.rate = item.rate.toFixed(2) + '%'
})
this.progressList = value
},
immediate:true,
deep:true
@ -96,9 +98,28 @@ export default {
},
//
handleTap(e){
console.log('e',e)
uChartsInstance[e.target.id].showToolTip(e,{
formatter: (item, category, index, opts) =>{
return item.name + ":" + item.data + '辆';
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 + '辆';
}
});
uChartsInstance[e.target.id].touchLegend(e);
@ -183,7 +204,9 @@ export default {
<style scoped lang="scss">
.main{
width: 100%;
.homePlace{
height: 160px;
width: 100%;
.carNum{
width: 100%;