diff --git a/ui/dasadmin/src/views/backend/dashboard.vue b/ui/dasadmin/src/views/backend/dashboard.vue index d40abab6..ade8f383 100644 --- a/ui/dasadmin/src/views/backend/dashboard.vue +++ b/ui/dasadmin/src/views/backend/dashboard.vue @@ -1,20 +1,36 @@ @@ -322,10 +338,14 @@ const clearScroll = () => { const createScroll = () => { clearScroll() timer =setInterval(() => { - scrollRef.value.scrollTop += 1 - if (scrollRef.value.clientHeight + scrollRef.value.scrollTop == scrollRef.value.scrollHeight) { - scrollRef.value.scrollTop = 0 + scrollRef.value.scrollLeft += 1; + if (scrollRef.value.clientWidth + scrollRef.value.scrollLeft == scrollRef.value.scrollWidth) { + scrollRef.value.scrollLeft = 0 } + //scrollRef.value.scrollTop += 1 + /* if (scrollRef.value.clientHeight + scrollRef.value.scrollTop == scrollRef.value.scrollHeight) { + scrollRef.value.scrollTop = 0 + }*/ }, 30); } @@ -356,7 +376,7 @@ const sizeChange = () => { if (!rect) return computedHeight.powerHeight = rect.height - 630 + 'px' computedHeight.alarmHeight = rect.height - 5 + 'px' - computedHeight.centerHeight = rect.height - 5 + 'px' + computedHeight.centerHeight = rect.height - 0 + 'px' if (window.screen.width < 1360) { computedHeight.alarmHeight = '300px' computedHeight.powerHeight = '200px' @@ -394,7 +414,7 @@ onUnmounted(() => { diff --git a/ui/dasadmin/src/views/backend/realData/index.vue b/ui/dasadmin/src/views/backend/realData/index.vue index 3c60fbd9..fafa2a56 100644 --- a/ui/dasadmin/src/views/backend/realData/index.vue +++ b/ui/dasadmin/src/views/backend/realData/index.vue @@ -87,7 +87,7 @@
测点选择 - 数据导出 + 数据导出
自动更新:
+ +
+
+ +
+ + + + +
+
+
+
+ + +
@@ -15,6 +68,7 @@ + 选择变量
@@ -26,7 +80,8 @@ import {nextTick, onActivated, onMounted, onUnmounted, reactive, ref} from 'vue' import {equipList,getTemperatureLimitByDeviceId,getsnapshotData} from "/@/api/backend/temperature/request.ts"; import * as echarts from "echarts"; import {useEventListener } from '@vueuse/core' -import {dayjs} from "element-plus"; +import { ElMessage} from "element-plus"; +import {getModelAttributeList} from "/@/api/backend/realData/request"; const defaultProps = { children: 'children', label: 'name' @@ -50,14 +105,14 @@ const deviceQuery = (data: any) => { nextTick(() => { deviceId.value=res.data[0]?.id equipTreeRef.value?.setCurrentKey(deviceData.value[0].children[0].id!, true) - getChartData({id:deviceId.value}) + getChartData({deviceId:deviceId.value,attributes:[]}) }) }) } const handleNodeClick = (data: any) => { deviceId.value=data.id state.charts.temperatureChart.clear() - getChartData({id:deviceId.value}) + getChartData({id:deviceId.value,attributes:[]}) } const state: { @@ -86,7 +141,7 @@ const inittemperatureChar = () => { const option = { grid: { show:true, - top: 50, + top: 0, right: 23, bottom: 10, left: 25, @@ -94,12 +149,6 @@ const inittemperatureChar = () => { borderColor:'transparent', backgroundColor:'rgba(254,55,49,0.20)' }, - // tooltip: { - // trigger: 'axis', - // axisPointer: { - // type: 'shadow', - // }, - // }, xAxis: { type: 'value', interval: 10, @@ -147,7 +196,7 @@ const inittemperatureChar = () => { color: '#4E5969', }, }, - axisTick: { show: true }, + axisTick: { show: false }, splitLine: { interval: 50, lineStyle: { @@ -230,9 +279,86 @@ const inittemperatureChar = () => { temperatureChart.setOption(option) state.charts.temperatureChart = temperatureChart } -const attributesCode:any[]=[] + +const currentPage = ref(1) +const currentPageSize = ref(20) +const pageTotal = ref(0) +const pagePagination = ref([20, 50, 100]) +const modalTbleData=ref([]) + +const visible = ref(false) + +const checkList=ref([]) +const selectcheck=ref([]) +const openMeasure=() =>{ + visible.value=true + variableList() +} +const subSystemDataList=ref([]) +const variableList = () =>{ + const data={ + deviceId:deviceId.value, + attributes:[] + } + getTemperatureLimitByDeviceId(data).then((res) => { + if (res.code=='200') { + subSystemDataList.value=res.data.map((item) => { + return { + measPointName:item.measPointName, + measPointCode: item.measPointCode + } + }) + // selectcheck.value=res.data.map((item) => { + // return item.measPointCode + // }) + + } + }) +} +const queryListData = reactive({ + pageSize: 20, + pageNum: 1, + iotModelId: '', + attributeType: '138' +}) + + +const modelAttributeList=(data: any) =>{ + getModelAttributeList(data).then((res) => { + if (res.code == 200) { + modalTbleData.value = res.rows + pageTotal.value = res.total; + + } else { + ElMessage.error({ + message: res.msg, + type: 'error', + }) + } + }) +} + +const handleSizeChange = (val: number) => { + queryListData.pageSize = val + modelAttributeList(queryListData) +} +const handleCurrentChange = (val: number) => { + queryListData.pageNum = val + modelAttributeList(queryListData) +} +const handleClose = (done: () => void) => { + visible.value = false +} + +const sureBtn = () => { + visible.value = false + selectcheck.value=checkList.value + getChartData({deviceId:deviceId.value,attributes:selectcheck.value}) +} + +let attributesCode:any[]=[] const getChartData = (data: any) => { - console.log(JSON.stringify(data)) + //console.log(JSON.stringify(data)) getTemperatureLimitByDeviceId(data).then((res) => { if (res.code=='200') { temperatureData.name=[] @@ -241,6 +367,7 @@ const getChartData = (data: any) => { temperatureData.limit1Low=[] temperatureData.limit2High=[] temperatureData.limit2Low=[] + attributesCode=[] res.data.forEach((item,index) => { temperatureData.name.push(item.measPointName) attributesCode.push(item.measPointCode) @@ -253,7 +380,13 @@ const getChartData = (data: any) => { temperatureData.limit2Low.push(item.limit2Low) } }) - getTemperaData([{deviceId:data.id,attributes:attributesCode}]) + //console.log(JSON.stringify({deviceId:data.id,attributes:attributesCode})) + if(!data.attributes.length){ + getTemperaData([{deviceId:data.deviceId,attributes:attributesCode}]) + }else{ + getTemperaData([{deviceId:data.deviceId,attributes:data.attributes}]) + } + } }) } @@ -308,7 +441,12 @@ let autoUpdateTimer: any = null const autoUpdate = () => { if (!autoUpdateTimer) { autoUpdateTimer = setInterval(() => { - getChartData({id:deviceId.value}) + if(!selectcheck.value.length){ + getChartData({deviceId:deviceId.value,attributes:[]}) + }else{ + getChartData({deviceId:deviceId.value,attributes:selectcheck.value}) + } + }, 2000) } } @@ -339,9 +477,37 @@ onUnmounted(() => {