refactor: 简化录像诊断卡片逻辑

This commit is contained in:
yangsy
2026-01-15 13:59:38 +08:00
parent b59b34e68b
commit db3a6ddca5

View File

@@ -1,14 +1,12 @@
<script setup lang="ts">
import { getChannelListApi, getRecordCheckApi, reloadAllRecordCheckApi, reloadRecordCheckApi, type NdmNvrResultVO, type NdmRecordCheck, type RecordItem, type Station } from '@/apis';
import { exportRecordDiagCsv, transformRecordChecks } from '@/helpers';
import { useStationStore } from '@/stores';
import { parseErrorFeedback } from '@/utils';
import { useMutation } from '@tanstack/vue-query';
import { isCancel } from 'axios';
import dayjs from 'dayjs';
import { DownloadIcon, RotateCwIcon } from 'lucide-vue-next';
import { NButton, NCard, NFlex, NIcon, NPagination, NPopconfirm, NPopover, NRadioButton, NRadioGroup, NTooltip, useThemeVars } from 'naive-ui';
import { storeToRefs } from 'pinia';
import { computed, onBeforeUnmount, onMounted, ref, toRefs, watch } from 'vue';
const props = defineProps<{
@@ -18,9 +16,6 @@ const props = defineProps<{
const themeVars = useThemeVars();
const stationStore = useStationStore();
const { stations } = storeToRefs(stationStore);
const { ndmDevice, station } = toRefs(props);
const recordChecks = ref<NdmRecordCheck[]>([]);
@@ -78,9 +73,7 @@ const { mutate: reloadAllRecordCheck, isPending: reloading } = useMutation({
});
const onExportRecordCheck = () => {
const code = station.value.code;
const stationName = stations.value.find((station) => station.code === code)?.name ?? '';
exportRecordDiagCsv(recordDiags.value, stationName);
exportRecordDiagCsv(recordDiags.value, station.value.name);
};
const page = ref(1);