|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div style="position: fixed; z-index: 999; right: 120px; top: 20px; color: #fff">
|
|
|
+ <div style="position: fixed; z-index: 999999; right: 120px; top: 20px; color: #fff">
|
|
|
<div class="btn" @click="showWarningBroad">
|
|
|
<!-- <div>语音播报</div>
|
|
|
<a-badge :count="10">
|
|
@@ -10,11 +10,11 @@
|
|
|
<WarningOutlined style="font-size: 22px; color: #fff" />
|
|
|
</a-badge>
|
|
|
</div>
|
|
|
- <div v-if="isShowWarningBroad" class="broadcast">
|
|
|
+ <div v-if="isShowWarningBroad" class="broadcast" ref="VoiceBroadcastRef" id="VoiceBroadcast">
|
|
|
<div class="title">
|
|
|
<div class="message-title">预警通知</div>
|
|
|
<div class="badge-box">
|
|
|
- <SoundOutlined :class="{ 'no-play': !isBroad }" style="font-size: 16px; color: #fff" @click="handleBroad" />
|
|
|
+ <SoundOutlined :class="{ 'no-play': !isBroad }" style="font-size: 20px; color: #fff" @click="handleBroad" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="broadcast-context">
|
|
@@ -33,7 +33,7 @@
|
|
|
:style="{ color: item['isok'] == 0 ? '#f73210' : '#eee', fontWeight: item['isok'] == 0 ? '600' : '500' }"
|
|
|
>
|
|
|
<div>{{ item['createTime'] }}</div>
|
|
|
- <div>{{ item['devicekind_dictText'] }}</div>
|
|
|
+ <div>{{ item['devicename'] }}</div>
|
|
|
<div>{{ item['wardescrip'] || item['nwartype_dictText'] }}</div>
|
|
|
<div>{{ item['isok'] ? '已解决' : '未解决' }}</div>
|
|
|
</div>
|
|
@@ -47,7 +47,7 @@
|
|
|
import { Tooltip, Badge } from 'ant-design-vue';
|
|
|
import { SoundOutlined, BellOutlined, WarningOutlined } from '@ant-design/icons-vue';
|
|
|
import Icon from '/@/components/Icon';
|
|
|
- import { defineComponent, ref, unref, onMounted } from 'vue';
|
|
|
+ import { defineComponent, ref, unref, onMounted, nextTick } from 'vue';
|
|
|
import { defHttp } from '/@/utils/http/axios';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import { connectWebSocket, onWebSocket } from '/@/hooks/web/useWebSocket';
|
|
@@ -55,6 +55,7 @@
|
|
|
import { useUserStore } from '/@/store/modules/user';
|
|
|
import { useGlobSetting } from '/@/hooks/setting';
|
|
|
import SpeakVoice from './notify/speakVoice';
|
|
|
+ import { useDrag } from '@/hooks/event/useDrag';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'VoiceBroadcast',
|
|
@@ -71,10 +72,15 @@
|
|
|
const isBroad = ref(true);
|
|
|
const isWarningDot = ref(false);
|
|
|
const broadcastList = ref([]);
|
|
|
+
|
|
|
function showWarningBroad() {
|
|
|
isShowWarningBroad.value = !isShowWarningBroad.value;
|
|
|
if (isShowWarningBroad.value) {
|
|
|
toSelectList(0);
|
|
|
+ nextTick(() => {
|
|
|
+ const dom = document.getElementById('VoiceBroadcast');
|
|
|
+ if (dom) useDrag(dom);
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -84,7 +90,7 @@
|
|
|
|
|
|
async function toSelectList(key) {
|
|
|
activeKey.value = key;
|
|
|
- const res = await list({ pageSize: 20, devicetype: '', isok: key == 1 ? 0 : key == 2 ? 1 : null });
|
|
|
+ const res = await list({ pageSize: 20, devicetype: '', isok: key == 1 ? 0 : key == 2 ? 1 : null, sort: 'createTime' });
|
|
|
broadcastList.value = res['records'];
|
|
|
// const isHasWarning = broadcastList.value.findIndex((item) => !item['isok']);
|
|
|
// isWarningDot.value = isHasWarning > -1 ? true : false;
|
|
@@ -145,14 +151,23 @@
|
|
|
}
|
|
|
|
|
|
.no-play {
|
|
|
- background: linear-gradient(
|
|
|
- to bottom left,
|
|
|
- transparent 0%,
|
|
|
- transparent calc(50% - 1px),
|
|
|
- #000000 50%,
|
|
|
- transparent calc(50% + 1px),
|
|
|
- transparent 100%
|
|
|
- );
|
|
|
+ position: relative;
|
|
|
+ &::after {
|
|
|
+ position: absolute;
|
|
|
+ width: 70%;
|
|
|
+ height: 100%;
|
|
|
+ content: '';
|
|
|
+ left: 15%;
|
|
|
+ top: 0;
|
|
|
+ background: linear-gradient(
|
|
|
+ to bottom left,
|
|
|
+ transparent 0%,
|
|
|
+ transparent calc(50% - 1px),
|
|
|
+ #ffffff 50%,
|
|
|
+ transparent calc(50% + 1px),
|
|
|
+ transparent 100%
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.broadcast {
|
|
@@ -248,11 +263,11 @@
|
|
|
justify-content: flex-start;
|
|
|
|
|
|
&:nth-child(1) {
|
|
|
- width: 40%;
|
|
|
+ width: 44%;
|
|
|
}
|
|
|
|
|
|
&:nth-child(2) {
|
|
|
- width: 20%;
|
|
|
+ width: 40%;
|
|
|
}
|
|
|
|
|
|
&:nth-child(3) {
|