|
|
|
@ -7,7 +7,7 @@
|
|
|
|
|
|
|
|
|
|
<div class="right-menu">
|
|
|
|
|
<template v-if="device!=='mobile'">
|
|
|
|
|
<search id="header-search" class="right-menu-item" />
|
|
|
|
|
<search id="header-search" class="right-menu-item"/>
|
|
|
|
|
|
|
|
|
|
<!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">
|
|
|
|
|
<ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
|
|
|
|
@ -18,30 +18,43 @@
|
|
|
|
|
</el-tooltip>-->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
|
|
|
|
<screenfull id="screenfull" class="right-menu-item hover-effect"/>
|
|
|
|
|
|
|
|
|
|
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
|
|
|
|
<size-select id="size-select" class="right-menu-item hover-effect" />
|
|
|
|
|
<size-select id="size-select" class="right-menu-item hover-effect"/>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
|
|
|
|
|
<div class="avatar-wrapper">
|
|
|
|
|
<i class="el-icon-bell " style="font-size:22px "><el-badge :value="Number(hdMsgCount)+Number(msgCount)" class="item"/></i>
|
|
|
|
|
<i class="el-icon-caret-bottom" />
|
|
|
|
|
<i class="el-icon-bell " style="font-size:22px ">
|
|
|
|
|
<el-badge
|
|
|
|
|
:value="Number(hdMsgCount)+Number(msgCount)+Number(msgMaterial1)+Number(msgMaterial2)+Number(msgMaterial3)+Number(msgMaterial4)"
|
|
|
|
|
class="item"/>
|
|
|
|
|
</i>
|
|
|
|
|
<i class="el-icon-caret-bottom"/>
|
|
|
|
|
</div>
|
|
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
|
|
<el-dropdown-item @click.native="goHD(hdMsgCount)">
|
|
|
|
|
<span>隐患消息 <el-badge class="mark" :value="hdMsgCount" /></span>
|
|
|
|
|
<!--<router-link :to="{ path: '/ehsHiddenDangerMenu/ehsHiddenDanger', query: {overTime: '10' }}">
|
|
|
|
|
隐患消息
|
|
|
|
|
<el-badge class="mark" :value="hdMsgCount" />
|
|
|
|
|
</router-link>-->
|
|
|
|
|
<el-dropdown-item v-show='this.$auth.hasRole("store")' @click.native="goMaterial(msgMaterial1,1)">
|
|
|
|
|
<span>通用应急救援装备 <el-badge class="mark" :value="msgMaterial1"/></span>
|
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
<el-dropdown-item v-show='this.$auth.hasRole("store")' @click.native="goMaterial(msgMaterial2,2)">
|
|
|
|
|
<span>防汛抗旱装备 <el-badge class="mark" :value="msgMaterial2"/></span>
|
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
<el-dropdown-item v-show='this.$auth.hasRole("store")' @click.native="goMaterial(msgMaterial3,3)">
|
|
|
|
|
<span>森林防灭火装备 <el-badge class="mark" :value="msgMaterial3"/></span>
|
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
<el-dropdown-item v-show='this.$auth.hasRole("store")' @click.native="goMaterial(msgMaterial3,4)">
|
|
|
|
|
<span>救灾物资 <el-badge class="mark" :value="msgMaterial4"/></span>
|
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
<el-dropdown-item v-show='this.$auth.hasRole("HDDept") || this.$auth.hasRole("HDAdmin")'
|
|
|
|
|
@click.native="goHD(hdMsgCount)">
|
|
|
|
|
<span>隐患消息 <el-badge class="mark" :value="hdMsgCount"/></span>
|
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
<el-dropdown-item @click.native="goMsg(msgCount)">
|
|
|
|
|
<span>消息通知</span>
|
|
|
|
|
<el-badge class="mark" :value="msgCount" />
|
|
|
|
|
<el-badge class="mark" :value="msgCount"/>
|
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
|
|
|
|
|
</el-dropdown-menu>
|
|
|
|
@ -50,7 +63,7 @@
|
|
|
|
|
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
|
|
|
|
|
<div class="avatar-wrapper">
|
|
|
|
|
<img :src="avatar" class="user-avatar">
|
|
|
|
|
<i class="el-icon-caret-bottom" />
|
|
|
|
|
<i class="el-icon-caret-bottom"/>
|
|
|
|
|
</div>
|
|
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
|
|
<router-link to="/user/profile">
|
|
|
|
@ -69,7 +82,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { mapGetters } from 'vuex'
|
|
|
|
|
import {mapGetters} from 'vuex'
|
|
|
|
|
import Breadcrumb from '@/components/Breadcrumb'
|
|
|
|
|
import TopNav from '@/components/TopNav'
|
|
|
|
|
import Hamburger from '@/components/Hamburger'
|
|
|
|
@ -78,14 +91,19 @@
|
|
|
|
|
import Search from '@/components/HeaderSearch'
|
|
|
|
|
import RuoYiGit from '@/components/RuoYi/Git'
|
|
|
|
|
import RuoYiDoc from '@/components/RuoYi/Doc'
|
|
|
|
|
import { getUnread} from "@/api/ehs/ehsMyMessage";
|
|
|
|
|
import {setReadByHD, updateEhsMyMessage, getSendQuantity, getUnread, getNoticeMsg} from "@/api/ehs/ehsMyMessage";
|
|
|
|
|
import {getOverTimeId} from "@/api/ehs/ehsHiddenDanger";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
hdMsgCount: 0,
|
|
|
|
|
msgCount: 0,
|
|
|
|
|
timer:null
|
|
|
|
|
timer: null,
|
|
|
|
|
msgMaterial1: 0,
|
|
|
|
|
msgMaterial2: 0,
|
|
|
|
|
msgMaterial3: 0,
|
|
|
|
|
msgMaterial4: 0,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
components: {
|
|
|
|
@ -122,29 +140,55 @@
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
goHD(msgC){
|
|
|
|
|
if(msgC!=0){
|
|
|
|
|
goMaterial(msgC, classFast) {
|
|
|
|
|
if (msgC != 0) {
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path: '/ehsHiddenDangerMenu/ehsHiddenDanger', query: {overTime: "10" }
|
|
|
|
|
path: '/ehsMaterial/ehsMaterial' + classFast, query: {"classFirst": classFast,"isSendQuantity":1}
|
|
|
|
|
});
|
|
|
|
|
/* setMaterial().then(response => {
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path: '/ehsMaterial/ehsMaterial' + classFast, query: {"classFirst": classFast}
|
|
|
|
|
});
|
|
|
|
|
});*/
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
goMsg(msgC){
|
|
|
|
|
if(msgC!=0){
|
|
|
|
|
goHD(msgC) {
|
|
|
|
|
if (msgC != 0) {
|
|
|
|
|
setReadByHD().then(response => {
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path: '/ehsNoticeMessage/ehsNoticeMessageDept', query: {noticeType: "0" }
|
|
|
|
|
path: '/ehsHiddenDangerMenu/ehsHiddenDanger', query: {overTime: "10"}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
goMsg(msgC) {
|
|
|
|
|
if (msgC != 0) {
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path: '/ehsNoticeMessage/ehsNoticeMessageDept', query: {noticeType: "0"}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getUnread() {
|
|
|
|
|
console.log("定时任务");
|
|
|
|
|
getUnread().then(response => {
|
|
|
|
|
this.hdMsgCount = response.msgHD;
|
|
|
|
|
this.msgCount = response.msg;
|
|
|
|
|
//各种消息提醒在这里提醒,
|
|
|
|
|
//有新增的进行消息提醒。只提醒一次,
|
|
|
|
|
//隐患消息提醒
|
|
|
|
|
this.getHdCount();
|
|
|
|
|
this.getMaterialMsg();
|
|
|
|
|
this.getNoticeMsg();
|
|
|
|
|
/* getUnread().then(response => {
|
|
|
|
|
//this.hdMsgCount = this.getCount(response.msgHD );
|
|
|
|
|
//this.msgCount = this.getCount(response.msg );
|
|
|
|
|
this.getHdCount();
|
|
|
|
|
this.getMaterialMsg();
|
|
|
|
|
this.getNoticeMsg();
|
|
|
|
|
console.log(response);
|
|
|
|
|
});
|
|
|
|
|
});*/
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
getCount(msgC) {
|
|
|
|
|
return (msgC == null|| msgC =="")? 0 : (msgC.split(",")).length;
|
|
|
|
|
},
|
|
|
|
|
toggleSideBar() {
|
|
|
|
|
this.$store.dispatch('app/toggleSideBar')
|
|
|
|
|
},
|
|
|
|
@ -157,14 +201,160 @@
|
|
|
|
|
this.$store.dispatch('LogOut').then(() => {
|
|
|
|
|
location.href = '/index';
|
|
|
|
|
})
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getHdCount() {
|
|
|
|
|
if (this.$auth.hasRoleOr(["HDDept", "HDAdmin"])) {
|
|
|
|
|
getOverTimeId().then(response => {
|
|
|
|
|
console.log(response);
|
|
|
|
|
this.hdMsgCount = this.getCount(response.data.myMessageKey)
|
|
|
|
|
if (response.code == 200) {
|
|
|
|
|
if (response.data.myMessageDesc != "" && response.data.myMessageDesc != null) {
|
|
|
|
|
const h = this.$createElement;
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
|
message: h(
|
|
|
|
|
"div",
|
|
|
|
|
{style: "padding-right:20px display: flex;align-items: center;color:#00B42A"},
|
|
|
|
|
[
|
|
|
|
|
h("span", null, response.data.myMessageDesc),
|
|
|
|
|
h(
|
|
|
|
|
"span",
|
|
|
|
|
{
|
|
|
|
|
style: "position:absolute;right: 15px;cursor:pointer",
|
|
|
|
|
on: {
|
|
|
|
|
click: () => {
|
|
|
|
|
this.goHD((response.data.myMessageKey.split(",")).length);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
"查看"
|
|
|
|
|
),
|
|
|
|
|
]
|
|
|
|
|
),
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
/* if(response.data.myMessageDesc!="" && response.data.myMessageDesc!=null){
|
|
|
|
|
this.$confirm(response.data.myMessageDesc , '隐患信息', {
|
|
|
|
|
confirmButtonText: '查看',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
updateEhsMyMessage({"myMessageId":response.data.myMessageId,"myMessageState":"Y"}).then(response => {
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path: '/ehsHiddenDangerMenu/ehsHiddenDanger', query: {overTime: "10" }
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
/!* this.$message({
|
|
|
|
|
type: 'info',
|
|
|
|
|
message: '已取消删除'
|
|
|
|
|
});*!/
|
|
|
|
|
});
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
console.log("不是隐患管理员!");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getMaterialMsg() {
|
|
|
|
|
if (this.$auth.hasRoleOr(["store"])) {
|
|
|
|
|
for (var i = 1; i <= 4; i++) {
|
|
|
|
|
getSendQuantity(i).then(response => {
|
|
|
|
|
console.log(response);
|
|
|
|
|
if (response.code == 200) {
|
|
|
|
|
var tt = response.data.myMessageType.substring(1, 2);
|
|
|
|
|
if (tt == 1) {
|
|
|
|
|
this.msgMaterial1 = this.getCount(response.data.myMessageKey);
|
|
|
|
|
} else if (tt == 2) {
|
|
|
|
|
this.msgMaterial2 = this.getCount(response.data.myMessageKey);
|
|
|
|
|
} else if (tt == 3) {
|
|
|
|
|
this.msgMaterial3 = this.getCount(response.data.myMessageKey);
|
|
|
|
|
} else if (tt == 4) {
|
|
|
|
|
this.msgMaterial4 = this.getCount(response.data.myMessageKey);
|
|
|
|
|
}
|
|
|
|
|
if (response.data.myMessageDesc != "" && response.data.myMessageDesc != null) {
|
|
|
|
|
const h = this.$createElement;
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
|
message: h(
|
|
|
|
|
"div",
|
|
|
|
|
{style: "padding-right:20px display: flex;align-items: center;color:#00B42A"},
|
|
|
|
|
[
|
|
|
|
|
h("span", null, response.data.myMessageDesc),
|
|
|
|
|
h(
|
|
|
|
|
"span",
|
|
|
|
|
{
|
|
|
|
|
style: "position:absolute;right: 15px;cursor:pointer",
|
|
|
|
|
on: {
|
|
|
|
|
click: () => {
|
|
|
|
|
this.goMaterial(response.data.myMessageId, response.data.myMessageType.substring(1, 2),this.getCount((response.data.myMessageKey.split(",")).length));
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
"查看"
|
|
|
|
|
),
|
|
|
|
|
]
|
|
|
|
|
),
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
console.log("不是仓库管理员!");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getNoticeMsg() {
|
|
|
|
|
getNoticeMsg( ).then(response => {
|
|
|
|
|
console.log(response);
|
|
|
|
|
if (response.code == 200) {
|
|
|
|
|
this.msgCount = this.getCount(response.data.myMessageKey);
|
|
|
|
|
if (response.data.myMessageDesc != "" && response.data.myMessageDesc != null) {
|
|
|
|
|
const h = this.$createElement;
|
|
|
|
|
this.$message({
|
|
|
|
|
type: "success",
|
|
|
|
|
message: h(
|
|
|
|
|
"div",
|
|
|
|
|
{style: "padding-right:20px display: flex;align-items: center;color:#00B42A"},
|
|
|
|
|
[
|
|
|
|
|
h("span", null, response.data.myMessageDesc),
|
|
|
|
|
h(
|
|
|
|
|
"span",
|
|
|
|
|
{
|
|
|
|
|
style: "position:absolute;right: 15px;cursor:pointer",
|
|
|
|
|
on: {
|
|
|
|
|
click: () => {
|
|
|
|
|
this.goMsg((response.data.myMessageKey.split(",")).length);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
"查看"
|
|
|
|
|
),
|
|
|
|
|
]
|
|
|
|
|
),
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/* goMaterial(myMessageId, classFast) {
|
|
|
|
|
setMaterial(myMessageId).then(response => {
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path: '/ehsMaterial/ehsMaterial' + classFast, query: {"classFirst": classFast}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},*/
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
console.log("启动定时器");
|
|
|
|
|
this.getUnread();
|
|
|
|
|
//一秒后执行一次get方法,打印1
|
|
|
|
|
this.timer = setInterval(this.getUnread, 10000);//十秒执行一次
|
|
|
|
|
this.timer = setInterval(this.getUnread, 30000);//十秒执行一次
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//销毁定时器,不然会一直存在
|
|
|
|
@ -180,7 +370,7 @@
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
position: relative;
|
|
|
|
|
background: #fff;
|
|
|
|
|
box-shadow: 0 1px 4px rgba(0,21,41,.08);
|
|
|
|
|
box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
|
|
|
|
|
|
|
|
|
|
.hamburger-container {
|
|
|
|
|
line-height: 46px;
|
|
|
|
@ -188,7 +378,7 @@
|
|
|
|
|
float: left;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: background .3s;
|
|
|
|
|
-webkit-tap-highlight-color:transparent;
|
|
|
|
|
-webkit-tap-highlight-color: transparent;
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
background: rgba(0, 0, 0, .025)
|
|
|
|
@ -261,6 +451,7 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item {
|
|
|
|
|
margin-top: -20px;
|
|
|
|
|
|
|
|
|
|