报警列表增加查询

This commit is contained in:
joylink_zhaoerwei 2023-09-14 10:56:08 +08:00
parent 238edf7869
commit a1c73423f2
2 changed files with 80 additions and 13 deletions

View File

@ -10,12 +10,17 @@
v-model:pagination="pagination" v-model:pagination="pagination"
:rows-per-page-options="[10, 20, 50, 100]" :rows-per-page-options="[10, 20, 50, 100]"
:loading="loading" :loading="loading"
:filter="filter"
binary-state-sort binary-state-sort
@request="onRequest" @request="onRequest"
> >
<template v-slot:top-right> <template v-slot:top-right>
<div class="q-gutter-sm row justify-center"> <div class="q-gutter-sm row justify-center">
<q-btn
class="q-mr-md"
color="primary"
label="查询"
@click="searchDialog = true"
/>
<q-btn color="primary" label="报警统计" @click="showStatistics" /> <q-btn color="primary" label="报警统计" @click="showStatistics" />
</div> </div>
</template> </template>
@ -31,6 +36,39 @@
</q-td> </q-td>
</template> </template>
</q-table> </q-table>
<q-dialog
v-model="searchDialog"
persistent
transition-show="scale"
transition-hide="scale"
>
<q-card style="width: 300px">
<q-card-section>
<div class="text-h6">查询报警信息</div>
</q-card-section>
<q-card-section>
<q-input
outlined
v-model.number="filter.lineId"
label="线路ID"
type="number"
class="q-mb-md"
lazy-rules
/>
<q-select
outlined
label="故障类型"
v-model="filter.alertType"
:options="optionsAlertType"
/>
</q-card-section>
<q-card-actions align="right">
<q-btn color="primary" label="确定" @click="searchDecisionInfo()" />
<q-btn label="取消" v-close-popup />
</q-card-actions>
</q-card>
</q-dialog>
</div> </div>
</template> </template>
@ -130,10 +168,6 @@ const columnDefs: QTableColumn[] = [
const tableRef = ref(); const tableRef = ref();
const rows = reactive([]); const rows = reactive([]);
const filter = reactive({
alertType: '',
lineId: '',
});
const loading = ref(false); const loading = ref(false);
const pagination = ref({ const pagination = ref({
sortBy: 'desc', sortBy: 'desc',
@ -145,14 +179,13 @@ const pagination = ref({
async function onRequest(props: any) { async function onRequest(props: any) {
const { page, rowsPerPage, sortBy, descending } = props.pagination; const { page, rowsPerPage, sortBy, descending } = props.pagination;
const filter = props.filter;
loading.value = true; loading.value = true;
try { try {
let response = await alarmInfoListQuery({ let response = await alarmInfoListQuery({
current: page, current: page,
size: rowsPerPage, size: rowsPerPage,
alertType: (saveAlertTypeData as never)[filter.alertType], alertType: (saveAlertTypeData as never)[filter.value.alertType],
lineId: filter.lineId, lineId: +filter.value.lineId,
}); });
const pageData = response; const pageData = response;
pagination.value.rowsNumber = pageData.total; pagination.value.rowsNumber = pageData.total;
@ -178,6 +211,40 @@ onMounted(() => {
}); });
}); });
const searchDialog = ref(false);
const filter = ref({
alertType: '',
lineId: '',
});
const optionsAlertType = [
'蓝显',
'全线蓝显',
'列车延误2分钟',
'列车延误10分钟',
'整侧站台门无关闭锁紧信号',
'整侧站台门无法打开',
'整侧站台门无法关闭',
'道岔均失表',
'道岔定位失表',
'道岔反位失表',
'计轴红光带',
'计轴大面积红光带',
'计轴橙光带',
'计轴大面积橙光带',
'道岔大面积失表',
'列车信号故障',
];
function searchDecisionInfo() {
searchDialog.value = false;
try {
tableRef.value.requestServerInteraction();
} finally {
setTimeout(() => {
filter.value = { alertType: '', lineId: '' };
});
}
}
const dialogInstance = ref(); const dialogInstance = ref();
function openAlarmDialog(row: any) { function openAlarmDialog(row: any) {
row.alert_time = row.alertTime; row.alert_time = row.alertTime;

View File

@ -237,10 +237,6 @@ const columnDefs: QTableColumn[] = [
const operateDisabled = ref(false); const operateDisabled = ref(false);
const tableRef = ref(); const tableRef = ref();
const rows = reactive([]); const rows = reactive([]);
const filter = ref({
alertType: '',
areaConfigName: '',
});
const loading = ref(false); const loading = ref(false);
const pagination = ref({ const pagination = ref({
sortBy: 'desc', sortBy: 'desc',
@ -284,13 +280,17 @@ onMounted(() => {
}); });
const searchDialog = ref(false); const searchDialog = ref(false);
const filter = ref({
alertType: '',
areaConfigName: '',
});
function searchDecisionInfo() { function searchDecisionInfo() {
searchDialog.value = false; searchDialog.value = false;
try { try {
tableRef.value.requestServerInteraction(); tableRef.value.requestServerInteraction();
} finally { } finally {
setTimeout(() => { setTimeout(() => {
filter.value = { alertType: '', areaConfigId: '' }; filter.value = { alertType: '', areaConfigName: '' };
}); });
} }
} }