From aaa8ffcb83ce577612d1c88a295db0e12f87a83c Mon Sep 17 00:00:00 2001 From: he wei <858544502@qq.com> Date: 星期五, 14 四月 2023 14:21:07 +0800 Subject: [PATCH] U 首页修改 --- src/views/home/home-ops.vue | 159 +++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 130 insertions(+), 29 deletions(-) diff --git a/src/views/home/home-ops.vue b/src/views/home/home-ops.vue index c9b532a..f4f9a34 100644 --- a/src/views/home/home-ops.vue +++ b/src/views/home/home-ops.vue @@ -27,6 +27,16 @@ <div class="label">璐熻浇鐔旀柇:</div> <div class="value">{{ sum.fusing }}</div> </div> + <!-- 鍋滅數鏀剧數 --> + <div class="item cur-pointer" @click="getJcdisBatt"> + <div class="label">鍋滅數鏀剧數:</div> + <div class="value">{{ sum.jcdisNum }}</div> + </div> + <!-- 骞村害宸叉牳瀹� --> + <div class="item cur-pointer" v-if="isMain" @click="getHrYeardisBatt"> + <div class="label">骞村害宸叉牳瀹�:</div> + <div class="value">{{ sum.hrdisNum }}</div> + </div> <!-- 鎸夐挳 --> <div class="btn-grp"> <div class="loop-time" v-if="!isMain"> @@ -54,7 +64,7 @@ <div class="row"> <template v-for="(card, idx) in item.slice(0, 4)"> <card class="item" :key="'card_' + idx" v-if="card" :title="card.title" :vol="card.stationType" - :is-node="!!card.nodeStation"> + @showinfo="showInfo(card)" :problem="!!card.pwrinf.exceptionCause" :is-node="!!card.nodeStation"> <info :data="card"></info> </card> <div class="item" :key="'carde1_' + idx" v-else></div> @@ -63,7 +73,7 @@ <div class="row"> <template v-for="(card, idx) in item.slice(4)"> <card class="item" :key="'card1_' + idx" v-if="card" :title="card.title" :vol="card.stationType" - :is-node="!!card.nodeStation"> + @showinfo="showInfo(card)" :problem="!!card.pwrinf.exceptionCause" :is-node="!!card.nodeStation"> <info :data="card"></info> </card> <div class="item" :key="'carde2_' + idx" v-else></div> @@ -86,18 +96,18 @@ </div> </div> - <div class="col col2"> + <div v-for="(item, idx) in kvList" :key="'kv_' + idx" :class="['col', 'col' + (idx + 2)]"> <div class="col-inner"> - <div class="label">220V绔�:</div> - <div class="value">{{ desc.v220 }}</div> + <div class="label">{{ item.name }}绔�:</div> + <div class="value">{{ item.value }}</div> </div> </div> - <div class="col col3"> + <!-- <div class="col col3"> <div class="col-inner"> <div class="label">110kv绔�:</div> <div class="value">{{ desc.v110 }}</div> </div> - </div> + </div> --> </div> <div class="row"> <div class="col col1"> @@ -233,7 +243,8 @@ <!-- <div class="btn" @click="view">鏌ョ湅</div> --> </div> <div class="res-wrap"> - <card class="item" :title="resCard.title" :vol="resCard.stationType" :is-node="!!resCard.nodeStation"> + <card class="item" :title="resCard.title" :vol="resCard.stationType" @showinfo="showInfo(resCard)" + :problem="!!resCard.pwrinf && !!resCard.pwrinf.exceptionCause" :is-node="!!resCard.nodeStation"> <info :data="resCard" v-if="resCard.stationId"></info> <div v-else class="empty">璇烽�夋嫨瑕佹煡鐪嬬殑鏈烘埧</div> </card> @@ -244,7 +255,7 @@ </div> </el-dialog> <!-- --> - <el-dialog :title="listTitle" width="500px" :visible.sync="listVisible" :close-on-click-modal="false" top="0" + <el-dialog :title="listTitle" width="700px" :visible.sync="listVisible" :close-on-click-modal="false" top="0" class="dialog-center" :modal-append-to-body="false"> <el-table height="400" :data="tableData" :show-header="false" style="width: 100%"> <el-table-column type="index" width="50"> @@ -257,6 +268,7 @@ </el-table-column> </el-table> </el-dialog> + <power-remarks :visible.sync="powerRemarksDialog" v-if="powerRemarksDialog" :num="pwrNum"></power-remarks> </div> </template> @@ -266,6 +278,7 @@ import cardBox from '@/components/bigScreenPage/big_screen_card'; import MapChart from "@/components/myCharts/MapChart.vue"; import MapMarkList from "@/components/mapMarkList.vue"; +import PowerRemarks from "@/views/dataMager/components/powerRemarks.vue"; import Timeout from '@/assets/js/tools/Timeout'; import formatSeconds from '@/assets/js/tools/formatSeconds'; @@ -276,6 +289,8 @@ searchCheckCapDischarge, searchCapAlarm, searCapChange, + getJcdisBatt, + getHrYeardisBatt, } from './js/api'; import createWs from "@/assets/js/websocket"; @@ -286,6 +301,9 @@ mixins: [WSMixin], data() { return { + pwrNum: '', + powerRemarksDialog: false, + kvList: [], slideName: "slide-left", tableData: [], listTitle: '鐩稿叧绔欑偣', @@ -316,7 +334,9 @@ discharg: 0, float: 0, fault: 0, - fusing: 0 + fusing: 0, + jcdisNum: 0, + hrdisNum: 0, }, // 鏄惁涓昏鍥� isMain: true, @@ -355,7 +375,8 @@ MapChart, card, info, - cardBox + cardBox, + PowerRemarks, }, watch: { isMain(n) { @@ -408,23 +429,25 @@ fusemap, stationNum, nodeStation, - '220V': v220, - '110V': v110, + kvMap, nomalStation, powerOff, checkCapDischarge, alarmNum, changeNum, + hrdisNum, + jcdisNum, } = res.data2; this.sum.station = stationNum; - this.sum.discharg = battState.batt1; - this.sum.float = battState.batt2; + this.sum.discharg = battState.batt3; + this.sum.float = battState.batt1; this.sum.fault = errmap.err1; this.sum.fusing = fusemap.fuse1; + this.sum.hrdisNum = hrdisNum; + this.sum.jcdisNum = jcdisNum; this.desc.nodeStation = nodeStation; - this.desc.v220 = v220; - this.desc.v110 = v110; + this.kvList = Object.keys(kvMap).map((v) => ({ name: v.toUpperCase(), value: kvMap[v] })).sort((a, b) => b.value - a.value).slice(0, 2); this.desc.nomalStation = nomalStation; this.desc.powerOff = powerOff; this.desc.checkCapDischarge = checkCapDischarge; @@ -465,6 +488,10 @@ isAcdcmod16Err: 0, isLoaderFuse: 0, }; + v.pwrinf = v.pwrinf || { + num: -1, + routeNum: 1, + }; }); this.stationList = data; @@ -479,26 +506,36 @@ format(data) { let { acdc, - sgbList + sgbList, + pwrinf, } = data; let isNode = data.nodeStation ? '鑺傜偣绔�' : '闈炶妭鐐圭珯'; let stationTypeStr = data.stationType ? `${data.stationType}/${isNode}` : isNode; let battList = sgbList.map((v) => { return { testTimeLong: formatSeconds(v.battTestTlong), - battState: ['鍦ㄧ嚎鐩戞祴', '鏀剧數娴嬭瘯', '鍏呯數娴嬭瘯', '鍐呴樆娴嬭瘯'][v.battState] || '鏈煡', + battState: ['鏈煡', '娴厖', '鍏呯數', '鏀剧數', '鍧囧厖', '鍐呴樆娴嬭瘯'][v.battState] || '鏈煡', battAlm1: v.battAlm ? '钀藉悗' : '姝e父', enduranceActualTimelong: v.enduranceActualTimelong * 60 } }); battList.splice(2); let battAlm = battList.reduce((t, v) => t + v.battAlm * 1, 0); + let isOne = 1 == pwrinf.routeNum; + let acinA = acdc.acin1Vola + '/' + acdc.acin2Vola + ' (V)  ' + acdc.acin1Curra + ' (A)', + acinB = acdc.acin1Volb + '/' + acdc.acin2Volb + ' (V)  ' + acdc.acin1Currb + ' (A)', + acinC = acdc.acin1Volc + '/' + acdc.acin2Volc + ' (V)  ' + acdc.acin1Currc + ' (A)'; + if (isOne) { + acinA = acdc.acin1Vola + ' (V)  ' + acdc.acin1Curra + ' (A)'; + acinB = acdc.acin1Volb + ' (V)  ' + acdc.acin1Currb + ' (A)'; + acinC = acdc.acin1Volc + ' (V)  ' + acdc.acin1Currc + ' (A)'; + } return { ...data, battList, - acinA: acdc.acin1Vola + '/' + acdc.acin2Vola + ' (V)  ' + acdc.acin1Curra + '/' + acdc.acin2Curra + ' (A)', - acinB: acdc.acin1Volb + '/' + acdc.acin2Volb + ' (V)  ' + acdc.acin1Currb + '/' + acdc.acin2Currb + ' (A)', - acinC: acdc.acin1Volc + '/' + acdc.acin2Volc + ' (V)  ' + acdc.acin1Currc + '/' + acdc.acin2Currc + ' (A)', + acinA, + acinB, + acinC, dcout: acdc.dcoutVol + ' (V)  ' + acdc.dcoutCurr + ' (A)', battAlm, stationTypeStr, @@ -517,12 +554,14 @@ stationName3, stationName5, stationType, - nodeStation + nodeStation, + pwrinf, } = v; v.sgbList.forEach(item => { list.push({ battInf: item, acdc, + pwrinf, devAlm, pwrAlm, stationId, @@ -763,17 +802,79 @@ "&home=" + obj.stationName3 + "&batt=" + - (obj.battGroupId ? obj.battGroupId : obj.powerDeviceId) + - // list缁勪欢閲嶈浇 - "&listReload=1"; - this.$router.push("/dataTest/movingRingSystem/" + search); + (obj.battGroupId ? obj.battGroupId : obj.powerDeviceId); + // list缁勪欢閲嶈浇 + // "&listReload=1"; + let url = ''; + if (obj.isHis) { + url = '/dataTest/history' + search; + } else { + url = "/dataTest/movingRingSystem/" + search + "&listReload=1"; + } + this.$router.push(url); this.listVisible = false; // if (obj.powerDeviceId) { // this.$router.push("/dataTest/movingRingSystem/ele-info/" + obj.powerDeviceId); // } else { // this.$router.push("/dataTest/movingRingSystem/" + search); // } - } + }, + // 骞村害鏍稿鐢垫睜缁� + getHrYeardisBatt() { + if (this.sum.hrdisNum == 0) { + this.$message.success('娌℃湁鐩稿叧鐢垫睜缁�'); + return false; + } + this.listTitle = '鏈勾搴﹀凡鏍稿鏀剧數鐢垫睜缁勫垪琛�'; + this.tableData = []; + let loading = this.$layer.loading(); + getHrYeardisBatt().then((res) => { + let { code, data, data2 } = res.data; + if (code && data) { + this.$layer.close(loading); + this.listVisible = true; + this.tableData = data2.map(v => { + v.isHis = true; + v.stationName = v.stationName + ' ' + v.battGroupName; + return v; + }); + } else { + this.$layer.close(loading); + this.$message.error('鏌ヨ澶辫触'); + } + }).catch((err) => { + this.$message.error('寮傚父'); + console.log(err); + }); + }, + // 瀹炴椂鍋滅數鏀剧數鐢垫睜缁勫垪琛� + getJcdisBatt() { + if (this.sum.jcdisNum == 0) { + this.$message.success('娌℃湁鐩稿叧绔欑偣'); + return false; + } + this.listTitle = '瀹炴椂鍋滅數鏀剧數绔欑偣鍒楄〃'; + this.tableData = []; + let loading = this.$layer.loading(); + getJcdisBatt().then((res) => { + let { code, data, data2 } = res.data; + if (code && data) { + this.$layer.close(loading); + this.listVisible = true; + this.tableData = data2; + } else { + this.$layer.close(loading); + this.$message.error('鏌ヨ澶辫触'); + } + }).catch((err) => { + this.$message.error('寮傚父'); + console.log(err); + }); + }, + showInfo(obj) { + this.pwrNum = obj.pwrinf.num; + this.powerRemarksDialog = true; + }, }, mounted() { @@ -805,7 +906,7 @@ align-items: center; &:not(:first-child) { - margin-left: 4.4em; + margin-left: 1.4em; } .label { -- Gitblit v1.9.1