web
7 天以前 6e6127068f03a7fe655f1fd504c488f20683039f
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
<template>
    <div class="home">
        <!-- 虚化盒子 -->
         <div class="blurBox"></div>
        <!-- 顶部菜单占位符 -->
        <div class="home-t"></div>
        <div class="home-content">
            <div class="hc-position">
                <div class="point" v-for="(item, index) in pointData" :key="index" 
                    :style="{left: `${item.left}%`, top: `${item.top}%`, backgroundImage: `url(${getPointImg(item.facilityState)})`}"
                    @click.self="changeShow(index)"
                >
                    <div class="msg-l" v-if="item.showMask && item.boxType === '0'">
                        <div class="msg-item">
                            <span class="name">设备名称:</span>
                            <span class="val">{{ item.facilityName }}</span>
                        </div>
                        <div class="msg-item">
                            <span class="name">设备状态:</span>
                            <span class="val">{{ item.facilityState }}</span>
                        </div>
                        <div class="msg-item">
                            <span class="name">甲烷浓度:</span>
                            <span class="val">{{ item.methaneValue }}%</span>
                        </div>
                        <div class="msg-item">
                            <span class="name">室内温度:</span>
                            <span class="val">{{ item.temperature }}°</span>
                        </div>
                        <div class="msg-item">
                            <span class="name">风机状态:</span>
                            <span class="val">{{ item.facilityFanState }}</span>
                        </div>
                        <div class="msg-item">
                            <span class="name">硫化氢浓度:</span>
                            <span class="val">{{ item.hyrothionValue }}ppm</span>
                        </div>
                    </div>
                    <div class="msg-r" v-if="item.showMask && item.boxType === '1'">
                        <div class="msg-item">
                            <span class="name">设备名称:</span>
                            <span class="val">{{ item.facilityName }}</span>
                        </div>
                        <div class="msg-item">
                            <span class="name">设备状态:</span>
                            <span class="val">{{ item.facilityState }}</span>
                        </div>
                        <div class="msg-item">
                            <span class="name">甲烷浓度:</span>
                            <span class="val">{{ item.methaneValue }}%</span>
                        </div>
                        <div class="msg-item">
                            <span class="name">室内温度:</span>
                            <span class="val">{{ item.temperature }}°</span>
                        </div>
                        <div class="msg-item">
                            <span class="name">风机状态:</span>
                            <span class="val">{{ item.facilityFanState }}</span>
                        </div>
                        <div class="msg-item">
                            <span class="name">硫化氢浓度:</span>
                            <span class="val">{{ item.hyrothionValue }}ppm</span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="hc-info">
                <div class="shebei item">
                    <div class="item-t">辖区内设备数统计</div>
                    <div class="item-c">
                        <el-table 
                            :data="facityData" 
                            :header-cell-style="headerStyle"
                            :cell-style="rowStyle"
                            style="height: 100%;"
                        >
                            <el-table-column prop="pointName" label="辖区位置" align="center" />
                            <el-table-column prop="methaneCount" label="甲烷传感器" align="center" />
                            <el-table-column prop="hyrothionCount" label="硫化氢传感器" min-width="100" align="center" />
                            <el-table-column prop="boxCount" label="终端控制器" align="center" />
                            <el-table-column prop="facilityFanCount" label="风机设备" align="center" />
                            <el-table-column prop="sumCount" label="总设备数" align="center" />
                        </el-table>
                    </div>
                </div>
                <div class="gongdan item">
                    <div class="item-t">未处理工单统计</div>
                    <div class="item-c">
                        <el-table 
                            :data="orderData" 
                            :header-cell-style="headerStyle"
                            :cell-style="rowStyle"
                            style="height: 100%;"
                        >
                            <el-table-column prop="code" label="工单号" align="center" />
                            <el-table-column label="工单类型" align="center">
                                <template #default="scope">
                                    <div v-if="scope.row.type === 1">设备维护</div>
                                    <div v-else>设备维修</div>
                                </template>
                            </el-table-column>
                            <el-table-column prop="createTimeView" label="上报时间" align="center" min-width="100" />
                            <el-table-column prop="createUserName" label="上报人" align="center" />
                            <el-table-column prop="address" label="所属地址" align="center" min-width="120" />
                            <el-table-column label="工单状态" align="center">
                                <template #default="scope">
                                    <div v-if="scope.row.executeState === 100" style="color: #ccc;">未执行</div>
                                    <div v-else style="color: #36fc0e;">已执行</div>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
 
 
<script setup>
    import { onMounted, ref } from 'vue'
    import { getPointFacityList, staticFacity, staticOrder } from '@/api/screen/home'
    import postRun from '@/assets/images/screen/pos-run.png'
    import warnStop from '@/assets/images/screen/pos-stop.png'
    import warnWarn from '@/assets/images/screen/pos-warn.png'
 
    const headerStyle = { 
        "background-color": '#041025 !important'
    }
    const rowStyle = {
        "background-color": '#081C3F !important'
    }
 
    const pointData = ref([])
    const facityData = ref([])
    const orderData = ref([])
 
    // 显示隐藏弹窗
    const changeShow = (index) => {
        pointData.value[index].showMask = !pointData.value[index].showMask
    }
 
    /*
        获取图标
        0停止  1运行  2一级报警  3二级报警 
     */
    const getPointImg = (status) => {
        if(status === '运行中') {
            return postRun
        }else if(status === '一级报警' || status === '二级报警'){
            return warnWarn
        }else{
            return warnStop
        }
    }
 
    const getPointData = () => {
        getPointFacityList().then(res => {
            pointData.value = res.data.map(item => {
                return {
                    ...item, 
                    showMask: false
                }
            })
        })
    }
 
    const getFacity = () => {
        staticFacity().then(res => {
            facityData.value = res.data
        })
    }
 
    const getOrder = () => {
        const searchdata = {
            limit: 100, 
            page: 1
        }
        staticOrder(searchdata).then(res => {
            orderData.value = res.data.list
        })
    }
 
 
    onMounted(() => {
        getPointData()
        getFacity()
        getOrder()
    })
 
</script>
 
 
<style scoped lang="scss">
.home{
    position: absolute;
    left: 0;
    top: 7%;
    width: 100%;
    height: 93%;
    background-image: url('@/assets/images/map-bg.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    z-index: 10;
    .blurBox{ //模糊背景盒子覆盖图片
        position: absolute;
        top: -1rem;
        left: 0;
        width: 100%;
        height: 3%;
        background-color: #000;
        filter: blur(10px);
    }
    &-t{
        height: 1%;
    }
    &-content{
        height: 99%;
        padding: 1rem 1.5rem 0;
        position: relative;
        display: flex;
        .hc-position{
            width: 70%;
            height: 100%;
            position: relative;
            .point{
                position: absolute;
                width: 32px;
                height: 80px;
                background-repeat: no-repeat;
                background-size: 100% 100%;
                .msg-l{
                    width: 250px;
                    height: 160px;
                    position: absolute;
                    left: -245px;
                    top: 0;
                    background-image: url('@/assets/images/screen/msg-box-l.png');
                    background-repeat: no-repeat;
                    background-size: 100% 100%;
                    padding: 0.5rem 1.5rem 0.5rem 0.5rem;
                    display: flex;
                    flex-direction: column;
                    justify-content: space-between;
                }
                .msg-r{
                    width: 250px;
                    height: 160px;
                    position: absolute;
                    left: 30px;
                    top: 0;
                    background-image: url('@/assets/images/screen/msg-box-r.png');
                    background-repeat: no-repeat;
                    background-size: 100% 100%;
                    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
                    display: flex;
                    flex-direction: column;
                    justify-content: space-between;
                }
                .msg-item{
                    width: 100%;
                    color: #fff;
                    overflow: hidden;
                    white-space: nowrap;
                    text-overflow: ellipsis;
                }
            }
        }
        .hc-info{
            width: 30%;
            height: 100%;
            display: flex;
            flex-direction: column;
            gap: 1rem;
            .item{
                width: 100%;
                height: 50%;
                background-image: url("@/assets/images/screen/ct-default.png");
                background-repeat: no-repeat;
                background-size: 100% 100%;
                &-t{
                    color: #fff;
                    height: 3rem;
                    line-height: 3rem;
                    padding-left: 2.5rem;
                }
                &-c{
                    color: #fff;
                    height: calc(100% - 3rem);
                    padding: 1rem 0.5rem;
                }
            }
        }
    }
}
 
:deep(.el-table){
    --el-table-border-color: #000;
    --el-table-bg-color: transparent;
    th{
        font-size: 12px;
        color: #fff;
    }
    tr{
        font-size: 12px;
        color: #fff;
    }
    .el-table__cell{
        border: none;
    }
}
</style>