更新数据接口,匹配 timescaledb
This commit is contained in:
@@ -31,7 +31,6 @@ import { parseColor } from "@utils/parseColor";
|
|||||||
import { VectorTile } from "ol";
|
import { VectorTile } from "ol";
|
||||||
import { useNotification } from "@refinedev/core";
|
import { useNotification } from "@refinedev/core";
|
||||||
import { config } from "@/config/config";
|
import { config } from "@/config/config";
|
||||||
import { set } from "ol/transform";
|
|
||||||
|
|
||||||
interface StyleConfig {
|
interface StyleConfig {
|
||||||
property: string;
|
property: string;
|
||||||
|
|||||||
@@ -119,7 +119,8 @@ const Timeline: React.FC<TimelineProps> = ({
|
|||||||
`${backendUrl}/queryallschemerecordsbytimeproperty/?querytime=${query_time}&type=node&property=${junctionProperties}&schemename=${schemeName}`
|
`${backendUrl}/queryallschemerecordsbytimeproperty/?querytime=${query_time}&type=node&property=${junctionProperties}&schemename=${schemeName}`
|
||||||
))
|
))
|
||||||
: (nodePromise = fetch(
|
: (nodePromise = fetch(
|
||||||
`${backendUrl}/queryallrecordsbytimeproperty/?querytime=${query_time}&type=node&property=${junctionProperties}`
|
// `${backendUrl}/queryallrecordsbytimeproperty/?querytime=${query_time}&type=node&property=${junctionProperties}`
|
||||||
|
`${backendUrl}/timescaledb/realtime/query/by-time-property?query_time=${query_time}&type=node&property=${junctionProperties}`
|
||||||
));
|
));
|
||||||
requests.push(nodePromise);
|
requests.push(nodePromise);
|
||||||
}
|
}
|
||||||
@@ -136,7 +137,8 @@ const Timeline: React.FC<TimelineProps> = ({
|
|||||||
`${backendUrl}/queryallschemerecordsbytimeproperty/?querytime=${query_time}&type=link&property=${pipeProperties}&schemename=${schemeName}`
|
`${backendUrl}/queryallschemerecordsbytimeproperty/?querytime=${query_time}&type=link&property=${pipeProperties}&schemename=${schemeName}`
|
||||||
))
|
))
|
||||||
: (linkPromise = fetch(
|
: (linkPromise = fetch(
|
||||||
`${backendUrl}/queryallrecordsbytimeproperty/?querytime=${query_time}&type=link&property=${pipeProperties}`
|
// `${backendUrl}/queryallrecordsbytimeproperty/?querytime=${query_time}&type=link&property=${pipeProperties}`
|
||||||
|
`${backendUrl}/timescaledb/realtime/query/by-time-property?query_time=${query_time}&type=link&property=${pipeProperties}`
|
||||||
));
|
));
|
||||||
requests.push(linkPromise);
|
requests.push(linkPromise);
|
||||||
}
|
}
|
||||||
@@ -210,6 +212,7 @@ const Timeline: React.FC<TimelineProps> = ({
|
|||||||
|
|
||||||
// 播放时间间隔选项
|
// 播放时间间隔选项
|
||||||
const intervalOptions = [
|
const intervalOptions = [
|
||||||
|
{ value: 5000, label: "5秒" },
|
||||||
{ value: 10000, label: "10秒" },
|
{ value: 10000, label: "10秒" },
|
||||||
{ value: 15000, label: "15秒" },
|
{ value: 15000, label: "15秒" },
|
||||||
{ value: 20000, label: "20秒" },
|
{ value: 20000, label: "20秒" },
|
||||||
|
|||||||
@@ -340,11 +340,13 @@ const Toolbar: React.FC<ToolbarProps> = ({ hiddenButtons, queryType }) => {
|
|||||||
let response;
|
let response;
|
||||||
if (queryType === "scheme") {
|
if (queryType === "scheme") {
|
||||||
response = await fetch(
|
response = await fetch(
|
||||||
`${backendUrl}/queryschemesimulationrecordsbyidtime/?scheme_name=${schemeName}&id=${id}&querytime=${querytime}&type=${type}`
|
// `${backendUrl}/queryschemesimulationrecordsbyidtime/?scheme_name=${schemeName}&id=${id}&querytime=${querytime}&type=${type}`
|
||||||
|
`${backendUrl}/timescaledb/scheme/query/by-id-time?scheme_name=${schemeName}&id=${id}&type=${type}&query_time=${querytime}`
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
response = await fetch(
|
response = await fetch(
|
||||||
`${backendUrl}/querysimulationrecordsbyidtime/?id=${id}&querytime=${querytime}&type=${type}`
|
// `${backendUrl}/querysimulationrecordsbyidtime/?id=${id}&querytime=${querytime}&type=${type}`
|
||||||
|
`${backendUrl}/timescaledb/realtime/query/by-id-time?id=${id}&type=${type}&query_time=${querytime}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import utc from "dayjs/plugin/utc";
|
|||||||
import timezone from "dayjs/plugin/timezone";
|
import timezone from "dayjs/plugin/timezone";
|
||||||
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
|
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
|
||||||
import { DateTimePicker, LocalizationProvider } from "@mui/x-date-pickers";
|
import { DateTimePicker, LocalizationProvider } from "@mui/x-date-pickers";
|
||||||
import config, { NETWORK_NAME } from "@/config/config";
|
import config from "@/config/config";
|
||||||
import { GeoJSON } from "ol/format";
|
import { GeoJSON } from "ol/format";
|
||||||
import { useGetIdentity } from "@refinedev/core";
|
import { useGetIdentity } from "@refinedev/core";
|
||||||
import { useNotification } from "@refinedev/core";
|
import { useNotification } from "@refinedev/core";
|
||||||
@@ -451,7 +451,6 @@ const SCADADataPanel: React.FC<SCADADataPanelProps> = ({
|
|||||||
null,
|
null,
|
||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
network: NETWORK_NAME,
|
|
||||||
ids_list: deviceIds.join(","), // 修改:将数组转为逗号分隔字符串
|
ids_list: deviceIds.join(","), // 修改:将数组转为逗号分隔字符串
|
||||||
start_time: startTime,
|
start_time: startTime,
|
||||||
end_time: endTime,
|
end_time: endTime,
|
||||||
|
|||||||
Reference in New Issue
Block a user