Compare commits

...

4 Commits

Author SHA1 Message Date
JIANG
ae1f9b284f 调整环境变量配置,便于docker打包 2026-02-09 15:32:35 +08:00
JIANG
409057cef2 支持管道冲洗模块流量参数为0 2026-02-09 15:32:10 +08:00
JIANG
2c51785157 修改管道清洗默认值 2026-02-06 17:47:55 +08:00
JIANG
6be4a0de14 修改爆管分析传递的参数格式 2026-02-06 16:59:59 +08:00
5 changed files with 44 additions and 13 deletions

View File

@@ -1,7 +1,10 @@
**/node_modules/
**/dist
node_modules
.next
out
build
.git
npm-debug.log
.coverage
.coverage.*
.env
.env*.local
README.md
docker-compose.yml
Dockerfile
.dockerignore

15
.env Normal file
View File

@@ -0,0 +1,15 @@
KEYCLOAK_CLIENT_ID=
KEYCLOAK_CLIENT_SECRET=
KEYCLOAK_ISSUER=
NEXTAUTH_SECRET=
NEXTAUTH_URL=
# 为前端暴露的变量添加 NEXT_PUBLIC_ 前缀
NEXT_PUBLIC_BACKEND_URL=
NEXT_PUBLIC_MAP_URL=
NEXT_PUBLIC_MAP_WORKSPACE=
NEXT_PUBLIC_MAP_EXTENT=
# NEXT_PUBLIC_MAP_AVAILABLE_LAYERS="junctions, pipes, reservoirs, scada"
NEXT_PUBLIC_NETWORK_NAME=
NEXT_PUBLIC_MAPBOX_TOKEN=
NEXT_PUBLIC_TIANDITU_TOKEN=

View File

@@ -1,4 +1,4 @@
FROM refinedev/node:18 AS base
FROM refinedev/node:22 AS base
FROM base AS deps
@@ -15,6 +15,16 @@ RUN \
FROM base AS builder
# 只定义 ARG 接收来自构建命令或 docker-compose.yaml 的参数
# Next.js 在 build 时会自动读取同名的 ARG 作为环境变量
ARG NEXT_PUBLIC_BACKEND_URL
ARG NEXT_PUBLIC_MAP_URL
ARG NEXT_PUBLIC_MAP_WORKSPACE
ARG NEXT_PUBLIC_MAP_EXTENT
ARG NEXT_PUBLIC_NETWORK_NAME
ARG NEXT_PUBLIC_MAPBOX_TOKEN
ARG NEXT_PUBLIC_TIANDITU_TOKEN
COPY --from=deps /app/refine/node_modules ./node_modules
COPY . .
@@ -23,7 +33,7 @@ RUN npm run build
FROM base AS runner
ENV NODE_ENV production
ENV NODE_ENV=production
COPY --from=builder /app/refine/public ./public
@@ -37,7 +47,7 @@ USER refine
EXPOSE 3000
ENV PORT 3000
ENV HOSTNAME "0.0.0.0"
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]

View File

@@ -285,6 +285,9 @@ const AnalysisParameters: React.FC = () => {
try {
await axios.get(`${config.BACKEND_URL}/api/v1/burst_analysis/`, {
params,
paramsSerializer: {
indexes: null, // 移除数组索引,即由 burst_ID[] 变为 burst_ID
},
});
// 更新弹窗为成功状态
open?.({

View File

@@ -47,7 +47,7 @@ const AnalysisParameters: React.FC = () => {
const [drainageFeature, setDrainageFeature] = useState<Feature | null>(null);
const [startTime, setStartTime] = useState<Dayjs | null>(dayjs(new Date()));
const [flushFlow, setFlushFlow] = useState<number>(0);
const [flushFlow, setFlushFlow] = useState<number>(200);
const [duration, setDuration] = useState<number>(3600);
const [selectionMode, setSelectionMode] = useState<'none' | 'valve' | 'drainage'>('none');
@@ -401,7 +401,7 @@ const AnalysisParameters: React.FC = () => {
<Box className="flex gap-2">
<Box className="flex-1">
<Typography variant="subtitle2" className="mb-1 font-medium">
(CMH)
</Typography>
<TextField
fullWidth
@@ -436,7 +436,7 @@ const AnalysisParameters: React.FC = () => {
!schemeName.trim() ||
!drainageNode ||
!startTime ||
!flushFlow ||
// !flushFlow ||
!duration
}
className="bg-blue-600 hover:bg-blue-700"