feat: 首页设备状态、告警通知初始化完成

dev-deviceSetting
donghao 1 year ago
parent ed023b30e3
commit f95eca1731

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 448 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

@ -80,7 +80,7 @@ const rightSwitchState = computed(() => {
const defaultOption = computed(() => {
return {
//
step: 1,
step: 0.5,
//
limitMoveNum: 5,
//hover

@ -0,0 +1,20 @@
/* 设备详情 */
.alarmInfoList_wrap {
.alarm_info_list_box {
height: 180px;
overflow-y: scroll;
font-size: 14px;
li {
padding-bottom: 23px;
.level_status_2 {
color: #e80d0d;
}
.level_status_1 {
color: #faad14;
}
.level_status_0 {
color: #52c41a;
}
}
}
}

@ -0,0 +1,74 @@
<!--
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-02-28 15:21:32
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-02-28 15:25:08
* @FilePath: \General-AI-Platform-Web-Client\src\pages\dataScreen\components\alarmInfoList.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script setup lang="ts">
defineOptions({
name: "AlarmInfoList"
});
const deviceStatusData = [
{
type: 2,
label: "紧急",
des: "核心监测001设备发生告警请及时处理",
time: "今天10:03:01"
},
{
type: 1,
label: "优先",
des: "核心监测001设备发生告警请及时处理",
time: "今天10:03:01"
},
{
type: 0,
label: "一般",
des: "核心监测001设备发生告警请及时处理",
time: "今天10:03:01"
},
{
type: 0,
label: "一般",
des: "核心监测001设备发生告警请及时处理",
time: "今天10:03:01"
}
// {
// type: 0,
// label: "",
// des: "001",
// time: "10:03:01"
// },
// {
// type: 0,
// label: "",
// des: "001",
// time: "10:03:01"
// }
];
</script>
<template>
<div class="w-full h-full alarmInfoList_wrap">
<ul class="device_alarm_info_list alarm_info_list_box">
<li
v-for="(v, k) in deviceStatusData"
:key="k"
class="flex justify-between"
>
<span class="level_status" :class="`level_status_${v.type}`">{{
v.label
}}</span>
<span>{{ v.des }}</span>
<span>{{ v.time }}</span>
</li>
</ul>
</div>
</template>
<style lang="scss" scoped>
@import "./alarmInfoList.scss";
</style>

@ -0,0 +1,102 @@
<!--
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-01-12 13:27:07
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-02-28 15:48:31
* @FilePath: \General-AI-Platform-Web-Client\src\views\workbench\components\DeviceStatus.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script setup lang="ts">
import { ref } from "vue";
import deviceStatusOnline from "@/assets/svg/deviceStatus/online.svg?component";
import deviceStatusProcess from "@/assets/svg/deviceStatus/process.svg?component";
import deviceStatusError from "@/assets/svg/deviceStatus/error.svg?component";
import deviceStatusOutline from "@/assets/svg/deviceStatus/outline.svg?component";
defineOptions({
name: "DeviceStatus"
});
const deviceStatusData = ref<Record<string, any>>({
onlineCount: 618,
errorCount: 120,
processCount: 118,
outlineCount: 200
});
const deviceStatusOptions = ref<Record<string, any>[]>([
{
label: "在线",
color: "#52C41A",
bgColor: "rgba(82, 196, 26, 1)",
valueKey: "onlineCount" // 线
},
{
label: "进行中",
color: "#FAAD14",
bgColor: "rgba(250, 173, 20, 1)",
valueKey: "processCount" //
},
{
label: "故障",
color: "#E80D0D",
bgColor: "rgba(232, 13, 13, 1)",
valueKey: "errorCount" //
},
{
label: "离线",
color: "#999999",
bgColor: "#999999",
valueKey: "outlineCount" //
}
]);
</script>
<template>
<ul class="w-full text-sm deviceStatus_box">
<li
class="flex items-center justify-between w-full"
:style="{
marginBottom: '16px'
}"
v-for="(v, k) in deviceStatusOptions"
:key="k"
>
<div
class="flex items-center justify-center"
:style="{
backgroundColor: v.bgColor,
width: '40px',
height: '40px',
borderRadius: '4px',
marginRight: '12px'
}"
>
<deviceStatusOnline v-if="v.valueKey === 'onlineCount'" />
<deviceStatusProcess v-if="v.valueKey === 'processCount'" />
<deviceStatusError v-if="v.valueKey === 'errorCount'" />
<deviceStatusOutline v-if="v.valueKey === 'outlineCount'" />
</div>
<div class="flex flex-col flex-1">
<div class="flex justify-between" style="margin-bottom: 4px">
<span>{{ v.label }}</span>
<span>{{ deviceStatusData[v.valueKey] }}</span>
</div>
<div class="w-full">
<el-progress
:show-text="false"
:stroke-width="8"
:percentage="deviceStatusData[v.valueKey] / 10"
:color="v.color"
/>
</div>
</div>
</li>
</ul>
</template>
<style lang="scss">
.deviceStatus_box {
.el-progress-bar__outer {
background-color: #e0e0e0;
}
}
</style>

@ -39,20 +39,5 @@
color: #2de6ff;
line-height: 22px;
}
.device_alarm_info_list {
font-size: 14px;
li {
padding-bottom: 23px;
.level_status_2 {
color: #e80d0d;
}
.level_status_1 {
color: #faad14;
}
.level_status_0 {
color: #52c41a;
}
}
}
}
}

