index.vue 17.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<template>
    <div  style="width: 100vw;height: 100%vh;background: rgb(247, 247, 247);">
        <div class="entrance">
            <div class="entrance-l">
                <div class="entrance-l-t">
                    <div class="ent-l ent">
                        <span>人员出入</span>
                        <div class="ent-div"></div>
                        <div class="ent-ruchang">
                            <div class="ent-ru-in">
                                <div class="ru-in-l">
                                    <img src="../../assets/img/Shape.png" alt="">
                                </div>
                                <div class="ru-in-r">
                                    <span>入场</span>
耿迪迪's avatar
耿迪迪 committed
16
                                    <div style="color: #0fb980;">{{importCount?importCount:0}}</div>
17 18 19 20 21 22 23
                                </div>
                            </div>
                            <div class="ent-ru-in">
                                <div class="ru-in-l">
                                    <img src="../../assets/img/11.png" alt="">
                                </div>
                                <div class="ru-in-r">
yaqizhang's avatar
yaqizhang committed
24
                                    <span>出场</span>
耿迪迪's avatar
耿迪迪 committed
25
                                    <div style="color: #f95f5f;">{{exportCount?exportCount:0}}</div>
26 27 28 29 30 31 32
                                </div>
                            </div>
                            <div class="ent-ru-in">
                                <div class="ru-in-l">
                                    <img src="../../assets/img/user.png" alt="">
                                </div>
                                <div class="ru-in-r">
yaqizhang's avatar
yaqizhang committed
33
                                    <span>在场</span>
耿迪迪's avatar
耿迪迪 committed
34
                                    <div style="color: #3a65ed">{{stayInCount?stayInCount:0}}</div>
yaqizhang's avatar
yaqizhang committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="ent-l ent">
                        <span>车辆出入</span>
                        <div class="ent-div"></div>
                        <div class="ent-ruchang">
                            <div class="ent-ru-in">
                                <div class="ru-in-l">
                                    <img src="../../assets/img/Group 1.png" alt="">
                                </div>
                                <div class="ru-in-r">
yaqizhang's avatar
yaqizhang committed
49
                                    <span>入场</span>
耿迪迪's avatar
耿迪迪 committed
50
                                    <div style="color: #0fb980;">{{importCars}}</div>
yaqizhang's avatar
yaqizhang committed
51 52 53 54 55 56 57
                                </div>
                            </div>
                            <div class="ent-ru-in">
                                <div class="ru-in-l">
                                    <img src="../../assets/img/Gr.png" alt="">
                                </div>
                                <div class="ru-in-r">
yaqizhang's avatar
yaqizhang committed
58
                                    <span>出场</span>
耿迪迪's avatar
耿迪迪 committed
59
                                    <div style="color: #f95f5f;">{{exportCars}}</div>
yaqizhang's avatar
yaqizhang committed
60 61 62 63 64 65 66
                                </div>
                            </div>
                            <div class="ent-ru-in">
                                <div class="ru-in-l">
                                    <img src="../../assets/img/Group.png" alt="">
                                </div>
                                <div class="ru-in-r">
yaqizhang's avatar
yaqizhang committed
67
                                    <span>在场</span>
耿迪迪's avatar
耿迪迪 committed
68
                                    <div style="color: #3a65ed">{{stayInCars}}</div>
69 70 71 72
                                </div>
                            </div>
                        </div>
                    </div>
yaqizhang's avatar
yaqizhang committed
73 74 75 76
                </div>

                <div class="entrance-l-a">
                    <div class="ent-b-car1">
yaqizhang's avatar
yaqizhang committed
77
                        <span>人员入场</span>
yaqizhang's avatar
yaqizhang committed
78 79 80
                        <div class="ent-div"></div>
                        <div class="ent-b-in">
                            <div class="a-in1">
81
                                <el-image style="height: 100%" :src="lastImportData.catchPic ? lastImportData.catchPic : require('@/assets/img/biguser.png')" :preview-src-list="[lastImportData.catchPic]" alt=""/>
yaqizhang's avatar
yaqizhang committed
82 83
                            </div>
                            <div class="a-in2">
耿迪迪's avatar
耿迪迪 committed
84 85 86
                                <div>人员姓名:<span>{{lastImportData?lastImportData.personName:"-"}}</span> </div>
                                <div>员工ID:<span>{{lastImportData?lastImportData.personNum:"-"}}</span> </div>
                                <div>入场时间:<span>{{lastImportData?lastImportData.actionTime:"-"}}</span> </div>
