|
|
@@ -6,6 +6,7 @@ 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'
|
|
|
+import download from '@/utils/download'
|
|
|
|
|
|
// 定义时间类型
|
|
|
type TimeType = 'year' | 'month' | 'day'
|
|
|
@@ -256,6 +257,23 @@ const handleClear = () => {
|
|
|
const handleChange = () => {
|
|
|
activeTimeType.value = undefined
|
|
|
}
|
|
|
+
|
|
|
+const message = useMessage()
|
|
|
+
|
|
|
+const exportLoading = ref(false)
|
|
|
+
|
|
|
+async function handleExport() {
|
|
|
+ try {
|
|
|
+ await message.exportConfirm()
|
|
|
+
|
|
|
+ exportLoading.value = true
|
|
|
+ const res = await IotReportApi.exportOrderPage(query.value)
|
|
|
+
|
|
|
+ download.excel(res, '工单完成情况.xlsx')
|
|
|
+ } finally {
|
|
|
+ exportLoading.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
@@ -384,7 +402,13 @@ const handleChange = () => {
|
|
|
<el-button size="default" @click="handleReset">重置</el-button>
|
|
|
<!-- @click="handleExport"
|
|
|
:loading="exportLoading" -->
|
|
|
- <el-button size="default" plain type="success">
|
|
|
+ <el-button
|
|
|
+ @click="handleExport"
|
|
|
+ :loading="exportLoading"
|
|
|
+ size="default"
|
|
|
+ plain
|
|
|
+ type="success"
|
|
|
+ >
|
|
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
|
|
</el-button>
|
|
|
</div>
|