diff --git a/src/views/Monitoring/index.vue b/src/views/Monitoring/index.vue index 9bf097b..5ed445a 100644 --- a/src/views/Monitoring/index.vue +++ b/src/views/Monitoring/index.vue @@ -148,6 +148,9 @@ @@ -236,15 +239,36 @@ function transformHourlyData(data) { const lineData = ref([]) const recdDate = ref(dayjs().add(-1, 'day').format('YYYY-MM-DD')) const lineDataLoading = ref(false) +const agvEnergy = ref(0) +const maxEnergy = ref(0) const getLineData = () => { lineDataLoading.value = true - RPC.post('/lightm/rtu/his', { commUid: commit_uid, recdDate: recdDate.value }).then(res => { - lineData.value = transformHourlyData(res) + // RPC.post('/lightm/rtu/his', { commUid: commit_uid, recdDate: recdDate.value }).then(res => { + // lineData.value = transformHourlyData(res) + // }).finally(() => { + // lineDataLoading.value = false + // }) + RPC.post('/lightm/rtu/minHis', { CommUid: commit_uid, recdDate: recdDate.value }).then((res) => { + // 直流电流、电源、功率 + // console.log(res) + agvEnergy.value = res.agvEnergy?.toFixed(3) + maxEnergy.value = res.maxEnergy?.toFixed(3) + lineData.value = transformminHisData(res.minutesEnergy) }).finally(() => { lineDataLoading.value = false }) } -getLineData() + +const transformminHisData = arr => { + if (!arr) return + return arr.map(item => { + return { + name: dayjs(item.record_time).format('HH:mm'), + value: item.energy + } + }) +} +// getLineData() // 电力参数数据 const powerPhases = ref([ @@ -403,8 +427,11 @@ const getInfo = () => { }) RPC.post('/m9z/getDeviceStatus2', { comm_uid: commit_uid }).then((res) => { // 直流电流、电源、功率 - info.value = res + if (res.Loops?.length === 10) { + info.value = res + } }) + getLineData() // RPC.post('/m9z/getDeviceSunRiseTime', { comm_uid: commit_uid }).then(res => { // sunriseTime.value = res.Sunrise ? dayjs(res.Sunrise).format('HH:mm:ss') : '' @@ -995,6 +1022,14 @@ onUnmounted(() => { border-color: #006eff; margin-left: 20px; } + + .info_item { + color: #fff; + margin-left: 20px; + border: 0.5px solid #00E0F4; + padding: 5px 10px; + border-radius: 5px; + } } } diff --git a/vite.config.js b/vite.config.js index b1b59c2..f011535 100644 --- a/vite.config.js +++ b/vite.config.js @@ -59,7 +59,7 @@ export default defineConfig({ open: true, proxy: { '/jsonrpc': { - target: 'https://lamp-dev.ruixininfo.com', + target: 'https://cd-databoard-lamp.ruixininfo.com', changeOrigin: true, secure: false, },