diff --git a/public/alarmMusic/all-line-blue.mp3 b/public/alarmMusic/all-line-blue.mp3 index 4bda92e..ebd757e 100644 Binary files a/public/alarmMusic/all-line-blue.mp3 and b/public/alarmMusic/all-line-blue.mp3 differ diff --git a/public/alarmMusic/atp-cut.mp3 b/public/alarmMusic/atp-cut.mp3 index 7288aa1..f2550a5 100644 Binary files a/public/alarmMusic/atp-cut.mp3 and b/public/alarmMusic/atp-cut.mp3 differ diff --git a/public/alarmMusic/blue.mp3 b/public/alarmMusic/blue.mp3 index df23371..f7cd920 100644 Binary files a/public/alarmMusic/blue.mp3 and b/public/alarmMusic/blue.mp3 differ diff --git a/public/alarmMusic/cannot-close.mp3 b/public/alarmMusic/cannot-close.mp3 index 9d568d8..51c2857 100644 Binary files a/public/alarmMusic/cannot-close.mp3 and b/public/alarmMusic/cannot-close.mp3 differ diff --git a/public/alarmMusic/cannot-open.mp3 b/public/alarmMusic/cannot-open.mp3 index 55c0e0a..20718ea 100644 Binary files a/public/alarmMusic/cannot-open.mp3 and b/public/alarmMusic/cannot-open.mp3 differ diff --git a/public/alarmMusic/orange-most.mp3 b/public/alarmMusic/orange-most.mp3 index 5cf2991..317fc43 100644 Binary files a/public/alarmMusic/orange-most.mp3 and b/public/alarmMusic/orange-most.mp3 differ diff --git a/public/alarmMusic/orange.mp3 b/public/alarmMusic/orange.mp3 index 0337816..e707d7c 100644 Binary files a/public/alarmMusic/orange.mp3 and b/public/alarmMusic/orange.mp3 differ diff --git a/public/alarmMusic/red-most.mp3 b/public/alarmMusic/red-most.mp3 index fad1085..5dfb884 100644 Binary files a/public/alarmMusic/red-most.mp3 and b/public/alarmMusic/red-most.mp3 differ diff --git a/public/alarmMusic/red.mp3 b/public/alarmMusic/red.mp3 index 5fe1ba2..8fcf8cd 100644 Binary files a/public/alarmMusic/red.mp3 and b/public/alarmMusic/red.mp3 differ diff --git a/public/alarmMusic/switch-lost-most.mp3 b/public/alarmMusic/switch-lost-most.mp3 index 375c7b8..d8f69ec 100644 Binary files a/public/alarmMusic/switch-lost-most.mp3 and b/public/alarmMusic/switch-lost-most.mp3 differ diff --git a/public/alarmMusic/switch-lost.mp3 b/public/alarmMusic/switch-lost.mp3 index 6e097e6..d4b3719 100644 Binary files a/public/alarmMusic/switch-lost.mp3 and b/public/alarmMusic/switch-lost.mp3 differ diff --git a/src/api/ConfigApi.ts b/src/api/ConfigApi.ts index bfc09a2..82aeb7f 100644 --- a/src/api/ConfigApi.ts +++ b/src/api/ConfigApi.ts @@ -13,13 +13,15 @@ export async function getDeviceAreaList({ deviceType, current, size, + areaName, }: { lineId?: string; deviceType?: string; + areaName?: string; } & PageQueryDto) { const resp = await api.get>( - '/api/config/device/area/page', - { params: { current, size, lineId, deviceType } } + `/api/config/device/area/page/${lineId}`, + { params: { current, size, deviceType, areaName } } ); if (resp.status === 200) { return resp.data; @@ -61,10 +63,3 @@ export function queryDeviceRangeById( interface IAreaConfig { data: T; } - -export async function getAllDeviceArea() { - return await api.get>( - '/api/config/device/area/page', - { params: { current: 1, size: 50 } } - ); -} diff --git a/src/api/DecisionInfo.ts b/src/api/DecisionInfo.ts index 2f95f4f..4bad973 100644 --- a/src/api/DecisionInfo.ts +++ b/src/api/DecisionInfo.ts @@ -1,7 +1,7 @@ import { api } from 'src/boot/axios'; import { PageDto, PageQueryDto } from './ApiCommon'; -const DraftUriBase = '/api/alertTip'; +const AlertTipUriBase = '/api/alertTip'; interface AlarmInfoCreateParams { alertType: string; @@ -18,12 +18,13 @@ export interface AlarmInfoListItem { areaConfigId: number; drivingInfo: string; submissionInfo: string; + areaConfigName?: string; } export class PagingQueryParams extends PageQueryDto { alertType?: string; timeType?: string; - areaConfigId?: number; + areaConfigName?: string; } /** @@ -34,7 +35,7 @@ export class PagingQueryParams extends PageQueryDto { export async function alarmInfoPageQuery( params: PagingQueryParams ): Promise> { - const response = await api.get(`${DraftUriBase}/page`, { + const response = await api.get(`${AlertTipUriBase}/page`, { params: params, }); return response.data; @@ -47,7 +48,7 @@ export async function alarmInfoPageQuery( export function queryAlarmInfoById( id: number ): Promise> { - return api.get(`${DraftUriBase}/id/${id}`); + return api.get(`${AlertTipUriBase}/id/${id}`); } /** @@ -57,7 +58,7 @@ export function queryAlarmInfoById( export function queryAlarmInfoByType( type: string ): Promise> { - return api.get(`${DraftUriBase}/type/${type}`); + return api.get(`${AlertTipUriBase}/type/${type}`); } /** @@ -66,7 +67,7 @@ export function queryAlarmInfoByType( * @returns */ export function createAlarmInfo(draftData: AlarmInfoCreateParams) { - return api.post(`${DraftUriBase}`, draftData); + return api.post(`${AlertTipUriBase}`, draftData); } /** @@ -74,7 +75,7 @@ export function createAlarmInfo(draftData: AlarmInfoCreateParams) { * @param id 草稿id */ export function deleteAlarmInfo(id: number) { - return api.delete(`${DraftUriBase}/id/${id}`); + return api.delete(`${AlertTipUriBase}/id/${id}`); } /** @@ -83,7 +84,7 @@ export function deleteAlarmInfo(id: number) { * @returns */ export function updataAlarmInfo(id: number, data: AlarmInfoListItem) { - return api.put(`${DraftUriBase}/id`, data); + return api.put(`${AlertTipUriBase}/id`, data); } export interface AlarmInfo { @@ -100,7 +101,7 @@ export async function getDeviceAreaByAlarmType( alertType: string ): Promise { const response = await api.post( - `${DraftUriBase}/find/type/${id}/${alertType}`, + `${AlertTipUriBase}/find/type/${id}/${alertType}`, {} ); return response.data; diff --git a/src/components/common/DraggableDialog.vue b/src/components/common/DraggableDialog.vue index b9ef912..6a2f434 100644 --- a/src/components/common/DraggableDialog.vue +++ b/src/components/common/DraggableDialog.vue @@ -1,3 +1,47 @@ + + - - diff --git a/src/components/rangeConfigApp/RangeConfig.vue b/src/components/rangeConfigApp/RangeConfig.vue index 6144020..86adf9f 100644 --- a/src/components/rangeConfigApp/RangeConfig.vue +++ b/src/components/rangeConfigApp/RangeConfig.vue @@ -120,8 +120,9 @@ const optionsAlertType = [ '整侧站台门无关闭锁紧信号', '整侧站台门无法打开', '整侧站台门无法关闭', - '道岔失表', '道岔均失表', + '道岔定位失表', + '道岔反位失表', '计轴红光带', '计轴大面积红光带', '计轴橙光带', diff --git a/src/components/rangeConfigApp/RangeList.vue b/src/components/rangeConfigApp/RangeList.vue index 13765f8..21c34f0 100644 --- a/src/components/rangeConfigApp/RangeList.vue +++ b/src/components/rangeConfigApp/RangeList.vue @@ -4,7 +4,7 @@ import { getDeviceAreaList, deleteDeviceArea, } from 'src/api/ConfigApi'; -import { ref } from 'vue'; +import { ref, watch } from 'vue'; import { useRoute } from 'vue-router'; import DraggableDialog from '../common/DraggableDialog.vue'; import { QTable, useQuasar } from 'quasar'; @@ -41,15 +41,33 @@ const pagination = ref({ rowsNumber: 10, }); +const searchAreaName = ref(''); +watch( + () => searchAreaName.value, + () => { + tableRef.value?.requestServerInteraction(); + } +); + const onRequest: QTable['onRequest'] = async (props) => { const { page, rowsPerPage } = props.pagination; loading.value = true; - const resp = await getDeviceAreaList({ - lineId, - current: page, - size: rowsPerPage, - }); - + let resp; + try { + resp = await getDeviceAreaList({ + lineId, + current: page, + size: rowsPerPage, + areaName: searchAreaName.value, + }); + } catch (error) { + errorNotify('没有所查区域名称', ''); + resp = await getDeviceAreaList({ + lineId, + current: page, + size: rowsPerPage, + }); + } pagination.value.page = resp.current; pagination.value.rowsNumber = resp.total; pagination.value.rowsPerPage = resp.size; @@ -113,5 +131,29 @@ function deleteData(row: IAreaConfigListItem) { + diff --git a/src/pages/DecisionInfoManage.vue b/src/pages/DecisionInfoManage.vue index 567719c..dc1ad09 100644 --- a/src/pages/DecisionInfoManage.vue +++ b/src/pages/DecisionInfoManage.vue @@ -10,7 +10,6 @@ v-model:pagination="pagination" :rows-per-page-options="[10, 20, 50, 100]" :loading="loading" - :filter="filter" binary-state-sort @request="onRequest" > @@ -28,13 +27,12 @@ @@ -118,6 +116,38 @@ + + + + +
查询决策信息
+
+ + + + + + + + + +
+
@@ -131,12 +161,12 @@ import { updataAlarmInfo, AlarmInfoListItem, getDeviceAreaByAlarmType, + AreaConfigItem, } from '../api/DecisionInfo'; import { showAlertTypeData, saveAlertTypeData, } from 'src/components/alarm/alarmInfoEnum'; -import { getAllDeviceArea, IAreaConfigListItem } from 'src/api/ConfigApi'; const $q = useQuasar(); @@ -151,11 +181,6 @@ const tableHeight = computed(() => { return props.sizeHeight - 32; }); -onMounted(() => { - tableRef.value.requestServerInteraction(); - searchAllLocationType(); -}); - const columnDefs: QTableColumn[] = [ { name: 'id', @@ -183,18 +208,7 @@ const columnDefs: QTableColumn[] = [ { name: 'areaConfigId', label: '地点定义类型', - field: (row) => { - if (row.areaConfigId) { - let areaConfigareaName; - for (let i = 0; i < optionsLocationList.length; i++) { - if (optionsLocationList[i].id == row.areaConfigId) { - areaConfigareaName = optionsLocationList[i].areaName; - break; - } - } - return areaConfigareaName; - } - }, + field: 'areaConfigName', align: 'center', }, { @@ -223,8 +237,9 @@ const columnDefs: QTableColumn[] = [ const operateDisabled = ref(false); const tableRef = ref(); const rows = reactive([]); -const filter = reactive({ +const filter = ref({ alertType: '', + areaConfigName: '', }); const loading = ref(false); const pagination = ref({ @@ -237,13 +252,13 @@ const pagination = ref({ const onRequest: QTable['onRequest'] = async (props) => { const { page, rowsPerPage, sortBy, descending } = props.pagination; - const filter = props.filter; loading.value = true; try { let response = await alarmInfoPageQuery({ current: page, size: rowsPerPage, - alertType: (saveAlertTypeData as never)[filter.alertType], + alertType: (saveAlertTypeData as never)[filter.value.alertType], + areaConfigName: filter.value.areaConfigName, }); const pageData = response; pagination.value.rowsNumber = pageData.total; @@ -262,6 +277,24 @@ const onRequest: QTable['onRequest'] = async (props) => { } }; +onMounted(() => { + setTimeout(() => { + tableRef.value.requestServerInteraction(); + }); +}); + +const searchDialog = ref(false); +function searchDecisionInfo() { + searchDialog.value = false; + try { + tableRef.value.requestServerInteraction(); + } finally { + setTimeout(() => { + filter.value = { alertType: '', areaConfigId: '' }; + }); + } +} + const createFormShow = ref(false); const myForm = ref(null); const creatForm = reactive({ @@ -304,11 +337,14 @@ function onReset() { myForm.value?.resetValidation(); } +let optionsLocationList: AreaConfigItem[] = []; async function searchLocationType() { try { const alertType = (saveAlertTypeData as never)[creatForm.alertType]; - const res = await getDeviceAreaByAlarmType(3, alertType); - optionsLocationType.value = res.map((item) => item.areaName); + optionsLocationList = await getDeviceAreaByAlarmType(3, alertType); + optionsLocationType.value = optionsLocationList.map( + (item) => item.areaName + ); optionsLocationType.value.push('无'); } catch (err) { $q.notify({ @@ -318,19 +354,6 @@ async function searchLocationType() { } } -let optionsLocationList: IAreaConfigListItem[] = []; -async function searchAllLocationType() { - try { - const resp = await getAllDeviceArea(); - optionsLocationList = resp.data.records; - } catch (err) { - $q.notify({ - type: 'negative', - message: '无法获取范围配置列表', - }); - } -} - function onCreate() { myForm.value?.validate().then(async (res) => { if (res) { @@ -381,13 +404,7 @@ function editData(row: AlarmInfoListItem) { creatForm.id = row.id + ''; creatForm.alertType = (showAlertTypeData as never)[row.alertType + '']; creatForm.timeType = row.timeType || ''; - creatForm.areaConfigId = (showAlertTypeData as never)[row.areaConfigId + '']; - for (let i = 0; i < optionsLocationList.length; i++) { - if (optionsLocationList[i].id == row.areaConfigId) { - creatForm.areaConfigId = optionsLocationList[i].areaName; - break; - } - } + creatForm.areaConfigId = row.areaConfigName as string; creatForm.drivingInfo = row.drivingInfo ? JSON.parse(row.drivingInfo) : ''; creatForm.submissionInfo = row.submissionInfo ? JSON.parse(row.submissionInfo)