Compare commits
8 Commits
54591f401f
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd7238a7f1 | ||
|
|
6c7897198c | ||
|
|
15a9f68db7 | ||
|
|
70f52eb3bb | ||
|
|
c189f79aa4 | ||
|
|
8e9bd75067 | ||
|
|
a215f2e391 | ||
|
|
e19fcf79a6 |
@@ -15,4 +15,5 @@ export * from './alarm';
|
||||
export * from './log';
|
||||
export * from './other';
|
||||
export * from './storage';
|
||||
export * from './upper-ndm';
|
||||
export * from './video';
|
||||
|
||||
2
src/apis/model/biz/entity/upper-ndm/index.ts
Normal file
2
src/apis/model/biz/entity/upper-ndm/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './sync-camera-result';
|
||||
export * from './sync-camera-result-detail';
|
||||
@@ -0,0 +1,6 @@
|
||||
export interface SyncCameraResultDetail {
|
||||
name: string;
|
||||
deviceId: string;
|
||||
ipAddress: string;
|
||||
gbCode: string;
|
||||
}
|
||||
10
src/apis/model/biz/entity/upper-ndm/sync-camera-result.ts
Normal file
10
src/apis/model/biz/entity/upper-ndm/sync-camera-result.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { SyncCameraResultDetail } from './sync-camera-result-detail';
|
||||
|
||||
export interface SyncCameraResult {
|
||||
stationCode: string;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
insertList: SyncCameraResultDetail[];
|
||||
updateList: SyncCameraResultDetail[];
|
||||
deleteList: SyncCameraResultDetail[];
|
||||
}
|
||||
@@ -17,22 +17,24 @@ const cardShow = computed(() => {
|
||||
return Object.values(props).some((value) => !!value);
|
||||
});
|
||||
|
||||
// 门禁状态 (switches[0]: 0=关闭/失效, 1=打开/生效)
|
||||
// 门禁状态
|
||||
const accessControlStatus = computed(() => {
|
||||
if (!switches?.value || switches.value.length === 0) return null;
|
||||
return switches.value[0] === 0 ? '打开' : '关闭';
|
||||
const status = switches.value.at(0)!;
|
||||
return status === 0 ? '开门' : status === 1 ? '关门' : '-';
|
||||
});
|
||||
|
||||
// 防雷状态 (switches[1]: 0=关闭/失效, 1=打开/生效)
|
||||
// 防雷状态
|
||||
const lightningProtectionStatus = computed(() => {
|
||||
if (!switches?.value || switches.value.length < 2) return null;
|
||||
return switches.value[1] === 1 ? '生效' : '失效';
|
||||
const status = switches.value.at(1)!;
|
||||
return status === 0 ? '正常' : status === 1 ? '失效' : '-';
|
||||
});
|
||||
|
||||
// 获取状态标签类型
|
||||
const getStatusTagType = (status: string | null) => {
|
||||
if (['打开', '生效'].includes(status ?? '')) return 'success';
|
||||
if (['关闭', '失效'].includes(status ?? '')) return 'error';
|
||||
if (['正常'].includes(status ?? '')) return 'success';
|
||||
if (['失效'].includes(status ?? '')) return 'error';
|
||||
return 'default';
|
||||
};
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ const { mutate: getDeviceAlarmLogList, isPending } = useMutation({
|
||||
if (!dateTimeRange.value) throw new Error('请选择时间范围');
|
||||
const range = dateTimeRange.value as [number, number];
|
||||
const deviceId = ndmDevice.value.deviceId;
|
||||
if (!deviceId) throw new Error('该设备未配置设备ID');
|
||||
const alarmDate_ge = range[0];
|
||||
const alarmDate_le = range[1];
|
||||
const restParams: Omit<PageParams<{ id: string }>, 'model' | 'extra'> = {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { renderAlarmDateCell, renderDeviceTypeCell, renderAlarmTypeCell, renderF
|
||||
import { downloadByData } from '@/utils';
|
||||
import { useMutation } from '@tanstack/vue-query';
|
||||
import dayjs from 'dayjs';
|
||||
import { NButton, NCol, NDataTable, NModal, NRow, NSpace, NStatistic, NTag, type DataTableColumns, type DataTableProps, type DataTableRowData, type PaginationProps } from 'naive-ui';
|
||||
import { NButton, NDataTable, NGrid, NGridItem, NModal, NSpace, NStatistic, NTag, type DataTableColumns, type DataTableProps, type DataTableRowData, type PaginationProps } from 'naive-ui';
|
||||
import { computed, h, reactive, ref, toRefs } from 'vue';
|
||||
|
||||
interface Props {
|
||||
@@ -125,7 +125,7 @@ const resetFilterFields = () => {
|
||||
filterFields.faultLevel_in = [];
|
||||
};
|
||||
|
||||
const tablePagination = reactive<PaginationProps>({
|
||||
const pagination = reactive<PaginationProps>({
|
||||
size: 'small',
|
||||
showSizePicker: true,
|
||||
page: 1,
|
||||
@@ -135,27 +135,27 @@ const tablePagination = reactive<PaginationProps>({
|
||||
return h('div', {}, { default: () => `共${itemCount}条` });
|
||||
},
|
||||
onUpdatePage: (page: number) => {
|
||||
tablePagination.page = page;
|
||||
getStaionAlarmList();
|
||||
pagination.page = page;
|
||||
getTableData();
|
||||
},
|
||||
onUpdatePageSize: (pageSize: number) => {
|
||||
tablePagination.pageSize = pageSize;
|
||||
tablePagination.page = 1;
|
||||
getStaionAlarmList();
|
||||
pagination.pageSize = pageSize;
|
||||
pagination.page = 1;
|
||||
getTableData();
|
||||
},
|
||||
});
|
||||
|
||||
const tableData = ref<DataTableRowData[]>([]);
|
||||
|
||||
const onAfterModalEnter = () => {
|
||||
getStaionAlarmList();
|
||||
getTableData();
|
||||
};
|
||||
|
||||
const onAfterModalLeave = () => {
|
||||
resetFilterFields();
|
||||
tablePagination.page = 1;
|
||||
tablePagination.pageSize = 10;
|
||||
tablePagination.itemCount = 0;
|
||||
pagination.page = 1;
|
||||
pagination.pageSize = 10;
|
||||
pagination.itemCount = 0;
|
||||
tableData.value = [];
|
||||
};
|
||||
|
||||
@@ -168,10 +168,10 @@ const onUpdateFilters: DataTableProps['onUpdateFilters'] = (filterState) => {
|
||||
filterFields.alarmType_in = alarmTypeKeys;
|
||||
const faultLevelVals = filterState['faultLevel'];
|
||||
filterFields.faultLevel_in = faultLevelVals;
|
||||
getStaionAlarmList();
|
||||
getTableData();
|
||||
};
|
||||
|
||||
const { mutate: getStaionAlarmList, isPending: tableLoading } = useMutation({
|
||||
const { mutate: getTableData, isPending: loading } = useMutation({
|
||||
mutationFn: async () => {
|
||||
const now = dayjs();
|
||||
const res = await pageDeviceAlarmLogApi(
|
||||
@@ -188,8 +188,8 @@ const { mutate: getStaionAlarmList, isPending: tableLoading } = useMutation({
|
||||
createdTime_precisest: now.startOf('date').format('YYYY-MM-DD HH:mm:ss'),
|
||||
createdTime_preciseed: now.endOf('date').format('YYYY-MM-DD HH:mm:ss'),
|
||||
},
|
||||
current: tablePagination.page ?? 1,
|
||||
size: tablePagination.pageSize ?? 10,
|
||||
current: pagination.page ?? 1,
|
||||
size: pagination.pageSize ?? 10,
|
||||
order: 'descending',
|
||||
sort: 'id',
|
||||
},
|
||||
@@ -201,8 +201,8 @@ const { mutate: getStaionAlarmList, isPending: tableLoading } = useMutation({
|
||||
},
|
||||
onSuccess: (res) => {
|
||||
const { records, size, total } = res;
|
||||
tablePagination.pageSize = parseInt(size);
|
||||
tablePagination.itemCount = parseInt(total);
|
||||
pagination.pageSize = parseInt(size);
|
||||
pagination.itemCount = parseInt(total);
|
||||
tableData.value = records;
|
||||
},
|
||||
onError: (error) => {
|
||||
@@ -226,8 +226,8 @@ const { mutate: exportTableData, isPending: exporting } = useMutation({
|
||||
createdTime_precisest: now.startOf('date').format('YYYY-MM-DD HH:mm:ss'),
|
||||
createdTime_preciseed: now.endOf('date').format('YYYY-MM-DD HH:mm:ss'),
|
||||
},
|
||||
current: tablePagination.page ?? 1,
|
||||
size: tablePagination.pageSize ?? 10,
|
||||
current: pagination.page ?? 1,
|
||||
size: pagination.pageSize ?? 10,
|
||||
order: 'descending',
|
||||
sort: 'id',
|
||||
},
|
||||
@@ -264,11 +264,11 @@ const { mutate: exportTableData, isPending: exporting } = useMutation({
|
||||
</div>
|
||||
<div v-else style="height: 100%; display: flex; flex-direction: column">
|
||||
<div style="flex: 0 0 auto; margin-bottom: 16px">
|
||||
<NRow>
|
||||
<NCol :span="3" v-for="item in classifiedAlarmCounts" :key="item.label">
|
||||
<NGrid cols="9">
|
||||
<NGridItem v-for="item in classifiedAlarmCounts" :key="item.label" span="1">
|
||||
<NStatistic :label="item.label + '告警'" :value="item.count" />
|
||||
</NCol>
|
||||
</NRow>
|
||||
</NGridItem>
|
||||
</NGrid>
|
||||
</div>
|
||||
<div style="flex: 0 0 auto; display: flex; align-items: center; padding: 8px 0">
|
||||
<div style="font-size: medium">今日设备告警列表</div>
|
||||
@@ -278,10 +278,10 @@ const { mutate: exportTableData, isPending: exporting } = useMutation({
|
||||
</div>
|
||||
<div style="flex: 1 1 auto; min-height: 0">
|
||||
<NDataTable
|
||||
:loading="tableLoading"
|
||||
:loading="loading"
|
||||
:columns="tableColumns"
|
||||
:data="tableData"
|
||||
:pagination="tablePagination"
|
||||
:pagination="pagination"
|
||||
:single-line="false"
|
||||
remote
|
||||
flex-height
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
import { exportIcmpApi } from '@/apis';
|
||||
import { exportIcmpApi, type Station } from '@/apis';
|
||||
import { DeviceType } from '@/enums';
|
||||
import { useDeviceStore, useStationStore } from '@/stores';
|
||||
import { useDeviceStore } from '@/stores';
|
||||
import { downloadByData } from '@/utils';
|
||||
import { useMutation } from '@tanstack/vue-query';
|
||||
import dayjs from 'dayjs';
|
||||
import { NButton, NFlex, NGrid, NGridItem, NModal, NRadio, NRadioGroup, NStatistic } from 'naive-ui';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { computed, ref } from 'vue';
|
||||
import { computed, ref, toRefs } from 'vue';
|
||||
|
||||
const props = defineProps<{
|
||||
stationList: Station[];
|
||||
}>();
|
||||
|
||||
const show = defineModel<boolean>('show', { default: false });
|
||||
|
||||
@@ -15,11 +19,11 @@ const emit = defineEmits<{
|
||||
'after-leave': [];
|
||||
}>();
|
||||
|
||||
const stationStore = useStationStore();
|
||||
const { stationList } = storeToRefs(stationStore);
|
||||
const deviceStore = useDeviceStore();
|
||||
const { lineDevices } = storeToRefs(deviceStore);
|
||||
|
||||
const { stationList } = toRefs(props);
|
||||
|
||||
const status = ref('');
|
||||
|
||||
const onAfterLeave = () => {
|
||||
|
||||
@@ -4,3 +4,4 @@ export { default as DeviceParamsConfigModal } from './device-params-config-modal
|
||||
export { default as OfflineDeviceDetailModal } from './offline-device-detail-modal.vue';
|
||||
export { default as RecordCheckExportModal } from './record-check-export-modal.vue';
|
||||
export { default as StationCard } from './station-card.vue';
|
||||
export { default as SyncCameraResultModal } from './sync-camera-result-modal.vue';
|
||||
|
||||
88
src/components/station-page/sync-camera-result-modal.vue
Normal file
88
src/components/station-page/sync-camera-result-modal.vue
Normal file
@@ -0,0 +1,88 @@
|
||||
<script setup lang="ts">
|
||||
import { watchDebounced } from '@vueuse/core';
|
||||
import { NFlex, NIcon, NList, NListItem, NModal, NScrollbar, NStatistic, NText, NThing } from 'naive-ui';
|
||||
import { computed, ref, toRefs } from 'vue';
|
||||
import { useStationStore } from '@/stores';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import type { Station, SyncCameraResult } from '@/apis';
|
||||
import { DeleteFilled, EditFilled, PlusCircleFilled } from '@vicons/antd';
|
||||
|
||||
const props = defineProps<{
|
||||
syncCameraResult: Record<Station['code'], SyncCameraResult>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
'after-leave': [];
|
||||
}>();
|
||||
|
||||
const stationStore = useStationStore();
|
||||
const { stationList } = storeToRefs(stationStore);
|
||||
|
||||
const { syncCameraResult } = toRefs(props);
|
||||
|
||||
const show = ref(false);
|
||||
|
||||
watchDebounced(
|
||||
[syncCameraResult],
|
||||
([result]) => {
|
||||
show.value = Object.keys(result).length > 0;
|
||||
},
|
||||
{
|
||||
debounce: 500,
|
||||
deep: true,
|
||||
},
|
||||
);
|
||||
|
||||
const onAfterLeave = () => {
|
||||
emit('after-leave');
|
||||
};
|
||||
|
||||
const syncList = computed(() => {
|
||||
return Object.values(syncCameraResult.value).map((sync) => {
|
||||
const { stationCode, startTime, endTime, insertList, updateList, deleteList } = sync;
|
||||
const stationName = stationList.value.find((station) => station.code === stationCode)?.name;
|
||||
return { stationName, startTime, endTime, insertList, updateList, deleteList };
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NModal v-model:show="show" preset="card" title="摄像机同步结果" style="width: 600px" @after-leave="onAfterLeave">
|
||||
<NScrollbar style="max-height: 400px">
|
||||
<NList hoverable clickable>
|
||||
<NListItem v-for="{ stationName, endTime, insertList, updateList, deleteList } in syncList" :key="stationName">
|
||||
<NThing title-independent>
|
||||
<template #header>
|
||||
<NText strong>{{ stationName }}</NText>
|
||||
</template>
|
||||
<template #header-extra>
|
||||
<NText depth="3"> {{ endTime }} 完成 </NText>
|
||||
</template>
|
||||
<NFlex justify="space-around" :size="24" style="margin-top: 8px">
|
||||
<NStatistic label="新增">
|
||||
<template #prefix>
|
||||
<NIcon :component="PlusCircleFilled" />
|
||||
</template>
|
||||
{{ insertList.length }}
|
||||
</NStatistic>
|
||||
<NStatistic label="更新">
|
||||
<template #prefix>
|
||||
<NIcon :component="EditFilled" />
|
||||
</template>
|
||||
{{ updateList.length }}
|
||||
</NStatistic>
|
||||
<NStatistic label="删除">
|
||||
<template #prefix>
|
||||
<NIcon :component="DeleteFilled" />
|
||||
</template>
|
||||
{{ deleteList.length }}
|
||||
</NStatistic>
|
||||
</NFlex>
|
||||
</NThing>
|
||||
</NListItem>
|
||||
</NList>
|
||||
</NScrollbar>
|
||||
</NModal>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
@@ -8,7 +8,7 @@ export function useDeviceSelection() {
|
||||
const router = useRouter();
|
||||
|
||||
const selectedStationCode = ref<string>();
|
||||
const selectedDeviceType = ref<DeviceTypeVal>(DeviceType.AlarmHost);
|
||||
const selectedDeviceType = ref<DeviceTypeVal>(DeviceType.Camera);
|
||||
const selectedDevice = ref<NdmDeviceResultVO>();
|
||||
|
||||
const initFromRoute = (lineDevices: LineDevices) => {
|
||||
|
||||
@@ -78,7 +78,7 @@ function useStationAlarmCountsMutation() {
|
||||
},
|
||||
size: 50000,
|
||||
current: 1,
|
||||
sort: 'id',
|
||||
sort: 'alarmDate',
|
||||
order: 'descending',
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { NdmDeviceAlarmLogResultVO } from '@/apis';
|
||||
import { TOPIC_DEVICE_ALARM } from '@/constants';
|
||||
import type { NdmDeviceAlarmLogResultVO, Station, SyncCameraResult } from '@/apis';
|
||||
import { TOPIC_DEVICE_ALARM, SYNC_CAMERA_STATUS_TOPIC } from '@/constants';
|
||||
import { useAlarmStore } from '@/stores';
|
||||
import { Client } from '@stomp/stompjs';
|
||||
import { destr } from 'destr';
|
||||
@@ -19,6 +19,8 @@ export const useStompClient = () => {
|
||||
const { unreadAlarmCount } = storeToRefs(alarmStore);
|
||||
const stompClient = ref<Client | null>(null);
|
||||
|
||||
const syncCameraResult = ref<Record<Station['code'], SyncCameraResult>>({});
|
||||
|
||||
onMounted(() => {
|
||||
stompClient.value = new Client({
|
||||
brokerURL: getBrokerUrl(),
|
||||
@@ -33,10 +35,15 @@ export const useStompClient = () => {
|
||||
unreadAlarmCount.value++;
|
||||
}
|
||||
});
|
||||
stompClient.value?.subscribe(SYNC_CAMERA_STATUS_TOPIC, (message) => {
|
||||
const { stationCode, startTime, endTime, insertList, updateList, deleteList } = destr<SyncCameraResult>(message.body);
|
||||
syncCameraResult.value[stationCode] = { stationCode, startTime, endTime, insertList, updateList, deleteList };
|
||||
});
|
||||
},
|
||||
onDisconnect: () => {
|
||||
console.log('Stomp连接断开');
|
||||
stompClient.value?.unsubscribe(TOPIC_DEVICE_ALARM);
|
||||
stompClient.value?.unsubscribe(SYNC_CAMERA_STATUS_TOPIC);
|
||||
},
|
||||
onStompError: (frame) => {
|
||||
console.log('Stomp错误', frame);
|
||||
@@ -57,5 +64,10 @@ export const useStompClient = () => {
|
||||
|
||||
return {
|
||||
stompClient,
|
||||
|
||||
syncCameraResult,
|
||||
afterCheckSyncCamera: () => {
|
||||
syncCameraResult.value = {};
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
export const TOPIC_DEVICE_ALARM = '/topic/deviceAlarm';
|
||||
|
||||
export const SYNC_CAMERA_STATUS_TOPIC = '/topic/syncCameraStatus';
|
||||
|
||||
@@ -5,7 +5,7 @@ function renderIcon(icon: Component): () => VNode {
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { SettingsDrawer } from '@/components';
|
||||
import { SettingsDrawer, SyncCameraResultModal } from '@/components';
|
||||
import { useStompClient } from '@/composables';
|
||||
import { useLineStationsQuery } from '@/composables';
|
||||
import { LINE_STATIONS_QUERY_KEY, LINE_DEVICES_QUERY_KEY, LINE_ALARMS_QUERY_KEY } from '@/constants';
|
||||
@@ -29,7 +29,7 @@ import { storeToRefs } from 'pinia';
|
||||
import { computed, h, onBeforeMount, ref, watch, type Component, type VNode } from 'vue';
|
||||
import { RouterLink, useRoute, useRouter } from 'vue-router';
|
||||
|
||||
useStompClient();
|
||||
const { syncCameraResult, afterCheckSyncCamera } = useStompClient();
|
||||
|
||||
const userStore = useUserStore();
|
||||
const { userInfo } = storeToRefs(userStore);
|
||||
@@ -205,7 +205,10 @@ const openSettingsDrawer = () => {
|
||||
</NLayout>
|
||||
</NLayout>
|
||||
</NScrollbar>
|
||||
|
||||
<SettingsDrawer v-model:show="settingsDrawerShow" />
|
||||
|
||||
<SyncCameraResultModal :sync-camera-result="syncCameraResult" @after-leave="afterCheckSyncCamera" />
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -342,6 +342,7 @@ const onClickQuery = () => {
|
||||
tablePagination.pageSize = 10;
|
||||
searchFieldsChanged.value = false;
|
||||
}
|
||||
realtimeRefresh.value = false;
|
||||
getTableData();
|
||||
};
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import { syncCameraApi, syncNvrChannelsApi, type Station } from '@/apis';
|
||||
import { DeviceAlarmDetailModal, DeviceExportModal, DeviceParamsConfigModal, OfflineDeviceDetailModal, RecordCheckExportModal, StationCard } from '@/components';
|
||||
import { useLineAlarmsQuery, useLineDevicesQuery } from '@/composables';
|
||||
import { useAlarmStore, useDeviceStore, usePollingStore, useSettingStore, useStationStore } from '@/stores';
|
||||
import { sleep } from '@/utils';
|
||||
import { useMutation } from '@tanstack/vue-query';
|
||||
import { NGrid, NGi, NScrollbar, NFlex, NButtonGroup, NButton, NCheckbox } from 'naive-ui';
|
||||
import { storeToRefs } from 'pinia';
|
||||
@@ -38,9 +37,9 @@ const selectedAction = ref<Action>(null);
|
||||
const showOperation = ref(false);
|
||||
const stationSelectable = ref(false);
|
||||
const stationSelection = ref<Record<Station['code'], boolean>>({});
|
||||
// TODO: 后期导出设备也会支持选择车站,而不是目前的Modal交互
|
||||
const showIcmpExportModal = ref(false);
|
||||
const showRecordCheckExportModal = ref(false);
|
||||
|
||||
const onToggleSelectAll = (checked: boolean) => {
|
||||
if (!checked) {
|
||||
stationSelection.value = {};
|
||||
@@ -48,23 +47,23 @@ const onToggleSelectAll = (checked: boolean) => {
|
||||
stationSelection.value = Object.fromEntries(stationList.value.map((station) => [station.code, true]));
|
||||
}
|
||||
};
|
||||
|
||||
const onAction = (action: Action) => {
|
||||
selectedAction.value = action;
|
||||
if (action === 'export-icmp') {
|
||||
showIcmpExportModal.value = true;
|
||||
} else if (action === 'export-record') {
|
||||
if (action === null) return;
|
||||
showOperation.value = true;
|
||||
stationSelectable.value = true;
|
||||
} else if (action === 'sync-camera') {
|
||||
showOperation.value = true;
|
||||
stationSelectable.value = true;
|
||||
} else if (action === 'sync-nvr') {
|
||||
showOperation.value = true;
|
||||
stationSelectable.value = true;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
const onCancel = () => {
|
||||
selectedAction.value = null;
|
||||
showOperation.value = false;
|
||||
stationSelectable.value = false;
|
||||
stationSelection.value = {};
|
||||
};
|
||||
|
||||
const onFinish = onCancel;
|
||||
|
||||
const { mutate: syncCamera, isPending: cameraSyncing } = useMutation({
|
||||
mutationFn: async () => {
|
||||
const stationCodes = Object.entries(stationSelection.value)
|
||||
@@ -101,6 +100,7 @@ const { mutate: syncCamera, isPending: cameraSyncing } = useMutation({
|
||||
onCancel();
|
||||
},
|
||||
});
|
||||
|
||||
const { mutate: syncNvrChannels, isPending: nvrChannelsSyncing } = useMutation({
|
||||
mutationFn: async () => {
|
||||
const stationCodes = Object.entries(stationSelection.value)
|
||||
@@ -133,23 +133,31 @@ const { mutate: syncNvrChannels, isPending: nvrChannelsSyncing } = useMutation({
|
||||
onCancel();
|
||||
},
|
||||
});
|
||||
|
||||
const confirming = computed(() => cameraSyncing.value || nvrChannelsSyncing.value);
|
||||
|
||||
const onConfirm = async () => {
|
||||
const noStationSelected = !Object.values(stationSelection.value).some((selected) => selected);
|
||||
if (selectedAction.value === 'export-icmp') {
|
||||
if (noStationSelected) {
|
||||
window.$message.warning('请选择要导出设备状态的车站');
|
||||
return;
|
||||
}
|
||||
showIcmpExportModal.value = true;
|
||||
} else if (selectedAction.value === 'export-record') {
|
||||
if (!Object.values(stationSelection.value).some((selected) => selected)) {
|
||||
if (noStationSelected) {
|
||||
window.$message.warning('请选择要导出录像诊断的车站');
|
||||
return;
|
||||
}
|
||||
showRecordCheckExportModal.value = true;
|
||||
} else if (selectedAction.value === 'sync-camera') {
|
||||
if (!Object.values(stationSelection.value).some((selected) => selected)) {
|
||||
if (noStationSelected) {
|
||||
window.$message.warning('请选择要同步摄像机的车站');
|
||||
return;
|
||||
}
|
||||
syncCamera();
|
||||
} else if (selectedAction.value === 'sync-nvr') {
|
||||
if (!Object.values(stationSelection.value).some((selected) => selected)) {
|
||||
if (noStationSelected) {
|
||||
window.$message.warning('请选择要同步录像机通道的车站');
|
||||
return;
|
||||
}
|
||||
@@ -158,13 +166,6 @@ const onConfirm = async () => {
|
||||
return;
|
||||
}
|
||||
};
|
||||
const onCancel = () => {
|
||||
selectedAction.value = null;
|
||||
showOperation.value = false;
|
||||
stationSelectable.value = false;
|
||||
stationSelection.value = {};
|
||||
};
|
||||
const onFinish = onCancel;
|
||||
|
||||
// 车站卡片的事件
|
||||
const selectedStation = ref<Station>();
|
||||
@@ -225,7 +226,7 @@ const openDeviceParamsConfigModal = (station: Station) => {
|
||||
<!-- 设备配置面板对话框 -->
|
||||
<DeviceParamsConfigModal v-model:show="showDeviceParamsConfigModal" :station="selectedStation" />
|
||||
<!-- 设备状态导出对话框 -->
|
||||
<DeviceExportModal v-model:show="showIcmpExportModal" @after-leave="onFinish" />
|
||||
<DeviceExportModal v-model:show="showIcmpExportModal" :station-list="stationList.filter((station) => stationSelection[station.code])" @after-leave="onFinish" />
|
||||
<!-- 录像诊断导出对话框 -->
|
||||
<RecordCheckExportModal v-model:show="showRecordCheckExportModal" :stations="stationList.filter((station) => stationSelection[station.code])" @after-leave="onFinish" />
|
||||
</template>
|
||||
|
||||
@@ -11,6 +11,36 @@ type ProxyItem = {
|
||||
rewrite?: [string, string];
|
||||
};
|
||||
|
||||
const line04ApiProxyList: ProxyItem[] = [
|
||||
{ key: '/minio', target: 'http://10.15.128.10:9000', rewrite: ['/minio', ''] },
|
||||
|
||||
{ key: '/api', target: 'http://10.15.128.10:18760' },
|
||||
|
||||
{ key: '/0475/api', target: 'http://10.15.128.10:18760', rewrite: ['/0475/api', '/api'] },
|
||||
|
||||
{ key: '/0401/api', target: 'http://10.15.129.10:18760', rewrite: ['/0401/api', '/api'] },
|
||||
{ key: '/0402/api', target: 'http://10.15.131.10:18760', rewrite: ['/0402/api', '/api'] },
|
||||
{ key: '/0403/api', target: 'http://10.15.133.10:18760', rewrite: ['/0403/api', '/api'] },
|
||||
{ key: '/0404/api', target: 'http://10.15.135.10:18760', rewrite: ['/0404/api', '/api'] },
|
||||
{ key: '/0405/api', target: 'http://10.15.137.10:18760', rewrite: ['/0405/api', '/api'] },
|
||||
{ key: '/0406/api', target: 'http://10.15.139.10:18760', rewrite: ['/0406/api', '/api'] },
|
||||
{ key: '/0407/api', target: 'http://10.15.141.10:18760', rewrite: ['/0407/api', '/api'] },
|
||||
{ key: '/0408/api', target: 'http://10.15.143.10:18760', rewrite: ['/0408/api', '/api'] },
|
||||
{ key: '/0409/api', target: 'http://10.15.145.10:18760', rewrite: ['/0409/api', '/api'] },
|
||||
{ key: '/0410/api', target: 'http://10.15.147.10:18760', rewrite: ['/0410/api', '/api'] },
|
||||
|
||||
{ key: '/0411/api', target: 'http://10.15.149.10:18760', rewrite: ['/0411/api', '/api'] },
|
||||
{ key: '/0412/api', target: 'http://10.15.151.10:18760', rewrite: ['/0412/api', '/api'] },
|
||||
{ key: '/0413/api', target: 'http://10.15.153.10:18760', rewrite: ['/0413/api', '/api'] },
|
||||
{ key: '/0414/api', target: 'http://10.15.155.10:18760', rewrite: ['/0414/api', '/api'] },
|
||||
{ key: '/0415/api', target: 'http://10.15.157.10:18760', rewrite: ['/0415/api', '/api'] },
|
||||
{ key: '/0416/api', target: 'http://10.15.159.10:18760', rewrite: ['/0416/api', '/api'] },
|
||||
{ key: '/0417/api', target: 'http://10.15.161.10:18760', rewrite: ['/0417/api', '/api'] },
|
||||
{ key: '/0418/api', target: 'http://10.15.163.10:18760', rewrite: ['/0418/api', '/api'] },
|
||||
{ key: '/0419/api', target: 'http://10.15.165.10:18760', rewrite: ['/0419/api', '/api'] },
|
||||
{ key: '/0420/api', target: 'http://10.15.167.10:18760', rewrite: ['/0420/api', '/api'] },
|
||||
];
|
||||
|
||||
const line10ApiProxyList: ProxyItem[] = [
|
||||
{ key: '/minio', target: 'http://10.18.128.10:9000', rewrite: ['/minio', ''] },
|
||||
|
||||
@@ -54,12 +84,14 @@ const line10ApiProxyList: ProxyItem[] = [
|
||||
{ key: '/1031/api', target: 'http://10.18.189.10:18760', rewrite: ['/1031/api', '/api'] },
|
||||
{ key: '/1032/api', target: 'http://10.18.244.10:18760', rewrite: ['/1032/api', '/api'] },
|
||||
];
|
||||
|
||||
const apiProxyList: ProxyItem[] = [
|
||||
//
|
||||
// ...line04ApiProxyList,
|
||||
...line10ApiProxyList,
|
||||
];
|
||||
const wsProxyList: ProxyItem[] = [
|
||||
//
|
||||
// { key: '/ws', target: 'ws://10.15.128.10:18103' },
|
||||
{ key: '/ws', target: 'ws://10.18.128.10:18103' },
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user