|
|
@ -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 ( |
|
|
|
<div> |
|
|
|
<div className="p-[15px]"> |
|
|
|
<Button |
|
|
|
disabled={!selectRows.length} |
|
|
|
type="primary" |
|
|
|
onClick={onBatchDel}> |
|
|
|
删除 |
|
|
|
</Button> |
|
|
|
<Input className='ml-[2rem]' placeholder="测量名称" onChange={(e)=>setName(e.target.value)} style={{ width: 200 }}/> |
|
|
|
<Input className='ml-[2rem]' placeholder="线路名称" onChange={(e)=>setLineName(e.target.value)} style={{ width: 200 }}/> |
|
|
|
<Button type="primary" className='ml-[2rem]' onClick={onSearch}>搜索</Button> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Table<DetailTable> |
|
|
|
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 }} |
|
|
|
|
|
|
|
/> |
|
|
|
<div className="float-right mt-[10px] mr-[1rem]"> |
|
|
|
<Pagination onChange={onPageChange} current={pageNum} pageSizeOptions={[5,10,20,30]} defaultCurrent={pageNum} defaultPageSize={pageSize} total={total}/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{isModalOpen && |
|
|
|
<Modal |
|
|
|
title="测量记录详情" |
|
|
|
open={isModalOpen} |
|
|
|
width={{ xl: '90%'}} |
|
|
|
style={{ top: 20 }} |
|
|
|
closable={true} |
|
|
|
onCancel={handleCancel} |
|
|
|
key={String(isModalOpen)} |
|
|
|
footer={[ |
|
|
|
<Button key="cancel" onClick={handleCancel}> |
|
|
|
取消 |
|
|
|
</Button>]} |
|
|
|
> |
|
|
|
<div className="flex"> |
|
|
|
|
|
|
|
{isModalOpen ? |
|
|
|
<div className="pt-[5px]"> |
|
|
|
<div className="flex"> |
|
|
|
<div className="ml-[7rem]"> |
|
|
|
<Switch defaultChecked onChange={checked => setShowGrid(checked)} /> |
|
|
|
<span>参考线</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div className="ml-[1rem]"> |
|
|
|
<div className="ml-[1rem] "> |
|
|
|
<Switch |
|
|
|
checked={showStandard} |
|
|
|
onChange={checked => { |
|
|
@ -382,7 +344,8 @@ export default function MeasureDetail() { |
|
|
|
<span>角度线</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="flex justify-center mt-[5px]"> |
|
|
|
|
|
|
|
<div className="flex ml-[7rem] mt-[5px]"> |
|
|
|
<MeasurementCanvas |
|
|
|
width={800} |
|
|
|
height={600} |
|
|
@ -401,7 +364,7 @@ export default function MeasureDetail() { |
|
|
|
/> |
|
|
|
|
|
|
|
{analysisReport && |
|
|
|
<div className=" h-[600px] ml-[1rem]"> |
|
|
|
<div className=" h-[550px] ml-[1rem]"> |
|
|
|
|
|
|
|
<header className="bg-[#e8f0ff] w-[300px] text-center text-lg font-medium py-2 text-primary border border-[#c1c6d4]"> |
|
|
|
分析 |
|
|
@ -425,21 +388,61 @@ export default function MeasureDetail() { |
|
|
|
{analysisReport.railHeadWidth} |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
{analysisReport.angleAnalysisList && analysisReport.angleAnalysisList.map((item, index) => ( |
|
|
|
{analysisReport.angleAnalysisList ? analysisReport.angleAnalysisList.map((item, index) => ( |
|
|
|
<tr key={index} style={{ height: "40px", fontSize: "18px", color: "#9E9E9E" }}> |
|
|
|
<td style={{ padding: "8px", border: "1px solid #ccc" }}>{item.describe}</td> |
|
|
|
<td style={{ padding: "8px", border: "1px solid #ccc" }}>{item.distance}</td> |
|
|
|
</tr> |
|
|
|
))} |
|
|
|
)) |
|
|
|
: |
|
|
|
<div className="h-[28rem]">加载中……</div> |
|
|
|
} |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
</div> |
|
|
|
<div className="flex justify-center mt-[1.5rem]" > |
|
|
|
<Button type="primary" onClick={handleCancel} className='w-[200px]'> |
|
|
|
返回 |
|
|
|
</Button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
} |
|
|
|
</div> |
|
|
|
|
|
|
|
</Modal> |
|
|
|
} |
|
|
|
</div> |
|
|
|
: |
|
|
|
<> |
|
|
|
<div className="p-[15px]"> |
|
|
|
<Button |
|
|
|
disabled={!selectRows.length} |
|
|
|
type="primary" |
|
|
|
onClick={onBatchDel}> |
|
|
|
删除 |
|
|
|
</Button> |
|
|
|
<Input className='ml-[2rem]' placeholder="测量名称" onChange={(e)=>setName(e.target.value)} style={{ width: 200 }}/> |
|
|
|
<Input className='ml-[2rem]' placeholder="线路名称" onChange={(e)=>setLineName(e.target.value)} style={{ width: 200 }}/> |
|
|
|
<Button type="primary" className='ml-[2rem]' onClick={onSearch}>搜索</Button> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Table<DetailTable> |
|
|
|
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 }} |
|
|
|
|
|
|
|
/> |
|
|
|
<div className="float-right mt-[10px] mr-[1rem]"> |
|
|
|
<Pagination onChange={onPageChange} current={pageNum} pageSizeOptions={[5,10,20,30]} defaultCurrent={pageNum} defaultPageSize={pageSize} total={total}/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</> |
|
|
|
} |
|
|
|
</div> |
|
|
|
); |
|
|
|
} |