Browse Source

完善告警弹窗

wangqin
hui 7 months ago
parent
commit
c8082d6e12
  1. 10
      ruoyi-ui/src/App.vue
  2. 29
      ruoyi-ui/src/assets/iconfont/demo_index.html
  3. 10
      ruoyi-ui/src/assets/iconfont/iconfont.css
  4. 2
      ruoyi-ui/src/assets/iconfont/iconfont.js
  5. 7
      ruoyi-ui/src/assets/iconfont/iconfont.json
  6. BIN
      ruoyi-ui/src/assets/iconfont/iconfont.ttf
  7. BIN
      ruoyi-ui/src/assets/iconfont/iconfont.woff
  8. BIN
      ruoyi-ui/src/assets/iconfont/iconfont.woff2
  9. 2
      ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/EarlyWarning.vue
  10. 305
      ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue
  11. 212
      ruoyi-ui/src/views/JiHeExpressway/index.vue
  12. 470
      ruoyi-ui/src/views/JiHeExpressway/utils/enum.js
  13. 56
      ruoyi-ui/src/views/websocket.vue

10
ruoyi-ui/src/App.vue

@ -9,13 +9,15 @@
<template>
<div id="app">
<router-view />
<websocket />
<websocket @newEvent="onNewEvent"/>
<WarningNotify ref="notifyShow" />
<!-- <websocket_phone /> -->
</div>
</template>
<script>
import websocket from "@/views/websocket";
import WarningNotify from "@screen/components/WarningNotify.vue";
// import websocket_phone from "@/views/websocket_phone";
export default {
name: "App",
@ -29,6 +31,7 @@ export default {
},
components: {
websocket,
WarningNotify
// websocket_phone
},
watch: {
@ -49,6 +52,11 @@ export default {
},
};
},
methods:{
onNewEvent(para){
this.$refs["notifyShow"].showNotify(para);
}
}
};
</script>

29
ruoyi-ui/src/assets/iconfont/demo_index.html

@ -54,6 +54,12 @@
<div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe7ef;</span>
<div class="name">汽车</div>
<div class="code-name">&amp;#xe7ef;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe602;</span>
<div class="name">行人</div>
@ -114,9 +120,9 @@
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.woff2?t=1715061600935') format('woff2'),
url('iconfont.woff?t=1715061600935') format('woff'),
url('iconfont.ttf?t=1715061600935') format('truetype');
src: url('iconfont.woff2?t=1715072390653') format('woff2'),
url('iconfont.woff?t=1715072390653') format('woff'),
url('iconfont.ttf?t=1715072390653') format('truetype');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@ -142,6 +148,15 @@
<div class="content font-class">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-car"></span>
<div class="name">
汽车
</div>
<div class="code-name">.icon-car
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-pedestrian"></span>
<div class="name">
@ -232,6 +247,14 @@
<div class="content symbol">
<ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-car"></use>
</svg>
<div class="name">汽车</div>
<div class="code-name">#icon-car</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-pedestrian"></use>

