| | |
| | | import iconPower from "@/components/icons/iconPower.vue"; |
| | | import formatSeconds from "@/assets/js/tools/formatSeconds.js"; |
| | | import IconDot from "@/components/icons/IconDot.vue"; |
| | | |
| | | import toFixed from "@/assets/js/tools/toFixed.js"; |
| | | import const_digits from "@/assets/js/const/const_digits"; |
| | | const { VOL, GROUPVOL, CURR_YT, CURR_JH } = const_digits; |
| | | |
| | | const infoTab = ref(0); |
| | | const { sendData, message } = useWebSocket("rtstateSocket"); |
| | | |
| | |
| | | onlyOneGroup: { |
| | | type: Boolean, |
| | | default: false, |
| | | } |
| | | }, |
| | | }); |
| | | |
| | | const headers = [ |
| | |
| | | |
| | | const battVolChart = ref(); |
| | | |
| | | const groupCount = computed(() => props.onlyOneGroup ? 1 : 2); |
| | | const groupCount = computed(() => (props.onlyOneGroup ? 1 : 2)); |
| | | |
| | | const rtDatas = computed(() => { |
| | | if (message.value) { |
| | |
| | | devStates = [{}, {}]; |
| | | } |
| | | |
| | | monStates0.forEach(v => { |
| | | v.monState = v.needTest==0 ? '--' : v.monState; |
| | | monStates0.forEach((v) => { |
| | | v.monState = v.needTest == 0 ? "--" : v.monState; |
| | | v.monVol = toFixed(v.monVol, VOL); |
| | | v.monCurr = toFixed(v.monCurr, CURR_JH); |
| | | }); |
| | | |
| | | monStates1.forEach(v => { |
| | | v.monState = v.needTest==0 ? '--' : v.monState; |
| | | monStates1.forEach((v) => { |
| | | v.monState = v.needTest == 0 ? "--" : v.monState; |
| | | v.monVol = toFixed(v.monVol, VOL); |
| | | v.monCurr = toFixed(v.monCurr, CURR_JH); |
| | | }); |
| | | |
| | | return { monStates0, monStates1, devStates, eventList }; |
| | |
| | | if (reg.test(v)) { |
| | | sendData(JSON.stringify({ devId: props.devId, devType: 2 })); |
| | | } |
| | | |
| | | }, |
| | | { immediate: true } |
| | | ); |
| | | |
| | | watch(message, (val) => { |
| | | changeTab(); |
| | | }); |
| | | |
| | | watch(() => props.onlyOneGroup, (val) => { |
| | | if (battVolChart.value) { |
| | | battVolChart.value[0].resize(); |
| | | battVolChart.value[1]?.resize(); |
| | | } |
| | | }); |
| | | |
| | | function changeTab() { |
| | |
| | | } |
| | | |
| | | onMounted(() => { |
| | | // sendData(JSON.stringify({ devId: props.devId, devType: 1 })); |
| | | // console.log('devId,' , props.devId, 'onMounted', '============='); |
| | | |
| | | let reg = /^2/; |
| | | if (reg.test(props.devId)) { |
| | | sendData(JSON.stringify({ devId: props.devId, devType: 2 })); |
| | | } |
| | | }); |
| | | </script> |
| | | |
| | |
| | | class="group" |
| | | :datas="rtDatas.devStates[0]" |
| | | :rtdata="rtDatas.monStates0" |
| | | :idx="0" |
| | | ></jhy-info> |
| | | <jhy-info |
| | | class="group" |
| | | v-if="!onlyOneGroup" |
| | | :datas="rtDatas.devStates[1]" |
| | | :rtdata="rtDatas.monStates1" |
| | | :idx="1" |
| | | ></jhy-info> |
| | | </div> |
| | | <!-- 单体列表 --> |
| | |
| | | ]" |
| | | > |
| | | <div class="index"> |
| | | #{{ rtDatas.devStates[idx].batteryStorageIndex + 1 }} |
| | | <!-- #{{ rtDatas.devStates[idx].batteryStorageIndex + 1 }} --> |
| | | #{{ i }} |
| | | </div> |
| | | <div class="state"> |
| | | <el-icon class="ico"><icon-dot /></el-icon> |
| | |
| | | <div class="chart-info"> |
| | | <div class="label">最大值</div> |
| | | <div class="value max"> |
| | | {{ rtDatas["devStates"][idx].maxBatteryVoltage }}V |
| | | {{ toFixed(rtDatas["devStates"][idx].maxBatteryVoltage, VOL) }}V |
| | | </div> |
| | | <div class="label">最小值</div> |
| | | <div class="value min"> |
| | | {{ rtDatas["devStates"][idx].minBatteryVoltage }}V |
| | | {{ toFixed(rtDatas["devStates"][idx].minBatteryVoltage, VOL) }}V |
| | | </div> |
| | | <div class="label">平均值</div> |
| | | <div class="value"> |
| | | {{ rtDatas["devStates"][idx].avgMonVol }}V |
| | | {{ toFixed(rtDatas["devStates"][idx].avgMonVol, VOL) }}V |
| | | </div> |
| | | </div> |
| | | <div class="chart-wrap1"> |