Commit 8e6b4d6a authored by qjeslks's avatar qjeslks

7.29.4

parent 451d697e
......@@ -89,6 +89,9 @@ onDeactivated(() => {
hidePlay();
})
const route = useRoute();
console.log(route.query.id)
//声明公用变量
var initCount = 0;
......
......@@ -574,6 +574,99 @@ export default defineComponent({
// );
}
//报警弹窗
const userId = ref();
const roleIds = ref();
const title = ref();
const msg = ref();
const id = ref();
const counttitle = ref();
const countmsg = ref();
const countid = ref();
//获取用户信息
function getuser(){
var user = store.getters.getUserInfo();
if(user){
enterpriseId.value = user.enterpriseId;
userId.value = user.userId;
roleIds.value = user.roleId;
}
}
const AlarmInfo = ref({});
function getinfo(){
AlarmInfo.value = {
"enterpriseId": enterpriseId.value,
"UserId": userId.value,
"RoleId": roleIds.value
};
}
function alarm(){
http.post("/api/alarm/GetAlarmMsg", AlarmInfo.value).then((result) => {
if(result.data !== null){
if(result.data !== null && title.value !== result.data[0].title || msg.value !== result.data[0].msg){
title.value = result.data[0].title;
msg.value = result.data[0].msg;
id.value = result.data[0].id;
ElNotification({
title: title.value,
message: msg.value,
position: 'bottom-right',
type: 'warning',
duration: 0,
onClick() {
activeTable.value = '/Video'
localStorage.setItem("activeTab", '/Video');
//路由跳转
this.$router.push({ //如果要是用 name 传参 就直接 携带一个 query 对象中包含参数
path: "/Video",
query:{
id:id.value
}
});
},
})
}
}
});
}
function countalarm(){
http.post("/api/alarm/GetAlarmMsg", AlarmInfo.value).then((result) => {
if(result.data !== null){
if(result.data !== null && counttitle.value !== result.data[1].title || countmsg.value !== result.data[1].msg){
counttitle.value = result.data[1].title;
countmsg.value = result.data[1].msg;
countid.value = result.data[1].id;
ElNotification({
title: counttitle.value,
message: countmsg.value,
position: 'bottom-right',
type: 'warning',
duration: 0,
onClick() {
activeTable.value = '/Video'
localStorage.setItem("activeTab", '/Video');
//路由跳转
this.$router.push({ //如果要是用 name 传参 就直接 携带一个 query 对象中包含参数
path: "/Video",
query:{
id:id.value
}
});
},
})
}
}
});
}
setInterval(() => {
getuser()
getinfo();
alarm();
countalarm();
}, 10 * 1000); // 每分钟执行一次
return {
menuWidth,
mainHeight,
......@@ -639,93 +732,6 @@ export default defineComponent({
},
});
//报警弹窗
const userId = ref();
const roleId = ref();
const title = ref();
const msg = ref();
const id = ref();
const counttitle = ref();
const countmsg = ref();
const countid = ref();
const route = useRoute();
//获取用户信息
function getuser(){
var user = store.getters.getUserInfo();
if(user){
enterpriseId.value = user.enterpriseId;
userId.value = user.userId;
roleId.value = user.roleId;
}
}
const AlarmInfo = ref({});
function getinfo(){
AlarmInfo.value = {
"enterpriseId": enterpriseId.value,
"UserId": userId.value,
"RoleId": roleId.value
};
}
function alarm(){
http.post("/api/alarm/GetAlarmMsg", AlarmInfo.value).then((result) => {
if(result.data !== null){
if(result.data !== null && title.value !== result.data[0].title || msg.value !== result.data[0].msg){
title.value = result.data[0].title;
msg.value = result.data[0].msg;
id.value = result.data[0].id;
ElNotification({
title: title.value,
message: msg.value,
position: 'bottom-right',
type: 'warning',
duration: 0,
// onClick() {
// console.log(111111)
// const routePath = '/Home/Video'; // 要导航到的路由路径
// const routeQuery = { id: id.value }; // 如果需要,可以传递参数
// // 序列化查询参数
// const queryString = new URLSearchParams(routeQuery).toString();
// // 打开新窗口并导航到指定路由
// window.open(
// `${routePath}?${queryString}`,
// '_blank',
// 'toolbar=yes,location=yes,status=yes,menubar=yes,width=600,height=400,scrollbars=yes'
// );
// },
})
}
}
});
}
const router = useRouter()
function countalarm(){
http.post("/api/alarm/GetAlarmMsg", AlarmInfo.value).then((result) => {
if(result.data !== null){
if(result.data !== null && counttitle.value !== result.data[1].title || countmsg.value !== result.data[1].msg){
counttitle.value = result.data[1].title;
countmsg.value = result.data[1].msg;
countid.value = result.data[1].id;
ElNotification({
title: counttitle.value,
message: countmsg.value,
position: 'bottom-right',
type: 'warning',
duration: 0,
// onClick() {
// router.push({ path: '/GisHome'})
// },
})
}
}
});
}
setInterval(() => {
getuser()
getinfo();
alarm();
countalarm();
}, 10 * 1000); // 每分钟执行一次
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment