设备监控-准实时数据上面修改
This commit is contained in:
@@ -103,11 +103,10 @@ export function getDeviceHarmonicSpectrumData(data: any) {
|
||||
})
|
||||
}
|
||||
//获取指标类型-谐波频谱
|
||||
export function queryDictType() {
|
||||
export function queryDictType(data?: any) {
|
||||
return createAxios({
|
||||
url: '/system-boot/dictTree/queryDictType',
|
||||
method: 'GET',
|
||||
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -149,8 +149,7 @@
|
||||
统计时间:{{ tableData[0]?.time || '' }}
|
||||
</div>
|
||||
|
||||
<nearRealTimeData ref="nearRealTimeDataRef" v-if="dataSet.indexOf('_history') == -1"
|
||||
/>
|
||||
<nearRealTimeData ref="nearRealTimeDataRef" v-if="dataSet.indexOf('_history') == -1" />
|
||||
|
||||
|
||||
<!-- 循环渲染的card 最新数据/历史数据显示 -->
|
||||
@@ -328,6 +327,11 @@
|
||||
v-loading="tableLoading">
|
||||
<Event ref="eventRef"></Event>
|
||||
</div>
|
||||
<!-- 测试项记录 -->
|
||||
<div style="height: calc(100vh - 340px)" v-if="dataSet.indexOf('_items') != -1"
|
||||
v-loading="tableLoading">
|
||||
<!-- <Event ref="eventRef"></Event> -->
|
||||
</div>
|
||||
<div v-if="!tableData" style="height: 42px"></div>
|
||||
</el-tabs>
|
||||
</div>
|
||||
@@ -563,6 +567,12 @@ const deviceId: any = ref('')
|
||||
const lineId: any = ref('')
|
||||
const dataLevel: any = ref('')
|
||||
const nodeClick = async (e: anyObj) => {
|
||||
await queryDictType({
|
||||
lineId: e?.id
|
||||
}).then(res => {
|
||||
queryList.value = res.data
|
||||
formInline.targetType = res.data[0].id
|
||||
})
|
||||
// console.log("🚀 ~ nodeClick ~ e:", e)
|
||||
if (e.level == 2) return
|
||||
deviceId.value = e?.pid
|
||||
@@ -607,6 +617,9 @@ const nodeClick = async (e: anyObj) => {
|
||||
if (item.type === 'event') {
|
||||
item.id = item.id + '_event'
|
||||
}
|
||||
if (item.type === 'items') {
|
||||
item.id = item.id + '_items'
|
||||
}
|
||||
})
|
||||
res.data.dataSetList = res.data.dataSetList.filter((item: any) => item.name != '历史统计数据')
|
||||
//便携式设备默认二次值
|
||||
@@ -933,11 +946,9 @@ const handleClick = async (tab?: any) => {
|
||||
tableLoading.value = false
|
||||
}, 1500)
|
||||
}
|
||||
//查询当前指标
|
||||
if (!dataSet.value.includes('_')) {
|
||||
//测试项记录
|
||||
if (dataSet.value.includes('_items')) {
|
||||
formInline.id = dataSet.value
|
||||
console.log("🚀 ~ handleClick ~ formInline:", formInline)
|
||||
|
||||
// await deviceRtData(formInline)
|
||||
await realTimeData(formInline)
|
||||
.then((res: any) => {
|
||||
@@ -945,7 +956,7 @@ const handleClick = async (tab?: any) => {
|
||||
formInline.total = res.data.total
|
||||
tableLoading.value = false
|
||||
setTimeout(() => { //targetType
|
||||
nearRealTimeDataRef.value.setData(res.data, queryList.value.filter((item: any) => item.id == formInline.targetType))
|
||||
nearRealTimeDataRef.value?.setData(res.data, queryList.value.filter((item: any) => item.id == formInline.targetType))
|
||||
}, 500)
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -958,6 +969,32 @@ const handleClick = async (tab?: any) => {
|
||||
}, 1500)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//查询当前指标
|
||||
if (!dataSet.value.includes('_')) {
|
||||
formInline.id = dataSet.value
|
||||
// await deviceRtData(formInline)
|
||||
await realTimeData(formInline)
|
||||
.then((res: any) => {
|
||||
tableData.value = res.data
|
||||
formInline.total = res.data.total
|
||||
tableLoading.value = false
|
||||
setTimeout(() => { //targetType
|
||||
nearRealTimeDataRef.value?.setData(res.data, queryList.value.filter((item: any) => item.id == formInline.targetType))
|
||||
}, 500)
|
||||
setTimeout(() => {
|
||||
|
||||
loading.value = false
|
||||
}, 1500)
|
||||
})
|
||||
.catch(e => {
|
||||
setTimeout(() => {
|
||||
tableLoading.value = false
|
||||
}, 1500)
|
||||
})
|
||||
}
|
||||
|
||||
if (!dataSet.value.includes('_realtimedata')) {
|
||||
if (realDataTimer.value) {
|
||||
window.clearInterval(realDataTimer.value)
|
||||
@@ -1009,10 +1046,7 @@ queryByCode('Device_Type').then(res => {
|
||||
})
|
||||
})
|
||||
const queryList: any = ref([])
|
||||
queryDictType().then(res => {
|
||||
queryList.value = res.data
|
||||
formInline.targetType = res.data[0].id
|
||||
})
|
||||
|
||||
const echoName = (value: any, arr: any[]) => {
|
||||
return value ? arr.find(item => item.value == value)?.label : '/'
|
||||
}
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
|
||||
<div :style="{ height: height }">
|
||||
<vxe-table height="auto" auto-resize :data="dataList" v-bind="defaultAttribute" :key="key">
|
||||
<vxe-column v-for="item in column" :field="item.field" :title="item.title"></vxe-column>
|
||||
< <!-- <vxe-column field="valueM" title=""></vxe-column> -->
|
||||
<vxe-column v-for="item in column" :field="item.field" :title="item.title"
|
||||
:formatter="formatter"></vxe-column>
|
||||
|
||||
</vxe-table>
|
||||
</div>
|
||||
|
||||
@@ -22,12 +23,13 @@ const setData = (data: any, targetType: any) => {
|
||||
dataList.value = JSON.parse(JSON.stringify(data))
|
||||
|
||||
console.log("🚀 ~ setData ~ targetType:", targetType[0].code)
|
||||
if (targetType[0].code == 'base_data') {
|
||||
if (targetType[0].code == 'base_data' || targetType[0].code == '1') {
|
||||
column.value = [
|
||||
{ field: 'otherName', title: '名称', },
|
||||
{ field: 'valueA', title: 'A相', },
|
||||
{ field: 'valueB', title: 'B相', },
|
||||
{ field: 'valueC', title: 'C相', },
|
||||
{ field: 'valueM', title: '', },
|
||||
]
|
||||
} else if (targetType[0].code == 'other_data') {
|
||||
let list: any = []
|
||||
@@ -59,7 +61,9 @@ const setData = (data: any, targetType: any) => {
|
||||
}
|
||||
key.value += 1
|
||||
}
|
||||
|
||||
const formatter = (row: any) => {
|
||||
return row.cellValue || '/'
|
||||
}
|
||||
|
||||
defineExpose({ setData })
|
||||
</script>
|
||||
|
||||
@@ -255,23 +255,23 @@ const tableStore = new TableStore({
|
||||
{ title: '录入时间', field: 'createTime' },
|
||||
{ title: '网络设备ID', field: 'ndid' },
|
||||
{
|
||||
title: '状态',
|
||||
field: 'status',
|
||||
title: '通讯状态',
|
||||
field: 'runStatus',
|
||||
width: 100,
|
||||
render: 'tag',
|
||||
custom: {
|
||||
1: 'warning',
|
||||
1: 'primary',
|
||||
2: 'success',
|
||||
3: 'primary',
|
||||
4: 'primary',
|
||||
5: 'warning'
|
||||
// 3: 'primary',
|
||||
// 4: 'primary',
|
||||
// 5: 'warning'
|
||||
},
|
||||
replaceValue: {
|
||||
1: '未注册',
|
||||
2: '注册',
|
||||
3: '接入',
|
||||
4: '已取消',
|
||||
5: '未接入'
|
||||
1: '离线',
|
||||
2: '在线',
|
||||
// 3: '接入',
|
||||
// 4: '已取消',
|
||||
// 5: '未接入'
|
||||
}
|
||||
// formatter: row => {
|
||||
// return row.cellValue == 1 ? '未注册' : row.cellValue == 2 ? '注册' : '接入'
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<pane style="background: #fff" :style="height">
|
||||
<TableHeader ref="TableHeaderRef" >
|
||||
<template v-slot:select>
|
||||
<el-form-item label="模板1策略">
|
||||
<el-form-item label="模板策略">
|
||||
<el-select v-model="Template" @change="changetype" placeholder="请选择模版" value-key="id">
|
||||
<el-option v-for="item in templatePolicy" :key="item.id" :label="item.name"
|
||||
:value="item"></el-option>
|
||||
|
||||
Reference in New Issue
Block a user