diff --git a/src/apis/request/biz/storage/ndm-nvr.ts b/src/apis/request/biz/storage/ndm-nvr.ts index 92f4cdd..c598cad 100644 --- a/src/apis/request/biz/storage/ndm-nvr.ts +++ b/src/apis/request/biz/storage/ndm-nvr.ts @@ -51,3 +51,15 @@ export const probeNvrApi = async (ids: string[], options?: { stationCode?: strin throw err; } }; + +export const syncNvrChannelsApi = async (options?: { stationCode?: string; signal?: AbortSignal }) => { + const { stationCode, signal } = options ?? {}; + const client = stationCode ? ndmClient : userClient; + const prefix = stationCode ? `/${stationCode}` : ''; + const endpoint = `${prefix}/api/ndm/ndmNvr/syncNvrChannels`; + const resp = await client.get(endpoint, { signal }); + const [err] = resp; + if (err) { + throw err; + } +}; diff --git a/src/apis/request/biz/video/ndm-camera.ts b/src/apis/request/biz/video/ndm-camera.ts index 60be7fa..761603b 100644 --- a/src/apis/request/biz/video/ndm-camera.ts +++ b/src/apis/request/biz/video/ndm-camera.ts @@ -49,3 +49,15 @@ export const getCameraSnapApi = async (deviceId: string, options?: { signal?: Ab } return data; }; + +export const syncCameraApi = async (options?: { stationCode?: string; signal?: AbortSignal }) => { + const { stationCode, signal } = options ?? {}; + const client = stationCode ? ndmClient : userClient; + const prefix = stationCode ? `/${stationCode}` : ''; + const endpoint = `${prefix}/api/ndm/ndmCamera/syncCamera`; + const resp = await client.get(endpoint, { signal }); + const [err] = resp; + if (err) { + throw err; + } +}; diff --git a/src/components/index.ts b/src/components/index.ts index 2d78d7b..59036d4 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,4 +1,3 @@ export * from './device-page'; export * from './global'; -export * from './helper'; export * from './station-page'; diff --git a/src/components/station-page/device-export-modal.vue b/src/components/station-page/device-export-modal.vue index 86c1211..92440d9 100644 --- a/src/components/station-page/device-export-modal.vue +++ b/src/components/station-page/device-export-modal.vue @@ -11,6 +11,10 @@ import { computed, ref } from 'vue'; const show = defineModel('show', { default: false }); +const emit = defineEmits<{ + 'after-leave': []; +}>(); + const stationStore = useStationStore(); const { stationList } = storeToRefs(stationStore); const deviceStore = useDeviceStore(); @@ -18,6 +22,11 @@ const { lineDevices } = storeToRefs(deviceStore); const status = ref(''); +const onAfterLeave = () => { + status.value = ''; + emit('after-leave'); +}; + const { mutate: exportIcmp, isPending: loading } = useMutation({ mutationFn: async (params: { status: string }) => { const data = await exportIcmpApi(params.status); @@ -70,16 +79,8 @@ const deviceCount = computed(() => onlineDeviceCount.value + offlineDeviceCount. diff --git a/src/components/station-page/index.ts b/src/components/station-page/index.ts index f70f4d7..878e9be 100644 --- a/src/components/station-page/index.ts +++ b/src/components/station-page/index.ts @@ -2,4 +2,5 @@ export { default as DeviceAlarmDetailModal } from './device-alarm-detail-modal.v export { default as DeviceExportModal } from './device-export-modal.vue'; export { default as DeviceParamsConfigModal } from './device-params-config-modal.vue'; 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'; diff --git a/src/components/station-page/record-check-export-modal.vue b/src/components/station-page/record-check-export-modal.vue new file mode 100644 index 0000000..483cd92 --- /dev/null +++ b/src/components/station-page/record-check-export-modal.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/src/components/station-page/station-card.vue b/src/components/station-page/station-card.vue index 12db458..bad2380 100644 --- a/src/components/station-page/station-card.vue +++ b/src/components/station-page/station-card.vue @@ -3,15 +3,18 @@ import type { Station, StationAlarmCounts, StationDevices } from '@/apis'; import { DeviceType } from '@/enums'; import { MoreOutlined, EllipsisOutlined } from '@vicons/antd'; import axios from 'axios'; -import { NCard, NTag, NButton, NIcon, useThemeVars, NFlex, NText, NTooltip, NDropdown, type DropdownOption } from 'naive-ui'; +import { NCard, NTag, NButton, NIcon, useThemeVars, NFlex, NTooltip, NDropdown, type DropdownOption, NCheckbox } from 'naive-ui'; import { toRefs, computed } from 'vue'; const props = defineProps<{ station: Station; stationDevices?: StationDevices; stationAlarmCounts?: StationAlarmCounts; + selectable?: boolean; }>(); +const selected = defineModel('selected', { default: false }); + const emit = defineEmits<{ 'open-offline-device-detail-modal': [station: Station]; 'open-device-alarm-detail-modal': [station: Station]; @@ -125,7 +128,8 @@ const theme = useThemeVars();