yaqizhang's avatar
yaqizhang committed
87 88 89 90 91 92
                            </div>
                        </div>
                    </div>
                    <div class="ent-b-car1">
                        <div class="a-car-out">
                            <div>人员出场</div>
93
                            <!--<div style="color: #c5c6c7;font-size: 14px;">出入记录</div>-->
yaqizhang's avatar
yaqizhang committed
94 95 96 97
                        </div>
                        <div class="ent-div"></div>
                        <div class="ent-b-in">
                            <div class="a-in1">
98
                                <el-image style="height: 100%" :src="lastExportData.catchPic ? lastExportData.catchPic : require('@/assets/img/biguser.png')" :preview-src-list="[lastExportData.catchPic]" alt=""/>
yaqizhang's avatar
yaqizhang committed
99 100
                            </div>
                            <div class="a-in2">
耿迪迪's avatar
耿迪迪 committed
101 102 103
                                <div>人员姓名:<span>{{lastExportData?lastExportData.personName:"-"}}</span> </div>
                                <div>员工ID:<span>{{lastExportData?lastExportData.personNum:"-"}}</span> </div>
                                <div>出场时间:<span>{{lastExportData?lastExportData.actionTime:"-"}}</span> </div>
yaqizhang's avatar
yaqizhang committed
104 105
                            </div>
                        </div>
106 107
                    </div>
                </div>
yaqizhang's avatar
yaqizhang committed
108

109 110
                <div class="entrance-l-b">
                    <div class="ent-b-car1">
yaqizhang's avatar
yaqizhang committed
111
                        <span>车辆入场</span>
112 113 114
                        <div class="ent-div"></div>
                        <div class="ent-b-in">
                            <img src="../../assets/img/car.png" alt="">
115
                            <div>车辆类型:<span></span>{{lastImportCarData ? lastImportCarData.cName : "-"}}</div>
耿迪迪's avatar
耿迪迪 committed
116 117
                            <div>车辆号牌:<span>{{lastImportCarData?lastImportCarData.plateNumber:"-"}}</span> </div>
                            <div>入场时间:<span>{{lastImportCarData?changeDateFormat(lastImportCarData.inParkTime):"-"}}</span> </div>
118 119 120
                        </div>
                    </div>
                    <div class="ent-b-car1">
yaqizhang's avatar
yaqizhang committed
121 122
                        <div class="a-car-out">
                            <div>车辆出场</div>
123
                            <!--<div style="color: #c5c6c7;font-size: 14px;">出入记录</div>-->
yaqizhang's avatar
yaqizhang committed
124
                        </div>
125 126 127
                        <div class="ent-div"></div>
                        <div class="ent-b-in">
                            <img src="../../assets/img/car.png" alt="">
128
                            <div>车辆类型:<span></span>{{lastExportCarData ? lastExportCarData.cName : "-"}}</div>
耿迪迪's avatar
耿迪迪 committed
129
                            <div>车辆号牌:<span>{{lastExportCarData?lastExportCarData.plateNumber:"-"}}</span> </div>
130
                            <div>出场时间:<span>{{lastExportCarData?changeDateFormat(lastExportCarData.outParkTime):"-"}}</span> </div>
131 132 133 134 135 136 137 138 139 140 141 142
                        </div>
                    </div>
                </div>
            </div>
            <div class="entrance-r">
                <span>园区内车辆</span>
                <div class="ent-div"></div>
                <div class="ent-yuanqu">
                    <el-table
                    :data="tableData"
                    style="width: 100%">
                    <el-table-column
耿迪迪's avatar
耿迪迪 committed
143
                        prop="plateNumber"
144 145 146 147
                        label="车牌号"
                        width="170">
                    </el-table-column>
                    <el-table-column
148
                        prop="cName"
149 150 151
                        label="类型">
                    </el-table-column>
                    <el-table-column
耿迪迪's avatar
耿迪迪 committed
152
                        prop="inParkTime"
yaqizhang's avatar
yaqizhang committed
153
                        label="入场时间"
154 155 156 157 158 159 160 161 162
                        width="200">
                    </el-table-column>
                    </el-table>
                    <!-- <el-pagination
                        layout="prev, pager, next"
                        :total="1000">
                    </el-pagination> -->
                </div>
            </div>
