feat:重新对接首页接口

This commit is contained in:
zjc
2025-01-14 19:01:09 +08:00
parent 880db48579
commit ebac43f818
28 changed files with 2250 additions and 2133 deletions

143
src/stores/home.js Normal file
View File

@@ -0,0 +1,143 @@
import { ref } from 'vue'
import { defineStore } from 'pinia'
export const useHomeStore = defineStore('home', () => {
// 景区信息数据
let scenicData = ref({
scenicSpot: [
{ value: 0, name: '全县景区数量' },
{ value: 0, name: '核心景区数' },
{ value: 0, name: '低感景区总数' }
],
data: [
{ name: '当日购票量:', value: 0 },
{ name: '未来3天购票量', value: 0 },
{ name: '3天后购票量', value: 0 }
]
})
// 景区排队数据
let scenicQueueData = ref({
dataList: [],
info: []
})
// 景区承载量
let scenicBearData = ref({
dataList: [],
info: []
})
// 用户画像数据
let userPortraitData = ref({
genderRate: [],
provinceRate: [],
channel: [],
ageRate: []
})
// 景区游客统计
let visitorInfoData = ref({
total_count_this_year: 0,
total_count_today: 0,
total_count_today_within_three_hours: 0
})
// 景区拥堵情况统计
let visitorInfoList = ref([])
// 百度地图数据
let baiduMapData = ref(null)
// 工单列表
let wordkOrderList = ref([])
// 交通信息
let trafficInfoData = ref({
data: {
congestion: [],
congestionList: [],
countItem: {
max_congestion_duration: 0,
now_yongdu_sum: 0,
yongdu_luduan_count: 0,
yongdu_sum: 0
},
countRate: [],
timeRate: []
},
info: {
dqydld: 0,
ldzs: 0,
zdydsc: 0,
zydcs: 0
}
})
// 停车信息
let carStopInfoData = ref({
countInfo: { ckzs: 0, ysycws: 0, zcws: 0 },
dataList: [],
dataList1: [],
dataList2: [],
spotInfo: []
})
// 车船信息
let carShipData = ref(null)
// 酒店数据
let hotelData = ref(null)
const setVisitorInfoList = (val) => {
visitorInfoList.value = val
}
const setHotelData = (val) => {
hotelData.value = val
}
const setCarShipData = (val) => {
carShipData.value = val
}
const setCarStopInfoData = (val) => {
carStopInfoData.value = val
}
const setTrafficInfoData = (val) => {
trafficInfoData.value = val
}
const setVisitorInfoData = (val) => {
visitorInfoData.value = val
}
const setScenicBearData = (val) => {
scenicBearData.value = val
}
const setScenicQueueData = (val) => {
scenicQueueData.value = val
}
const setWordkOrderList = (val) => {
wordkOrderList.value = val
}
const setBaiduMapData = (val) => {
baiduMapData.value = val
}
const setScenicData = (val) => {
scenicData.value = val
}
const setUserPortraitData = (val) => {
userPortraitData.value = val
}
return {
scenicData,
userPortraitData,
baiduMapData,
wordkOrderList,
scenicQueueData,
scenicBearData,
visitorInfoData,
visitorInfoList,
trafficInfoData,
carStopInfoData,
carShipData,
hotelData,
setScenicData,
setUserPortraitData,
setBaiduMapData,
setWordkOrderList,
setScenicQueueData,
setScenicBearData,
setVisitorInfoData,
setVisitorInfoList,
setTrafficInfoData,
setCarStopInfoData,
setCarShipData,
setHotelData
}
})