feat:设置默认时间
This commit is contained in:
1 parent
f4a2f11716
commit
9b2399a2d2
13 files changed
+53
-12
No files matched your search
@@ -10,9 +10,17 @@ import request from '/@/utils/request';
|
||||
import { useMessage } from '/@/hooks/message';
|
||||
import * as CryptoJS from 'crypto-js';
|
||||
import { sm4 } from 'sm-crypto'
|
||||
import dayjs from "dayjs";
|
||||
|
||||
import { validateNull } from './validate';
|
||||
|
||||
|
||||
export const getDefaultAlarmDateList = (format: "YYYY-MM-DD HH:mm:ss" | "YYYY-MM-DD" = "YYYY-MM-DD HH:mm:ss") => {
|
||||
const endTime = dayjs().hour(23).minute(23).second(23).format(format)
|
||||
const startTime = dayjs().subtract(3, 'month').startOf('day').format(format)
|
||||
return [startTime, endTime]
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置浏览器标题国际化
|
||||
* @method const title = useTitle(); ==> title()
|
||||
|
||||
@@ -92,6 +92,9 @@ import * as alarmRecordApi from "/@/api/alarm/alarmRecord";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { usePanel } from "/@/stores/panel"
|
||||
import { getDefaultAlarmDateList } from "/@/utils/other"
|
||||
|
||||
|
||||
|
||||
const storesPanel = usePanel()
|
||||
|
||||
@@ -111,6 +114,7 @@ const multiple = ref(true)
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
alarmTypeList: [],
|
||||
alarmDateList: getDefaultAlarmDateList(),
|
||||
},
|
||||
pageList: alarmRecordApi.fetchList
|
||||
})
|
||||
@@ -174,4 +178,4 @@ const handleDelete = async (ids: string[]) => {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
@@ -82,6 +82,7 @@
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { getDefaultAlarmDateList } from "/@/utils/other"
|
||||
|
||||
import * as ComDhLogApi from "/@/api/com/comDhLog";
|
||||
|
||||
@@ -100,7 +101,8 @@ const multiple = ref(true)
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
type: "车",
|
||||
typeList: []
|
||||
typeList: [],
|
||||
createTimeList: getDefaultAlarmDateList("YYYY-MM-DD")
|
||||
},
|
||||
pageList: ComDhLogApi.fetchList
|
||||
})
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { getDefaultAlarmDateList } from "/@/utils/other"
|
||||
|
||||
import * as ComDhLogApi from "/@/api/com/comDhLog";
|
||||
|
||||
@@ -102,7 +103,8 @@ const multiple = ref(true)
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
type: "设备",
|
||||
typeList: []
|
||||
typeList: [],
|
||||
createTimeList: getDefaultAlarmDateList("YYYY-MM-DD")
|
||||
},
|
||||
pageList: ComDhLogApi.fetchList
|
||||
})
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { getDefaultAlarmDateList } from "/@/utils/other"
|
||||
|
||||
import * as ComDhLogApi from "/@/api/com/comDhLog";
|
||||
|
||||
@@ -100,7 +101,8 @@ const multiple = ref(true)
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
type: "门禁",
|
||||
typeList: []
|
||||
typeList: [],
|
||||
createTimeList: getDefaultAlarmDateList("YYYY-MM-DD")
|
||||
},
|
||||
pageList: ComDhLogApi.fetchList
|
||||
})
|
||||
|
||||
@@ -111,6 +111,7 @@ import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { timeDiff } from '/@/utils/dispose';
|
||||
import { getDefaultAlarmDateList } from "/@/utils/other"
|
||||
|
||||
import * as CarAccessApi from "/@/api/car/carAccess";
|
||||
|
||||
@@ -129,7 +130,10 @@ const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
queryForm: {
|
||||
enterTimeList: getDefaultAlarmDateList("YYYY-MM-DD"),
|
||||
exitTimeList: getDefaultAlarmDateList("YYYY-MM-DD")
|
||||
},
|
||||
pageList: CarAccessApi.fetchList
|
||||
})
|
||||
|
||||
|
||||
@@ -163,6 +163,7 @@ import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { parseTime } from "/@/utils/formatTime"
|
||||
import { usePanel } from "/@/stores/panel"
|
||||
import { getDefaultAlarmDateList } from "/@/utils/other"
|
||||
|
||||
const storesPanel = usePanel()
|
||||
|
||||
@@ -184,7 +185,9 @@ const multiple = ref(true)
|
||||
const { dh_car_color, dh_enter_or_exit, dh_car_num_color, dh_car_direct, car_alarm_type, yes_no_type } = useDict("dh_car_color", "dh_enter_or_exit", "dh_car_num_color", "dh_car_direct", "car_alarm_type", "yes_no_type")
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
queryForm: {
|
||||
capTimeList: getDefaultAlarmDateList(),
|
||||
},
|
||||
pageList: CarAccessApi.carAlarmPage
|
||||
})
|
||||
|
||||
|
||||
@@ -136,6 +136,7 @@ import * as carRecordApi from "/@/api/car/carRecord";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { usePanel } from "/@/stores/panel"
|
||||
import { getDefaultAlarmDateList } from "/@/utils/other"
|
||||
|
||||
const storesPanel = usePanel()
|
||||
|
||||
@@ -154,7 +155,9 @@ const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
queryForm: {
|
||||
capTimeList: getDefaultAlarmDateList()
|
||||
},
|
||||
pageList: carRecordApi.fetchList
|
||||
})
|
||||
|
||||
|
||||
@@ -176,6 +176,7 @@ import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { parseTime } from "/@/utils/formatTime"
|
||||
import { usePanel } from "/@/stores/panel"
|
||||
import { getDefaultAlarmDateList } from "/@/utils/other"
|
||||
|
||||
const storesPanel = usePanel()
|
||||
|
||||
@@ -200,7 +201,9 @@ const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
queryForm: {
|
||||
swingTimeList: getDefaultAlarmDateList()
|
||||
},
|
||||
pageList: DoorRecordApi.doorAlarmPage
|
||||
})
|
||||
|
||||
|
||||
@@ -157,6 +157,7 @@ import * as doorRecordApi from "/@/api/door/doorRecord";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { usePanel } from "/@/stores/panel"
|
||||
import { getDefaultAlarmDateList } from "/@/utils/other"
|
||||
|
||||
const storesPanel = usePanel()
|
||||
|
||||
@@ -175,7 +176,9 @@ const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
queryForm: {
|
||||
swingTimeList: getDefaultAlarmDateList(),
|
||||
},
|
||||
pageList: doorRecordApi.fetchList
|
||||
})
|
||||
|
||||
|
||||
@@ -96,6 +96,7 @@ import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import * as doorRecordApi from "/@/api/door/doorRecord";
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { usePanel } from "/@/stores/panel"
|
||||
import { getDefaultAlarmDateList } from "/@/utils/other"
|
||||
|
||||
const storesPanel = usePanel()
|
||||
|
||||
@@ -117,7 +118,7 @@ const multiple = ref(true)
|
||||
const doorTableDialogRef = ref<any>(null)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: { swingTimeList: [] },
|
||||
queryForm: { swingTimeList: getDefaultAlarmDateList() },
|
||||
pageList: doorRecordApi.beLatePage
|
||||
})
|
||||
|
||||
|
||||
@@ -123,6 +123,7 @@
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { parseTime } from "/@/utils/formatTime"
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { getDefaultAlarmDateList } from "/@/utils/other"
|
||||
|
||||
import * as CarRecordApi from "/@/api/car/carRecord";
|
||||
|
||||
@@ -181,7 +182,9 @@ const columnSetting = ref({
|
||||
})
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
queryForm: {
|
||||
capTimeList: getDefaultAlarmDateList()
|
||||
},
|
||||
pagination: {
|
||||
size: 20,
|
||||
pageSizes: [20, 50, 100, 500, 1000, 2000]
|
||||
|
||||
@@ -177,6 +177,7 @@
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { parseTime } from "/@/utils/formatTime"
|
||||
import { getDefaultAlarmDateList } from "/@/utils/other"
|
||||
|
||||
import * as DoorRecordApi from "/@/api/door/doorRecord";
|
||||
|
||||
@@ -251,7 +252,9 @@ const columnSetting = ref({
|
||||
})
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
queryForm: {
|
||||
swingTimeList: getDefaultAlarmDateList()
|
||||
},
|
||||
pagination: {
|
||||
size: 20,
|
||||
pageSizes: [20, 50, 100, 500, 1000, 2000]
|
||||
|
||||
Reference in new issue
Block a user