|
|
@@ -326,6 +326,7 @@
|
|
|
>报表录入</a
|
|
|
>
|
|
|
<a class="table-action-link" @click="deviceEdit($event, 'deviceInfo', record)">设备编辑</a>
|
|
|
+ <a v-if="hasPermission('fan:exportDataBtn')" class="table-action-link" @click="exportData(record)">数据导出</a>
|
|
|
</template>
|
|
|
</GroupMonitorTable>
|
|
|
</a-tab-pane>
|
|
|
@@ -668,7 +669,7 @@
|
|
|
import { deviceControlApi } from '/@/api/vent/index';
|
|
|
import { mountedThree, destroy, addText, setModelType, playAnimate, resetEcharts } from './main.threejs';
|
|
|
import { SvgIcon } from '/@/components/Icon';
|
|
|
- import { list, pointMonitor, getFaultDiagnosis } from './main.api';
|
|
|
+ import { list, pointMonitor, getFaultDiagnosis, exportMonitorData } from './main.api';
|
|
|
import { list as baseList } from '../../deviceManager/fanTabel/fan.api';
|
|
|
import { getTableList } from '/@/views/vent/monitorManager/fanLocalMonitor/fanLocal.api';
|
|
|
import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
|
|
|
@@ -688,6 +689,7 @@
|
|
|
import { usePermission } from '/@/hooks/web/usePermission';
|
|
|
import { cloneDeep } from 'lodash-es';
|
|
|
import { getDictItems } from '/@/api/common/api';
|
|
|
+ import { downloadByData } from '/@/utils/file/download';
|
|
|
|
|
|
const globalConfig = inject('globalConfig');
|
|
|
const HistoryTable =
|
|
|
@@ -1654,6 +1656,25 @@
|
|
|
deviceId: record['deviceID'],
|
|
|
});
|
|
|
}
|
|
|
+ // 导出实时数据
|
|
|
+ async function exportData(record) {
|
|
|
+ try {
|
|
|
+ const res = await exportMonitorData({
|
|
|
+ devicetype: 'fanmain',
|
|
|
+ ids: record['deviceID'],
|
|
|
+ });
|
|
|
+ if (!res) {
|
|
|
+ createMessage.warning('文件下载失败');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const fileName = `${record['strname'] || '风机实时监测数据'}_${new Date().getTime()}.xlsx`;
|
|
|
+ downloadByData(res, fileName, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
|
|
+ createMessage.success('导出成功');
|
|
|
+ } catch (error) {
|
|
|
+ console.error('导出失败:', error);
|
|
|
+ createMessage.error('导出失败');
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 保德特有
|
|
|
function goOutLink(type: string) {
|