10
ruoyi-ui/src/assets/iconfont/iconfont.css

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 4466169 */
src: url('iconfont.woff2?t=1715061600935') format('woff2'),
url('iconfont.woff?t=1715061600935') format('woff'),
url('iconfont.ttf?t=1715061600935') format('truetype');
src: url('iconfont.woff2?t=1715072390653') format('woff2'),
url('iconfont.woff?t=1715072390653') format('woff'),
url('iconfont.ttf?t=1715072390653') format('truetype');
}
.iconfont {
@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-car:before {
content: "\e7ef";
}
.icon-pedestrian:before {
content: "\e602";
}

2
ruoyi-ui/src/assets/iconfont/iconfont.js

File diff suppressed because one or more lines are too long

7
ruoyi-ui/src/assets/iconfont/iconfont.json

@ -5,6 +5,13 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "7791021",
"name": "汽车",
"font_class": "car",
"unicode": "e7ef",
"unicode_decimal": 59375
},
{
"icon_id": "28559895",
"name": "行人",

BIN
ruoyi-ui/src/assets/iconfont/iconfont.ttf

Binary file not shown.

BIN
ruoyi-ui/src/assets/iconfont/iconfont.woff

Binary file not shown.

BIN
ruoyi-ui/src/assets/iconfont/iconfont.woff2

Binary file not shown.

2
ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/EarlyWarning.vue

@ -34,6 +34,6 @@ export default {
<style lang="scss" scoped>
.early_warning{
&:hover{ cursor: pointer;}
}
</style>

305
ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue

@ -0,0 +1,305 @@
<template>
<div>
</div>
</template>
<script>
import moment from "moment";
export default {
name: "WarningNotify",
props: {
},
provide() {
return {
}
},
data() {
return {
notifications: [],
notifyIndex: 0,
}
},
computed: {
},
watch: {
},
methods: {
//
closeNotify(para) {
// let type = para.type;
this.notifications[para.index].close();
},
showNotify(para){
let _this = this;
let obj = {
content: "这里是从websocket收到的告警内容,最少一行,最多三行,多了就隐藏掉,这是演示的三行的效果。",
time: moment().format("yyyy-MM-DD hh:mm"),
type: ["pedestrian", "car", "pedestrian"][_this.notifyIndex % 3],
level: ["info", "danger"][_this.notifyIndex % 2],
duration: 0
}
_this.notifications[_this.notifyIndex] = _this.$notify({
title: '',
dangerouslyUseHTMLString: true,
duration: obj.duration,
customClass: 'notify_whole',
offset: 50,
showClose: false,
message: _this.$createElement(
"div",
{ class: "notify_box " + obj.level },
[
_this.$createElement(
"div",
{ class: 'nofify_head' },
[
_this.$createElement(
"p",
{ class: "title" },
[
_this.$createElement(
"i",
{ class: 'icon el-icon-warning' }
), _this.$createElement(
"span",
{ class: 'text' },
"告警"
)
]
)
, _this.$createElement(
"button",
{
class: 'btn_close el-icon-close',
on: {
click: _this.closeNotify.bind(_this, { type: obj.type, index: _this.notifyIndex }),
},
}
)
]
),
_this.$createElement(
"div",
{ class: 'nofify_content' },
[
_this.$createElement(
"span",
{ class: 'type_icon' },
[
_this.$createElement(
"i",
{ class: 'iconfont icon-' + obj.type }
)
]
),
_this.$createElement(
"div",
{ class: 'info' },
[
_this.$createElement(
"p",
{ class: 'content' },
obj.content
)
,
_this.$createElement(
"p",
{ class: 'time' },
obj.time
)
]
),
]
),
]
),
});
_this.notifyIndex++;
}
},
mounted() {
},
};
</script>
<style lang="scss">
.notify_whole {
padding: 0;
width: 420px !important;
// height: 120px !important;
margin-top: 40px !important;
background: none;
border: none;
border-radius: 0;
}
.el-notification__group {
width: 100%;
height: 100%;
margin: 0;
}
.el-notification__content {
width: 100%;
height: 100%;
margin: 0;
}
.notify_box {
width: 100%;
height: 100%;
border: 1px solid;
.nofify_head {
display: flex;
justify-content: space-between;
height: 44px;
align-items: center;
margin: 0 12px;
.title {
display: flex;
justify-content: flex-start;
align-items: center;
.icon {
font-size: 24px;
}
.text {
font-size: 17px;
margin-left: 4px;
font-weight: bold;
}
}
.btn_close {
background: none;
border: none;
cursor: pointer;
font-size: 20px;
text-align: center;
}
}
.nofify_content {
display: flex;
align-items: center;
padding: 20px 20px 16px 0;
.type_icon {
width: 80px;
display: flex;
align-items: center;
justify-content: center;
.iconfont {
font-size: 48px;
}
}
.info {
flex: 1;
.content {
color: #FFF;
font-size: 16px;
word-wrap: break-word;
white-space: wrap;
}
.time {
color: #FFF;
font-size: 14px;
opacity: 0.5;
text-align: right;
margin-top: 8px;
}
}
}
}
$infoColor: #3DE8FF;
$dangerColor: #FF5F5F;
.notify_box.info {
background-image: linear-gradient(180deg, rgba(14, 69, 92, 0.9) 0%, rgba(20, 89, 119, 0.9) 100%);
border-image: linear-gradient(180deg, rgba(78, 174, 204, 1), rgba(78, 174, 204, 0)) 2 2;
.nofify_head {
border-bottom: 1px solid #FFFFFF33;
.title {
.icon {
color: $infoColor;
}
.text {
color: $infoColor;
}
}
.btn_close {
color: $infoColor;
}
}
.nofify_content {
.type_icon {
.iconfont {
color: $infoColor;
}
}
.info {
.content {}
.time {}
}
}
}
.notify_box.danger {
background-image: linear-gradient(180deg, rgba(30, 0, 0, 0.9) 0%, rgba(111, 0, 0, 0.9) 100%);
border-image: linear-gradient(180deg, rgba(237, 147, 128, 1), rgba(239, 146, 157, 0)) 2 2;
.nofify_head {
border-bottom: 1px solid #FFFFFF33;
.title {
.icon {
color: $dangerColor;
}
.text {
color: $dangerColor;
}
}
.btn_close {
color: $dangerColor;
}
}
.nofify_content {
.type_icon {
.iconfont {
color: $dangerColor;
}
}
.info {
.content {}
.time {}
}
}
}
</style>

212
ruoyi-ui/src/views/JiHeExpressway/index.vue

@ -15,7 +15,7 @@ import HeaderMenu from "./components/HeaderMenu/index.vue";
import Adaptation from "./components/Adaptation.vue";
import getBoardBaseData from '@/common/getBoardBaseData'
import { mapGetters } from "vuex";
import moment from "moment";
export default {
name: "ji_ze_gao_su",
components: {
@ -25,8 +25,7 @@ export default {
},
data() {
return {
notifications: [],
notifyIndex:0,
isShowContent:false,
headerHeight:100,
header: {
@ -61,101 +60,6 @@ export default {
},
mounted(){
let _this = this;
document.onkeydown = function(e){
if(e.code == 'Space'){
let obj = {
content: "一个沙雕横穿马路导致堵车,他还不承认,不知道怎么办,请求指导,在线等。",
time:moment().format("yyyy-MM-DD hh:mm"),
type : "3",
level: ["info", "danger"][_this.notifyIndex%2]
}
_this.notifications[_this.notifyIndex] = _this.$notify({
title: '',
dangerouslyUseHTMLString: true,
duration: 0,
customClass: 'notify_whole',
offset: 50,
showClose: false,
message: _this.$createElement(
"div",
{class : "notify_box " + obj.level},
[
_this.$createElement(
"div",
{ class: 'nofify_head' },
[
_this.$createElement(
"p",
{ class:"title"},
[
_this.$createElement(
"i",
{ class: 'icon el-icon-warning' }
), _this.$createElement(
"span",
{ class: 'text' },
"告警"
)
]
)
, _this.$createElement(
"button",
{
class: 'btn_close el-icon-close',
on: {
click: _this.closeNotify.bind(_this, { type: obj.type, index: _this.notifyIndex }),
},
}
)
]
),
_this.$createElement(
"div",
{ class:'nofify_content'},
[
_this.$createElement(
"span",
{ class: 'type_icon' },
[
_this.$createElement(
"i",
{ class: 'iconfont icon-pedestrian' }
)
]
),
_this.$createElement(
"span",
{ class: 'info' },
[
_this.$createElement(
"span",
{ class: 'content' },
obj.content
)
,
_this.$createElement(
"div",
{class: 'time'},
obj.time
)
]
),
]
),
]
),
});
_this.notifyIndex ++;
}
}
// this.$store.commit("menu/resetRecent");
getBoardBaseData().then(res => {
this.isShowContent = true;
@ -170,19 +74,7 @@ export default {
this.calcHeaderScale();
},
methods: {
//
closeNotify(para) {
let type = para.type;
console.log("hahah");
console.log(type);
if (type === '2') {
console.log("自动关闭,流程。。");
}
if (type === '3') {
console.log("手动确认,流程。。");
}
this.notifications[para.index].close();
},
calcHeaderScale(){
let winW = window.innerWidth;
this.header.scale = winW / this.header.originW;
@ -247,101 +139,3 @@ export default {
}
}
</style>
<style lang="scss">
.notify_whole {
padding: 0;
width: 420px !important;
// height: 120px !important;
margin-top: 50px !important;
background: none;
border: none; border-radius: 0;
}
.el-notification__group {
width: 100%; height: 100%; margin: 0;
}
.el-notification__content {
width: 100%;
height: 100%;
margin: 0;
}
.notify_box{ width: 100%; height: 100%; background-image: linear-gradient(180deg, rgba(14, 69, 92, 0.9) 0%, rgba(20, 89, 119, 0.9) 100%);
border: 1px solid; border-image: linear-gradient(180deg, rgba(78, 174, 204, 1), rgba(78, 174, 204, 0)) 2 2;
.nofify_head{ display: flex; justify-content: space-between; height: 44px; align-items: center; margin: 0 12px;
.title{ display: flex; justify-content: flex-start; align-items: center;
.icon { font-size: 24px;}
.text{ font-size: 17px; margin-left: 4px; font-weight: bold;}
}
.btn_close{ background: none; border: none;
cursor: pointer;
font-size: 20px;
text-align: center;
}
}
.nofify_content{
display: flex; align-items: center; padding: 20px 20px 16px 0;
.type_icon{ width: 80px; display: flex; align-items: center; justify-content: center;
.iconfont{ font-size: 48px;}
}
.info{ flex: 1;
.content{ color:#FFF; font-size: 16px; word-wrap: break-word; white-space: wrap;}
.time{ color: #FFF; font-size: 14px; opacity: 0.5; text-align: right; margin-top: 8px;}
}
}
}
$infoColor: #3DE8FF;
$dangerColor: #FF5F5F;
.notify_box.info {
background-image: linear-gradient(180deg, rgba(14, 69, 92, 0.9) 0%, rgba(20, 89, 119, 0.9) 100%);
border-image: linear-gradient(180deg, rgba(78, 174, 204, 1), rgba(78, 174, 204, 0)) 2 2;
.nofify_head { border-bottom: 1px solid #FFFFFF33;
.title {
.icon { color: $infoColor;}
.text {color: $infoColor; }
}
.btn_close {color: $infoColor;}
}
.nofify_content {
.type_icon {
.iconfont{color: $infoColor;}
}
.info {
.content {}
.time {}
}
}
}
.notify_box.danger {
background-image: linear-gradient(180deg, rgba(30, 0, 0, 0.9) 0%, rgba(111, 0, 0, 0.9) 100%);
border-image: linear-gradient(180deg, rgba(237, 147, 128, 1), rgba(239, 146, 157, 0)) 2 2;
.nofify_head { border-bottom: 1px solid #FFFFFF33;
.title {
.icon { color: $dangerColor;}
.text {color: $dangerColor; }
}
.btn_close {color: $dangerColor;}
}
.nofify_content {
.type_icon {
.iconfont{color: $dangerColor;}
}
.info {
.content {}
.time {}
}
}
}
</style>

470
ruoyi-ui/src/views/JiHeExpressway/utils/enum.js

@ -4,7 +4,15 @@
* icon: 展示的图标
*/
// 相机的状态
function arrayToDic(arr) {
let obj = {};
arr.map((item) => {
obj[item.value] = item;
});
return obj;
}
// 相机状态
export const CameraStatusEnum = {
"-1": {
color: "",
@ -60,7 +68,7 @@ export const CameraDirectionEnumList = Object.keys(CameraDirectionEnum).map(
}
);
// 设备状态
// 设备状态
export const DeviceTypeEnum = {
0: {
text: "异常",
@ -94,7 +102,8 @@ export const CameraControlTypeEnum = {
},
};
//交通事件类型
//交通事件主类
export const EventTopics = {
交通事故: 1,
车辆故障: 2,
@ -109,79 +118,73 @@ export const EventTopics = {
其他事件: 11,
};
//路网设施类型
// 1-收费站
// 2-桥梁
// 3-互通立交
// 4-枢纽立交
// 5-隧道
// 6-服务区',
// 7-停车区,
// 8-清障驻点
// 9-边坡
export const RoadNFTopics = {
收费站: 1,
桥梁: 2,
枢纽立交: 4,
服务区: 6,
停车区: 7,
清障驻点: 8,
边坡: 9,
};
// 事件类型 eventType
export const EventType = {
0: {
text: "待确认",
},
1: {
text: "处理中",
},
2: {
text: "已完成",
},
};
// 信息来源 warningSource
export const InfoWarningSource = {
1: {
text: "视频AI",
},
2: {
text: "雷达识别",
},
3: {
text: "锥桶",
},
4: {
text: "护栏碰撞",
},
5: {
text: "扫码报警",
},
6: {
text: "非机预警",
},
// 7: {
// text: "气象监测器",
// },
};
//交通事件主类 {1: "交通事故",... }
export const trafficType = Object.keys(EventTopics).reduce((prev, now) => {
return { ...prev, [EventTopics[now]]: now };
}, {});
export const warningSourceMapping = {
1: "视频AI",
2: "雷达识别",
3: "锥桶",
4: "护栏碰撞",
5: "扫码报警",
6: "非机预警",
// 7: '气象监测器'
//交通事件主类 [{value:"", label:""},...]
export const trafficKV = Object.keys(trafficType).map((key) => {
return {
value: key * 1,
label: trafficType[key],
};
});
export const warningStateMapping = {
1: "上报",
2: "已完成",
3: "已终止",
4: "自动结束",
//交通事件子类
export const EventSubclass = {
"1-1": "追尾",
"1-2": "侧翻",
"1-3": "撞护栏",
"1-4": "自燃",
"1-5": "其他事故",
"2-1": "车辆故障",
"3-1": "主线封闭限行",
"3-2": "收费站封闭和限行",
"3-3": "立交封闭和限行",
"3-4": "服务区封闭和限行",
"4-1": "道路拥堵",
"4-2": "立交拥堵",
"4-3": "收费站拥堵",
"4-4": "服务区拥堵",
"5-1": "行人",
"5-2": "非机动车",
"5-3": "摩托车",
"5-4": "其他",
"6-1": "烟雾",
"6-2": "倒伏树木",
"6-3": "撒落物",
"6-4": "动物",
"6-5": "其他",
"7-1": "道路养护施工",
"7-2": "收费站养护施工",
"7-3": "服务区养护施工",
"7-4": "枢纽立交匝道养护施工",
"7-5": "地方道路养护施工",
"7-6": "道路工程建设施工",
"7-7": "收费站工程建设施工",
"7-8": "服务区工程建设施工",
"7-9": "枢纽立交匝道工程建设施工",
"7-10": "地方道路工程建设施工",
"8-1": "封闭、暂停营业",
"8-2": "重要设施停用",
"8-3": "服务区其他异常",
"9-1": "摄像机",
"9-2": "护栏",
"9-3": "隔离栅",
"9-4": "情报板",
"9-5": "防炫板",
"9-6": "其他",
"10-1": "雨",
"10-2": "雪",
"10-3": "雾",
"10-4": "大风",
"10-5": "低温寒潮",
"10-6": "路面积雪",
"10-7": "路面结冰",
"10-8": "路面积水",
"10-9": "其他",
"11-1": "其他事件",
};
// 感知事件主类 warningType
@ -200,80 +203,7 @@ export const WarningType = {
99: "其他事件",
};
function arrayToDic(arr) {
let obj = {};
arr.map((item) => {
obj[item.value] = item;
});
return obj;
}
//设备Options
export const deviceTypeOptions = [
{
value: 1,
label: "摄像机",
},
{
value: 2,
label: "可变信息标志",
timingControl: true,
},
{
value: 3,
label: "气象监测器",
},
{
value: 4,
label: "出口诱导灯",
},
{
value: 5,
label: "路段语音广播",
timingControl: true,
},
{
value: 6,
label: "护栏碰撞",
},
{
value: 7,
label: "毫米波雷达",
},
{
value: 8,
label: "合流区预警",
},
{
value: 9,
label: "智慧锥桶",
},
{
value: 10,
label: "激光疲劳唤醒",
timingControl: true,
},
{
value: 11,
label: "一类交通量调查站",
},
{
value: 12,
label: "行车诱导",
timingControl: true,
},
{
value: 13,
label: "智能设备箱",
// timingControl: true,
},
{
value: 14,
label: "光线在线监测",
},
];
export const deviceTypeDic = arrayToDic(deviceTypeOptions);
//感知事件主类 [{ value: "", label: "" }, ...]
export const WarningTypeList = Object.keys(WarningType).map((key) => {
return {
value: key * 1,
@ -281,26 +211,7 @@ export const WarningTypeList = Object.keys(WarningType).map((key) => {
};
});
// 交通事件主类 {1: "交通事故" } 格式
export const trafficType = Object.keys(EventTopics).reduce((prev, now) => {
return { ...prev, [EventTopics[now]]: now };
}, {});
//激光疲劳唤醒工作模式
export const awakerWorkModeDic = {
0: "激光关闭",
1: "常亮模式",
2: "间隔100ms闪烁模式",
3: "间隔200ms闪烁模式",
4: "间隔500ms闪烁模式",
5: "2次闪烁模式",
6: "SOS模式",
7: "自定义模式1",
8: "自定义模式2",
9: "自定义模式3",
};
// 感知事件主类的子类(上方) warningSubclass
// 感知事件子类
export const WarningSubclass = {
1: {
"1-1": "拥堵",
@ -377,14 +288,6 @@ export const WarningSubclass = {
},
};
//========= 交通事件 主类(key vulue) =========
export const trafficKV = Object.keys(trafficType).map((key) => {
return {
value: key * 1,
label: trafficType[key],
};
});
//交通事件、感知事件 子类(key vulue)预案使用
export const eventSubClassMap = {
1: {
@ -855,6 +758,162 @@ export const eventSubClassMap = {
},
};
//路网设施类型
// 1-收费站
// 2-桥梁
// 3-互通立交
// 4-枢纽立交
// 5-隧道
// 6-服务区',
// 7-停车区,
// 8-清障驻点
// 9-边坡
export const RoadNFTopics = {
收费站: 1,
桥梁: 2,
枢纽立交: 4,
服务区: 6,
停车区: 7,
清障驻点: 8,
边坡: 9,
};
// 事件类型 eventType
export const EventType = {
0: {
text: "待确认",
},
1: {
text: "处理中",
},
2: {
text: "已完成",
},
};
// 信息来源 warningSource
export const InfoWarningSource = {
1: {
text: "视频AI",
},
2: {
text: "雷达识别",
},
3: {
text: "锥桶",
},
4: {
text: "护栏碰撞",
},
5: {
text: "扫码报警",
},
6: {
text: "非机预警",
},
// 7: {
// text: "气象监测器",
// },
};
export const warningSourceMapping = {
1: "视频AI",
2: "雷达识别",
3: "锥桶",
4: "护栏碰撞",
5: "扫码报警",
6: "非机预警",
// 7: '气象监测器'
};
export const warningStateMapping = {
1: "上报",
2: "已完成",
3: "已终止",
4: "自动结束",
};
//设备Options
export const deviceTypeOptions = [
{
value: 1,
label: "摄像机",
},
{
value: 2,
label: "可变信息标志",
timingControl: true,
},
{
value: 3,
label: "气象监测器",
},
{
value: 4,
label: "出口诱导灯",
},
{
value: 5,
label: "路段语音广播",
timingControl: true,
},
{
value: 6,
label: "护栏碰撞",
},
{
value: 7,
label: "毫米波雷达",
},
{
value: 8,
label: "合流区预警",
},
{
value: 9,
label: "智慧锥桶",
},
{
value: 10,
label: "激光疲劳唤醒",
timingControl: true,
},
{
value: 11,
label: "一类交通量调查站",
},
{
value: 12,
label: "行车诱导",
timingControl: true,
},
{
value: 13,
label: "智能设备箱",
// timingControl: true,
},
{
value: 14,
label: "光线在线监测",
},
];
export const deviceTypeDic = arrayToDic(deviceTypeOptions);
//激光疲劳唤醒 工作模式
export const awakerWorkModeDic = {
0: "激光关闭",
1: "常亮模式",
2: "间隔100ms闪烁模式",
3: "间隔200ms闪烁模式",
4: "间隔500ms闪烁模式",
5: "2次闪烁模式",
6: "SOS模式",
7: "自定义模式1",
8: "自定义模式2",
9: "自定义模式3",
};
//激光疲劳唤醒 工作模式
export const gzmsMap = {
SETMD0: "激光关闭",
@ -1032,74 +1091,21 @@ export const DirectionTypes = {
3: "济南方向",
2: "双向",
};
export const EventSubclass = {
"1-1": "追尾",
"1-2": "侧翻",
"1-3": "撞护栏",
"1-4": "自燃",
"1-5": "其他事故",
"2-1": "车辆故障",
"3-1": "主线封闭限行",
"3-2": "收费站封闭和限行",
"3-3": "立交封闭和限行",
"3-4": "服务区封闭和限行",
"4-1": "道路拥堵",
"4-2": "立交拥堵",
"4-3": "收费站拥堵",
"4-4": "服务区拥堵",
"5-1": "行人",
"5-2": "非机动车",
"5-3": "摩托车",
"5-4": "其他",
"6-1": "烟雾",
"6-2": "倒伏树木",
"6-3": "撒落物",
"6-4": "动物",
"6-5": "其他",
"7-1": "道路养护施工",
"7-2": "收费站养护施工",
"7-3": "服务区养护施工",
"7-4": "枢纽立交匝道养护施工",
"7-5": "地方道路养护施工",
"7-6": "道路工程建设施工",
"7-7": "收费站工程建设施工",
"7-8": "服务区工程建设施工",
"7-9": "枢纽立交匝道工程建设施工",
"7-10": "地方道路工程建设施工",
"8-1": "封闭、暂停营业",
"8-2": "重要设施停用",
"8-3": "服务区其他异常",
"9-1": "摄像机",
"9-2": "护栏",
"9-3": "隔离栅",
"9-4": "情报板",
"9-5": "防炫板",
"9-6": "其他",
"10-1": "雨",
"10-2": "雪",
"10-3": "雾",
"10-4": "大风",
"10-5": "低温寒潮",
"10-6": "路面积雪",
"10-7": "路面结冰",
"10-8": "路面积水",
"10-9": "其他",
"11-1": "其他事件",
};
// 方向
export const directionOptions = [
{ value: "1", label: "菏泽方向" },
{ value: "3", label: "济南方向" },
{ value: "2", label: "双向" },
];
//行车诱导相关
//行车诱导控制模式
export const inducerModeDic = {
"00": "手动模式",
"01": "自动模式",
"02": "万年历",
};
//行车诱导工作模式
export const inducerWorkTypeDic = {
"00": "不更新",
"01": "常亮",

56
ruoyi-ui/src/views/websocket.vue

@ -31,7 +31,8 @@ export default {
// websocket
this.socket.initialize({
// url: 'ws://' + location.hostname + ':' + port + path,
url: 'wss://' + location.hostname + ':' + window.location.port + '/ws' || 80 + '/ws',
// url: 'wss://' + location.hostname + ':' + window.location.port + '/ws' || 80 + '/ws',
url: 'ws://10.168.77.128:7789/ws',
// url: "ws://10.7.179.15" + ":" + port + path,
// url: "ws://10.168.64.171" + ":" + port + path,
// url: 'ws://10.168.78.127'+ ':' + port + path,
@ -40,8 +41,10 @@ export default {
tokenSN: this.token,
heartRate: interval,
});
this.socket.onopen = () => {};
this.socket.onmessage = (message) => {
// debugger
message = JSON.parse(message);
const method = message.method;
@ -53,7 +56,11 @@ export default {
const params = message.params;
const subEvent = params.subEvent;
const content = params.content;
if(_.isString(content)){
var contentList = JSON.parse(content);
}else{
var contentList = content;
}
switch (subEvent) {
case "payment_webSocket_send":
@ -92,7 +99,10 @@ export default {
this.$nextTick(() => {
this.$store.commit("EVENTUNTREATEDNUM", contentList);
});
break;
case "0":
case "1":
this.$emit("newEvent", params);
break;
default:
}
@ -101,6 +111,48 @@ export default {
},
created() {},
methods: {},
mounted(){
let _this = this;
document.onkeydown = function (e) {
if (e.code == 'Space') {
let params = {
"subEvent": "0",
"content": {
"event": {
"id": "1555c6599eb14e3fb68d04e512182ee7",
"deptId": 103,
"stakeMark": "K059+289",
"endStakeMark": "",
"direction": "1",
"userId": 1,
"estimatedEndTime": "2024-04-11 00:00:00",
"eventType": 3,
"eventSubclass": "3-2",
"eventState": 0,
"eventSource": 1,
"inTunnel": 0,
"roadId": 1,
"occurrenceTime": "2024-04-10 16:56:02",
"lang": "",
"dcEventTrafficControl": {
"controlType": 1,
"controlCause": 1,
"exitsInlets": 2,
"facilityId": 11,
"measure": 1,
"classify": 1,
"facilityIds": [
11
]
},
"createTime": "2024-05-08 18:02:40"
},
"content": "菏泽方向 K059+289 发生收费站封闭和限行事件"
}
};
_this.$emit("newEvent", params);
}}
}
};
</script>

Loading…
Cancel
Save