马宇豪
2023-08-07 7ed4982b8f2a345bfad95a96070143c32142bc61
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<template>
    <div class="home-container">
        <el-row :gutter="15" class="home-card-one mb15">
            <el-col
                :xs="24"
                :sm="12"
                :md="12"
                :lg="4"
                :xl="4"
                v-for="(v, k) in homeOne"
                :key="k"
                :class="{ 'home-media home-media-lg': k > 1, 'home-media-sm': k === 1 }"
            >
                <div class="home-card-item flex" >
                    <el-button @click="renderMenu(v.id)">{{v.name}}</el-button>
                </div>
            </el-col>
        </el-row>
        <el-row :gutter="15" class="home-card-two mb15">
            <el-col :xs="24" :sm="14" :md="14" :lg="16" :xl="16">
                <div class="home-card-item">
                    <div style="height: 100%">
                        <el-button @click="renderMenu('6')">{{'应急管理系统'}}</el-button>
                    </div>
                </div>
            </el-col>
            <el-col :xs="24" :sm="10" :md="10" :lg="8" :xl="8" class="home-media">
                <div class="home-card-item">
                    <div style="height: 100%">
                        <el-button @click="renderMenu('7')">{{'目标责任管理系统'}}</el-button>
                    </div>
                </div>
            </el-col>
        </el-row>
        <el-row :gutter="15" class="home-card-three">
            <el-col :xs="24" :sm="10" :md="10" :lg="8" :xl="8">
                <div class="home-card-item">
                    <el-button @click="renderMenu('8')">{{'事故管理系统'}}</el-button>
                </div>
            </el-col>
            <el-col :xs="24" :sm="14" :md="14" :lg="16" :xl="16" class="home-media">
                <div class="home-card-item">
                    <div style="height: 100%">
                        <el-button @click="renderMenu('9')">{{'设备综合管控系统'}}</el-button>
                    </div>
                </div>
            </el-col>
        </el-row>
    </div>
</template>
 
<script lang="ts">
import { toRefs, reactive, defineComponent, } from 'vue';
import { storeToRefs } from 'pinia';
import { initBackEndControlRoutes } from '/@/router/backEnd';
import {useUserInfo} from "/@/stores/userInfo";
import { Session } from '/@/utils/storage';
let global: any = {
    homeChartOne: null,
    homeChartTwo: null,
    homeCharThree: null,
    dispose: [null, '', undefined],
};
 
interface stateType {
    homeOne: Array <type>
}
interface type {
    id:number,
    name: string
}
export default defineComponent({
    name: 'layoutPage',
    setup() {
        const userInfo = useUserInfo()
        const { userInfos } = storeToRefs(userInfo);
        const state  = reactive<stateType>({
            homeOne:[{id:1,name:'安全基础信息系统'},{id:2,name:'双重预防系统'},{id:3,name:'系统2'},{id:4,name:'系统3'},{id:5,name:'系统4'}],
        });
        // 折线图
        const renderMenu = async (value: string) => {
            Session.set('projectId',value)
            userInfos.value.projectId = value
            await initBackEndControlRoutes();
        };
        return {
            renderMenu,
            ...toRefs(state),
        };
    },
});
</script>
 
<style scoped lang="scss">
$homeNavLengh: 8;
.home-container {
    overflow: hidden;
    .home-card-one,
    .home-card-two,
    .home-card-three {
        .home-card-item {
            width: 100%;
            height: 130px;
            border-radius: 4px;
            transition: all ease 0.3s;
            padding: 20px;
            overflow: hidden;
            background: var(--el-color-white);
            color: var(--el-text-color-primary);
            border: 1px solid var(--next-border-color-light);
            &:hover {
                box-shadow: 0 2px 12px var(--next-color-dark-hover);
                transition: all ease 0.3s;
            }
            &-icon {
                width: 70px;
                height: 70px;
                border-radius: 100%;
                flex-shrink: 1;
                i {
                    color: var(--el-text-color-placeholder);
                }
            }
            &-title {
                font-size: 15px;
                font-weight: bold;
                height: 30px;
            }
        }
    }
    .home-card-one {
        @for $i from 0 through 3 {
            .home-one-animation#{$i} {
                opacity: 0;
                animation-name: error-num;
                animation-duration: 0.5s;
                animation-fill-mode: forwards;
                animation-delay: calc($i/10) + s;
            }
        }
    }
    .home-card-two,
    .home-card-three {
        .home-card-item {
            height: 400px;
            width: 100%;
            overflow: hidden;
            .home-monitor {
                height: 100%;
                .flex-warp-item {
                    width: 25%;
                    height: 111px;
                    display: flex;
                    .flex-warp-item-box {
                        margin: auto;
                        text-align: center;
                        color: var(--el-text-color-primary);
                        display: flex;
                        border-radius: 5px;
                        background: var(--next-bg-color);
                        cursor: pointer;
                        transition: all 0.3s ease;
                        &:hover {
                            background: var(--el-color-primary-light-9);
                            transition: all 0.3s ease;
                        }
                    }
                    @for $i from 0 through $homeNavLengh {
                        .home-animation#{$i} {
                            opacity: 0;
                            animation-name: error-num;
                            animation-duration: 0.5s;
                            animation-fill-mode: forwards;
                            animation-delay: calc($i/10) + s;
                        }
                    }
                }
            }
        }
    }
}
</style>