- 统计时间:{{ tableData[0].children.length ? tableData[0].children[0].time : '' }}
+ 统计时间:{{ tableData[0]?.time || '' }}
+
+
+
+
+ {{ child.anotherName }}:
+ {{ child.dataValue === 3.1415926 ? '暂无数据' : child.dataValue }}
+
+
+
+
+
+
+
+
+ MAX
+
+ {{
+ item.children[0].maxValue === 3.1415956 ||
+ typeof item.children[0].maxValue != 'number'
+ ? '暂无数据'
+ : item.children[0].maxValue
+ }}
+
+
+
+ AVG
+
+ {{
+ item.children[0].avgValue === 3.1415956 ||
+ typeof item.children[0].avgValue != 'number'
+ ? '暂无数据'
+ : item.children[0].avgValue
+ }}
+
+
+
+ MIN
+
+ {{
+ item.children[0].minValue === 3.1415956 ||
+ typeof item.children[0].minValue != 'number'
+ ? '暂无数据'
+ : item.children[0].minValue
+ }}
+
+
+
+
@@ -271,9 +348,11 @@ import {
getDeviceData,
getBasicRealData,
getHarmRealData,
- getOverLimitData
+ getOverLimitData,
+ queryDictType,
+
} from '@/api/cs-device-boot/EquipmentDelivery'
-import { deviceHisData, deviceRtData } from '@/api/cs-device-boot/csGroup'
+import { deviceHisData, deviceRtData, realTimeData } from '@/api/cs-device-boot/csGroup'
import { ref, reactive, onMounted, onUnmounted, inject, nextTick, onBeforeUnmount } from 'vue'
import { ElMessage } from 'element-plus'
import DatePicker from '@/components/form/datePicker/index.vue'
@@ -284,6 +363,7 @@ import harmonicSpectrum from './tabs/components/harmonicSpectrum.vue' //实时
import recordWoves from './tabs/components/recordwoves.vue' //实时数据-实时录波子页面
import offLineDataImport from './offLineDataImport/index.vue'
import Event from './tabs/event.vue'
+import nearRealTimeData from './nearRealTimeData.vue'
import { useRouter } from 'vue-router'
import TableHeader from '@/components/table/header/index.vue'
import { useAdminInfo } from '@/stores/adminInfo'
@@ -300,11 +380,12 @@ const tableLoading = ref(false)
const getGroupLoading = ref(false)
const deviceData = ref
(null)
const dataSet = ref('')
+const nearRealTimeDataRef = ref()
const devTypeOptions = ref([])
const devModelOptions = ref([])
const tableData = ref([])
-const tableHeight = mainHeight(330).height
-const tableHeightBox = mainHeight(365).height
+const tableHeight = mainHeight(290).height
+const tableHeightBox = mainHeight(310).height
const mangePopup = ref()
const datePickerRef = ref()
const formInline = reactive({
@@ -316,8 +397,10 @@ const formInline = reactive({
endTime: '',
id: '',
lineId: '',
+ targetType: '',
dataLevel: 'Secondary'
})
+
const detail = ref(null)
//是否显示实时数据默认内容
const realTimeFlag = ref(true)
@@ -339,6 +422,7 @@ const changeTrendType = (val: any) => {
const activeTrendName: any = ref(0)
const trendTimer: any = ref()
const trendDataTime: any = ref()
+
//谐波频谱方法
const handleTrend = async () => {
realTimeFlag.value = false
@@ -493,6 +577,7 @@ const nodeClick = async (e: anyObj) => {
formInline.lineId = e.level == 3 ? e.id : e.children[0].id
await getDeviceData(e.level == 3 ? e.pid : e.id, 'history', e.level == 3 ? e.id : e.children[0].id)
.then((res: any) => {
+
deviceData.value = res.data
formInline.dataLevel = res.data.dataLevel
dataLevel.value = res.data.dataLevel
@@ -504,6 +589,7 @@ const nodeClick = async (e: anyObj) => {
tableData.value = []
loading.value = false
} else {
+
res.data.dataSetList.forEach((item: any) => {
//历史
if (item.type === 'history') {
@@ -522,6 +608,7 @@ const nodeClick = async (e: anyObj) => {
item.id = item.id + '_event'
}
})
+ res.data.dataSetList = res.data.dataSetList.filter((item: any) => item.name != '历史统计数据')
//便携式设备默认二次值
// if (deviceType.value == '1') {
// formInline.dataLevel = 'Primary'
@@ -771,6 +858,7 @@ const handleClick = async (tab?: any) => {
realTimeFlag.value = false
//初始化点击tab隐藏子页面
sonTab.value = null
+ console.log(123, dataSet.value.includes('_history'));
//查询历史指标
if (dataSet.value.includes('_history')) {
@@ -848,12 +936,19 @@ const handleClick = async (tab?: any) => {
//查询当前指标
if (!dataSet.value.includes('_')) {
formInline.id = dataSet.value
- await deviceRtData(formInline)
+ console.log("🚀 ~ handleClick ~ formInline:", formInline)
+
+ // await deviceRtData(formInline)
+ await realTimeData(formInline)
.then((res: any) => {
- tableData.value = res.data.records
+ 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)
})
@@ -913,6 +1008,11 @@ 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 : '/'
}
diff --git a/src/views/govern/device/control/nearRealTimeData.vue b/src/views/govern/device/control/nearRealTimeData.vue
new file mode 100644
index 0000000..a69b6fc
--- /dev/null
+++ b/src/views/govern/device/control/nearRealTimeData.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
+ <
+
+
+
+
+
+
diff --git a/src/views/govern/device/control/tabs/components/realtrend.vue b/src/views/govern/device/control/tabs/components/realtrend.vue
index 539455d..5de6a12 100644
--- a/src/views/govern/device/control/tabs/components/realtrend.vue
+++ b/src/views/govern/device/control/tabs/components/realtrend.vue
@@ -257,7 +257,6 @@ const setRealTrendData = (val: any) => {
tableData.value[key] = val[key]
}
}
-
} else {
if (activeName.value == 2) {
if (numberPart % 2 === 0) {