-
+ }" v-if="dataSet.includes('_realtimedata') && sonTab != 2 && !realTimeFlag">
+
数据时间:{{ trendDataTime || '-' }}
+ :icon="Back" @click="handleReturn">
返回
@@ -503,7 +503,7 @@ const activeTrendName: any = ref(0)
const trendTimer: any = ref()
const trendDataTime: any = ref()
const showButton = ref(false)
-const latestTime=ref('')
+const latestTime = ref('')
const decodeMqttPayload = (message: any) => {
try {
return JSON.parse(JSON.stringify(JSON.parse(new TextDecoder().decode(message))))
@@ -552,6 +552,7 @@ const handleTrend = async () => {
})
.catch(e => {
realTrendRef.value && realTrendRef.value.setRealTrendData(false)
+ harmonicSpectrumRef.value && harmonicSpectrumRef.value.setloading()
tableLoading.value = false
})
@@ -559,8 +560,12 @@ const handleTrend = async () => {
if (res.code == 'A0000') {
realTrendRef.value && realTrendRef.value.setOverLimitData(res.data)
}
+ }).catch(e => {
+ realTrendRef.value && realTrendRef.value.setRealTrendData(false)
+ harmonicSpectrumRef.value && harmonicSpectrumRef.value.setloading()
+ tableLoading.value = false
})
- realTrendRef.value &&
+ await realTrendRef.value &&
realTrendRef.value.open({ devId: deviceId.value, lineId: lineId.value, activeTrendName: activeTrendName.value })
}
//实时趋势
@@ -632,7 +637,7 @@ const handleSearch = () => {
if (oddAndEvenFlag.value) {
list = list.filter((item: any) => {
let str = item.name.split('次')[0]
-
+
if (oddAndEven.value == '1') {
// 奇次
@@ -693,24 +698,25 @@ const nodeClick = async (e: anyObj, node?: any) => {
if (e == undefined) {
return (loading.value = false)
}
- if(e.pname?.includes('便携')){
+ if (e.pname?.includes('便携')) {
deviceType.value = '1'
- }else{
+ } else {
deviceType.value = '2'
}
-
- searchValue.value = ''
- deviceId.value = e?.pid
- lineId.value = e?.id
- TrendList.value = e
- if (!e) {
- loading.value = false
- return
- }
//选中设备名称后,点击标签页也能查询数据,要求点击设备名称后,点击标签页默认查询第一个监测点数据
if (e.level == 3) {
+ searchValue.value = ''
+
+ deviceId.value = e?.pid
+ lineId.value = e?.id
+ TrendList.value = e
+ if (!e) {
+ loading.value = false
+ return
+ }
+
engineeringName.value = node?.parent.parent.data.name
await queryDictType({
@@ -795,7 +801,7 @@ const nodeClick = async (e: anyObj, node?: any) => {
//治理设备和便携式设备切换判断
const deviceType = ref('0')
const pointTypeChange = (val: any, obj: any) => {
-
+
nodeClick(obj)
}
const realTimeRef: any = ref()
@@ -1209,7 +1215,7 @@ const handleClick = async (tab?: any) => {
}
//运行趋势
if (dataSet.value.includes('_devRunTrend')) {
- tableLoading.value=true
+ tableLoading.value = true
setTimeout(async () => {
if (tab.props != undefined) await (datePickerRef.value && datePickerRef.value?.setInterval(5))
@@ -1242,13 +1248,13 @@ const handleClick = async (tab?: any) => {
//查询当前指标
if (!dataSet.value.includes('_')) {
formInline.id = dataSet.value
- latestTime.value=''
- tableData.value=[]
+ latestTime.value = ''
+ tableData.value = []
// await deviceRtData(formInline)
await realTimeData(formInline)
.then((res: any) => {
tableData.value = res.data[0].children
- latestTime.value=res.data[0].dataTime
+ latestTime.value = res.data[0].dataTime
formInline.total = res.data.total
let queryListName = queryList.value.filter((item: any) => item.id == formInline.targetType)
let list = tableData.value.filter((item: any) => {
diff --git a/src/views/govern/device/control/nearRealTimeData.vue b/src/views/govern/device/control/nearRealTimeData.vue
index 847a705..5fe10af 100644
--- a/src/views/govern/device/control/nearRealTimeData.vue
+++ b/src/views/govern/device/control/nearRealTimeData.vue
@@ -205,15 +205,17 @@ const buildTMetric = (name: string, items: RawMetricItem[]): DisplayMetric => {
}
const sharedUnit = getSharedUnit(items)
- const unitsDiffer = sharedUnit == null && new Set(items.map(item => item.unit ?? null)).size > 1
return {
name,
otherName: name,
- unit: getSharedUnit(items),
+ unit: sharedUnit,
type: 't-multi',
subItems: items.map(item => ({
- subTitle: extractSubTitle(item.otherName || item.name || ''),
+ subTitle: buildTitle(
+ extractSubTitle(item.otherName || item.name || ''),
+ item.unit
+ ),
value: item.data,
})),
}
diff --git a/src/views/govern/device/control/supplementaryRecruitment/history.vue b/src/views/govern/device/control/supplementaryRecruitment/history.vue
index 886ac0a..50b24d4 100644
--- a/src/views/govern/device/control/supplementaryRecruitment/history.vue
+++ b/src/views/govern/device/control/supplementaryRecruitment/history.vue
@@ -46,7 +46,7 @@