|
|
@@ -81,7 +81,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, nextTick, reactive, onMounted, onUnmounted, inject } from 'vue';
|
|
|
+import { ref, nextTick, computed, reactive, onMounted, onUnmounted, inject } from 'vue';
|
|
|
import { usePermission } from '/@/hooks/web/usePermission';
|
|
|
import customHeader from '/@/components/vent/customHeader.vue';
|
|
|
import { AesEncryption } from '/@/utils/cipher';
|
|
|
@@ -89,6 +89,7 @@ import { loginCipher } from '/@/settings/encryptionSetting';
|
|
|
import { message, TreeProps } from 'ant-design-vue';
|
|
|
import { list, getDeviceList, getDeviceTypeList, devPosition, getDepartmentInfo, getExportUrl, getRegulation } from './device.api';
|
|
|
import { DownOutlined, RightOutlined } from '@ant-design/icons-vue';
|
|
|
+import { subStationList } from './device.api';
|
|
|
|
|
|
const { hasPermission } = usePermission();
|
|
|
let activeKey = ref('device');
|
|
|
@@ -96,44 +97,37 @@ const treeData = ref<TreeProps['treeData']>([]);
|
|
|
const selectedKeys = ref<string[]>([]);
|
|
|
const expandedKeys = ref<string[]>([]);
|
|
|
const systemID = ref(''); // 系统监测时,系统id
|
|
|
+let cardList = ref<any[]>(); //分站列表
|
|
|
+let openNum = ref(0);
|
|
|
+let clsoeNum = ref(0);
|
|
|
+
|
|
|
+// 分页配置
|
|
|
+const pagination = reactive({
|
|
|
+ current: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ total: computed(() => deviceList.value.length),
|
|
|
+ showSizeChanger: true,
|
|
|
+ pageSizeOptions: ['10', '20', '50'],
|
|
|
+ onChange: (page, size) => {
|
|
|
+ pagination.current = page;
|
|
|
+ pagination.pageSize = size;
|
|
|
+ },
|
|
|
+ onShowSizeChange: (current, size) => {
|
|
|
+ pagination.current = 1;
|
|
|
+ pagination.pageSize = size;
|
|
|
+ },
|
|
|
+});
|
|
|
//树形菜单选择事件
|
|
|
const onSelect: TreeProps['onSelect'] = (keys, e) => {};
|
|
|
-// 获取树形菜单数据
|
|
|
-async function getDeviceType(sysType?) {
|
|
|
- if (treeData.value?.length > 0) return;
|
|
|
- const result = await getDeviceTypeList({});
|
|
|
- if (result.length > 0) {
|
|
|
- const dataSource = <TreeProps['treeData']>[];
|
|
|
- let key = '0';
|
|
|
- const getData = (resultList, dataSourceList, keyVal) => {
|
|
|
- resultList.forEach((item, index) => {
|
|
|
- if (item.deviceType != 'sys' && item.children && item.children.length > 0) {
|
|
|
- const children = getData(item.children, [], `${keyVal}-${index}`);
|
|
|
- // 判断关键阻力路线
|
|
|
- if (item.itemValue.startsWith(sysType) && children[0]) {
|
|
|
- systemID.value = item.children[0]['itemValue'];
|
|
|
- }
|
|
|
-
|
|
|
- dataSourceList.push({
|
|
|
- children: children,
|
|
|
- title: item.itemText,
|
|
|
- key: `${keyVal}-${index}`,
|
|
|
- type: item.itemValue,
|
|
|
- parentKey: `${keyVal}`,
|
|
|
- });
|
|
|
- } else {
|
|
|
- dataSourceList.push({
|
|
|
- children: [],
|
|
|
- title: item.itemText,
|
|
|
- key: `${keyVal}-${index}`,
|
|
|
- type: item.itemValue,
|
|
|
- parentKey: `${keyVal}`,
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- return dataSourceList;
|
|
|
- };
|
|
|
- treeData.value = getData(result, dataSource, key);
|
|
|
+//获取分站信息
|
|
|
+async function getSubStationList() {
|
|
|
+ let res = await subStationList({ strtype: 'modbus' });
|
|
|
+ if (res.length != 0) {
|
|
|
+ cardList.value = res;
|
|
|
+ openNum.value = cardList.value?.filter((v) => v.linkstatus == 1)['length'];
|
|
|
+ clsoeNum.value = cardList.value?.filter((v) => v.linkstatus == 0)['length'];
|
|
|
+ } else {
|
|
|
+ cardList.value = [];
|
|
|
}
|
|
|
}
|
|
|
// 设备数据结构
|
|
|
@@ -163,6 +157,201 @@ const expandedRowKeys = ref([]);
|
|
|
|
|
|
// 加载状态映射
|
|
|
const loadingMap = reactive({});
|
|
|
+// 根据选择设备获取设备列表
|
|
|
+async function getDeviceList(deviceTypeVal?) {
|
|
|
+ // if (!deviceTypeVal) return;
|
|
|
+ const params: any = {
|
|
|
+ devKind: deviceTypeVal,
|
|
|
+ };
|
|
|
+ const result = {
|
|
|
+ records: [
|
|
|
+ {
|
|
|
+ id: '1965325207547695105',
|
|
|
+ strname: '束管1',
|
|
|
+ strinstallpos: '束管1',
|
|
|
+ devicekind: 'bundletube',
|
|
|
+ strtype: 'bundletube_auto',
|
|
|
+ typename: null,
|
|
|
+ flength: null,
|
|
|
+ fsectarea: null,
|
|
|
+ planedVa: null,
|
|
|
+ regulation: null,
|
|
|
+ elevation: null,
|
|
|
+ nsubstationid: '1696417397868986370',
|
|
|
+ stationname: '调试http协议',
|
|
|
+ strremark: null,
|
|
|
+ createBy: 'admin',
|
|
|
+ createTime: '2025-09-09 16:03:38',
|
|
|
+ updateBy: null,
|
|
|
+ updateTime: null,
|
|
|
+ isSelfDevice: 0,
|
|
|
+ status: 1,
|
|
|
+ monitorflag: 1,
|
|
|
+ testflag: 0,
|
|
|
+ sysOrgCode: 'A02A02',
|
|
|
+ orgCode: 'A02',
|
|
|
+ readData: {},
|
|
|
+ linkInfo: null,
|
|
|
+ stationids: null,
|
|
|
+ password: null,
|
|
|
+ strserno: 'sg001',
|
|
|
+ devgroup: null,
|
|
|
+ panel: null,
|
|
|
+ coalseam: null,
|
|
|
+ other1: null,
|
|
|
+ other2: null,
|
|
|
+ other3: null,
|
|
|
+ other4: null,
|
|
|
+ info: {},
|
|
|
+ linkId: null,
|
|
|
+ addrIndex: null,
|
|
|
+ standCode: null,
|
|
|
+ stationtype: null,
|
|
|
+ otherInfo: null,
|
|
|
+ programList: null,
|
|
|
+ debugFlag: 0,
|
|
|
+ orderNum: 0,
|
|
|
+ insType: null,
|
|
|
+ disTeamId: null,
|
|
|
+ isSensor: null,
|
|
|
+ nameEarly: null,
|
|
|
+ nameNoon: null,
|
|
|
+ nameNight: null,
|
|
|
+ disTeamName: null,
|
|
|
+ gasCheckTaskId: null,
|
|
|
+ isExistGasCheckTask: null,
|
|
|
+ netStatus: null,
|
|
|
+ devicekind_dictText: '束管监测',
|
|
|
+ isSelfDevice_dictText: '其他厂家',
|
|
|
+ monitorflag_dictText: '监测',
|
|
|
+ testflag_dictText: '否',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '1965325207568666626',
|
|
|
+ strname: '束管2',
|
|
|
+ strinstallpos: '束管2',
|
|
|
+ devicekind: 'bundletube',
|
|
|
+ strtype: 'bundletube_auto',
|
|
|
+ typename: null,
|
|
|
+ flength: null,
|
|
|
+ fsectarea: null,
|
|
|
+ planedVa: null,
|
|
|
+ regulation: null,
|
|
|
+ elevation: null,
|
|
|
+ nsubstationid: '1696417397868986370',
|
|
|
+ stationname: '调试http协议',
|
|
|
+ strremark: null,
|
|
|
+ createBy: 'admin',
|
|
|
+ createTime: '2025-09-09 16:03:38',
|
|
|
+ updateBy: null,
|
|
|
+ updateTime: null,
|
|
|
+ isSelfDevice: 0,
|
|
|
+ status: 1,
|
|
|
+ monitorflag: 1,
|
|
|
+ testflag: 0,
|
|
|
+ sysOrgCode: 'A02A02',
|
|
|
+ orgCode: 'A02',
|
|
|
+ readData: {},
|
|
|
+ linkInfo: null,
|
|
|
+ stationids: null,
|
|
|
+ password: null,
|
|
|
+ strserno: 'sg002',
|
|
|
+ devgroup: null,
|
|
|
+ panel: null,
|
|
|
+ coalseam: null,
|
|
|
+ other1: null,
|
|
|
+ other2: null,
|
|
|
+ other3: null,
|
|
|
+ other4: null,
|
|
|
+ info: {},
|
|
|
+ linkId: null,
|
|
|
+ addrIndex: null,
|
|
|
+ standCode: null,
|
|
|
+ stationtype: null,
|
|
|
+ otherInfo: null,
|
|
|
+ programList: null,
|
|
|
+ debugFlag: 0,
|
|
|
+ orderNum: 0,
|
|
|
+ insType: null,
|
|
|
+ disTeamId: null,
|
|
|
+ isSensor: null,
|
|
|
+ nameEarly: null,
|
|
|
+ nameNoon: null,
|
|
|
+ nameNight: null,
|
|
|
+ disTeamName: null,
|
|
|
+ gasCheckTaskId: null,
|
|
|
+ isExistGasCheckTask: null,
|
|
|
+ netStatus: null,
|
|
|
+ devicekind_dictText: '束管监测',
|
|
|
+ isSelfDevice_dictText: '其他厂家',
|
|
|
+ monitorflag_dictText: '监测',
|
|
|
+ testflag_dictText: '否',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '1965325207568666627',
|
|
|
+ strname: '束管3',
|
|
|
+ strinstallpos: '束管3',
|
|
|
+ devicekind: 'bundletube',
|
|
|
+ strtype: 'bundletube_auto',
|
|
|
+ typename: null,
|
|
|
+ flength: null,
|
|
|
+ fsectarea: null,
|
|
|
+ planedVa: null,
|
|
|
+ regulation: null,
|
|
|
+ elevation: null,
|
|
|
+ nsubstationid: '1696417397868986370',
|
|
|
+ stationname: '调试http协议',
|
|
|
+ strremark: null,
|
|
|
+ createBy: 'admin',
|
|
|
+ createTime: '2025-09-09 16:03:38',
|
|
|
+ updateBy: null,
|
|
|
+ updateTime: null,
|
|
|
+ isSelfDevice: 0,
|
|
|
+ status: 1,
|
|
|
+ monitorflag: 1,
|
|
|
+ testflag: 0,
|
|
|
+ sysOrgCode: 'A02A02',
|
|
|
+ orgCode: 'A02',
|
|
|
+ readData: {},
|
|
|
+ linkInfo: null,
|
|
|
+ stationids: null,
|
|
|
+ password: null,
|
|
|
+ strserno: 'sg003',
|
|
|
+ devgroup: null,
|
|
|
+ panel: null,
|
|
|
+ coalseam: null,
|
|
|
+ other1: null,
|
|
|
+ other2: null,
|
|
|
+ other3: null,
|
|
|
+ other4: null,
|
|
|
+ info: {},
|
|
|
+ linkId: null,
|
|
|
+ addrIndex: null,
|
|
|
+ standCode: null,
|
|
|
+ stationtype: null,
|
|
|
+ otherInfo: null,
|
|
|
+ programList: null,
|
|
|
+ debugFlag: 0,
|
|
|
+ orderNum: 0,
|
|
|
+ insType: null,
|
|
|
+ disTeamId: null,
|
|
|
+ isSensor: null,
|
|
|
+ nameEarly: null,
|
|
|
+ nameNoon: null,
|
|
|
+ nameNight: null,
|
|
|
+ disTeamName: null,
|
|
|
+ gasCheckTaskId: null,
|
|
|
+ isExistGasCheckTask: null,
|
|
|
+ netStatus: null,
|
|
|
+ devicekind_dictText: '束管监测',
|
|
|
+ isSelfDevice_dictText: '其他厂家',
|
|
|
+ monitorflag_dictText: '监测',
|
|
|
+ testflag_dictText: '否',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ deviceList.value = result.records;
|
|
|
+}
|
|
|
|
|
|
// 外层表格列配置
|
|
|
const outerColumns = [
|
|
|
@@ -170,16 +359,25 @@ const outerColumns = [
|
|
|
title: '设备ID',
|
|
|
dataIndex: 'id',
|
|
|
key: 'id',
|
|
|
+ align: 'center',
|
|
|
},
|
|
|
{
|
|
|
- title: '设备名称',
|
|
|
- dataIndex: 'name',
|
|
|
- key: 'name',
|
|
|
+ title: '安装位置',
|
|
|
+ dataIndex: 'strinstallpos',
|
|
|
+ key: 'strinstallpos',
|
|
|
+ align: 'center',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备类型',
|
|
|
+ dataIndex: 'devicekind_dictText',
|
|
|
+ key: 'devicekind_dictText',
|
|
|
+ align: 'center',
|
|
|
},
|
|
|
{
|
|
|
title: '状态',
|
|
|
- dataIndex: 'status',
|
|
|
- key: 'status',
|
|
|
+ dataIndex: 'netStatus',
|
|
|
+ key: 'netStatus',
|
|
|
+ align: 'center',
|
|
|
customRender: ({ text }) => {
|
|
|
text = '在线';
|
|
|
return `${text}`;
|
|
|
@@ -190,34 +388,37 @@ const outerColumns = [
|
|
|
// 内层表格列配置
|
|
|
const innerColumns = [
|
|
|
{
|
|
|
- title: '监测字段',
|
|
|
- dataIndex: 'field',
|
|
|
- key: 'field',
|
|
|
- width: '40%',
|
|
|
+ title: '地址',
|
|
|
+ dataIndex: 'plcAddr',
|
|
|
+ key: 'plcAddr',
|
|
|
+ align: 'center',
|
|
|
},
|
|
|
{
|
|
|
- title: '当前值',
|
|
|
+ title: '数据code',
|
|
|
+ dataIndex: 'valueCode',
|
|
|
+ align: 'center',
|
|
|
+ key: 'valueCode',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '数据名称',
|
|
|
+ dataIndex: 'valueName',
|
|
|
+ align: 'center',
|
|
|
+ key: 'valueName',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '数据值',
|
|
|
dataIndex: 'value',
|
|
|
+ align: 'center',
|
|
|
key: 'value',
|
|
|
- width: '30%',
|
|
|
},
|
|
|
{
|
|
|
- title: '单位',
|
|
|
- dataIndex: 'unit',
|
|
|
- key: 'unit',
|
|
|
- width: '30%',
|
|
|
+ title: '时间',
|
|
|
+ dataIndex: 'time',
|
|
|
+ align: 'center',
|
|
|
+ key: 'time',
|
|
|
},
|
|
|
];
|
|
|
|
|
|
-// 分页配置
|
|
|
-const pagination = reactive({
|
|
|
- current: 1,
|
|
|
- pageSize: 10,
|
|
|
- total: 3,
|
|
|
- showSizeChanger: true,
|
|
|
- pageSizeOptions: ['10', '20', '50'],
|
|
|
-});
|
|
|
-
|
|
|
// 切换展开状态
|
|
|
const toggleExpand = (deviceId) => {
|
|
|
const index = expandedRowKeys.value.indexOf(deviceId);
|
|
|
@@ -235,48 +436,675 @@ const toggleExpand = (deviceId) => {
|
|
|
const loadMonitoringData = async (deviceId) => {
|
|
|
const device = deviceList.value.find((d) => d.id === deviceId);
|
|
|
|
|
|
- if (device && device.monitoringFields.length === 0) {
|
|
|
- loadingMap[deviceId] = true;
|
|
|
- try {
|
|
|
- // 模拟API请求
|
|
|
- await new Promise((resolve) => setTimeout(resolve, 800));
|
|
|
- // 根据设备ID加载对应数据
|
|
|
- device.monitoringFields = mockFetchMonitoringData(deviceId);
|
|
|
- } catch (error) {
|
|
|
- console.error(`加载设备 ${deviceId} 数据失败:`, error);
|
|
|
- } finally {
|
|
|
- loadingMap[deviceId] = false;
|
|
|
- }
|
|
|
+ loadingMap[deviceId] = true;
|
|
|
+ try {
|
|
|
+ const result = {
|
|
|
+ msgType: null,
|
|
|
+ deviceID: '1965325207568666627',
|
|
|
+ deviceType: 'bundletube_auto',
|
|
|
+ typeName: '束管监测',
|
|
|
+ kindtypeName: '束管监测',
|
|
|
+ deviceName: '束管3',
|
|
|
+ devicePos: '束管3',
|
|
|
+ subStationID: '1696417397868986370',
|
|
|
+ monitorflag: 1,
|
|
|
+ testflag: 0,
|
|
|
+ fsectarea: null,
|
|
|
+ planedVa: null,
|
|
|
+ regulation: null,
|
|
|
+ elevation: null,
|
|
|
+ subStationName: '调试http协议束管',
|
|
|
+ subStationIP: 'http://192.168.1.88:10930/compute/testDta/getSgList',
|
|
|
+ subStationPort: '8930',
|
|
|
+ subStationType: 'http',
|
|
|
+ addrIndex: null,
|
|
|
+ standCode: null,
|
|
|
+ sysOrgCode: 'A02A02',
|
|
|
+ orgCode: 'A02',
|
|
|
+ stationids: null,
|
|
|
+ bakids: null,
|
|
|
+ limits: null,
|
|
|
+ cameras: [],
|
|
|
+ summaryHour: [],
|
|
|
+ summaryDay: [],
|
|
|
+ history: [],
|
|
|
+ majorpath: {},
|
|
|
+ info: null,
|
|
|
+ netStatus: null,
|
|
|
+ frontGateOpenCtrl: null,
|
|
|
+ rearGateOpenCtrl: null,
|
|
|
+ readTime: '2025-10-30 14:31:32',
|
|
|
+ lastSummaryDate: null,
|
|
|
+ paramid: null,
|
|
|
+ readData: {
|
|
|
+ coval: {
|
|
|
+ id: 1611236056970682378,
|
|
|
+ saveid: 0,
|
|
|
+ valueCode: 'coval',
|
|
|
+ valueName: '一氧化碳',
|
|
|
+ value: '12.50',
|
|
|
+ hourNum: null,
|
|
|
+ dayNum: null,
|
|
|
+ hourAvg: null,
|
|
|
+ hourMax: null,
|
|
|
+ hourMin: null,
|
|
|
+ dayAvg: null,
|
|
|
+ dayMax: null,
|
|
|
+ dayMin: null,
|
|
|
+ hourMaxTime: null,
|
|
|
+ dayMaxTime: null,
|
|
|
+ hourMinTime: null,
|
|
|
+ dayMinTime: null,
|
|
|
+ dictset: null,
|
|
|
+ summaryDate: null,
|
|
|
+ valueType: 4,
|
|
|
+ maxVal: null,
|
|
|
+ minVal: null,
|
|
|
+ limitlevels: [
|
|
|
+ {
|
|
|
+ id: null,
|
|
|
+ limitid: null,
|
|
|
+ devicekind: null,
|
|
|
+ devicetype: null,
|
|
|
+ deviceid: null,
|
|
|
+ eventid: null,
|
|
|
+ eventname: null,
|
|
|
+ monitorcode: 'coval',
|
|
|
+ valuetype: 2,
|
|
|
+ alarmType: null,
|
|
|
+ relatedCode: null,
|
|
|
+ fmin: null,
|
|
|
+ fmax: -10000.00000999999974737875163555145263671875,
|
|
|
+ leveltype: 10000,
|
|
|
+ datakind: null,
|
|
|
+ timelength: null,
|
|
|
+ des: '一氧化碳低于限值',
|
|
|
+ maxDeviceid: null,
|
|
|
+ minDeviceid: null,
|
|
|
+ maxCode: null,
|
|
|
+ minCode: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: null,
|
|
|
+ limitid: null,
|
|
|
+ devicekind: null,
|
|
|
+ devicetype: null,
|
|
|
+ deviceid: null,
|
|
|
+ eventid: null,
|
|
|
+ eventname: null,
|
|
|
+ monitorcode: 'coval',
|
|
|
+ valuetype: 2,
|
|
|
+ alarmType: null,
|
|
|
+ relatedCode: null,
|
|
|
+ fmin: 1000.000009999999974752427078783512115478515625,
|
|
|
+ fmax: 1000000,
|
|
|
+ leveltype: 10000,
|
|
|
+ datakind: null,
|
|
|
+ timelength: null,
|
|
|
+ des: '一氧化碳高于限值',
|
|
|
+ maxDeviceid: null,
|
|
|
+ minDeviceid: null,
|
|
|
+ maxCode: null,
|
|
|
+ minCode: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ warnFlag: null,
|
|
|
+ time: '2025-10-30 14:31:32',
|
|
|
+ timelength: null,
|
|
|
+ warnInfo: '读取数据为空',
|
|
|
+ warnRank: null,
|
|
|
+ saveflag: 1,
|
|
|
+ spaceSave: null,
|
|
|
+ avgflag: 1,
|
|
|
+ warnKindType: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ plcAddr: 'co',
|
|
|
+ lastSummaryDate: null,
|
|
|
+ },
|
|
|
+ ch2val: {
|
|
|
+ id: 1611236056970682382,
|
|
|
+ saveid: 0,
|
|
|
+ valueCode: 'ch2val',
|
|
|
+ valueName: '乙烯',
|
|
|
+ value: '0.00',
|
|
|
+ hourNum: null,
|
|
|
+ dayNum: null,
|
|
|
+ hourAvg: null,
|
|
|
+ hourMax: null,
|
|
|
+ hourMin: null,
|
|
|
+ dayAvg: null,
|
|
|
+ dayMax: null,
|
|
|
+ dayMin: null,
|
|
|
+ hourMaxTime: null,
|
|
|
+ dayMaxTime: null,
|
|
|
+ hourMinTime: null,
|
|
|
+ dayMinTime: null,
|
|
|
+ dictset: null,
|
|
|
+ summaryDate: null,
|
|
|
+ valueType: 4,
|
|
|
+ maxVal: null,
|
|
|
+ minVal: null,
|
|
|
+ limitlevels: [
|
|
|
+ {
|
|
|
+ id: null,
|
|
|
+ limitid: null,
|
|
|
+ devicekind: null,
|
|
|
+ devicetype: null,
|
|
|
+ deviceid: null,
|
|
|
+ eventid: null,
|
|
|
+ eventname: null,
|
|
|
+ monitorcode: 'ch2val',
|
|
|
+ valuetype: 2,
|
|
|
+ alarmType: null,
|
|
|
+ relatedCode: null,
|
|
|
+ fmin: null,
|
|
|
+ fmax: -10000.00000999999974737875163555145263671875,
|
|
|
+ leveltype: 10000,
|
|
|
+ datakind: null,
|
|
|
+ timelength: null,
|
|
|
+ des: '乙烯低于限值',
|
|
|
+ maxDeviceid: null,
|
|
|
+ minDeviceid: null,
|
|
|
+ maxCode: null,
|
|
|
+ minCode: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: null,
|
|
|
+ limitid: null,
|
|
|
+ devicekind: null,
|
|
|
+ devicetype: null,
|
|
|
+ deviceid: null,
|
|
|
+ eventid: null,
|
|
|
+ eventname: null,
|
|
|
+ monitorcode: 'ch2val',
|
|
|
+ valuetype: 2,
|
|
|
+ alarmType: null,
|
|
|
+ relatedCode: null,
|
|
|
+ fmin: 1000.000009999999974752427078783512115478515625,
|
|
|
+ fmax: 1000000,
|
|
|
+ leveltype: 10000,
|
|
|
+ datakind: null,
|
|
|
+ timelength: null,
|
|
|
+ des: '乙烯高于限值',
|
|
|
+ maxDeviceid: null,
|
|
|
+ minDeviceid: null,
|
|
|
+ maxCode: null,
|
|
|
+ minCode: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ warnFlag: null,
|
|
|
+ time: '2025-10-30 14:31:32',
|
|
|
+ timelength: null,
|
|
|
+ warnInfo: '读取数据为空',
|
|
|
+ warnRank: null,
|
|
|
+ saveflag: 1,
|
|
|
+ spaceSave: null,
|
|
|
+ avgflag: 1,
|
|
|
+ warnKindType: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ plcAddr: 'ch2',
|
|
|
+ lastSummaryDate: null,
|
|
|
+ },
|
|
|
+ gasval: {
|
|
|
+ id: 1611236056970682380,
|
|
|
+ saveid: 0,
|
|
|
+ valueCode: 'gasval',
|
|
|
+ valueName: '甲烷',
|
|
|
+ value: '0.40',
|
|
|
+ hourNum: null,
|
|
|
+ dayNum: null,
|
|
|
+ hourAvg: null,
|
|
|
+ hourMax: null,
|
|
|
+ hourMin: null,
|
|
|
+ dayAvg: null,
|
|
|
+ dayMax: null,
|
|
|
+ dayMin: null,
|
|
|
+ hourMaxTime: null,
|
|
|
+ dayMaxTime: null,
|
|
|
+ hourMinTime: null,
|
|
|
+ dayMinTime: null,
|
|
|
+ dictset: null,
|
|
|
+ summaryDate: null,
|
|
|
+ valueType: 4,
|
|
|
+ maxVal: null,
|
|
|
+ minVal: null,
|
|
|
+ limitlevels: [
|
|
|
+ {
|
|
|
+ id: null,
|
|
|
+ limitid: null,
|
|
|
+ devicekind: null,
|
|
|
+ devicetype: null,
|
|
|
+ deviceid: null,
|
|
|
+ eventid: null,
|
|
|
+ eventname: null,
|
|
|
+ monitorcode: 'gasval',
|
|
|
+ valuetype: 2,
|
|
|
+ alarmType: null,
|
|
|
+ relatedCode: null,
|
|
|
+ fmin: null,
|
|
|
+ fmax: -10000.00000999999974737875163555145263671875,
|
|
|
+ leveltype: 10000,
|
|
|
+ datakind: null,
|
|
|
+ timelength: null,
|
|
|
+ des: '甲烷低于限值',
|
|
|
+ maxDeviceid: null,
|
|
|
+ minDeviceid: null,
|
|
|
+ maxCode: null,
|
|
|
+ minCode: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: null,
|
|
|
+ limitid: null,
|
|
|
+ devicekind: null,
|
|
|
+ devicetype: null,
|
|
|
+ deviceid: null,
|
|
|
+ eventid: null,
|
|
|
+ eventname: null,
|
|
|
+ monitorcode: 'gasval',
|
|
|
+ valuetype: 2,
|
|
|
+ alarmType: null,
|
|
|
+ relatedCode: null,
|
|
|
+ fmin: 1000.000009999999974752427078783512115478515625,
|
|
|
+ fmax: 1000000,
|
|
|
+ leveltype: 10000,
|
|
|
+ datakind: null,
|
|
|
+ timelength: null,
|
|
|
+ des: '甲烷高于限值',
|
|
|
+ maxDeviceid: null,
|
|
|
+ minDeviceid: null,
|
|
|
+ maxCode: null,
|
|
|
+ minCode: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ warnFlag: null,
|
|
|
+ time: '2025-10-30 14:31:32',
|
|
|
+ timelength: null,
|
|
|
+ warnInfo: '读取数据为空',
|
|
|
+ warnRank: null,
|
|
|
+ saveflag: 1,
|
|
|
+ spaceSave: null,
|
|
|
+ avgflag: 1,
|
|
|
+ warnKindType: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ plcAddr: 'ch4',
|
|
|
+ lastSummaryDate: null,
|
|
|
+ },
|
|
|
+ chval: {
|
|
|
+ id: 1611236056970682381,
|
|
|
+ saveid: 0,
|
|
|
+ valueCode: 'chval',
|
|
|
+ valueName: '乙炔',
|
|
|
+ value: '0.00',
|
|
|
+ hourNum: null,
|
|
|
+ dayNum: null,
|
|
|
+ hourAvg: null,
|
|
|
+ hourMax: null,
|
|
|
+ hourMin: null,
|
|
|
+ dayAvg: null,
|
|
|
+ dayMax: null,
|
|
|
+ dayMin: null,
|
|
|
+ hourMaxTime: null,
|
|
|
+ dayMaxTime: null,
|
|
|
+ hourMinTime: null,
|
|
|
+ dayMinTime: null,
|
|
|
+ dictset: null,
|
|
|
+ summaryDate: null,
|
|
|
+ valueType: 4,
|
|
|
+ maxVal: null,
|
|
|
+ minVal: null,
|
|
|
+ limitlevels: [
|
|
|
+ {
|
|
|
+ id: null,
|
|
|
+ limitid: null,
|
|
|
+ devicekind: null,
|
|
|
+ devicetype: null,
|
|
|
+ deviceid: null,
|
|
|
+ eventid: null,
|
|
|
+ eventname: null,
|
|
|
+ monitorcode: 'chval',
|
|
|
+ valuetype: 2,
|
|
|
+ alarmType: null,
|
|
|
+ relatedCode: null,
|
|
|
+ fmin: null,
|
|
|
+ fmax: -10000.00000999999974737875163555145263671875,
|
|
|
+ leveltype: 10000,
|
|
|
+ datakind: null,
|
|
|
+ timelength: null,
|
|
|
+ des: '乙炔低于限值',
|
|
|
+ maxDeviceid: null,
|
|
|
+ minDeviceid: null,
|
|
|
+ maxCode: null,
|
|
|
+ minCode: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: null,
|
|
|
+ limitid: null,
|
|
|
+ devicekind: null,
|
|
|
+ devicetype: null,
|
|
|
+ deviceid: null,
|
|
|
+ eventid: null,
|
|
|
+ eventname: null,
|
|
|
+ monitorcode: 'chval',
|
|
|
+ valuetype: 2,
|
|
|
+ alarmType: null,
|
|
|
+ relatedCode: null,
|
|
|
+ fmin: 1000.000009999999974752427078783512115478515625,
|
|
|
+ fmax: 1000000,
|
|
|
+ leveltype: 10000,
|
|
|
+ datakind: null,
|
|
|
+ timelength: null,
|
|
|
+ des: '乙炔高于限值',
|
|
|
+ maxDeviceid: null,
|
|
|
+ minDeviceid: null,
|
|
|
+ maxCode: null,
|
|
|
+ minCode: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ warnFlag: null,
|
|
|
+ time: '2025-10-30 14:31:32',
|
|
|
+ timelength: null,
|
|
|
+ warnInfo: '读取数据为空',
|
|
|
+ warnRank: null,
|
|
|
+ saveflag: 1,
|
|
|
+ spaceSave: null,
|
|
|
+ avgflag: 1,
|
|
|
+ warnKindType: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ plcAddr: 'c2h2',
|
|
|
+ lastSummaryDate: null,
|
|
|
+ },
|
|
|
+ o2val: {
|
|
|
+ id: 1611236056970683001,
|
|
|
+ saveid: 0,
|
|
|
+ valueCode: 'o2val',
|
|
|
+ valueName: '氧气',
|
|
|
+ value: '19.96',
|
|
|
+ hourNum: null,
|
|
|
+ dayNum: null,
|
|
|
+ hourAvg: null,
|
|
|
+ hourMax: null,
|
|
|
+ hourMin: null,
|
|
|
+ dayAvg: null,
|
|
|
+ dayMax: null,
|
|
|
+ dayMin: null,
|
|
|
+ hourMaxTime: null,
|
|
|
+ dayMaxTime: null,
|
|
|
+ hourMinTime: null,
|
|
|
+ dayMinTime: null,
|
|
|
+ dictset: null,
|
|
|
+ summaryDate: null,
|
|
|
+ valueType: 4,
|
|
|
+ maxVal: null,
|
|
|
+ minVal: null,
|
|
|
+ limitlevels: [
|
|
|
+ {
|
|
|
+ id: null,
|
|
|
+ limitid: null,
|
|
|
+ devicekind: null,
|
|
|
+ devicetype: null,
|
|
|
+ deviceid: null,
|
|
|
+ eventid: null,
|
|
|
+ eventname: null,
|
|
|
+ monitorcode: 'o2val',
|
|
|
+ valuetype: 2,
|
|
|
+ alarmType: null,
|
|
|
+ relatedCode: null,
|
|
|
+ fmin: null,
|
|
|
+ fmax: -10000.00000999999974737875163555145263671875,
|
|
|
+ leveltype: 10000,
|
|
|
+ datakind: null,
|
|
|
+ timelength: null,
|
|
|
+ des: '氧气低于限值',
|
|
|
+ maxDeviceid: null,
|
|
|
+ minDeviceid: null,
|
|
|
+ maxCode: null,
|
|
|
+ minCode: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: null,
|
|
|
+ limitid: null,
|
|
|
+ devicekind: null,
|
|
|
+ devicetype: null,
|
|
|
+ deviceid: null,
|
|
|
+ eventid: null,
|
|
|
+ eventname: null,
|
|
|
+ monitorcode: 'o2val',
|
|
|
+ valuetype: 2,
|
|
|
+ alarmType: null,
|
|
|
+ relatedCode: null,
|
|
|
+ fmin: 1000.000009999999974752427078783512115478515625,
|
|
|
+ fmax: 1000000,
|
|
|
+ leveltype: 10000,
|
|
|
+ datakind: null,
|
|
|
+ timelength: null,
|
|
|
+ des: '氧气高于限值',
|
|
|
+ maxDeviceid: null,
|
|
|
+ minDeviceid: null,
|
|
|
+ maxCode: null,
|
|
|
+ minCode: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ warnFlag: null,
|
|
|
+ time: '2025-10-30 14:31:32',
|
|
|
+ timelength: null,
|
|
|
+ warnInfo: '读取数据为空',
|
|
|
+ warnRank: null,
|
|
|
+ saveflag: 1,
|
|
|
+ spaceSave: null,
|
|
|
+ avgflag: 1,
|
|
|
+ warnKindType: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ plcAddr: 'o2',
|
|
|
+ lastSummaryDate: null,
|
|
|
+ },
|
|
|
+ co2val: {
|
|
|
+ id: 1611236056970682379,
|
|
|
+ saveid: 0,
|
|
|
+ valueCode: 'co2val',
|
|
|
+ valueName: '二氧化碳',
|
|
|
+ value: '0.22',
|
|
|
+ hourNum: null,
|
|
|
+ dayNum: null,
|
|
|
+ hourAvg: null,
|
|
|
+ hourMax: null,
|
|
|
+ hourMin: null,
|
|
|
+ dayAvg: null,
|
|
|
+ dayMax: null,
|
|
|
+ dayMin: null,
|
|
|
+ hourMaxTime: null,
|
|
|
+ dayMaxTime: null,
|
|
|
+ hourMinTime: null,
|
|
|
+ dayMinTime: null,
|
|
|
+ dictset: null,
|
|
|
+ summaryDate: null,
|
|
|
+ valueType: 4,
|
|
|
+ maxVal: null,
|
|
|
+ minVal: null,
|
|
|
+ limitlevels: [
|
|
|
+ {
|
|
|
+ id: null,
|
|
|
+ limitid: null,
|
|
|
+ devicekind: null,
|
|
|
+ devicetype: null,
|
|
|
+ deviceid: null,
|
|
|
+ eventid: null,
|
|
|
+ eventname: null,
|
|
|
+ monitorcode: 'co2val',
|
|
|
+ valuetype: 2,
|
|
|
+ alarmType: null,
|
|
|
+ relatedCode: null,
|
|
|
+ fmin: null,
|
|
|
+ fmax: -10000.00000999999974737875163555145263671875,
|
|
|
+ leveltype: 10000,
|
|
|
+ datakind: null,
|
|
|
+ timelength: null,
|
|
|
+ des: '二氧化碳低于限值',
|
|
|
+ maxDeviceid: null,
|
|
|
+ minDeviceid: null,
|
|
|
+ maxCode: null,
|
|
|
+ minCode: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: null,
|
|
|
+ limitid: null,
|
|
|
+ devicekind: null,
|
|
|
+ devicetype: null,
|
|
|
+ deviceid: null,
|
|
|
+ eventid: null,
|
|
|
+ eventname: null,
|
|
|
+ monitorcode: 'co2val',
|
|
|
+ valuetype: 2,
|
|
|
+ alarmType: null,
|
|
|
+ relatedCode: null,
|
|
|
+ fmin: 1000.000009999999974752427078783512115478515625,
|
|
|
+ fmax: 1000000,
|
|
|
+ leveltype: 10000,
|
|
|
+ datakind: null,
|
|
|
+ timelength: null,
|
|
|
+ des: '二氧化碳高于限值',
|
|
|
+ maxDeviceid: null,
|
|
|
+ minDeviceid: null,
|
|
|
+ maxCode: null,
|
|
|
+ minCode: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ warnFlag: null,
|
|
|
+ time: '2025-10-30 14:31:32',
|
|
|
+ timelength: null,
|
|
|
+ warnInfo: '读取数据为空',
|
|
|
+ warnRank: null,
|
|
|
+ saveflag: 1,
|
|
|
+ spaceSave: null,
|
|
|
+ avgflag: 1,
|
|
|
+ warnKindType: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ plcAddr: 'co2',
|
|
|
+ lastSummaryDate: null,
|
|
|
+ },
|
|
|
+ deviceStatus: {
|
|
|
+ id: 1611236056970682466,
|
|
|
+ saveid: 0,
|
|
|
+ valueCode: 'deviceStatus',
|
|
|
+ valueName: '运行状态',
|
|
|
+ value: '',
|
|
|
+ hourNum: null,
|
|
|
+ dayNum: null,
|
|
|
+ hourAvg: null,
|
|
|
+ hourMax: null,
|
|
|
+ hourMin: null,
|
|
|
+ dayAvg: null,
|
|
|
+ dayMax: null,
|
|
|
+ dayMin: null,
|
|
|
+ hourMaxTime: null,
|
|
|
+ dayMaxTime: null,
|
|
|
+ hourMinTime: null,
|
|
|
+ dayMinTime: null,
|
|
|
+ dictset: null,
|
|
|
+ summaryDate: null,
|
|
|
+ valueType: 3,
|
|
|
+ maxVal: null,
|
|
|
+ minVal: null,
|
|
|
+ limitlevels: [],
|
|
|
+ warnFlag: null,
|
|
|
+ time: '2025-10-30 14:31:32',
|
|
|
+ timelength: null,
|
|
|
+ warnInfo: null,
|
|
|
+ warnRank: null,
|
|
|
+ saveflag: 1,
|
|
|
+ spaceSave: null,
|
|
|
+ avgflag: null,
|
|
|
+ warnKindType: null,
|
|
|
+ isVoice: null,
|
|
|
+ isCxVoice: null,
|
|
|
+ voiceFre: null,
|
|
|
+ plcAddr: 'M49.0',
|
|
|
+ lastSummaryDate: null,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ oldData: {},
|
|
|
+ oldreadTime: null,
|
|
|
+ fclearwidth: null,
|
|
|
+ fperheight: null,
|
|
|
+ nwindow: null,
|
|
|
+ nwindownum: null,
|
|
|
+ sign: null,
|
|
|
+ isRun: null,
|
|
|
+ saveflag: null,
|
|
|
+ spaceSave: 0,
|
|
|
+ linkInfo: null,
|
|
|
+ linkId: null,
|
|
|
+ bakflag: null,
|
|
|
+ password: null,
|
|
|
+ strserno: 'sg003',
|
|
|
+ strRemark: null,
|
|
|
+ other1: null,
|
|
|
+ other2: null,
|
|
|
+ other3: null,
|
|
|
+ sysKind: 'fireS',
|
|
|
+ orderNum: 0,
|
|
|
+ dtype: 'bundletube',
|
|
|
+ nfrontPluseCircle: null,
|
|
|
+ nbackPluseCircle: null,
|
|
|
+ };
|
|
|
+ monitorList.value = Object.values(result.readData);
|
|
|
+ } catch (error) {
|
|
|
+ console.error(`加载设备 ${deviceId} 数据失败:`, error);
|
|
|
+ } finally {
|
|
|
+ loadingMap[deviceId] = false;
|
|
|
}
|
|
|
-};
|
|
|
-
|
|
|
-// 值样式分类
|
|
|
-const getValueClass = (value) => {
|
|
|
- if (value > 30) return 'high-value';
|
|
|
- if (value < 10) return 'low-value';
|
|
|
- return 'normal-value';
|
|
|
-};
|
|
|
-
|
|
|
-// 模拟API获取监测数据
|
|
|
-const mockFetchMonitoringData = (deviceId) => {
|
|
|
- const dataMap = {
|
|
|
- D001: [
|
|
|
- { field: '模拟数据', value: (Math.random() * 10).toFixed(2), unit: '1' },
|
|
|
- { field: '模拟数据', value: (Math.random() * 10).toFixed(2), unit: '1' },
|
|
|
- ],
|
|
|
- D002: [
|
|
|
- { field: '模拟数据', value: (Math.random() * 10).toFixed(2), unit: '1' },
|
|
|
- { field: '模拟数据', value: (Math.random() * 10).toFixed(2), unit: '1' },
|
|
|
- ],
|
|
|
- D003: [
|
|
|
- { field: '模拟数据', value: (Math.random() * 10).toFixed(2), unit: '1' },
|
|
|
- { field: '模拟数据', value: (Math.random() * 10).toFixed(2), unit: '1' },
|
|
|
- ],
|
|
|
- };
|
|
|
- return dataMap[deviceId] || [];
|
|
|
+ // const result = await getDevMonitorListById({ deviceId });
|
|
|
};
|
|
|
onMounted(async () => {
|
|
|
- getDeviceType();
|
|
|
+ getSubStationList();
|
|
|
+ getDeviceList();
|
|
|
});
|
|
|
onUnmounted(() => {});
|
|
|
</script>
|