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

# Conflicts:
#	src/drawApp/lineNetApp.ts
This commit is contained in:
joylink_fanyuhong 2024-11-12 18:02:55 +08:00
commit 1f8b5552c7
4 changed files with 175 additions and 109 deletions

View File

@ -3,11 +3,11 @@
seamless seamless
ref="dialogRef" ref="dialogRef"
@show="onDialogShow" @show="onDialogShow"
:title="props.dialogTitle" title="故障查询"
:width="990" :width="990"
:height="0" :height="580"
> >
<template v-slot:footer> <div class="dialogContainer">
<q-table <q-table
ref="tableRef" ref="tableRef"
row-key="id" row-key="id"
@ -17,22 +17,62 @@
: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"
> >
<template v-slot:body-cell="props"> <template v-slot:body="props">
<q-td :props="props" class="custom-column"> <q-tr
{{ props.value }} :props="props"
<q-tooltip :class="{ changeBackground: props.row.id === clickRowInfo.id }"
anchor="bottom middle" @click="handleRowClick(props.row)"
v-if="props.value && props.value.length > 20" >
<q-td
v-for="col in props.cols"
:key="col.name"
:props="props"
class="custom-column"
> >
<div class="message-tip"> {{ col.value }}
{{ props.value }} <q-tooltip
</div> anchor="bottom middle"
</q-tooltip> v-if="props.value && props.value.length > 20"
</q-td> >
<div class="message-tip">
{{ col.value }}
</div>
</q-tooltip>
</q-td>
</q-tr>
</template> </template>
</q-table> </q-table>
</template>
<q-scroll-area style="width: 490px; height: 560px">
<div class="detaiRow">
<div class="text">
<span class="textHead">故障类型</span> {{
clickRowInfo.faultType
}}
</div>
<div class="text">
<span class="textHead"> {{ showTitle.faultNameShower }}</span
>{{ clickRowInfo.faultNameShower }}
</div>
<q-card class="box-card">
<div class="head">{{ showTitle.faultDriverShower }}</div>
<q-separator />
<div>
<div class="detail">{{ clickRowInfo.faultDriverShower }}</div>
</div>
</q-card>
<q-card class="box-card">
<div class="head">{{ showTitle.resultMsg }}</div>
<q-separator />
<div>
<div class="detail">{{ clickRowInfo.resultMsg }}</div>
</div>
</q-card>
</div>
</q-scroll-area>
</div>
<template v-slot:titleButton> <template v-slot:titleButton>
<q-btn <q-btn
square square
@ -58,7 +98,7 @@
/> />
<q-input <q-input
dense dense
:label="inputSearchName" label="故障现象(故障名称)"
v-model="filter.faultName" v-model="filter.faultName"
lazy-rules lazy-rules
/> />
@ -78,7 +118,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, reactive, ref, computed } from 'vue'; import { reactive, ref, computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import DraggableDialog from '../common/DraggableDialog.vue'; import DraggableDialog from '../common/DraggableDialog.vue';
import { QTable, useQuasar } from 'quasar'; import { QTable, useQuasar } from 'quasar';
@ -89,19 +129,9 @@ import {
FaultTypeItem, FaultTypeItem,
} from 'src/api/faultQuery'; } from 'src/api/faultQuery';
const props = defineProps<{
dialogTitle: string;
}>();
const $q = useQuasar(); const $q = useQuasar();
const lineId = useRoute().params.lineId as string; const lineId = useRoute().params.lineId as string;
const tableTitle = reactive({
faultNameShower: '',
faultDriverShower: '',
resultMsg: '',
});
const tableRef = ref<QTable>(); const tableRef = ref<QTable>();
const columns = computed(() => [ const columns = computed(() => [
{ {
@ -111,13 +141,6 @@ const columns = computed(() => [
required: true, required: true,
align: 'center', align: 'center',
}, },
{
name: 'lineId',
label: '线路',
field: 'lineId',
required: true,
align: 'center',
},
{ {
name: 'faultType', name: 'faultType',
label: '故障类型', label: '故障类型',
@ -130,25 +153,11 @@ const columns = computed(() => [
}, },
{ {
name: 'faultNameShower', name: 'faultNameShower',
label: tableTitle.faultNameShower, label: '消息名称(故障现象)',
field: 'faultNameShower', field: 'faultNameShower',
required: true, required: true,
align: 'center', align: 'center',
}, },
{
name: 'faultDriverShower',
label: tableTitle.faultDriverShower,
field: 'faultDriverShower',
required: true,
align: 'center',
},
{
name: 'resultMsg',
label: tableTitle.resultMsg,
field: 'resultMsg',
required: true,
align: 'center',
},
]); ]);
const rows = reactive([]); const rows = reactive([]);
const loading = ref(false); const loading = ref(false);
@ -189,6 +198,7 @@ const onRequest: QTable['onRequest'] = async (props) => {
pagination.value.rowsNumber = resp.total; pagination.value.rowsNumber = resp.total;
pagination.value.rowsPerPage = resp.size; pagination.value.rowsPerPage = resp.size;
rows.splice(0, rows.length, ...(resp.records as [])); rows.splice(0, rows.length, ...(resp.records as []));
handleRowClick(rows[0]);
} catch (err) { } catch (err) {
$q.notify({ $q.notify({
type: 'negative', type: 'negative',
@ -199,6 +209,35 @@ const onRequest: QTable['onRequest'] = async (props) => {
} }
}; };
const clickRowInfo = reactive({
id: 0,
faultType: '',
faultNameShower: '',
faultDriverShower: '',
resultMsg: '',
});
const showTitle = reactive({
faultNameShower: '',
faultDriverShower: '',
resultMsg: '',
});
function handleRowClick(row: FaultQueryListItem) {
if (row.faultType.includes('FAULT_EMERGENCY_GUIDE')) {
showTitle.faultNameShower = '故障现象';
showTitle.faultDriverShower = '司机处理结果';
showTitle.resultMsg = '行调提醒司机关键点';
} else {
showTitle.faultNameShower = '故障名称';
showTitle.faultDriverShower = '故障现象';
showTitle.resultMsg = '退出服务地点';
}
clickRowInfo.id = row?.id as number;
clickRowInfo.faultType = getFaultTypeName(row) as string;
clickRowInfo.faultNameShower = row.faultNameShower;
clickRowInfo.faultDriverShower = row.faultDriverShower;
clickRowInfo.resultMsg = row.resultMsg;
}
async function queryAllFaultType() { async function queryAllFaultType() {
try { try {
allOptionsFaultType = await faultQueryType(); allOptionsFaultType = await faultQueryType();
@ -226,34 +265,14 @@ function getFaultTypeName(row: FaultQueryListItem) {
} }
const searchOptionsFaultType = ref([{ label: '全部', value: '' }]); const searchOptionsFaultType = ref([{ label: '全部', value: '' }]);
function handleSelectFaultType() { function handleSelectFaultType() {
let allType = ''; allOptionsFaultType.forEach((faultTypeOption) => {
for (let i = 0; i < allOptionsFaultType.length; i++) { faultTypeOption.fts.forEach((fault) =>
if (allOptionsFaultType[i].lineId == +lineId) { searchOptionsFaultType.value.push({
allOptionsFaultType[i].fts.forEach((item) => { label: fault.typeName,
if ( value: fault.faultType,
(props.dialogTitle == '故障指导' && })
item.faultType.includes('FAULT_EMERGENCY_GUIDE')) || );
(props.dialogTitle == '退出服务' && });
item.faultType.includes('FAULT_EXIT_SERVICE'))
) {
searchOptionsFaultType.value.push({
label: item.typeName,
value: item.faultType,
});
if (allType == '') {
allType = item.faultType;
} else {
allType = allType + ',' + item.faultType;
}
}
});
filter.faultType = allType;
searchOptionsFaultType.value[0].value = allType;
break;
}
}
} }
function searchTable() { function searchTable() {
@ -272,26 +291,13 @@ const onDialogShow = () => {
tableRef.value?.requestServerInteraction(); tableRef.value?.requestServerInteraction();
}, 1000); }, 1000);
}; };
const inputSearchName = ref('');
onMounted(() => {
if (props.dialogTitle == '故障指导') {
inputSearchName.value = '故障现象';
tableTitle.faultNameShower = '故障现象';
tableTitle.faultDriverShower = '司机处理结果';
tableTitle.resultMsg = '行调提醒司机关键点';
} else {
inputSearchName.value = '故障名称';
tableTitle.faultNameShower = '故障名称';
tableTitle.faultDriverShower = '故障现象';
tableTitle.resultMsg = '退出服务地点';
}
});
</script> </script>
<style scoped> <style lang='scss' scoped>
.changeBackground {
background-color: #31ccec;
}
.custom-column { .custom-column {
max-width: 250px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
@ -308,4 +314,37 @@ onMounted(() => {
justify-content: center; justify-content: center;
margin-top: 10px; margin-top: 10px;
} }
.dialogContainer {
display: flex;
.detaiRow {
margin: 10px 0 0 20px;
.text {
width: 450px;
word-wrap: break-word;
margin-bottom: 10px;
font-size: 18px;
.textHead {
font-weight: 600;
}
}
.box-card {
width: 450px;
height: 225px;
margin-bottom: 10px;
padding: 0 5px;
.head {
padding: 5px 5px;
font-size: 20px;
font-weight: 600;
}
.detail {
margin-bottom: 10px;
padding: 5px 5px;
line-height: 28px;
white-space: pre-wrap;
font-size: 20px;
}
}
}
}
</style> </style>

View File

@ -157,7 +157,7 @@ export function cancelSubscribe(lineNetApp: IGraphicApp) {
} }
let monitorDestinations: string[] = []; let monitorDestinations: string[] = [];
export function handleSubscribe(lineNetApp: IGraphicApp) { function handleSubscribe(lineNetApp: IGraphicApp) {
const lineNetStore = useLineNetStore(); const lineNetStore = useLineNetStore();
lineNetApp.enableWsMassaging({ lineNetApp.enableWsMassaging({
wsUrl: `${getWebsocketUrl()}`, wsUrl: `${getWebsocketUrl()}`,

View File

@ -18,16 +18,9 @@
<q-btn <q-btn
v-show="route.path.includes('line/monitor')" v-show="route.path.includes('line/monitor')"
color="info" color="info"
label="故障指导" label="故障查询"
class="q-mr-sm" class="q-mr-sm"
@click="openFaultQueryDialog('故障指导')" @click="openFaultQueryDialog()"
/>
<q-btn
v-show="route.path.includes('line/monitor')"
color="info"
label="退出服务"
class="q-mr-sm"
@click="openFaultQueryDialog('退出服务')"
/> />
<q-btn <q-btn
v-show="route.path.includes('line/monitor')" v-show="route.path.includes('line/monitor')"
@ -194,12 +187,9 @@ onMounted(() => {
socket = webSocketConnect(destination, handler); socket = webSocketConnect(destination, handler);
}); });
function openFaultQueryDialog(dialogTitle: string) { function openFaultQueryDialog() {
$q.dialog({ $q.dialog({
component: FaultQueryDialog, component: FaultQueryDialog,
componentProps: {
dialogTitle,
},
}); });
} }

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 { QTable } from 'quasar'; import { Notify, 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;
@ -91,6 +91,43 @@ export const useLineNetStore = defineStore('lineNet', {
}); });
}, },
setConnectInfo(data: state.WarnLineMessage) { setConnectInfo(data: state.WarnLineMessage) {
let tip = '';
data.msgs.forEach((item: state.WarnMessage) => {
if (this.connectInfo) {
this.connectInfo.msgs.forEach((elem) => {
if (elem.lineId === item.lineId) {
if (elem.occRealConned && !item.occRealConned) {
tip =
tip +
`<div>${elem.lineId}号线路与卡斯柯的实时连接已断开;</div>`;
}
if (elem.occUnrealConned && !item.occUnrealConned) {
tip =
tip +
`<div>${elem.lineId}号线路与卡斯柯的非实时连接已断开</div>`;
}
}
});
}
});
if (tip) {
const msgNotify = Notify.create({
type: 'negative',
timeout: 0,
position: 'top',
html: true,
message: tip,
actions: [
{
icon: 'close',
color: 'white',
handler: () => {
msgNotify();
},
},
],
});
}
this.connectInfo = data; this.connectInfo = data;
const allConnectAmount = data.msgs.reduce((pre, cur) => { const allConnectAmount = data.msgs.reduce((pre, cur) => {
let addValue = 0; let addValue = 0;