|
|
|
@ -7,6 +7,121 @@ import { StorageEnum } from "@/enums/storageEnum"; |
|
|
|
import { SystemStoreEnum } from '@/store/modules/systemStore/systemStore.d' |
|
|
|
import { SystemStoreEnum } from '@/store/modules/systemStore/systemStore.d' |
|
|
|
import { SelectDataSourceTypeAPIObj } from "@/enums/dataSourceEnum"; |
|
|
|
import { SelectDataSourceTypeAPIObj } from "@/enums/dataSourceEnum"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const testData = { |
|
|
|
|
|
|
|
"code": 0, |
|
|
|
|
|
|
|
"msg": "", |
|
|
|
|
|
|
|
"data": { |
|
|
|
|
|
|
|
"dimensions": [ |
|
|
|
|
|
|
|
"c_40136", |
|
|
|
|
|
|
|
"c_40138", |
|
|
|
|
|
|
|
"_ts" |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
"source": [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 24.93, |
|
|
|
|
|
|
|
"c_40138": 11.31, |
|
|
|
|
|
|
|
"_ts": 1753977600000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 24.94, |
|
|
|
|
|
|
|
"c_40138": 11.31, |
|
|
|
|
|
|
|
"_ts": 1753977720000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 24.94, |
|
|
|
|
|
|
|
"c_40138": 11.31, |
|
|
|
|
|
|
|
"_ts": 1753977840000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 24.95, |
|
|
|
|
|
|
|
"c_40138": 11.31, |
|
|
|
|
|
|
|
"_ts": 1753977960000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 24.96, |
|
|
|
|
|
|
|
"c_40138": 11.31, |
|
|
|
|
|
|
|
"_ts": 1753978080000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 24.97, |
|
|
|
|
|
|
|
"c_40138": 11.31, |
|
|
|
|
|
|
|
"_ts": 1753978200000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 24.98, |
|
|
|
|
|
|
|
"c_40138": 11.31, |
|
|
|
|
|
|
|
"_ts": 1753978320000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 24.99, |
|
|
|
|
|
|
|
"c_40138": 11.31, |
|
|
|
|
|
|
|
"_ts": 1753978440000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 25, |
|
|
|
|
|
|
|
"c_40138": 11.31, |
|
|
|
|
|
|
|
"_ts": 1753978560000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 27.45, |
|
|
|
|
|
|
|
"c_40138": 11.51, |
|
|
|
|
|
|
|
"_ts": 1754038560000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 27.45, |
|
|
|
|
|
|
|
"c_40138": 11.51, |
|
|
|
|
|
|
|
"_ts": 1754038680000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 27.45, |
|
|
|
|
|
|
|
"c_40138": 11.52, |
|
|
|
|
|
|
|
"_ts": 1754038800000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 27.45, |
|
|
|
|
|
|
|
"c_40138": 11.52, |
|
|
|
|
|
|
|
"_ts": 1754038920000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 27.45, |
|
|
|
|
|
|
|
"c_40138": 11.52, |
|
|
|
|
|
|
|
"_ts": 1754039040000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 27.45, |
|
|
|
|
|
|
|
"c_40138": 11.53, |
|
|
|
|
|
|
|
"_ts": 1754039160000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 27.45, |
|
|
|
|
|
|
|
"c_40138": 11.53, |
|
|
|
|
|
|
|
"_ts": 1754039280000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 27.45, |
|
|
|
|
|
|
|
"c_40138": 11.54, |
|
|
|
|
|
|
|
"_ts": 1754039400000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 27.45, |
|
|
|
|
|
|
|
"c_40138": 11.54, |
|
|
|
|
|
|
|
"_ts": 1754039520000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 27.45, |
|
|
|
|
|
|
|
"c_40138": 11.55, |
|
|
|
|
|
|
|
"_ts": 1754039640000 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c_40136": 27.45, |
|
|
|
|
|
|
|
"c_40138": 11.55, |
|
|
|
|
|
|
|
"_ts": 1754039760000 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
/* |
|
|
|
/* |
|
|
|
* 获取站点 |
|
|
|
* 获取站点 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ -105,7 +220,8 @@ function getPointParams(requestSource:RequestDataSourceConfig) { |
|
|
|
queryType: SelectDataSourceTypeAPIObj[requestSource.dataSourceType], |
|
|
|
queryType: SelectDataSourceTypeAPIObj[requestSource.dataSourceType], |
|
|
|
site: requestSource.station, |
|
|
|
site: requestSource.station, |
|
|
|
with: requestSource.recentTimeRange, |
|
|
|
with: requestSource.recentTimeRange, |
|
|
|
deviceSn: String(requestSource.device), |
|
|
|
deviceSn: requestSource.device.split('|')[0], |
|
|
|
|
|
|
|
deviceType: requestSource.device.split('|')[1], |
|
|
|
points: requestSource.points, |
|
|
|
points: requestSource.points, |
|
|
|
tenantId: getToken() |
|
|
|
tenantId: getToken() |
|
|
|
} |
|
|
|
} |
|
|
|
@ -136,6 +252,11 @@ export const fetchDataByIot = async (requestSource:RequestDataSourceConfig) => { |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
return await http(RequestHttpEnum.POST)<ProjectDetail>(`${ModuleTypeEnum.DATA}/get-by-iot`, params) |
|
|
|
return await http(RequestHttpEnum.POST)<ProjectDetail>(`${ModuleTypeEnum.DATA}/get-by-iot`, params) |
|
|
|
|
|
|
|
// await specialCustomizeHttp({
|
|
|
|
|
|
|
|
// url: `${ModuleTypeEnum.DATA}/get-by-iot`,
|
|
|
|
|
|
|
|
// method: 'POST',
|
|
|
|
|
|
|
|
// params
|
|
|
|
|
|
|
|
// })
|
|
|
|
} catch { |
|
|
|
} catch { |
|
|
|
httpErrorHandle() |
|
|
|
httpErrorHandle() |
|
|
|
} |
|
|
|
} |
|
|
|
|