修改name

master
秦子超 2025-11-25 13:41:59 +08:00
parent cc87b22279
commit ef70d45415
5 changed files with 623 additions and 523 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -374,7 +374,7 @@
"transform": null,
"fontFamily": "Noto Sans JP",
"x": "2450",
"name": "张管渠",
"name": "张管渠",
"y": "3050",
"style": "vector-effect: non-scaling-stroke",
"fontSize": "50",
@ -500,7 +500,7 @@
"transform": null,
"fontFamily": "Noto Sans JP",
"x": "3000",
"name": "新林渠道",
"name": "新林渠道",
"y": "2515",
"style": "vector-effect: non-scaling-stroke",
"fontSize": "50",
@ -626,7 +626,7 @@
"transform": null,
"fontFamily": "Noto Sans JP",
"x": "4245",
"name": "花灌渠",
"name": "灌渠",
"y": "1900",
"style": "vector-effect: non-scaling-stroke",
"fontSize": "50",
@ -815,7 +815,7 @@
"transform": null,
"fontFamily": "Noto Sans JP",
"x": "2890",
"name": "清江渠",
"name": "大寨渠",
"y": "4000",
"style": "vector-effect: non-scaling-stroke",
"fontSize": "45",
@ -941,7 +941,7 @@
"transform": null,
"fontFamily": "Noto Sans JP",
"x": "5450",
"name": "萌树渠",
"name": "萌树渠",
"y": "2000",
"style": "vector-effect: non-scaling-stroke",
"fontSize": "45",
@ -970,6 +970,27 @@
"isDel": "0",
"fontWeight": "bold",
"isVertical": true
},
{
"strokeWidth": "2",
"idElement": "svg_47",
"levelShow": "1",
"officeCode": "",
"xmlSpace": "preserve",
"textAnchor": "start",
"fill": "#ffffff",
"stroke": "#ffffff",
"transform": null,
"fontFamily": "Noto Sans JP",
"x": "2630",
"name": "长江",
"y": "650",
"style": "vector-effect: non-scaling-stroke",
"fontSize": "69",
"id": "20251118100747",
"isDel": "0",
"fontWeight": "bold",
"isVertical": false
}
],
"total": 209,

View File

@ -0,0 +1,40 @@
const SvgImageLayer = ({ data, level, href, onClick, style, onContextMenu }) => {
if (!data) {
return null;
}
return (
<g>
{
data.map((o) => (
level >= o.levelShow ? (
<image
key={o.id}
onClick={(e) => {
e.stopPropagation();
onClick && onClick(o);
}}
onContextMenu={(e) => {
if (onContextMenu) {
e.preventDefault();
onContextMenu(o);
}
}}
x={o.x}
y={o.y}
width={o.width}
height={o.height}
transform={o.transform}
href={o.href ? o.href : (href ? href(o) : undefined)}
stroke={o.stroke}
style={style}
/>
) : null
))
}
</g>
)
}
export default SvgImageLayer;

View File

@ -3,6 +3,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import useRequest from '../../../utils/useRequest';
import SvgLineLayer from './SvgLineLayer';
import SvgTextLayer from './SvgTextLayer';
import SvgImageLayer from './SvgImageLayer';
import StLayer from './StLayer';
import './index.less';
@ -70,7 +71,7 @@ const SvgMap = ({ctx}) => {
const lineReq = useRequest(() => fetchDemoData('overviewLineEntity', ctx.officeCode));
const textReq = useRequest(() => fetchDemoData('overviewTextEntity', ctx.officeCode));
const stReq = useRequest(() => fetchDemoData('overviewStEntity', ctx.officeCode));
const reservoirReq = useRequest(() => fetchDemoData('overviewReservoirEntity', ctx.officeCode));
//不知道是干什么的函数1
@ -156,7 +157,7 @@ const SvgMap = ({ctx}) => {
// panToEntent(extent);
// }
panToEntent([500, 500, 7000, 4500])
panToEntent([1500, 200, 7000, 4500])
}, [ctx.selArea]);
@ -165,6 +166,7 @@ const SvgMap = ({ctx}) => {
<div ref={containerRef} style={{ height: '100%' }}>
<svg ref={svgRef} width={IMG_W} height={IMG_H}>
<SvgLineLayer data={lineReq.data} level={level} onClick={(o) => { if (o.chanName) { ctx.setPopChan() } }} />
<SvgImageLayer data={reservoirReq.data} level={level} />
<SvgTextLayer data={textReq.data} level={level} />
<StLayer
style={{ cursor: 'pointer' }}