更新环境变量
This commit is contained in:
@@ -148,7 +148,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
|
||||
setLoading(true);
|
||||
try {
|
||||
const response = await axios.get(
|
||||
`${config.backendUrl}/getallsensorplacements/?network=${network}`
|
||||
`${config.BACKEND_URL}/getallsensorplacements/?network=${network}`
|
||||
);
|
||||
|
||||
let filteredResults = response.data;
|
||||
|
||||
@@ -92,12 +92,11 @@ const fetchFromBackend = async (
|
||||
const starttime = dayjs(range.from).format("YYYY-MM-DD HH:mm:ss");
|
||||
const endtime = dayjs(range.to).format("YYYY-MM-DD HH:mm:ss");
|
||||
// 清洗数据接口
|
||||
const cleaningSCADAUrl = `${config.backendUrl}/querycleaningscadadatabydeviceidandtimerange/?ids=${ids}&starttime=${starttime}&endtime=${endtime}`;
|
||||
const cleaningSCADAUrl = `${config.BACKEND_URL}/querycleaningscadadatabydeviceidandtimerange/?ids=${ids}&starttime=${starttime}&endtime=${endtime}`;
|
||||
// 原始数据
|
||||
const rawSCADAUrl = `${config.backendUrl}/queryscadadatabydeviceidandtimerange/?ids=${ids}&starttime=${starttime}&endtime=${endtime}`;
|
||||
const rawSCADAUrl = `${config.BACKEND_URL}/queryscadadatabydeviceidandtimerange/?ids=${ids}&starttime=${starttime}&endtime=${endtime}`;
|
||||
// 模拟数据接口
|
||||
const simulationSCADAUrl = `${config.backendUrl}/querysimulationscadadatabydeviceidandtimerange/?ids=${ids}&starttime=${starttime}&endtime=${endtime}`;
|
||||
|
||||
const simulationSCADAUrl = `${config.BACKEND_URL}/querysimulationscadadatabydeviceidandtimerange/?ids=${ids}&starttime=${starttime}&endtime=${endtime}`;
|
||||
try {
|
||||
let response;
|
||||
response = await fetch(cleaningSCADAUrl);
|
||||
@@ -274,9 +273,9 @@ const SCADADataPanel: React.FC<SCADADataPanelProps> = ({
|
||||
const starttime = dayjs(range.from).format("YYYY-MM-DD HH:mm:ss");
|
||||
const endtime = dayjs(range.to).format("YYYY-MM-DD HH:mm:ss");
|
||||
|
||||
const cleaningUrl = `${config.backendUrl}/querycleaningscadadatabydeviceidandtimerange/?ids=${ids}&starttime=${starttime}&endtime=${endtime}`;
|
||||
const rawUrl = `${config.backendUrl}/queryscadadatabydeviceidandtimerange/?ids=${ids}&starttime=${starttime}&endtime=${endtime}`;
|
||||
const simUrl = `${config.backendUrl}/querysimulationscadadatabydeviceidandtimerange/?ids=${ids}&starttime=${starttime}&endtime=${endtime}`;
|
||||
const cleaningUrl = `${config.BACKEND_URL}/querycleaningscadadatabydeviceidandtimerange/?ids=${ids}&starttime=${starttime}&endtime=${endtime}`;
|
||||
const rawUrl = `${config.BACKEND_URL}/queryscadadatabydeviceidandtimerange/?ids=${ids}&starttime=${starttime}&endtime=${endtime}`;
|
||||
const simUrl = `${config.BACKEND_URL}/querysimulationscadadatabydeviceidandtimerange/?ids=${ids}&starttime=${starttime}&endtime=${endtime}`;
|
||||
|
||||
try {
|
||||
const [cleanRes, rawRes, simRes] = await Promise.all([
|
||||
@@ -357,7 +356,7 @@ const SCADADataPanel: React.FC<SCADADataPanelProps> = ({
|
||||
useEffect(() => {
|
||||
const fetchDeviceLabels = async () => {
|
||||
try {
|
||||
const url = `${config.mapUrl}/TJWater/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=TJWater:geo_scada&outputFormat=application/json`;
|
||||
const url = `${config.MAP_URL}/${config.MAP_WORKSPACE}/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=${config.MAP_WORKSPACE}:geo_scada&outputFormat=application/json`;
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) return;
|
||||
|
||||
@@ -466,7 +465,7 @@ const SCADADataPanel: React.FC<SCADADataPanelProps> = ({
|
||||
|
||||
// 调用后端清洗接口
|
||||
const response = await axios.post(
|
||||
`${config.backendUrl}/scadadevicedatacleaning/`,
|
||||
`${config.BACKEND_URL}/scadadevicedatacleaning/`,
|
||||
null,
|
||||
{
|
||||
params: {
|
||||
|
||||
@@ -183,7 +183,7 @@ const SCADADeviceList: React.FC<SCADADeviceListProps> = ({
|
||||
const fetchScadaDevices = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const url = `${config.mapUrl}/TJWater/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=TJWater:geo_scada&outputFormat=application/json`;
|
||||
const url = `${config.MAP_URL}/${config.MAP_WORKSPACE}/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=${config.MAP_WORKSPACE}:geo_scada&outputFormat=application/json`;
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) throw new Error("Failed to fetch SCADA devices");
|
||||
const json = await response.json();
|
||||
@@ -607,7 +607,7 @@ const SCADADeviceList: React.FC<SCADADeviceListProps> = ({
|
||||
|
||||
// 调用后端清洗接口
|
||||
const response = await axios.post(
|
||||
`${config.backendUrl}/scadadevicedatacleaning/`,
|
||||
`${config.BACKEND_URL}/scadadevicedatacleaning/`,
|
||||
null,
|
||||
{
|
||||
params: {
|
||||
|
||||
@@ -20,8 +20,6 @@ interface ZonePropsPanelProps {
|
||||
onClose?: () => void;
|
||||
}
|
||||
|
||||
const mapUrl = config.mapUrl;
|
||||
|
||||
const ZonePropsPanel: React.FC<ZonePropsPanelProps> = ({
|
||||
title = "分区属性信息",
|
||||
isVisible = true,
|
||||
@@ -107,7 +105,7 @@ const ZonePropsPanel: React.FC<ZonePropsPanelProps> = ({
|
||||
}
|
||||
const networkZoneLayer = new VectorLayer({
|
||||
source: new VectorSource({
|
||||
url: `${mapUrl}/TJWater/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=TJWater:network_zone&outputFormat=application/json`,
|
||||
url: `${config.MAP_URL}/${config.MAP_WORKSPACE}/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=${config.MAP_WORKSPACE}:network_zone&outputFormat=application/json`,
|
||||
format: new GeoJson(),
|
||||
}),
|
||||
style: new Style({
|
||||
|
||||
Reference in New Issue
Block a user