From 31dcd2ac79af82cc149f34fbfb6ffd3d4a91a3cd Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: Tue, 25 Feb 2025 13:46:58 +0800
Subject: [PATCH] 修改名称
---
src/views/riskWarningSys/warningBigScreen/index.vue | 490 ++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 414 insertions(+), 76 deletions(-)
diff --git a/src/views/riskWarningSys/warningBigScreen/index.vue b/src/views/riskWarningSys/warningBigScreen/index.vue
index d8744f2..ffcb8aa 100644
--- a/src/views/riskWarningSys/warningBigScreen/index.vue
+++ b/src/views/riskWarningSys/warningBigScreen/index.vue
@@ -1,5 +1,25 @@
<template>
<div id="container" class="dark">
+ <div class="warn-dialog" :class="dialogShow">
+ <div>预警消息</div>
+ <p>企业8月份总体安全生产预警指数SPI风险值高于预警阈值,可能存在未处理隐患,请注意查阅相关风险因素,采取风险防控措施。</p>
+ <span @click="dialogShow = 'hide'">关闭</span>
+ </div>
+ <div class="info-panel" :class="dialogHide" @click="openDialog">
+ <div class="info-tit">
+ <div>
+ <el-icon><Bell /></el-icon>
+ <div style="margin-left: 10px">消息预警</div>
+ </div>
+ <div @click.stop="dialogHide = 'hide'">X</div>
+ </div>
+ <div class="info-desc">
+ 企业8月份总体安全生产预警指数SPI风险值高于预警阈值。
+ </div>
+ <div class="info-num">
+ 1
+ </div>
+ </div>
<div class="header-content">
<div class="logo">
<img v-if="screenTheme.isDark" src="../../../assets/warningScreen/logo_dark.png" alt="" />
@@ -10,10 +30,10 @@
<!-- <img src="themeStyle.skinIcon" class="qiehuan" @click="changeTheme" />-->
<span class="datetime">{{currentTime}}</span>
<div class="btns">
- <div class="themeBtn" @click="changeTheme()">
- <img v-if="screenTheme.isDark" src="../../../assets/warningScreen/skin.png"/>
- <img v-else src="../../../assets/warningScreen/skin-light.png"/>
- </div>
+<!-- <div class="themeBtn" @click="changeTheme()">-->
+<!-- <img v-if="screenTheme.isDark" src="../../../assets/warningScreen/skin.png"/>-->
+<!-- <img v-else src="../../../assets/warningScreen/skin-light.png"/>-->
+<!-- </div>-->
<div class="fullBtn" @click="onScreenfullClick">
<div class="toFull">
<i class="iconfont" :title="isScreenfull ? $t('message.user.title6') : $t('message.user.title5')" :class="!isScreenfull ? 'icon-fullscreen' : 'icon-tuichuquanping'"></i>
@@ -44,31 +64,40 @@
<div class="left-mid">
<dv-border-box-13 :backgroundColor="boxBg" :color="boxColor" class="box-bg"></dv-border-box-13>
<div class="part-tit">
- <span>| 应急演练次数</span>
+ <span>| 智能巡检超期未巡检任务</span>
<!-- <img @click="jumpPage(2)" src="../../../assets/warningScreen/small-full.png">-->
<Switch style="width: 1.2rem;height: 1.2rem;cursor: pointer" @click="jumpPage(2)"/>
</div>
<div class="chart-box">
- <span class="train-tip">距上次演练结束 5 天</span>
- <training class="train-chart" :size="1"></training>
+ <training :size="1" :theme="screenTheme.isDark"></training>
</div>
</div>
<div class="left-bottom">
<dv-border-box-13 :backgroundColor="boxBg" :color="boxColor" class="box-bg"></dv-border-box-13>
<div class="part-tit">
- <span>| 隐患等级数量分布</span>
+ <span>| 隐患趋势</span>
<Switch style="width: 1.2rem;height: 1.2rem;cursor: pointer" @click="jumpPage(3)"/>
</div>
<div class="chart-box">
- <risk :size="1" :theme="screenTheme.isDark"></risk>
+ <risk :size="1" :theme="screenTheme.isDark" :dep="departList"></risk>
</div>
</div>
</div>
<div class="main-middle">
<div class="mid-top">
<dv-border-box-11 title="SPI数据分析" :backgroundColor="boxBg" :color="boxBigColor" class="box-bg"></dv-border-box-11>
- <div class="part-tit" style="position: absolute;top: 8%;padding: 0 4%">
- <div></div>
+ <div class="part-tit" style="position: absolute;top: 10%;padding: 0 4%;align-items: flex-start;z-index: 10001">
+ <div class="spiChart">
+<!-- <el-cascader-->
+<!-- class="spiSe"-->
+<!-- :teleported="false"-->
+<!-- v-model="depValue"-->
+<!-- :options="departList"-->
+<!-- :props="depProps"-->
+<!-- :show-all-levels="false"-->
+<!-- @change="depChange"-->
+<!-- />-->
+ </div>
<Switch style="width: 1.2rem;height: 1.2rem;cursor: pointer" @click="jumpPage(4)"/>
</div>
<div class="chart-box" style="top: 60px;height: calc(100% - 70px)">
@@ -131,7 +160,7 @@
<Switch style="width: 1.2rem;height: 1.2rem;cursor: pointer" @click="jumpPage(9)"/>
</div>
<div class="chart-box">
- <monitor></monitor>
+ <monitor :size="1" ref="monRef" :theme="screenTheme.isDark"></monitor>
</div>
</div>
<div class="right-bottom">
@@ -151,7 +180,17 @@
<script lang="ts">
import screenfull from 'screenfull';
- import { toRefs, reactive, ref, onMounted, defineComponent, defineAsyncComponent, nextTick, onUnmounted } from 'vue';
+ import {
+ toRefs,
+ reactive,
+ ref,
+ onMounted,
+ defineComponent,
+ defineAsyncComponent,
+ nextTick,
+ onUnmounted,
+ onBeforeUnmount
+ } from 'vue';
import { ElTable } from 'element-plus';
import { FormInstance, FormRules, ElMessage } from 'element-plus';
import { safetyRiskEventApi } from '/@/api/doublePreventSystem/safetyRiskEvent/index.ts';
@@ -161,6 +200,9 @@
import '/@/theme/bigScreen.css'
import {useScreenTheme} from "/@/stores/screenTheme"
import {storeToRefs} from "pinia";
+ import {teamManageApi} from "/@/api/systemManage/basicDateManage/personShiftManage/teamManage";
+ import {NextLoading} from "/@/utils/loading";
+ import {videoApi} from "/@/api/systemManage/video";
// 定义接口来定义对象的类型
interface stateType {
@@ -169,8 +211,13 @@
boxBigColor: Array<string>;
isScreenfull: boolean;
currentTime: string;
- spiValue: number;
- spiOptions: Array<any>
+ depValue: number;
+ dialogShow: string;
+ dialogHide: string;
+ depProps: object;
+ departList: Array<any>;
+ lastTrain: number | null;
+ timer: any|null
}
export default defineComponent({
name: 'warningScreen',
@@ -196,65 +243,57 @@
}
const state = reactive<stateType>({
boxBg: 'rgba(8, 109, 209, 0.2)',
+ depValue: 1,
boxColor: [],
boxBigColor: [],
+ lastTrain: null,
isScreenfull: false,
currentTime: '',
- spiValue: 0,
- spiOptions: [
- {
- value: 0,
- label: '公司级别SPI'
- },
- {
- value: 1,
- label: 'A事业部SPI',
- children: [
- {
- value: 11,
- label: 'A车间SPI'
- },
- {
- value: 12,
- label: 'B车间SPI'
- },
- {
- value: 13,
- label: 'C车间SPI'
- }
- ]
- },
- {
- value: 2,
- label: 'B事业部SPI',
- children: [
- {
- value: 21,
- label: 'D车间SPI'
- },
- {
- value: 22,
- label: 'E车间SPI'
- },
- {
- value: 23,
- label: 'F车间SPI'
- }
- ]
- }
- ]
+ dialogShow: 'hide',
+ dialogHide: 'hide',
+ depProps: {
+ expandTrigger: 'hover',
+ checkStrictly: true,
+ value: 'depId',
+ label: 'depName',
+ emitPath: false
+ },
+ departList: [],
+ timer: null
});
-
+ const monRef = ref()
// 页面载入时执行方法
onMounted(() => {
- getTime()
+ NextLoading.done();
+ state.depValue = screenTheme.value.depId
+ getTime();
+ getAllDepartment();
+ state.timer = setInterval(()=>{
+ getTime()
+ },1000)
getTheme()
});
const getTime =()=>{
- setInterval(() => {
- state.currentTime = new Date().toLocaleString();
- }, 1000);
+ state.currentTime = new Date().toLocaleString();
+ }
+
+ // 获取部门列表
+ const getAllDepartment = async () => {
+ let res = await teamManageApi().getAllDepartment();
+ if (res.data.code === '200') {
+ state.departList = JSON.parse(JSON.stringify(res.data.data))
+ } else {
+ ElMessage({
+ type: 'warning',
+ message: res.data.msg
+ });
+ }
+ }
+
+ const depChange = (value)=>{
+ state.depValue = value
+ screenThemes.setDepId(value)
}
const changeTheme = () =>{
@@ -303,6 +342,18 @@
});
};
+ const openDialog = () => {
+ if(state.dialogShow == 'hide'){
+ state.dialogShow = 'showup'
+ }else{
+ state.dialogShow = 'hide'
+ }
+ }
+
+ const closeInfo = ()=>{
+ state.dialogHide = 'hide'
+ };
+
const jumpPage = (num) =>{
router.push({
path: 'screenPage',
@@ -314,9 +365,15 @@
// 返回上一页
const goBack = () => {
- window.history.go(-1);
+ // window.history.go(-1);
+ router.push({
+ path: 'newMenu'
+ });
};
+ onBeforeUnmount(() =>{
+ clearInterval(state.timer)
+ })
// 隐患状态列表
// const getDeviceRecord = async () => {
// const data = { pageSize: state.pageSize, pageIndex: state.pageIndex};
@@ -335,8 +392,12 @@
router,
props,
screenTheme,
+ monRef,
+ openDialog,
+ closeInfo,
changeTheme,
onScreenfullClick,
+ depChange,
jumpPage,
goBack,
...toRefs(state)
@@ -347,6 +408,17 @@
<style scoped lang="scss">
$homeNavLengh: 8;
+ .hide{
+ display: none;
+ }
+ #container{
+ width: 100%;
+ height: 100%;
+ }
+ .showup{
+ display: block;
+ }
+
.dark {
width: 100%;
height: 100%;
@@ -356,6 +428,97 @@
background: url('../../../assets/warningScreen/riskprocast.jpg') no-repeat center;
background-size: 100% 100%;
color: #11FEEE;
+
+ .warn-dialog{
+ position: absolute;
+ z-index: 999999;
+ top: 25%;
+ left: 50%;
+ width: 50%;
+ height: 50%;
+ transform: translateX(-50%);
+ border-radius: 8px;
+ transition: .3s;
+ box-shadow: 0 15px 30px rgba(0,0,0,.2);
+ border: 1px solid rgba(17,254,238,.4);
+ padding: 1.5rem;
+ background: rgba(0,16,32,.8);
+
+ div{
+ font-size: 1.5rem;
+ text-align: center;
+ }
+
+ p{
+ margin-top: 20px;
+ font-size: 1.125rem;
+ line-height: 28px;
+ text-align: left
+ }
+
+ span{
+ position: inherit;
+ right: 20px;
+ top: 20px;
+ font-size: 1rem;
+ cursor: pointer;
+ }
+ }
+
+ .info-panel{
+ position: absolute;
+ width: 20%;
+ right: 50px;
+ bottom: 50px;
+ z-index: 9999999;
+ font-size: 1rem;
+ padding: 0 10px;
+ border-radius: 4px;
+ cursor: pointer;
+ box-shadow: 0 15px 30px rgba(0,0,0,.2);
+ border: 1px solid rgba(17,254,238,.4);
+ background: rgba(0,16,32,.8);
+
+ .info-tit{
+ display: flex;
+ align-items: center;
+ padding: 10px;
+ border-bottom: 1px solid rgba(17,254,238,.4);
+ justify-content: space-between;
+
+ &>div{
+ display: flex;
+ align-items: center;
+
+ img{
+ width: 18px;
+ height: 18px;
+ margin-right: 10px;
+ }
+ }
+ }
+
+ .info-desc{
+ padding: 15px 10px;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ }
+ .info-num{
+ position: inherit;
+ width: 24px;
+ height: 24px;
+ line-height: 24px;
+ text-align: center;
+ left: -12px;
+ top: -12px;
+ color: #fff;
+ z-index: 999999999;
+ border-radius: 50%;
+ border: 1px solid #ff0000;
+ background: #ff0000;
+ }
+ }
.header-content {
width: 100%;
@@ -485,6 +648,52 @@
align-items: center;
z-index: 9999;
+ .spiChart{
+ width: 25% !important;
+
+ ::v-deep(.el-cascader){
+ width: 100% !important;
+ }
+ ::v-deep(.el-popper){
+ background-color: rgba(10,31,92,1);
+ border: 1px solid rgba(17,254,238,.4);
+ color: #11FEEE;
+ .el-cascader-node__label{
+ color: #11FEEE;
+ }
+ .el-icon{
+ color: #11FEEE;
+ }
+ .el-cascader-node{
+ &:hover{
+ background: #0049af;
+ }
+ }
+ }
+ ::v-deep(.el-popper__arrow){
+ &::before{
+ background-color: rgba(10,31,92,.6) !important;
+ border: 1px solid rgba(17,254,238,.4);
+ }
+ }
+ ::v-deep(.el-input__wrapper){
+ width: 20%;
+ box-shadow: none;
+ border: 1px solid rgba(17,254,238,.2);
+ background: rgba(10,31,92,.6) !important;
+ height: 2.5rem;
+ color: #11FEEE;
+
+ input{
+ font-size: 1.25rem;
+ color: #11FEEE;
+ }
+ .el-icon{
+ color: #11FEEE;
+ }
+ }
+ }
+
span{
font-size: 1.25rem;
font-weight: bolder;
@@ -505,7 +714,7 @@
right: 0;
width: 100%;
height: calc(100% - 50px);
- z-index: 99999;
+ z-index: 10000;
.train-tip{
display: block;
font-size: 0.8rem;
@@ -513,11 +722,6 @@
margin-left: 5%;
color: #fff;
height: 1rem;
- }
-
- .train-chart{
- width: 100%;
- height: calc(100% - 1rem);
}
}
}
@@ -575,6 +779,98 @@
background: url('../../../assets/warningScreen/riskprocast-light.jpg') no-repeat center;
background-size: 100% 100%;
color: #000;
+
+ .warn-dialog{
+ position: absolute;
+ z-index: 999999;
+ top: 25%;
+ left: 50%;
+ width: 50%;
+ height: 50%;
+ transform: translateX(-50%);
+ border-radius: 8px;
+ transition: .3s;
+ box-shadow: 0 15px 30px rgba(0,0,0,.2);
+ border: 1px solid #ccc;
+ padding: 1.5rem;
+ background: #fff;
+
+ div{
+ font-size: 1.5rem;
+ text-align: center;
+ }
+
+ p{
+ margin-top: 20px;
+ font-size: 1.125rem;
+ line-height: 28px;
+ text-align: left
+ }
+
+ span{
+ position: inherit;
+ right: 20px;
+ top: 20px;
+ font-size: 1rem;
+ cursor: pointer;
+ }
+ }
+
+ .info-panel{
+ position: absolute;
+ width: 20%;
+ right: 50px;
+ bottom: 50px;
+ z-index: 9999999;
+ font-size: 1rem;
+ color: #333;
+ padding: 0 10px;
+ border-radius: 4px;
+ cursor: pointer;
+ box-shadow: 0 15px 30px rgba(0,0,0,.2);
+ border: 1px solid #ccc;
+ background: #fff;
+
+ .info-tit{
+ display: flex;
+ align-items: center;
+ padding: 10px;
+ border-bottom: 1px solid #ccc;
+ justify-content: space-between;
+
+ &>div{
+ display: flex;
+ align-items: center;
+
+ img{
+ width: 18px;
+ height: 18px;
+ margin-right: 10px;
+ }
+ }
+ }
+
+ .info-desc{
+ padding: 15px 10px;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ }
+ .info-num{
+ position: inherit;
+ width: 24px;
+ height: 24px;
+ line-height: 24px;
+ text-align: center;
+ left: -12px;
+ top: -12px;
+ color: #fff;
+ z-index: 999999999;
+ border-radius: 50%;
+ border: 1px solid #ff0000;
+ background: #ff0000;
+ }
+ }
.header-content {
width: 100%;
@@ -703,6 +999,53 @@
justify-content: space-between;
align-items: center;
z-index: 9999;
+
+ .spiChart{
+ width: 25% !important;
+
+ ::v-deep(.el-cascader){
+ width: 100% !important;
+ }
+ ::v-deep(.el-popper){
+ background-color: #fff;
+ border: 1px solid #ccc;
+ color: #000;
+ .el-cascader-node__label{
+ color: #000;
+ }
+ .el-icon{
+ color: #000;
+ }
+ .el-cascader-node{
+ &:hover{
+ background: #ccc;
+ }
+ }
+ }
+ ::v-deep(.el-popper__arrow){
+ &::before{
+ background-color: #fff !important;
+ border: 1px solid #ccc;
+ }
+ }
+ ::v-deep(.el-input__wrapper){
+ width: 20%;
+ box-shadow: none;
+ border: 1px solid #ccc;
+ background: #fff !important;
+ height: 2.5rem;
+ color: #000;
+
+ input{
+ font-size: 1.25rem;
+ color: #000;
+ }
+ .el-icon{
+ color: #000;
+ }
+ }
+ }
+
span{
font-size: 1.25rem;
font-weight: bolder;
@@ -723,7 +1066,7 @@
right: 0;
width: 100%;
height: calc(100% - 50px);
- z-index: 99999;
+ z-index: 10000;
.train-tip{
display: block;
font-size: 0.8rem;
@@ -731,11 +1074,6 @@
margin-left: 5%;
color: #333;
height: 1rem;
- }
-
- .train-chart{
- width: 100%;
- height: calc(100% - 1rem);
}
}
}
--
Gitblit v1.9.2