refactor: 简化录像诊断卡片逻辑
This commit is contained in:
@@ -1,14 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getChannelListApi, getRecordCheckApi, reloadAllRecordCheckApi, reloadRecordCheckApi, type NdmNvrResultVO, type NdmRecordCheck, type RecordItem, type Station } from '@/apis';
|
import { getChannelListApi, getRecordCheckApi, reloadAllRecordCheckApi, reloadRecordCheckApi, type NdmNvrResultVO, type NdmRecordCheck, type RecordItem, type Station } from '@/apis';
|
||||||
import { exportRecordDiagCsv, transformRecordChecks } from '@/helpers';
|
import { exportRecordDiagCsv, transformRecordChecks } from '@/helpers';
|
||||||
import { useStationStore } from '@/stores';
|
|
||||||
import { parseErrorFeedback } from '@/utils';
|
import { parseErrorFeedback } from '@/utils';
|
||||||
import { useMutation } from '@tanstack/vue-query';
|
import { useMutation } from '@tanstack/vue-query';
|
||||||
import { isCancel } from 'axios';
|
import { isCancel } from 'axios';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { DownloadIcon, RotateCwIcon } from 'lucide-vue-next';
|
import { DownloadIcon, RotateCwIcon } from 'lucide-vue-next';
|
||||||
import { NButton, NCard, NFlex, NIcon, NPagination, NPopconfirm, NPopover, NRadioButton, NRadioGroup, NTooltip, useThemeVars } from 'naive-ui';
|
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';
|
import { computed, onBeforeUnmount, onMounted, ref, toRefs, watch } from 'vue';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -18,9 +16,6 @@ const props = defineProps<{
|
|||||||
|
|
||||||
const themeVars = useThemeVars();
|
const themeVars = useThemeVars();
|
||||||
|
|
||||||
const stationStore = useStationStore();
|
|
||||||
const { stations } = storeToRefs(stationStore);
|
|
||||||
|
|
||||||
const { ndmDevice, station } = toRefs(props);
|
const { ndmDevice, station } = toRefs(props);
|
||||||
|
|
||||||
const recordChecks = ref<NdmRecordCheck[]>([]);
|
const recordChecks = ref<NdmRecordCheck[]>([]);
|
||||||
@@ -78,9 +73,7 @@ const { mutate: reloadAllRecordCheck, isPending: reloading } = useMutation({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onExportRecordCheck = () => {
|
const onExportRecordCheck = () => {
|
||||||
const code = station.value.code;
|
exportRecordDiagCsv(recordDiags.value, station.value.name);
|
||||||
const stationName = stations.value.find((station) => station.code === code)?.name ?? '';
|
|
||||||
exportRecordDiagCsv(recordDiags.value, stationName);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const page = ref(1);
|
const page = ref(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user