|
|
@ -8,7 +8,7 @@ import MeasurementCanvas, { |
|
|
|
import Bridge from '../utils/bridge'; |
|
|
|
import { Measurement } from '../services/apiTypes'; |
|
|
|
import { useAppDispatch, useAppSelector } from '../utils/hooks'; |
|
|
|
import { XB_CODES } from '../utils/constant'; |
|
|
|
// import { XB_CODES } from '../utils/constant';
|
|
|
|
import { updateRailPoints } from '../store/features/baseData'; |
|
|
|
|
|
|
|
export default function MeasureRecord() { |
|
|
@ -24,7 +24,7 @@ export default function MeasureRecord() { |
|
|
|
useEffect(() => { |
|
|
|
Bridge.getMeasurementDetail({ id: +(params.recordId || '') }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
setMeasure(res.data); |
|
|
|
setMeasure({ ...res.data, extraDescObj: JSON.parse(res.data.extraDesc) }); |
|
|
|
} else { |
|
|
|
Toast.show(res.message); |
|
|
|
} |
|
|
@ -47,7 +47,7 @@ export default function MeasureRecord() { |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
if (measure) { |
|
|
|
const r = baseState.railTypes.find((rail) => rail.code === measure.trackShapeCode); |
|
|
|
const r = baseState.railTypes.find((rail) => rail.code === measure.railSize); |
|
|
|
if (!r) return; |
|
|
|
if (!!r.points) { |
|
|
|
drawRailBaseLine(r.points); |
|
|
@ -66,14 +66,14 @@ export default function MeasureRecord() { |
|
|
|
} |
|
|
|
}, [baseState.railTypes, dispatch, measure]); |
|
|
|
|
|
|
|
function railType(code: string) { |
|
|
|
const rail = baseState.railTypes.find((rail) => rail.code === code); |
|
|
|
return rail; |
|
|
|
} |
|
|
|
// function railType(code: string) {
|
|
|
|
// const rail = baseState.railTypes.find((rail) => rail.code === code);
|
|
|
|
// return rail;
|
|
|
|
// }
|
|
|
|
|
|
|
|
function direction(directCode: string) { |
|
|
|
return XB_CODES.find((dire) => dire.value === directCode); |
|
|
|
} |
|
|
|
// function direction(directCode: string) {
|
|
|
|
// return XB_CODES.find((dire) => dire.value === directCode);
|
|
|
|
// }
|
|
|
|
|
|
|
|
return ( |
|
|
|
<div> |
|
|
@ -111,20 +111,41 @@ export default function MeasureRecord() { |
|
|
|
<p className="text-[#818181]">测量名称</p> |
|
|
|
<span className="text-text">{measure.name}</span> |
|
|
|
|
|
|
|
<p className="text-[#818181]">批次</p> |
|
|
|
<span className="text-text">{measure.batch}</span> |
|
|
|
|
|
|
|
<p className="text-[#818181]">轨型</p> |
|
|
|
<span className="text-text">{measure.extraDescObj?.railSize}</span> |
|
|
|
|
|
|
|
<p className="text-[#818181]">数据来源</p> |
|
|
|
<span className="text-text">{measure.extraDescObj?.dataSource}</span> |
|
|
|
|
|
|
|
<p className="text-[#818181]">线路分类</p> |
|
|
|
<span className="text-text">{measure.extraDescObj?.lineClassify}</span> |
|
|
|
|
|
|
|
<p className="text-[#818181]">轨型</p> |
|
|
|
<span className="text-text">{railType(measure.trackShapeCode)?.name}</span> |
|
|
|
<span className="text-text">{measure.extraDescObj?.railSize}</span> |
|
|
|
|
|
|
|
{/* <p className="text-[#818181]">铁路局名称</p> |
|
|
|
<span className="text-text">北京铁路局</span> */} |
|
|
|
<p className="text-[#818181]">铁路局名称</p> |
|
|
|
<span className="text-text">{measure.extraDescObj?.tljCode}</span> |
|
|
|
|
|
|
|
<p className="text-[#818181]">路段名称</p> |
|
|
|
<span className="text-text">{measure.location}</span> |
|
|
|
<span className="text-text">{measure.extraDescObj?.gwdCode}</span> |
|
|
|
|
|
|
|
<p className="text-[#818181]">线路名称</p> |
|
|
|
<span className="text-text">{measure.lineName}</span> |
|
|
|
<span className="text-text">{measure.extraDescObj?.xmCode}</span> |
|
|
|
|
|
|
|
<p className="text-[#818181]">车站</p> |
|
|
|
<span className="text-text">{measure.extraDescObj?.stationCode}</span> |
|
|
|
|
|
|
|
<p className="text-[#818181]">方向</p> |
|
|
|
<span className="text-text">{direction(measure.direction)?.label}</span> |
|
|
|
<span className="text-text">{measure.extraDescObj?.xbCode}</span> |
|
|
|
|
|
|
|
<p className="text-[#818181]">股别</p> |
|
|
|
<span className="text-text">{measure.extraDescObj?.unitType}</span> |
|
|
|
|
|
|
|
<p className="text-[#818181]">里程</p> |
|
|
|
<span className="text-text">{`${measure.extraDescObj?.mile}公里+${measure.extraDescObj?.meter}米`}</span> |
|
|
|
</div> |
|
|
|
)} |
|
|
|
</section> |
|
|
|