@ -2,25 +2,31 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-02-23 10:14:31
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-02-28 13:23:26
* @LastEditTime: 2024-02-28 15:28:08
* @FilePath: \General-AI-Platform-Web-Client\src\pages\dataScreen\views\device\deviceList.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script setup lang="ts">
import { onMounted, ref } from "vue";
import { onMounted, ref, reactive } from "vue";
import { fabric } from "fabric";
import { bgImageData } from "./testData/fabricImageSvg";
import { currJson } from "./testData/fabricDeviceList";
import { currJson, deviceListData } from "./testData/fabricDeviceList";
import { deviceStatusData, deviceTypeOptions } from "./testData/deviceListData";
import { deviceTypeOptions } from "./testData/deviceListData";
import { DsBox2 } from "@/components/DsBox";
import DetailCard from "./modules/detailCard.vue";
import AlarmInfoList from "../../components/alarmInfoList.vue";
defineOptions({
name: "DeviceList"
});
// state
const classOption = reactive({
direction: "top"
});
const scroll = ref();
const deviceParams = ref<Record<string, any>>({
type: "0"
});
@ -34,23 +40,7 @@ const clipPathData = ref<{
});
const canvasRef = ref<any>(null);
const cvs = ref<any>(null);
const currentDetail = ref<Record<string, any>>({
deviceType: "1", // 1 1 2 2
id: "1001", // id
status: "0", //
deviceStatus: "启用",
deviceName: "工业摄像头01", //
deviceCode: "CRM001",
deviceLocation: "南京苏胜天信息科技有限公司",
deviceParams: "89hufd",
deviceCategory: "摄像设备",
diviceGroup: "组1",
createTime: "2024-01-15 14:00",
baseInfo: {
left: 527.0215, // x
top: 24.5797 // y
}
});
const currentDetail = ref<Record<string, any>>(deviceListData[0]);
//
function closeSelectedModel(targetCvs?: any) {
@ -90,6 +80,26 @@ function initCanvas() {
);
canvasObject.loadFromJSON(JSON.stringify(currJson), () => {
canvasObject.renderAll();
console.log(canvasObject.getObjects(), "canvasObject");
canvasObject.getObjects().forEach((item, index) => {
// if (changeId.includes(item?.userProperty?.id)) {
const groupObject = item;
//
// canvasObject.setActiveObject(groupObject); // selectable
canvasObject.requestRenderAll();
//
// const objectsInGroup = groupObject.getObjects();
if (index === 0) {
groupObject.item(0).item(6).set({
fill: "#00F0FF"
});
}
// groupObject.item(1).set({
// fill: "rgb(0,0,0)"
// });
canvasObject.renderAll();
});
// const groupObjectList = canvasObject.getObjects()
// const groupObject = canvasObject.getObjects()[0];
@ -105,11 +115,12 @@ function initCanvas() {
console.log(event, "targetObject");
// set_category_fk_id_open(false);
//
// if (targetObject && targetObject?.userProperty) {
// // setChangeId([targetObject?.userProperty?.id]);
// // setCurrentModelUserProperty(targetObject.userProperty);
// // set_category_fk_id_open(true);
// }
if (targetObject && targetObject?.userProperty) {
// setChangeId([targetObject?.userProperty?.id]);
currentDetail.value = targetObject.userProperty;
// setCurrentModelUserProperty(targetObject.userProperty);
// set_category_fk_id_open(true);
}
// //
if (targetObject) {
// setCurrentTargetObject(targetObject);
@ -179,21 +190,7 @@ onMounted(() => {
<div class="device_alarm_info">
<p>告警信息</p>
<ul class="device_alarm_info_list">
<li
v-for="(v, k) in deviceStatusData"
:key="k"
class="flex justify-between"
>
<span
class="level_status"
:class="`level_status_${v.type}`"
>{{ v.label }}</span
>
<span>{{ v.des }}</span>
<span>{{ v.time }}</span>
</li>
</ul>
<AlarmInfoList />
</div>
</div>
</template>

@ -16,12 +16,20 @@
padding: 3px 12px;
color: #52c41a;
}
.detail_value_status_1 {
color: #52c41a;
}
.detail_value_status_0 {
color: #e80d0d;
border: 1px solid #e80d0d;
}
}
}
.device_pic {
width: 383px;
height: 225px;
background-color: aqua;
background: url("@/assets/dataScreen/deviceList/deviceDetail1.png")
no-repeat;
}
}

@ -44,9 +44,11 @@ const props = defineProps({
</li>
<li>
<span class="label">设备状态: </span>
<span class="detail_value detail_value_status">{{
props.info?.deviceStatus
}}</span>
<span
class="detail_value detail_value_status"
:class="`detail_value_status_${props.info?.deviceStatus}`"
>{{ props.info?.deviceStatus === "1" ? "启用" : "禁用" }}</span
>
</li>
<li>
<span class="label">创建时间: </span>

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-02-27 15:04:53
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-02-27 15:09:57
* @LastEditTime: 2024-02-28 15:18:44
* @FilePath: \General-AI-Platform-Web-Client\src\pages\dataScreen\views\device\testData\deviceListData.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@ -10,27 +10,39 @@ export const deviceStatusData = [
{
type: 2,
label: "紧急",
des: "设备1发生紧急报警请及时关注",
des: "核心监测001设备发生告警请及时处理",
time: "今天10:03:01"
},
{
type: 1,
label: "优先",
des: "设备1发生紧急报警请及时关注",
des: "核心监测001设备发生告警请及时处理",
time: "今天10:03:01"
},
{
type: 0,
label: "一般",
des: "设备1发生紧急报警请及时关注",
des: "核心监测001设备发生告警请及时处理",
time: "今天10:03:01"
},
{
type: 0,
label: "一般",
des: "设备1发生紧急报警请及时关注",
des: "核心监测001设备发生告警请及时处理",
time: "今天10:03:01"
}
// {
// type: 0,
// label: "一般",
// des: "核心监测001设备发生告警请及时处理",
// time: "今天10:03:01"
// },
// {
// type: 0,
// label: "一般",
// des: "核心监测001设备发生告警请及时处理",
// time: "今天10:03:01"
// }
];
export const deviceTypeOptions = [

@ -4,79 +4,104 @@ const startData: Record<string, any> = {
modelsList: [
{
deviceType: "1", // 模型类型 1 设备1 2 设备2
id: "1001", // 模型id
id: "GigEPRO_gmcam_01_001", // 模型id
status: "1", //
deviceStatus: "启用",
deviceName: "工业摄像头01", // 模型名称
deviceCode: "CRM001",
deviceStatus: "1",
deviceName: "核心检测摄001", // 模型名称
deviceCode: "GigEPRO_gmcam_01_001",
deviceLocation: "南京苏胜天信息科技有限公司",
deviceParams: "89hufd",
deviceCategory: "摄像设备",
diviceGroup: "组1",
createTime: "2024-01-15 14:00",
baseInfo: {
left: 527.0215, // 相对x
top: 24.5797 // 相对y
left: 327.0215, // 相对x
top: 344.5797 // 相对y
}
},
{
deviceType: "1", // 模型类型 1 设备1 2 设备2
id: "1002", // 模型id
status: "0", // 模型状态 在线 离线 告警 故障
deviceName: "监控设备2", // 模型名称
deviceCode: "code1001",
deviceLocation: "客厅",
deviceParams: "设备参数",
deviceCategory: "控制器",
id: "GigEPRO_gmcam_01_002", // 模型id
status: "1", //
deviceStatus: "1",
deviceName: "核心检测摄002", // 模型名称
deviceCode: "GigEPRO_gmcam_01_002",
deviceLocation: "南京苏胜天信息科技有限公司",
deviceParams: "89hufd",
deviceCategory: "摄像设备",
diviceGroup: "组1",
createTime: "2024-01-15 14:05",
baseInfo: {
left: 397.0215, // 相对x
top: 444.5797 // 相对y
left: 587.0215, // 相对x
top: 104.5797 // 相对y
}
},
{
deviceType: "1", // 模型类型 1 设备1 2 设备2
id: "1003", // 模型id
status: "1", // 模型状态 在线 离线 告警 故障
deviceName: "监控设备2", // 模型名称
deviceCode: "code1001",
deviceLocation: "客厅",
deviceParams: "设备参数",
deviceCategory: "控制器",
id: "GigEPRO_gmcam_01_003", // 模型id
status: "0", //
deviceStatus: "1",
deviceName: "核心检测摄003", // 模型名称
deviceCode: "GigEPRO_gmcam_01_003",
deviceLocation: "南京苏胜天信息科技有限公司",
deviceParams: "89hufd",
deviceCategory: "摄像设备",
diviceGroup: "组1",
createTime: "2024-01-15 14:35",
baseInfo: {
left: 397.0215, // 相对x
top: 144.5797 // 相对y
left: 727.0215, // 相对x
top: 324.5797 // 相对y
}
},
{
deviceType: "1", // 模型类型 1 设备1 2 设备2
id: "1004", // 模型id
status: "2", // 模型状态 在线 离线 告警 故障
deviceName: "监控设备2", // 模型名称
deviceCode: "code1001",
deviceLocation: "客厅",
deviceParams: "设备参数",
deviceCategory: "控制器",
id: "GigEPRO_gmcam_01_004", // 模型id
status: "3", //
deviceStatus: "1",
deviceName: "核心检测摄004", // 模型名称
deviceCode: "GigEPRO_gmcam_01_004",
deviceLocation: "南京苏胜天信息科技有限公司",
deviceParams: "89hufd",
deviceCategory: "摄像设备",
diviceGroup: "组1",
createTime: "2024-01-15 14:55",
baseInfo: {
left: 297.0215, // 相对x
top: 644.5797 // 相对y
left: 902.0215, // 相对x
top: 184.5797 // 相对y
}
},
{
deviceType: "1", // 模型类型 1 设备1 2 设备2
id: "1005", // 模型id
status: "3", // 模型状态 在线 离线 告警 故障
deviceName: "监控设备2", // 模型名称
deviceCode: "code1001",
deviceLocation: "客厅",
deviceParams: "设备参数",
deviceCategory: "控制器",
id: "GigEPRO_gmcam_01_005", // 模型id
status: "2", //
deviceStatus: "1",
deviceName: "核心检测摄005", // 模型名称
deviceCode: "GigEPRO_gmcam_01_005",
deviceLocation: "南京苏胜天信息科技有限公司",
deviceParams: "89hufd",
deviceCategory: "摄像设备",
diviceGroup: "组1",
createTime: "2024-01-15 14:55",
baseInfo: {
left: 797.0215, // 相对x
top: 544.5797 // 相对y
left: 1102.0215, // 相对x
top: 104.5797 // 相对y
}
},
{
deviceType: "1", // 模型类型 1 设备1 2 设备2
id: "GigEPRO_gmcam_01_001", // 模型id
status: "1", //
deviceStatus: "0",
deviceName: "核心检测摄006", // 模型名称
deviceCode: "GigEPRO_gmcam_01_006",
deviceLocation: "南京苏胜天信息科技有限公司",
deviceParams: "89hufd",
deviceCategory: "摄像设备",
diviceGroup: "组1",
createTime: "2024-01-15 14:00",
baseInfo: {
left: 227.0215, // 相对x
top: 184.5797 // 相对y
}
}
]
@ -125,6 +150,8 @@ startData.modelsList.forEach((item: Record<string, any>) => {
);
});
export const deviceListData = startData.modelsList;
export const currJson = {
version: "5.3.0",
objects: fabricRoomListData,

@ -1677,25 +1677,26 @@ const fetchWatchIcon = (status: string) => {
rectFill: "#FAAD14"
};
switch (status) {
case "0":
case "0": // 故障
watchIconData = {
pathFill: "rgba(21,77,221,0.2)",
rectFill: "#E80D0D"
};
break;
case "1":
case "1": // 在线
watchIconData = {
pathFill: "rgba(21,77,221,0.2)",
rectFill: "#52C41A"
};
break;
case "2":
case "2": // 离线
watchIconData = {
pathFill: "rgba(21,77,221,0.2)",
rectFill: "##CCCCCC"
rectFill: "#CCCCCC"
};
return watchIcon3;
case "3":
break;
// return watchIcon3;
case "3": // 警告
watchIconData = {
pathFill: "rgba(21,77,221,0.2)",
rectFill: "#FAAD14"

@ -89,4 +89,13 @@
}
.ds_home_wrap {
background: url("@/assets/svg/screenHomeBg.svg") no-repeat center center;
padding: 40px 32px 0;
}
.bg_home_item1 {
background: url("@/assets/svg/screenBgCommon.svg") no-repeat;
.alarm_scroll_box {
height: 230px;
overflow: hidden;
}
}

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-02-22 14:27:21
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-02-22 15:43:48
* @LastEditTime: 2024-02-28 15:55:37
* @FilePath: \General-AI-Platform-Web-Client\src\pages\dataScreen\views\home\homeIndex.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@ -11,6 +11,11 @@ import { reactive, ref, unref } from "vue";
import AlarmLine from "./components/AlarmLine.vue";
import DefectLine from "./components/DefectLine.vue";
import SeamlessScroll from "@/components/ReSeamlessScroll";
import AlarmInfoList from "../../components/alarmInfoList.vue";
import DeviceStatus from "../../components/deviceStatus.vue";
import { DsBox2 } from "@/components/DsBox";
const scroll = ref();
const listData = ref([
@ -55,11 +60,14 @@ const classOption = reactive({
<template>
<div class="flex justify-between w-full ds_home_wrap">
<div class="left">
<div class="left_box_1">
<div class="box_header" style="height: 50px">分类告警</div>
<div style="height: 238px; width: 100%">
<AlarmLine />
</div>
<div class="left_box_1 mb-[24px]">
<DsBox2 title="分类告警" type="w1h1" bgClass="bg_home_item1">
<template #default>
<div class="w-full h-full">
<AlarmLine />
</div>
</template>
</DsBox2>
</div>
<div class="left_box_1">
<div class="box_header" style="height: 50px">总缺陷数</div>
@ -67,7 +75,6 @@ const classOption = reactive({
<DefectLine />
</div>
</div>
<div class="left_box_1">123</div>
</div>
<div class="mid">
<div class="mid_box">
@ -100,26 +107,41 @@ const classOption = reactive({
</div>
</div>
<div class="right">
<div class="left_box_1">123</div>
<div class="left_box_1">123</div>
<div class="left_box_1">
<div class="box_header" style="height: 50px">总缺陷数</div>
<div style="height: 238px; width: 100%">
<SeamlessScroll
ref="scroll"
:data="listData"
:class-option="classOption"
class="warp"
>
<ul class="item">
<li v-for="(item, index) in listData" :key="index">
<span class="type">紧急</span>
<span class="title" v-text="item.title" />
<span class="time">今天10:03:01</span>
</li>
</ul>
</SeamlessScroll>
</div>
<div class="right_box_1 mb-[24px]">
<DsBox2 title="设备在线数量" type="w1h1" bgClass="bg_home_item1">
<template #default>
<div class="w-full px-[24px] py-[8px]">
<DeviceStatus />
</div>
</template>
</DsBox2>
</div>
<div class="right_box_1 mb-[24px]">
<DsBox2 title="算力分配" type="w1h1" bgClass="bg_home_item1">
<template #default>
<div class="w-full px-[24px] py-[8px]">
<!-- 算力分配 -->
</div>
</template>
</DsBox2>
</div>
<div class="right_box_1">
<DsBox2 title="通知告警" type="w1h1" bgClass="bg_home_item1">
<template #default>
<div class="w-full px-[24px]">
<div style="height: 138px; width: 100%">
<SeamlessScroll
ref="scroll"
:data="listData"
:class-option="classOption"
class="alarm_scroll_box"
>
<AlarmInfoList />
</SeamlessScroll>
</div>
</div>
</template>
</DsBox2>
</div>
</div>
</div>

Loading…
Cancel
Save