diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 3522a338..5c954f6e 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -15,7 +15,7 @@ const dictStore = useDictStoreWithOut() export interface DictDataType { dictType: string label: string - value: string | number | boolean + value: string | number colorType: ElementPlusInfoType | '' cssClass: string } diff --git a/src/views/iot/device/index.vue b/src/views/iot/device/index.vue index f72ac725..2cb22589 100644 --- a/src/views/iot/device/index.vue +++ b/src/views/iot/device/index.vue @@ -314,12 +314,16 @@ const handleCopy = async (id: number) => { /** 导出按钮操作 */ const handleExport = async () => { + if (!selectedIds.value.length) { + message.error('请选择需要导出的数据') + return + } try { // 导出的二次确认 await message.exportConfirm() // 发起导出 exportLoading.value = true - const data = await DeviceApi.exportDevice(queryParams) + const data = await DeviceApi.exportDevice({ ids: selectedIds.value.join(',') }) download.excel(data, '物联设备.xls') } catch { } finally {