Commit e57c5082 authored by 李纪文's avatar 李纪文

fix: 修改组态

parent b2c34982
......@@ -32,15 +32,6 @@ export function getPointAddress(params) {
});
}
// 获取历史数据
export function getHistoryInfo(params) {
return request({
url: `${baseURI}/PandaCore/GCK/Device/SensorsDataForStation`,
method: REQUEST_METHOD_POST,
data: params,
});
}
// 获取数据字典
export function getDictionaryList(params) {
return request({
......
......@@ -760,11 +760,20 @@ const ConfigurationView = (props) => {
accountFieldParams,
};
const results = await getDeviceRealInfo(params);
const realDate = results && results.data && results.data.list ? results.data.list : [];
chartDataRender(realDate);
const realData = results && results.data && results.data.list ? results.data.list : [];
chartDataRender(flatten(realData));
} catch (err) {}
};
// 实时数据父子级平铺
const flatten = (arr) => {
return [].concat(
...arr.map((item) =>
item.child ? [].concat(item, ...flatten(item.child)) : [].concat(item),
),
);
};
/** ************************************图表数据处理******************************* */
const chartDataRender = (mqttData) => {
const json = JSON.parse(myDiagram.model.toJson());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment