forked from drone/command-center-dashboard

zhongrj
2025-04-21 07360ad073b3fd82da76b7740cafc25518ca3e15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<template>
    <!--时间 天气-->
    <common-weather></common-weather>
    <!--返回-->
    <div class="do-return" :style="{left:isHideBottomIcon?pxToRem(430):pxToRem(46)}" @click="goBack">
        <img src="@/assets/images/return.png" alt="" />
    </div>
    <common-title v-show="isHideBottomIcon" :style="{left:pxToRem(14)}" title="事件数据分析" />
    <div v-show="isHideBottomIcon" class="event-overview-detail-left">
        <CommonDateTime class="dateTime" v-model="timeArr" @change="timeChange" />
        <EventDataAnalysis />
        <EventTrendAnalysis />
        <EventTop5 />
    </div>
</template>
<script setup>
import CommonWeather from '@/components/CommonWeather.vue';
import EventDataAnalysis from './EventDataAnalysis.vue'
import CommonTitle from '@/components/CommonTitle.vue'
import CommonDateTime from '@/components/CommonDateTime.vue'
import dayjs from 'dayjs'
import { useStore } from 'vuex'
import EventTrendAnalysis from '@/views/Home/EventOverviewDetail/EventOverviewDetailLeft/EventTrendAnalysis.vue'
import EventTop5 from '@/views/Home/EventOverviewDetail/EventOverviewDetailLeft/EventTop5.vue'
import { pxToRem } from '@/utils/rem'
 
// 选中机巢默认日
// const today = dayjs().format('YYYY-MM-DD')
// const timeArr = ref([today, today])
// 选中事件默认为周
const startOfWeek = dayjs().startOf('week').add(1, 'day').format('YYYY-MM-DD')
const endOfWeek = dayjs().endOf('week').add(1, 'day').format('YYYY-MM-DD')
const timeArr = ref([startOfWeek, endOfWeek])
 
const isHideBottomIcon = computed(() => store.state.common.isHideBottomIcon)
 
const store = useStore()
 
const params = ref({
    date_enum: 'CURRENT_WEEK',
    end_date: undefined,
    start_date: undefined,
})
provide('eventOverviewParams', params)
 
// 时间变化
const timeChange = (value, date_enum, type) => {
    params.value = {
        ...params.value,
        date_enum,
    }
    store.commit('setEventTimeType', [type, date_enum]);
}
const goBack = () => {
    store.commit('setHideBottomIcon', true)
    store.commit('setIsEventOverviewDetail', false)
}
</script>
<style scoped lang="scss">
.event-overview-detail-left {
    position: absolute;
    width: 390px;
    height: 870px;
    top: 166px;
    margin-left: 29px;
    background: linear-gradient(
    270deg,
    rgba(31, 62, 122, 0) 0%,
    rgba(31, 62, 122, 0.35) 21%,
    #1f3e7a 100%
  );
  border-radius: 0px 0px 0px 0px;
    color: #e7f5ff;
    display: flex;
    flex-direction: column;
    align-items: center;
 
    .dateTime {
        width: 356px;
        margin: 0 0 8px 0;
    }
}
.do-return {
    position: absolute;
    top: 136px;
    left: 430px;
    cursor: pointer;
 
    img {
        width: 60px;
        height: 33px;
    }
}
</style>