|
@@ -1,5 +1,6 @@
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { IotStatApi } from '@/api/pms/stat'
|
|
import { IotStatApi } from '@/api/pms/stat'
|
|
|
|
|
+import download from '@/utils/download'
|
|
|
import dayjs from 'dayjs'
|
|
import dayjs from 'dayjs'
|
|
|
import type { Ref } from 'vue'
|
|
import type { Ref } from 'vue'
|
|
|
|
|
|
|
@@ -42,6 +43,7 @@ const props = withDefaults(
|
|
|
|
|
|
|
|
const createDate = ref(DEFAULT_DATE)
|
|
const createDate = ref(DEFAULT_DATE)
|
|
|
const loading = ref(false)
|
|
const loading = ref(false)
|
|
|
|
|
+const exportLoading = ref(false)
|
|
|
const list = ref<RhDeviceListRow[]>([])
|
|
const list = ref<RhDeviceListRow[]>([])
|
|
|
const teamDialogVisible = ref(false)
|
|
const teamDialogVisible = ref(false)
|
|
|
const teamLoading = ref(false)
|
|
const teamLoading = ref(false)
|
|
@@ -70,6 +72,21 @@ function handleDateChange() {
|
|
|
getList()
|
|
getList()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const message = useMessage()
|
|
|
|
|
+
|
|
|
|
|
+async function handleExport() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ await message.exportConfirm()
|
|
|
|
|
+
|
|
|
|
|
+ exportLoading.value = true
|
|
|
|
|
+ const res = await IotStatApi.exportRhDashboard({ createTime: createTime.value })
|
|
|
|
|
+
|
|
|
|
|
+ download.excel(res, `瑞恒看板-${createDate.value}.xlsx`)
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ exportLoading.value = false
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
async function handleRowClick(row: RhDeviceListRow) {
|
|
async function handleRowClick(row: RhDeviceListRow) {
|
|
|
currentProjectDeptName.value = row.projectDeptName || '项目部'
|
|
currentProjectDeptName.value = row.projectDeptName || '项目部'
|
|
|
teamDialogVisible.value = true
|
|
teamDialogVisible.value = true
|
|
@@ -126,7 +143,7 @@ onMounted(() => {
|
|
|
</div>
|
|
</div>
|
|
|
项目部统计
|
|
项目部统计
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="device-list-panel__picker">
|
|
|
|
|
|
|
+ <div class="device-list-panel__tools">
|
|
|
<el-date-picker
|
|
<el-date-picker
|
|
|
v-model="createDate"
|
|
v-model="createDate"
|
|
|
value-format="YYYY-MM-DD"
|
|
value-format="YYYY-MM-DD"
|
|
@@ -135,6 +152,9 @@ onMounted(() => {
|
|
|
:clearable="false"
|
|
:clearable="false"
|
|
|
class="device-list-panel__picker-input"
|
|
class="device-list-panel__picker-input"
|
|
|
@change="handleDateChange" />
|
|
@change="handleDateChange" />
|
|
|
|
|
+ <el-button type="success" plain :loading="exportLoading" @click="handleExport">
|
|
|
|
|
+ <Icon icon="ep:download" class="mr-5px" /> 导出
|
|
|
|
|
+ </el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="device-list-panel__body flex flex-col flex-1 min-h-0">
|
|
<div class="device-list-panel__body flex flex-col flex-1 min-h-0">
|
|
@@ -225,7 +245,12 @@ onMounted(() => {
|
|
|
margin-top: 0;
|
|
margin-top: 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.device-list-panel__picker,
|
|
|
|
|
|
|
+.device-list-panel__tools {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: calc(8px * var(--kb-scale, 1));
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
.device-list-panel__picker-input {
|
|
.device-list-panel__picker-input {
|
|
|
width: calc(160px * var(--kb-scale, 1)) !important;
|
|
width: calc(160px * var(--kb-scale, 1)) !important;
|
|
|
}
|
|
}
|