Merge remote-tracking branch 'origin/develop' into local-test
All checks were successful
local-test分支构建发布 / Docker-Build (push) Successful in 1m49s

# Conflicts:
#	src/components/dialog/FaultQueryDialog.vue
This commit is contained in:
joylink_fanyuhong 2024-11-13 10:09:51 +08:00
commit 5269e91153
3 changed files with 51 additions and 26 deletions

View File

@ -5,7 +5,7 @@
@show="onDialogShow" @show="onDialogShow"
title="故障查询" title="故障查询"
:width="990" :width="990"
:height="580" :height="600"
> >
<div class="dialogContainer"> <div class="dialogContainer">
<q-table <q-table
@ -17,7 +17,7 @@
:columns="columns" :columns="columns"
@request="onRequest" @request="onRequest"
:rows-per-page-options="[10, 20, 50, 100]" :rows-per-page-options="[10, 20, 50, 100]"
style="width: 500px; height: 580px" style="width: 500px; height: 600px"
> >
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr <q-tr
@ -45,7 +45,7 @@
</template> </template>
</q-table> </q-table>
<q-scroll-area style="width: 490px; height: 560px"> <q-scroll-area style="width: 490px; height: 580px">
<div class="detaiRow"> <div class="detaiRow">
<div class="text"> <div class="text">
<span class="textHead">故障类型</span> {{ <span class="textHead">故障类型</span> {{
@ -200,6 +200,11 @@ const onRequest: QTable['onRequest'] = async (props) => {
rows.splice(0, rows.length, ...(resp.records as [])); rows.splice(0, rows.length, ...(resp.records as []));
if (rows.length) { if (rows.length) {
handleRowClick(rows[0]); handleRowClick(rows[0]);
} else {
clickRowInfo.faultType = '';
clickRowInfo.faultNameShower = '';
clickRowInfo.faultDriverShower = '';
clickRowInfo.resultMsg = '';
} }
} catch (err) { } catch (err) {
$q.notify({ $q.notify({
@ -331,7 +336,7 @@ const onDialogShow = () => {
} }
.box-card { .box-card {
width: 450px; width: 450px;
height: 225px; height: 235px;
margin-bottom: 10px; margin-bottom: 10px;
padding: 0 5px; padding: 0 5px;
.head { .head {

View File

@ -108,7 +108,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, onMounted, onUnmounted, computed } from 'vue'; import { ref, reactive, onMounted, onUnmounted, computed, watch } from 'vue';
import SysMenu from 'src/components/SysMenu.vue'; import SysMenu from 'src/components/SysMenu.vue';
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
import { Dialog, DialogChainObject, useQuasar } from 'quasar'; import { Dialog, DialogChainObject, useQuasar } from 'quasar';
@ -141,6 +141,17 @@ const router = useRouter();
const route = useRoute(); const route = useRoute();
const lineStore = useLineStore(); const lineStore = useLineStore();
const lineNetStore = useLineNetStore(); const lineNetStore = useLineNetStore();
watch(
() => route.path,
() => {
if (!route.path.includes('line/monitor') && faultQueryDialogInstance) {
faultQueryDialogInstance.hide();
faultQueryDialogInstance = null;
}
}
);
function toggleLeftDrawer() { function toggleLeftDrawer() {
leftDrawerOpen.value = !leftDrawerOpen.value; leftDrawerOpen.value = !leftDrawerOpen.value;
onResize(); onResize();
@ -187,8 +198,10 @@ onMounted(() => {
socket = webSocketConnect(destination, handler); socket = webSocketConnect(destination, handler);
}); });
let faultQueryDialogInstance: DialogChainObject | null = null;
function openFaultQueryDialog() { function openFaultQueryDialog() {
$q.dialog({ if (faultQueryDialogInstance) return;
faultQueryDialogInstance = $q.dialog({
component: FaultQueryDialog, component: FaultQueryDialog,
}); });
} }

View File

@ -7,7 +7,7 @@ import {
cancelSubscribe, cancelSubscribe,
} from 'src/drawApp/lineNetApp'; } from 'src/drawApp/lineNetApp';
import { markRaw } from 'vue'; import { markRaw } from 'vue';
import { Notify, QTable } from 'quasar'; import { Notify, QNotifyUpdateOptions, QTable } from 'quasar';
import { state } from 'src/protos/system_warn_message'; import { state } from 'src/protos/system_warn_message';
export interface AlarmInfo { export interface AlarmInfo {
id: string; id: string;
@ -22,6 +22,10 @@ export interface AlarmInfo {
alert_location_id: number; alert_location_id: number;
alarmStatus?: number; alarmStatus?: number;
} }
let msgNotify: null | ((props?: QNotifyUpdateOptions | undefined) => void) =
null;
let tip = '';
export const useLineNetStore = defineStore('lineNet', { export const useLineNetStore = defineStore('lineNet', {
state: () => ({ state: () => ({
selectedGraphics: null as JlGraphic[] | null, selectedGraphics: null as JlGraphic[] | null,
@ -91,27 +95,24 @@ export const useLineNetStore = defineStore('lineNet', {
}); });
}, },
setConnectInfo(data: state.WarnLineMessage) { setConnectInfo(data: state.WarnLineMessage) {
let tip = ''; let newTip = '';
data.msgs.forEach((item: state.WarnMessage) => { data.msgs.forEach((item: state.WarnMessage) => {
if (this.connectInfo) { if (!item.occRealConned) {
this.connectInfo.msgs.forEach((elem) => { newTip =
if (elem.lineId === item.lineId) { newTip + `<div>${item.lineId}号线路与卡斯柯的实时连接已断开;</div>`;
if (elem.occRealConned && !item.occRealConned) { }
tip = if (!item.occUnrealConned) {
tip + newTip =
`<div>${elem.lineId}号线路与卡斯柯的实时连接已断开;</div>`; newTip +
} `<div>${item.lineId}号线路与卡斯柯的非实时连接已断开</div>`;
if (elem.occUnrealConned && !item.occUnrealConned) {
tip =
tip +
`<div>${elem.lineId}号线路与卡斯柯的非实时连接已断开</div>`;
}
}
});
} }
}); });
if (tip) { if (newTip && (newTip !== tip || !msgNotify)) {
const msgNotify = Notify.create({ if (msgNotify) {
msgNotify();
}
tip = newTip;
msgNotify = Notify.create({
type: 'negative', type: 'negative',
timeout: 0, timeout: 0,
position: 'top', position: 'top',
@ -122,11 +123,17 @@ export const useLineNetStore = defineStore('lineNet', {
icon: 'close', icon: 'close',
color: 'white', color: 'white',
handler: () => { handler: () => {
msgNotify(); if (msgNotify) {
msgNotify();
}
}, },
}, },
], ],
}); });
} else if (!newTip) {
if (msgNotify) {
msgNotify();
}
} }
this.connectInfo = data; this.connectInfo = data;
const allConnectAmount = data.msgs.reduce((pre, cur) => { const allConnectAmount = data.msgs.reduce((pre, cur) => {