|
@@ -36,6 +36,7 @@
|
|
|
import dayjs from 'dayjs';
|
|
|
import { getAutoScrollContainer } from '/@/utils/common/compUtils';
|
|
|
import { render } from '/@/utils/common/renderUtils';
|
|
|
+ import { useMethods } from '/@/hooks/system/useMethods';
|
|
|
|
|
|
const globalConfig = inject('globalConfig');
|
|
|
const props = defineProps({
|
|
@@ -77,7 +78,7 @@
|
|
|
default: () => [],
|
|
|
},
|
|
|
});
|
|
|
-
|
|
|
+ const { exportXlsPostBlob } = useMethods();
|
|
|
const getDeviceListApi = (params) => defHttp.post({ url: '/monitor/device', params });
|
|
|
const historyTable = ref();
|
|
|
const loading = ref(false);
|
|
@@ -110,6 +111,8 @@
|
|
|
const tableScroll = props.scroll.y ? ref({ y: props.scroll.y - 100 }) : ref({});
|
|
|
let deviceOptions = ref([]);
|
|
|
const deviceTypeStr = ref('');
|
|
|
+ const deviceTypeName = ref('');
|
|
|
+ const deviceType = ref('');
|
|
|
loading.value = true;
|
|
|
|
|
|
watch(
|
|
@@ -203,6 +206,10 @@
|
|
|
} else {
|
|
|
if (res['records'] && res['records'].length > 0) result = res['records'];
|
|
|
}
|
|
|
+ if (res['msgTxt'] && res['msgTxt'][0]) {
|
|
|
+ deviceTypeName.value = res['msgTxt'][0]['typeName'];
|
|
|
+ deviceType.value = res['msgTxt'][0]['type'];
|
|
|
+ }
|
|
|
} else {
|
|
|
const res = await getDeviceListApi({ devicetype: props.deviceType, pageSize: 10000 });
|
|
|
if (res['records'] && res['records'].length > 0) {
|
|
@@ -210,6 +217,10 @@
|
|
|
} else if (res['msgTxt'] && res['msgTxt'][0] && res['msgTxt'][0]['datalist']) {
|
|
|
result = res['msgTxt'][0]['datalist'];
|
|
|
}
|
|
|
+ if (res['msgTxt'] && res['msgTxt'][0]) {
|
|
|
+ deviceTypeName.value = res['msgTxt'][0]['typeName'];
|
|
|
+ deviceType.value = res['msgTxt'][0]['type'];
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
const res = await getDeviceListApi({
|
|
@@ -222,6 +233,10 @@
|
|
|
} else if (res['msgTxt'] && res['msgTxt'][0] && res['msgTxt'][0]['datalist']) {
|
|
|
result = res['msgTxt'][0]['datalist'];
|
|
|
}
|
|
|
+ if (res['msgTxt'] && res['msgTxt'][0]) {
|
|
|
+ deviceTypeName.value = res['msgTxt'][0]['typeName'];
|
|
|
+ deviceType.value = res['msgTxt'][0]['type'];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (result) {
|
|
@@ -236,6 +251,7 @@
|
|
|
stationtype: item['stationtype'],
|
|
|
};
|
|
|
});
|
|
|
+
|
|
|
stationType.value = deviceOptions.value[0]['stationtype'];
|
|
|
historyType.value = deviceOptions.value[0]['strtype'] || deviceOptions.value[0]['devicekind'];
|
|
|
}
|
|
@@ -473,7 +489,16 @@
|
|
|
const params = resetFormParam();
|
|
|
// 判断时间间隔和查询时间区间,数据量下载大时进行提示
|
|
|
if (stationType.value !== 'redis') {
|
|
|
- return onExportXls(params);
|
|
|
+ if (deviceType.value === 'modelsensor_multi') {
|
|
|
+ const url = '/ventanaly-device/safety/reportInfo/expComReportByParam';
|
|
|
+ return exportXlsPostBlob('传感器历史数据', url, {
|
|
|
+ deviceKind: deviceType.value.split('_')[0],
|
|
|
+ deviceType: deviceType.value,
|
|
|
+ tempName: 'dcsbb',
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return onExportXls(params);
|
|
|
+ }
|
|
|
} else {
|
|
|
return onExportXlsPost(params);
|
|
|
}
|