update
This commit is contained in:
parent
6f7aee4906
commit
850fa0a868
@ -110,8 +110,7 @@
|
|||||||
"path": "formatPortrait",
|
"path": "formatPortrait",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom"
|
||||||
"disableScroll": true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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>
|
||||||
@ -154,7 +154,7 @@ import Analyse from "./components/analyse.vue";
|
|||||||
import CommercialType from "./commercialType.vue";
|
import CommercialType from "./commercialType.vue";
|
||||||
export default {
|
export default {
|
||||||
name: "carPortrait",
|
name: "carPortrait",
|
||||||
data(){
|
data(){
|
||||||
const lastDay = this.$util.cutDate(new Date(), 'YYYY-MM-DD', -1)
|
const lastDay = this.$util.cutDate(new Date(), 'YYYY-MM-DD', -1)
|
||||||
return {
|
return {
|
||||||
menu:{}, //手机参数
|
menu:{}, //手机参数
|
||||||
@ -192,6 +192,7 @@ export default {
|
|||||||
addAllEntry:'',//相较上月增加的入区率
|
addAllEntry:'',//相较上月增加的入区率
|
||||||
endData:'',//截止日期
|
endData:'',//截止日期
|
||||||
isFirst:true,//是不是第一次调用
|
isFirst:true,//是不是第一次调用
|
||||||
|
carType:'',// 车辆类型
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@ -287,9 +288,8 @@ export default {
|
|||||||
type = item.value
|
type = item.value
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
this.carType = type
|
||||||
|
this.getHomeData(type)
|
||||||
this.getHomeData(type)
|
|
||||||
},
|
},
|
||||||
//获取服务区基本信息
|
//获取服务区基本信息
|
||||||
async getServiceInfo(){
|
async getServiceInfo(){
|
||||||
@ -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);
|
||||||
|
|||||||
@ -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,16 +74,18 @@ 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){
|
||||||
value.forEach(item=>{
|
console.log('homeCity',value)
|
||||||
item.rate = item.rate.toFixed(2) + '%'
|
value.forEach(item=>{
|
||||||
})
|
item.rate = item.rate.toFixed(2) + '%'
|
||||||
this.progressList = value
|
})
|
||||||
|
this.progressList = value
|
||||||
},
|
},
|
||||||
immediate:true,
|
immediate:true,
|
||||||
deep:true
|
deep:true
|
||||||
@ -96,9 +98,28 @@ 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) =>{
|
||||||
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);
|
uChartsInstance[e.target.id].touchLegend(e);
|
||||||
@ -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%;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user