耿迪迪's avatar
耿迪迪 committed
163

164 165
        </div>
    </div>
耿迪迪's avatar
耿迪迪 committed
166

167
  </template>
耿迪迪's avatar
耿迪迪 committed
168

169
  <script>
耿迪迪's avatar
耿迪迪 committed
170
  import { getEntranceGuardPersonInfo,statisticsVehicles } from "@/api/entranceguard/entranceguardPerson"
171
  export default {
yaqizhang's avatar
yaqizhang committed
172
    name: "",
173 174
    data() {
        return {
耿迪迪's avatar
耿迪迪 committed
175
          tableData: [],
耿迪迪's avatar
耿迪迪 committed
176 177 178 179 180 181 182 183 184
          //入场人数
          exportCount:"",
          //出场人数
          importCount:"",
          //在场人数
          stayInCount:"",
          //最新入场信息
          lastImportData:{},
          //最新出场信息
耿迪迪's avatar
耿迪迪 committed
185 186 187 188 189 190 191 192 193 194 195
          lastExportData:{},
          //出场车辆
          exportCars:"",
          //入场车辆数
          importCars:"",
          //在场人数
          stayInCars:"",
          //最新入场信息
          lastImportCarData:{},
          //最新出场信息
          lastExportCarData:{},
196 197
          timer:"",
          aaa:require("@/assets/img/biguser.png")
198
        }
耿迪迪's avatar
耿迪迪 committed
199 200
      },
    created(){
耿迪迪's avatar
耿迪迪 committed
201 202 203 204 205 206 207 208 209 210 211
      let that = this;
      that.initPersonData();
      that.initVehicleData();
      let timer = setInterval(() => {
        that.initPersonData();
        that.initVehicleData();
      }, 3000);
      this.$once('hook:beforeDestroy', () => {
          clearInterval(timer)
          timer = null
      })
耿迪迪's avatar
耿迪迪 committed
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
    },
    methods:{
      initPersonData(){
        getEntranceGuardPersonInfo().then(res =>{
          //入场人数
          this.importCount = res.data.importCount;
          //出场人数
          this.exportCount = res.data.exportCount;
          //在场人数
          this.stayInCount = res.data.stayInCount;
          //最新入场信息
          this.lastImportData = res.data.lastImportData;
          //最新出场信息
          this.lastExportData = res.data.lastExportData;
        })
耿迪迪's avatar
耿迪迪 committed
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248
      },
      initVehicleData(){
        statisticsVehicles().then(res =>{
          //入场车辆数
          this.importCars = res.data.importCount;
          //出场车辆数
          this.exportCars = res.data.exportCount;
          //在场车辆数
          this.stayInCars = res.data.stayInCount;
          //在场车辆
          this.tableData = res.data.stayInCarsData;
          //最新入场信息
          this.lastImportCarData = res.data.lastImportData;
          //最新出场信息
          this.lastExportCarData = res.data.lastExportData;
        })
      },
      changeDateFormat(jsondate) {
        if(!jsondate){
          return;
        }
        return new Date(jsondate).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '');
249
      }
耿迪迪's avatar
耿迪迪 committed
250
    }
