feat: vimp operation type
This commit is contained in:
@@ -12,6 +12,7 @@ export interface NdmVimpLogVO extends BaseModel {
|
|||||||
result: string;
|
result: string;
|
||||||
httpMethod: string;
|
httpMethod: string;
|
||||||
userId: string;
|
userId: string;
|
||||||
|
logType: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type NdmVimpLogResultVO = Partial<NdmVimpLogVO>;
|
export type NdmVimpLogResultVO = Partial<NdmVimpLogVO>;
|
||||||
|
|||||||
@@ -1,3 +1,40 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
const vimpOperationTypeOptions: SelectOption[] = [
|
||||||
|
{ label: '视频点播', value: 10001 },
|
||||||
|
{ label: '视频回放', value: 10002 },
|
||||||
|
{ label: '停止视频回放', value: 10003 },
|
||||||
|
{ label: '回放暂停', value: 10004 },
|
||||||
|
{ label: '回放回复', value: 10005 },
|
||||||
|
{ label: '回放倍速播放', value: 10006 },
|
||||||
|
{ label: '回放拖动播放', value: 10007 },
|
||||||
|
{ label: '云台指令', value: 10008 },
|
||||||
|
{ label: '根据国标码查录像', value: 10009 },
|
||||||
|
{ label: '下载录像', value: 10010 },
|
||||||
|
{ label: '停止下载录像', value: 10011 },
|
||||||
|
{ label: '获取预置位列表', value: 10012 },
|
||||||
|
{ label: '设置本平台分屏数量', value: 20001 },
|
||||||
|
{ label: '设置本平台monitor播放的摄像机rtsp流', value: 20002 },
|
||||||
|
{ label: '停止本平台monitor播放的摄像机rtsp流', value: 20003 },
|
||||||
|
{ label: '启动非报警时序', value: 30001 },
|
||||||
|
{ label: '停止非报警时序', value: 30002 },
|
||||||
|
{ label: '暂停非报警时序', value: 30003 },
|
||||||
|
{ label: '调用组切', value: 30004 },
|
||||||
|
{ label: '启动报警时序', value: 40001 },
|
||||||
|
{ label: '停止报警时序', value: 40002 },
|
||||||
|
{ label: '分页查询报警', value: 50001 },
|
||||||
|
{ label: '确认报警', value: 50002 },
|
||||||
|
{ label: '删除报警', value: 50004 },
|
||||||
|
];
|
||||||
|
|
||||||
|
const tableColumns: DataTableColumns<NdmVimpLogResultVO> = [
|
||||||
|
{ title: '时间', key: 'createdTime' },
|
||||||
|
{ title: '操作内容', key: 'description' },
|
||||||
|
{ title: '请求IP', key: 'requestIp' },
|
||||||
|
{ title: '操作参数', key: 'params' },
|
||||||
|
{ title: '操作结果', key: 'result' },
|
||||||
|
];
|
||||||
|
</script>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { NdmVimpLogResultVO } from '@/apis/models/device';
|
import type { NdmVimpLogResultVO } from '@/apis/models/device';
|
||||||
import { ndmVimpLogDefaultExportByTemplate, postNdmVimpLogPage } from '@/apis/requests';
|
import { ndmVimpLogDefaultExportByTemplate, postNdmVimpLogPage } from '@/apis/requests';
|
||||||
@@ -23,11 +60,11 @@ import {
|
|||||||
type SelectOption,
|
type SelectOption,
|
||||||
} from 'naive-ui';
|
} from 'naive-ui';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { computed, h, onBeforeMount, reactive, ref } from 'vue';
|
import { computed, h, onMounted, reactive, ref, watch, watchEffect } from 'vue';
|
||||||
|
|
||||||
useStationListQuery();
|
useStationListQuery();
|
||||||
const stationStore = useStationStore();
|
const stationStore = useStationStore();
|
||||||
const { stationList } = storeToRefs(stationStore);
|
const { stationList, onlineStationList } = storeToRefs(stationStore);
|
||||||
|
|
||||||
const stationSelectOptions = computed(() => {
|
const stationSelectOptions = computed(() => {
|
||||||
return stationList.value.map<SelectOption>((station) => ({
|
return stationList.value.map<SelectOption>((station) => ({
|
||||||
@@ -38,21 +75,15 @@ const stationSelectOptions = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const searchFields = reactive({
|
const searchFields = reactive({
|
||||||
stationCode: stationList.value.find((s) => s.online)?.code,
|
stationCode: undefined as string | undefined,
|
||||||
|
logType_in: [] as number[],
|
||||||
createdTime: [dayjs().startOf('date').subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().endOf('date').format('YYYY-MM-DD HH:mm:ss')] as [string, string],
|
createdTime: [dayjs().startOf('date').subtract(7, 'day').format('YYYY-MM-DD HH:mm:ss'), dayjs().endOf('date').format('YYYY-MM-DD HH:mm:ss')] as [string, string],
|
||||||
});
|
});
|
||||||
const resetSearchFields = () => {
|
const resetSearchFields = () => {
|
||||||
searchFields.stationCode = undefined;
|
searchFields.stationCode = stationList.value.find((station) => station.online)?.code;
|
||||||
|
searchFields.logType_in = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
const tableColumns: DataTableColumns<NdmVimpLogResultVO> = [
|
|
||||||
{ title: '时间', key: 'createdTime' },
|
|
||||||
{ title: '操作内容', key: 'description' },
|
|
||||||
{ title: '请求IP', key: 'requestIp' },
|
|
||||||
{ title: '操作参数', key: 'params' },
|
|
||||||
{ title: '操作结果', key: 'result' },
|
|
||||||
];
|
|
||||||
|
|
||||||
const tableData = ref<DataTableRowData[]>([]);
|
const tableData = ref<DataTableRowData[]>([]);
|
||||||
|
|
||||||
const tablePagination = reactive<PaginationProps>({
|
const tablePagination = reactive<PaginationProps>({
|
||||||
@@ -84,6 +115,7 @@ const { mutate: getVimpLogList, isPending: isTableLoading } = useMutation({
|
|||||||
extra: {
|
extra: {
|
||||||
createdTime_precisest: searchFields.createdTime[0],
|
createdTime_precisest: searchFields.createdTime[0],
|
||||||
createdTime_preciseed: searchFields.createdTime[1],
|
createdTime_preciseed: searchFields.createdTime[1],
|
||||||
|
logType_in: searchFields.logType_in,
|
||||||
},
|
},
|
||||||
current: tablePagination.page ?? 1,
|
current: tablePagination.page ?? 1,
|
||||||
size: tablePagination.pageSize ?? 10,
|
size: tablePagination.pageSize ?? 10,
|
||||||
@@ -122,6 +154,7 @@ const { mutate: downloadTableData, isPending: isDownloading } = useMutation({
|
|||||||
extra: {
|
extra: {
|
||||||
createdTime_precisest: searchFields.createdTime[0],
|
createdTime_precisest: searchFields.createdTime[0],
|
||||||
createdTime_preciseed: searchFields.createdTime[1],
|
createdTime_preciseed: searchFields.createdTime[1],
|
||||||
|
logType_in: searchFields.logType_in,
|
||||||
},
|
},
|
||||||
current: tablePagination.page ?? 1,
|
current: tablePagination.page ?? 1,
|
||||||
size: tablePagination.pageSize ?? 10,
|
size: tablePagination.pageSize ?? 10,
|
||||||
@@ -140,7 +173,32 @@ const { mutate: downloadTableData, isPending: isDownloading } = useMutation({
|
|||||||
|
|
||||||
const exportTableData = () => downloadTableData();
|
const exportTableData = () => downloadTableData();
|
||||||
|
|
||||||
onBeforeMount(() => getVimpLogList());
|
// 进入页面时选择首个在线的车站
|
||||||
|
onMounted(() => {
|
||||||
|
// if (onlineStationList.value.length > 0) {
|
||||||
|
// searchFields.stationCode = onlineStationList.value.at(0)?.code;
|
||||||
|
// getVimpLogList();
|
||||||
|
// } else {
|
||||||
|
// const watchHandle = watch(onlineStationList, (onlineStations) => {
|
||||||
|
// searchFields.stationCode = onlineStations.at(0)?.code;
|
||||||
|
// watchHandle.stop();
|
||||||
|
// getVimpLogList();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
});
|
||||||
|
|
||||||
|
// 进入页面时选择首个在线的车站
|
||||||
|
// 当页面刷新时,车站列表还没有加载完成,defaultStation不存在,if条件为false,
|
||||||
|
// 等待车站列表加载完成后,defaultStation会更新,if条件为true,会更新选择的车站并加载日志记录。
|
||||||
|
// 当从其他页面跳转过来时,车站列表已经存在,defaultStation存在,if条件为true,会更新选择的车站并加载日志记录。
|
||||||
|
// 由于if条件是and逻辑,所以即使defaultStation因车站状态变化而更新,由于已经选择了车站,所以if条件为false。
|
||||||
|
const defaultStation = computed(() => onlineStationList.value.at(0));
|
||||||
|
watchEffect(() => {
|
||||||
|
if (defaultStation.value?.code && !searchFields.stationCode) {
|
||||||
|
searchFields.stationCode = defaultStation.value.code;
|
||||||
|
getVimpLogList();
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -166,6 +224,9 @@ onBeforeMount(() => getVimpLogList());
|
|||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
</NFormItemGi>
|
</NFormItemGi>
|
||||||
|
<NFormItemGi :span="1" label="操作类型" label-placement="left">
|
||||||
|
<NSelect v-model:value="searchFields.logType_in" :options="vimpOperationTypeOptions" multiple clearable />
|
||||||
|
</NFormItemGi>
|
||||||
<NFormItemGi :span="1" label="时间" label-placement="left">
|
<NFormItemGi :span="1" label="时间" label-placement="left">
|
||||||
<NDatePicker v-model:formatted-value="searchFields.createdTime" type="datetimerange" />
|
<NDatePicker v-model:formatted-value="searchFields.createdTime" type="datetimerange" />
|
||||||
</NFormItemGi>
|
</NFormItemGi>
|
||||||
|
|||||||
Reference in New Issue
Block a user