diff --git a/.env b/.env index 93da990..7fd9e5c 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -REACT_APP_WS_URL=192.168.1.200:8080/ws +REACT_APP_WS_URL=192.168.1.201:8080/ws diff --git a/package.json b/package.json index 56424a1..e0d4d7b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "outline", "version": "0.1.0", "private": true, - "proxy": "http://192.168.1.200:8080", + "proxy": "http://192.168.1.201:8080", "dependencies": { "@babel/core": "^7.16.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.3", diff --git a/src/components/SideMenu.tsx b/src/components/SideMenu.tsx index 494b52e..11c39f3 100644 --- a/src/components/SideMenu.tsx +++ b/src/components/SideMenu.tsx @@ -39,8 +39,9 @@ const items: MenuItem[] = [ export default function SideMenu() { const navigate = useNavigate(); const location = useLocation(); + console.log('location.pathname.indexOf("/measure/detail")---', location.pathname.indexOf("/measure/detail")) const key = - location.pathname === "/measure/detail" + location.pathname.indexOf("/measure/detail")>-1 ? "/measure/detail" : location.pathname.startsWith("/measure") ? "/measure/config" diff --git a/src/index.tsx b/src/index.tsx index ec73b91..9555bce 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -39,7 +39,7 @@ const router = createBrowserRouter([ element: , children:[ { - path: "detail/:id", + path: ":id", element: , } ] diff --git a/src/pages/measure/components/Detail.tsx b/src/pages/measure/components/Detail.tsx index 513cf1f..3c612b2 100644 --- a/src/pages/measure/components/Detail.tsx +++ b/src/pages/measure/components/Detail.tsx @@ -1,9 +1,9 @@ -import {getDetailList, delDetail, getDetail, getPointByUuid} from '../../../services/measure/analysis' +import { getDetail, getPointByUuid} from '../../../services/measure/analysis' import { useState, useEffect, useRef } from 'react' import {message } from 'antd'; import { useNavigate, useParams } from 'react-router-dom'; -import type { AnalysisReport, DetailTable, } from "../../../services/measure/type"; +import type { AnalysisReport } from "../../../services/measure/type"; import { AnalysisData, BenchmarkShape, MeasurementCanvasRef } from './konva/MeasurementCanvas'; import MeasurementCanvas from "./konva/MeasurementCanvas"; import { @@ -12,10 +12,10 @@ import { } from "../../../services/measure/analysis"; export default function MeasureDetail() { const {id} = useParams() - const navigate = useNavigate(); const [measureId, setMeasureId] = useState(Number(id)) useEffect(()=>{ + console.error('detail--------') onShowDetail(measureId) }, []) diff --git a/src/pages/measure/components/MeasureDetail.tsx b/src/pages/measure/components/MeasureDetail.tsx index 886a5c4..0ca6947 100644 --- a/src/pages/measure/components/MeasureDetail.tsx +++ b/src/pages/measure/components/MeasureDetail.tsx @@ -6,6 +6,7 @@ import type { AnalysisReport, AnalysisResults, DetailTable, SearchParams } from import { ExclamationCircleFilled } from '@ant-design/icons'; import { AnalysisData, BenchmarkShape, MeasurementCanvasRef } from './konva/MeasurementCanvas'; import MeasurementCanvas from "./konva/MeasurementCanvas"; +import { Outlet } from 'react-router-dom'; import { getBaseRecordPointSetByCode, getReport @@ -155,6 +156,7 @@ export default function MeasureDetail() { const onShowDetail = async (item:DetailTable)=> { //获取基线 setIsModalOpen(true) + // navigate(`/measure/detail/${item.id}`) let res = await getBaseRecordPointSetByCode("6001") if (res.success) { const benchmarkShapes = JSON.parse(res.data.points) as BenchmarkShape[]; @@ -171,7 +173,7 @@ export default function MeasureDetail() { let resData = await getDetail({id:item.id}) console.log('res==测量记录详情=', resData) if(resData){ - navigate(`/measure/detail/${item.id}`) + // navigate(`/measure/detail/${item.id}`) //@ts-ignore getRecordByUuid(resData.data.uuid) //@ts-ignore @@ -306,56 +308,16 @@ export default function MeasureDetail() { return (
-
- - setName(e.target.value)} style={{ width: 200 }}/> - setLineName(e.target.value)} style={{ width: 200 }}/> - -
-
- - locale={{ - emptyText: '无数据', - }} - loading={loading} - rowSelection={{ type: selectionType, ...rowSelection }} - columns={columns} - rowKey="id" - dataSource={tableData && tableData.map(item => ({ ...item, key: item.name }))} - pagination={false} - scroll={{ y: 500 }} - - /> -
- -
-
- {isModalOpen && - - 取消 - ]} - > -
+ + {isModalOpen ? +
+
setShowGrid(checked)} /> 参考线
-
+
{ @@ -382,7 +344,8 @@ export default function MeasureDetail() { 角度线
-
+ +
{analysisReport && -
+
分析 @@ -425,21 +388,61 @@ export default function MeasureDetail() { {analysisReport.railHeadWidth} - {analysisReport.angleAnalysisList && analysisReport.angleAnalysisList.map((item, index) => ( + {analysisReport.angleAnalysisList ? analysisReport.angleAnalysisList.map((item, index) => ( {item.describe} {item.distance} - ))} + )) + : +
加载中……
+ }
+
+ +
}
- - } +
+ : + <> +
+ + setName(e.target.value)} style={{ width: 200 }}/> + setLineName(e.target.value)} style={{ width: 200 }}/> + +
+
+ + locale={{ + emptyText: '无数据', + }} + loading={loading} + rowSelection={{ type: selectionType, ...rowSelection }} + columns={columns} + rowKey="id" + dataSource={tableData && tableData.map(item => ({ ...item, key: item.name }))} + pagination={false} + scroll={{ y: 500 }} + + /> +
+ +
+
+ + }
); } diff --git a/src/pages/rail/railConfig.tsx b/src/pages/rail/railConfig.tsx index fd7f969..c7087a3 100644 --- a/src/pages/rail/railConfig.tsx +++ b/src/pages/rail/railConfig.tsx @@ -6,6 +6,7 @@ export default function RailManage() { type RailItem = { id?: number; name: string; + createName: string; createTime: string, updateTime: string } @@ -44,6 +45,7 @@ export default function RailManage() { let [total, setTotal] = useState() let [tableData, setTableData] = useState([{ name:'60形', + createName:'张三', createTime:'2025-03-03', updateTime:'' }])