Compare commits
3 Commits
db831e82ff
...
b1b2892ff7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1b2892ff7 | ||
|
|
ecfc13dc69 | ||
|
|
3d9825f58a |
@@ -211,7 +211,7 @@ const { mutate: cancelIgnore } = useMutation({
|
||||
|
||||
const tableData = ref<DataTableRowData[]>([]);
|
||||
|
||||
const DEFAULT_PAGE_SIZE = 10;
|
||||
const DEFAULT_PAGE_SIZE = 20;
|
||||
const pagination = reactive<PaginationProps>({
|
||||
showSizePicker: true,
|
||||
page: 1,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { exportDeviceAlarmLogApi, pageDeviceAlarmLogApi, type NdmDeviceAlarmLog, type NdmDeviceAlarmLogResultVO, type PageQueryExtra, type Station } from '@/apis';
|
||||
import { exportDeviceAlarmLogApi, pageDeviceAlarmLogApi, type NdmDeviceAlarmLog, type NdmDeviceAlarmLogPageQuery, type NdmDeviceAlarmLogResultVO, type PageQueryExtra, type Station } from '@/apis';
|
||||
import { useAlarmActionColumn, useCameraSnapColumn } from '@/composables';
|
||||
import { ALARM_TYPES, DEVICE_TYPE_CODES, DEVICE_TYPE_LITERALS, DEVICE_TYPE_NAMES, FAULT_LEVELS, tryGetDeviceType, type DeviceType } from '@/enums';
|
||||
import { renderAlarmDateCell, renderAlarmTypeCell, renderDeviceTypeCell, renderFaultLevelCell } from '@/helpers';
|
||||
@@ -132,6 +132,12 @@ const resetSearchFields = () => {
|
||||
alarmConfirm: '',
|
||||
};
|
||||
};
|
||||
const getModelFields = (): NdmDeviceAlarmLogPageQuery => {
|
||||
return {
|
||||
alarmCategory: searchFields.value.alarmCategory || undefined,
|
||||
alarmConfirm: searchFields.value.alarmConfirm || undefined,
|
||||
};
|
||||
};
|
||||
const getExtraFields = (): PageQueryExtra<NdmDeviceAlarmLog> => {
|
||||
const stationCodeIn = searchFields.value.stationCode_in;
|
||||
const deviceTypeIn = searchFields.value.deviceType_in.flatMap((deviceType) => DEVICE_TYPE_CODES[deviceType as DeviceType]);
|
||||
@@ -212,7 +218,7 @@ const tableColumns: DataTableColumns<NdmDeviceAlarmLogResultVO> = [
|
||||
alarmActionColumn,
|
||||
];
|
||||
|
||||
const DEFAULT_PAGE_SIZE = 10;
|
||||
const DEFAULT_PAGE_SIZE = 20;
|
||||
const pagination = reactive<PaginationProps>({
|
||||
showSizePicker: true,
|
||||
page: 1,
|
||||
@@ -244,10 +250,7 @@ const { mutate: getTableData, isPending: tableLoading } = useMutation({
|
||||
|
||||
const res = await pageDeviceAlarmLogApi(
|
||||
{
|
||||
model: {
|
||||
alarmCategory: searchFields.value.alarmCategory || undefined,
|
||||
alarmConfirm: searchFields.value.alarmConfirm || undefined,
|
||||
},
|
||||
model: getModelFields(),
|
||||
extra: getExtraFields(),
|
||||
current: pagination.page ?? 1,
|
||||
size: pagination.pageSize ?? DEFAULT_PAGE_SIZE,
|
||||
@@ -302,7 +305,7 @@ const { mutate: exportTableData, isPending: exporting } = useMutation({
|
||||
|
||||
const data = await exportDeviceAlarmLogApi(
|
||||
{
|
||||
model: {},
|
||||
model: getModelFields(),
|
||||
extra: getExtraFields(),
|
||||
current: pagination.page ?? 1,
|
||||
size: pagination.pageSize ?? 10,
|
||||
|
||||
@@ -104,7 +104,7 @@ const getExtraFields = (): PageQueryExtra<NdmCallLog> => {
|
||||
const method_like = searchFields.value.method_like;
|
||||
const messageType_like = searchFields.value.messageType_like;
|
||||
const cmdType_like = searchFields.value.cmdType_like;
|
||||
const logType_in = searchFields.value.logType_in;
|
||||
const logType_in = searchFields.value.logType_in.length > 0 ? [...searchFields.value.logType_in] : [...callLogTypeOptions.map((option) => option.value)];
|
||||
return {
|
||||
createdTime_precisest,
|
||||
createdTime_preciseed,
|
||||
@@ -143,7 +143,7 @@ const tableColumns: DataTableColumns<NdmCallLogResultVO> = [
|
||||
|
||||
const tableData = ref<DataTableRowData[]>([]);
|
||||
|
||||
const DEFAULT_PAGE_SIZE = 10;
|
||||
const DEFAULT_PAGE_SIZE = 20;
|
||||
const pagination = reactive<PaginationProps>({
|
||||
showSizePicker: true,
|
||||
page: 1,
|
||||
|
||||
@@ -95,7 +95,7 @@ const resetSearchFields = () => {
|
||||
const getExtraFields = (): PageQueryExtra<NdmVimpLog> => {
|
||||
const createdTime_precisest = searchFields.value.createdTime[0];
|
||||
const createdTime_preciseed = searchFields.value.createdTime[1];
|
||||
const logType_in = (searchFields.value.logType_in ?? []).length > 0 ? [...searchFields.value.logType_in] : undefined;
|
||||
const logType_in = searchFields.value.logType_in.length > 0 ? [...searchFields.value.logType_in] : [...vimpLogTypeOptions.map((option) => option.value)];
|
||||
return {
|
||||
createdTime_precisest,
|
||||
createdTime_preciseed,
|
||||
@@ -110,14 +110,7 @@ watch(searchFields, () => {
|
||||
|
||||
const tableColumns: DataTableColumns<NdmVimpLogResultVO> = [
|
||||
{ title: '时间', key: 'createdTime' },
|
||||
{
|
||||
title: '操作类型',
|
||||
key: 'logType',
|
||||
render: (rowData) => {
|
||||
const option = vimpLogTypeOptions.find((option) => option.value === rowData.logType);
|
||||
return `${option?.label ?? ''}`;
|
||||
},
|
||||
},
|
||||
{ title: '操作类型', key: 'description' },
|
||||
{ title: '请求IP', key: 'requestIp' },
|
||||
{ title: '耗时(ms)', key: 'consumedTime' },
|
||||
{ title: '被调用设备', key: 'targetCode' },
|
||||
@@ -125,7 +118,7 @@ const tableColumns: DataTableColumns<NdmVimpLogResultVO> = [
|
||||
|
||||
const tableData = ref<DataTableRowData[]>([]);
|
||||
|
||||
const DEFAULT_PAGE_SIZE = 10;
|
||||
const DEFAULT_PAGE_SIZE = 20;
|
||||
const pagination = reactive<PaginationProps>({
|
||||
showSizePicker: true,
|
||||
page: 1,
|
||||
|
||||
@@ -63,7 +63,7 @@ const tableColumns: DataTableColumns<BaseEmployeeResultVO> = [
|
||||
|
||||
const tableData = ref<DataTableRowData[]>([]);
|
||||
|
||||
const DEFAULT_PAGE_SIZE = 10;
|
||||
const DEFAULT_PAGE_SIZE = 20;
|
||||
const pagination = reactive<PaginationProps>({
|
||||
showSizePicker: true,
|
||||
page: 1,
|
||||
|
||||
Reference in New Issue
Block a user