251 252 253 254 255
  };
  </script>
  <style lang="scss" scoped>
    .entrance{
        width: 85%;
yaqizhang's avatar
yaqizhang committed
256
        height: calc(100vh - 50px);
257 258 259 260 261 262 263 264 265
        padding: 30px;
        display: flex;
        justify-content: space-between;
        .entrance-l{
            width: 60%;
            height: 100%;
            /* padding: 20px; */
            .entrance-l-t{
                width: 100%;
yaqizhang's avatar
yaqizhang committed
266
                height: 20%;
267 268 269 270 271 272 273 274 275 276 277 278 279
                display: flex;
                justify-content: space-between;
                .ent{
                    width: 48%;
                    height: 100%;
                    border-radius: 7px;
                    background: #fff;
                    padding: 20px;
                }
                .ent-l{
                    .ent-ruchang{
                        width: 100%;
                        height: 100%;
yaqizhang's avatar
yaqizhang committed
280 281 282
                        padding-top: 10px;
                        display: flex;
                        justify-content: space-between;
耿迪迪's avatar
耿迪迪 committed
283

284 285 286 287 288 289
                        .ent-ru-in{
                            width: 100%;
                            height: 30%;
                            display: flex;
                            margin-top: 4%;
                            .ru-in-l{
yaqizhang's avatar
yaqizhang committed
290 291
                                width: 50px;
                                height: 50px;
292 293
                                border-radius: 50px;
                                background: rgb(247, 247, 247);
yaqizhang's avatar
yaqizhang committed
294
                                line-height: 55px;
295
                                text-align: center;
yaqizhang's avatar
yaqizhang committed
296
                                margin-top: 10px;
297 298 299 300 301 302
                                img{
                                    width: 35%;
                                }
                            }
                            .ru-in-r{
                                padding: 7px 0 0 10px;
yaqizhang's avatar
yaqizhang committed
303 304 305
                                span{
                                    font-size: 15px;
                                }
306
                                div{
yaqizhang's avatar
yaqizhang committed
307
                                    font-size: 25px;
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337
                                    margin-top: 7px;
                                }
                            }
                        }
                    }
                }
                .ent-r{
                    .ent-r-car{
                        width: 100%;
                        height: 95%;
                        display: flex;
                        justify-content: space-around;
                        .r-car-in{
                            width: 25%;
                            height: 60%;
                            margin-top: 20%;
                            background-color: rgb(247, 247, 247);
                            border-radius: 15px;
                            text-align: center;
                            img{
                                margin-top: 40%;
                            }
                            p{
                                margin-top: 40%;
                                font-size: 30px;
                            }
                        }
                    }
                }
            }
yaqizhang's avatar
yaqizhang committed
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387
            .entrance-l-a{
                width: 100%;
                height: 27%;
                margin-top: 2%;
                border-radius: 7px;
                background: #fff;
                display: flex;
                justify-content: space-between;
                .ent-b-car1{
                    width: 47%;
                    height: 90%;
                    padding: 20px;
                    .a-car-out{
                        width: 100%;
                        display: flex;
                        justify-content: space-between;
                    }
                    .ent-b-in{
                        padding: 7% 20px 20px 20px;
                        display: flex;
                        justify-content: space-between;
                        width: 100%;
                        height: 100%;
                        .a-in1{
                            width: 30%;
                            height: 100%;
                            img{
                                width: 100%;
                            }
                        }
                        .a-in2{
                            width: 65%;
                            height: 90%;
                            display: flex;
                            flex-direction:column;
                            align-content: flex-end;
                            div{
                                font-size: 15px;
                                span{
                                    color: #a39e9e;
                                }
                            }
                            div:nth-child(2){
                                margin-top: 35px;
                            }
                            div:last-child{
                                margin-top: 35px;
                            }

                        }
耿迪迪's avatar
耿迪迪 committed
388

yaqizhang's avatar
yaqizhang committed
389 390 391
                    }
                }
            }
392 393 394 395 396 397 398 399 400 401 402 403
            .entrance-l-b{
                width: 100%;
                height: 49%;
                margin-top: 2%;
                border-radius: 7px;
                background: #fff;
                display: flex;
                justify-content: space-between;
                .ent-b-car1{
                    width: 47%;
                    height: 90%;
                    padding: 20px;
yaqizhang's avatar
yaqizhang committed
404 405 406 407 408
                    .a-car-out{
                        width: 100%;
                        display: flex;
                        justify-content: space-between;
                    }
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437
                    .ent-b-in{
                        padding: 30px 20px;
                        img{
                            width: 100%;
                        }
                        div{
                            margin-top: 20px;
                            span{
                                color: #a39e9e;
                            }
                        }
                    }
                }
            }
        }
        .entrance-r{
            width: 38%;
            height: 100%;
            background: #fff;
            border-radius: 7px;
            padding: 20px;
            .ent-yuanqu{
                width: 100%;
                height: 95%;
                padding: 10px;
                text-align: center;
            }
        }
    }
耿迪迪's avatar
耿迪迪 committed
438

439 440 441
.ent-div{
   width: 100%;
   height: 1px;
耿迪迪's avatar
耿迪迪 committed
442 443
   background-color: rgb(205, 207, 209);
   margin-top: 7px;
444 445 446 447 448 449 450
}
::v-deep .el-table th > .cell {
    text-align: center;
}
::v-deep .el-table tr td .cell {
    text-align: center;
}
耿迪迪's avatar
耿迪迪 committed
451
  </style>