|
|
@@ -5,6 +5,7 @@ import { useDebounceFn } from '@vueuse/core'
|
|
|
import MiniBarChart from '@/components/WorkOrderCompletionBar/index.vue'
|
|
|
import CountTo from '@/components/count-to1.vue'
|
|
|
import { IotReportApi } from '@/api/pms/report'
|
|
|
+import { rangeShortcuts } from '@/utils/formatTime'
|
|
|
|
|
|
// 定义时间类型
|
|
|
type TimeType = 'year' | 'month' | 'day'
|
|
|
@@ -40,7 +41,7 @@ const timeOptions: { label: string; value: TimeType }[] = [
|
|
|
{ label: '日', value: 'day' }
|
|
|
]
|
|
|
|
|
|
-const activeTimeType = ref<TimeType>('year')
|
|
|
+const activeTimeType = ref<TimeType | undefined>('year')
|
|
|
const query = ref<Query>({
|
|
|
pageNo: 1,
|
|
|
pageSize: 10
|
|
|
@@ -247,6 +248,14 @@ function handleReset() {
|
|
|
handleTimeChange('year')
|
|
|
selectType(undefined)
|
|
|
}
|
|
|
+
|
|
|
+const handleClear = () => {
|
|
|
+ handleTimeChange('year')
|
|
|
+}
|
|
|
+
|
|
|
+const handleChange = () => {
|
|
|
+ activeTimeType.value = undefined
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
@@ -346,6 +355,20 @@ function handleReset() {
|
|
|
</div>
|
|
|
<div class="flex justify-between">
|
|
|
<div class="flex gap-4">
|
|
|
+ <el-date-picker
|
|
|
+ size="default"
|
|
|
+ v-model="query.createTime"
|
|
|
+ value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ type="daterange"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ :shortcuts="rangeShortcuts"
|
|
|
+ class="!w-220px"
|
|
|
+ @clear="handleClear"
|
|
|
+ @change="handleChange"
|
|
|
+ :clearable="false"
|
|
|
+ :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
|
+ />
|
|
|
<el-button-group size="default">
|
|
|
<el-button
|
|
|
v-for="item in timeOptions"
|
|
|
@@ -356,9 +379,15 @@ function handleReset() {
|
|
|
{{ item.label }}
|
|
|
</el-button>
|
|
|
</el-button-group>
|
|
|
+ </div>
|
|
|
+ <div class="flex gap-2">
|
|
|
<el-button size="default" @click="handleReset">重置</el-button>
|
|
|
+ <!-- @click="handleExport"
|
|
|
+ :loading="exportLoading" -->
|
|
|
+ <el-button size="default" plain type="success">
|
|
|
+ <Icon icon="ep:download" class="mr-5px" /> 导出
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
- <el-button size="default" type="primary">导出</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="bg-white dark:bg-[#1d1e1f] shadow rounded-lg p-4 flex flex-col">
|