Skip to content
项目
群组
代码片段
帮助
正在加载...
登录/注册
切换导航
广
广东建设用地-前端
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
广东建设用地
广东建设用地-前端
Commits
8c1d2723
提交
8c1d2723
authored
1月 09, 2026
作者:
jinrongbin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
拐点生成错误弹窗显示拐点数据图层
上级
bf8d94cc
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
171 行增加
和
4 行删除
+171
-4
CdUpload.vue
src/components/customComponent/CdUpload.vue
+24
-4
mapgd.vue
src/components/customComponent/mapgd.vue
+147
-0
没有找到文件。
src/components/customComponent/CdUpload.vue
浏览文件 @
8c1d2723
...
@@ -54,6 +54,10 @@
...
@@ -54,6 +54,10 @@
</div>
</div>
</
template
>
</
template
>
</BasicForm>
</BasicForm>
<a-modal
v-model:visible=
"gdFlag"
:footer=
"null"
title=
"拐点生成图"
width=
"70%"
>
<Mapgd
:data=
"MapgdInfo"
v-if=
"gdFlag"
/>
</a-modal>
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
...
@@ -71,6 +75,7 @@
...
@@ -71,6 +75,7 @@
import
{
filterObj
}
from
'/@/utils/common/compUtils'
;
import
{
filterObj
}
from
'/@/utils/common/compUtils'
;
import
{
useMethods
}
from
'/@/hooks/system/useMethods'
;
import
{
useMethods
}
from
'/@/hooks/system/useMethods'
;
import
Mapbj
from
'@/components/customComponent/mapbj.vue'
;
import
Mapbj
from
'@/components/customComponent/mapbj.vue'
;
import
Mapgd
from
'@/components/customComponent/mapgd.vue'
;
const
{
handleExportXls
}
=
useMethods
();
const
{
handleExportXls
}
=
useMethods
();
const
{
createMessage
}
=
useMessage
();
const
{
createMessage
}
=
useMessage
();
const
fileListbjgd
=
ref
<
any
>
([]);
const
fileListbjgd
=
ref
<
any
>
([]);
...
@@ -78,8 +83,10 @@
...
@@ -78,8 +83,10 @@
const
headers
=
reactive
({
const
headers
=
reactive
({
'X-Access-Token'
:
getToken
(),
'X-Access-Token'
:
getToken
(),
});
});
const
gdFlag
=
ref
(
false
);
const
mapShow
=
ref
(
false
);
const
mapShow
=
ref
(
false
);
const
MapbjInfo
=
ref
({});
const
MapbjInfo
=
ref
<
any
>
({});
const
MapgdInfo
=
ref
<
any
>
([]);
// Emits声明
// Emits声明
const
emit
=
defineEmits
([
'upsuccess'
]);
const
emit
=
defineEmits
([
'upsuccess'
]);
...
@@ -105,7 +112,16 @@
...
@@ -105,7 +112,16 @@
});
});
}
else
{
}
else
{
fileList
.
value
=
[];
fileList
.
value
=
[];
createMessage
.
error
(
`
${
info
.
file
.
response
.
message
||
info
.
file
.
response
.
result
.
message
}
`
);
if
(
info
.
file
.
response
.
message
&&
info
.
file
.
response
.
message
.
indexOf
(
'拐点生成gis数据错误'
)
>-
1
)
{
let
res
=
transformation
(
'CGCS2000_3_Degree_GK_Zone_38'
,
[
info
.
file
.
response
.
result
]);
let
zxdw
=
{
"type"
:
"Point"
,
"coordinates"
:[
Number
(
props
.
dkxx
.
wrdkzxjd
),
Number
(
props
.
dkxx
.
wrdkzxwd
)]}
gdFlag
.
value
=
true
;
createMessage
.
error
(
`
${
info
.
file
.
response
.
message
||
info
.
file
.
response
.
result
.
message
}
`
);
MapgdInfo
.
value
.
push
(
zxdw
)
MapgdInfo
.
value
.
push
(
JSON
.
parse
(
JSON
.
parse
(
res
)[
0
]))
}
else
{
createMessage
.
error
(
`
${
info
.
file
.
response
.
message
||
info
.
file
.
response
.
result
.
message
}
`
);
}
}
}
}
else
if
(
info
.
file
.
status
===
'error'
)
{
}
else
if
(
info
.
file
.
status
===
'error'
)
{
fileList
.
value
=
[];
fileList
.
value
=
[];
...
@@ -129,10 +145,14 @@
...
@@ -129,10 +145,14 @@
});
});
});
});
}
else
{
}
else
{
console
.
log
(
info
.
file
.
response
)
fileListbjgd
.
value
=
[];
fileListbjgd
.
value
=
[];
if
(
info
.
file
.
response
.
message
&&
info
.
file
.
response
.
message
.
indexOf
(
'拐点生成gis数据错误'
)
>-
1
)
{
if
(
info
.
file
.
response
.
message
&&
info
.
file
.
response
.
message
.
indexOf
(
'拐点生成gis数据错误'
)
>-
1
)
{
let
res
=
transformation
(
'CGCS2000_3_Degree_GK_Zone_38'
,
[
info
.
file
.
response
.
result
]);
let
zxdw
=
{
"type"
:
"Point"
,
"coordinates"
:[
Number
(
props
.
dkxx
.
wrdkzxjd
),
Number
(
props
.
dkxx
.
wrdkzxwd
)]}
gdFlag
.
value
=
true
;
createMessage
.
error
(
`
${
info
.
file
.
response
.
message
||
info
.
file
.
response
.
result
.
message
}
`
);
MapgdInfo
.
value
.
push
(
zxdw
)
MapgdInfo
.
value
.
push
(
JSON
.
parse
(
JSON
.
parse
(
res
)[
0
]))
}
else
{
}
else
{
createMessage
.
error
(
`
${
info
.
file
.
response
.
message
||
info
.
file
.
response
.
result
.
message
}
`
);
createMessage
.
error
(
`
${
info
.
file
.
response
.
message
||
info
.
file
.
response
.
result
.
message
}
`
);
}
}
...
...
src/components/customComponent/mapgd.vue
0 → 100644
浏览文件 @
8c1d2723
<
template
>
<div
class=
"map h-240 w-full"
>
<div
id=
"gdMap"
class=
"w-full h-full"
></div>
</div>
</
template
>
<
script
setup
>
import
{
ref
,
onMounted
,
nextTick
,
watch
}
from
'vue'
;
import
'leaflet/dist/leaflet.css'
;
import
*
as
L
from
'leaflet'
;
// import 'leaflet.fullscreen/Control.FullScreen';
// import 'leaflet.fullscreen/Control.FullScreen.css';
import
'leaflet-measure-path/leaflet-measure-path.css'
;
import
'leaflet-measure-path/leaflet-measure-path.js'
;
import
'leaflet.markercluster/dist/MarkerCluster.css'
;
import
'leaflet.markercluster/dist/MarkerCluster.Default.css'
;
import
'leaflet.markercluster'
;
import
{
useRouter
}
from
'vue-router'
;
import
{
getScjdShp
}
from
'/@/api/common/api'
;
// 引入jsts
import
WKTReader
from
'jsts/org/locationtech/jts/io/WKTReader'
;
import
RelateOp
from
'jsts/org/locationtech/jts/operation/relate/RelateOp'
;
import
BufferOp
from
'jsts/org/locationtech/jts/operation/buffer/BufferOp'
;
import
WKTWriter
from
'jsts/org/locationtech/jts/io/WKTWriter'
;
import
positionIcon
from
'@/assets/images/position.png'
import
proj4
from
'proj4'
;
let
router
=
useRouter
();
// 注册路由
const
params
=
ref
(
router
.
currentRoute
.
value
.
query
);
const
props
=
defineProps
({
data
:
{
type
:
Object
,
default
:
{},
},
});
onMounted
(
async
()
=>
{
await
nextTick
();
initMap
();
});
const
mapgd
=
ref
(
''
);
const
content
=
ref
(
null
);
const
show
=
ref
(
false
);
const
geojsonLayer
=
ref
([]);
const
layerGroups
=
ref
();
const
markerClusterLayer
=
ref
();
const
open
=
ref
(
true
);
async
function
initMap
()
{
// 23.125178, 113.280637
await
nextTick
();
if
(
mapgd
.
value
)
{
return
}
mapgd
.
value
=
L
.
map
(
'gdMap'
,
{
center
:
[
23.125178
,
113.280637
],
zoom
:
12
,
zoomControl
:
true
,
attributionControl
:
false
,
crs
:
L
.
CRS
.
EPSG4326
,
// 默认3857
fullscreenControl
:
true
,
maxZoom
:
17
,
});
console
.
log
(
mapgd
.
value
,
'mapgd.value '
);
//定义一个比例尺控件
let
scale
=
L
.
control
.
scale
();
scale
.
addTo
(
mapgd
.
value
);
// 这个 比例尺的
scale
.
getContainer
().
childNodes
[
0
].
style
.
cssText
=
'margin-bottom:-4px;color:#FFF;text-shadow:none;border:2px solid #FFF;background:none;border-top:0px;'
;
scale
.
getContainer
().
childNodes
[
1
].
hidden
=
true
;
// // 经纬度投影
const
IMG_C
=
'https://t1.tianditu.gov.cn/img_c/wmts?layer=img&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}&tk=3cf92df1e46b9a576fa8d3f427030886'
;
const
CIA_C
=
'https://t1.tianditu.gov.cn/cia_c/wmts?layer=cia&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}&tk=3cf92df1e46b9a576fa8d3f427030886'
;
// 天地图注记
const
zj
=
'https://t1.tianditu.gov.cn/cia_c/wmts?layer=cia&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}&tk=3cf92df1e46b9a576fa8d3f427030886'
;
var
myLayer1
=
L
.
tileLayer
(
IMG_C
,
{
zoomOffset
:
1
,
// 经纬度投影打开
maxZoom
:
17
,
tileSize
:
256
,
}).
addTo
(
mapgd
.
value
);
var
myLayer2
=
L
.
tileLayer
(
CIA_C
,
{
zoomOffset
:
1
,
// 经纬度投影打开
maxZoom
:
17
,
tileSize
:
256
,
}).
addTo
(
mapgd
.
value
);
}
async
function
position
(
data
)
{
console
.
log
(
data
,
'拐点数据'
)
if
(
geojsonLayer
.
value
)
{
geojsonLayer
.
value
.
forEach
((
item
)
=>
{
mapgd
.
value
.
removeLayer
(
item
);
});
}
let
geojsonLayers
=
[];
data
?.
forEach
((
jsons
)
=>
{
let
geojsons
=
L
.
geoJSON
(
jsons
,
{
// style: { color: '#00C9D8', weight: 5, fillOpacity: 0 },
pointToLayer
:
function
(
geoJsonPoint
,
latlng
)
{
return
L
.
marker
(
latlng
,
{
icon
:
new
L
.
Icon
({
iconUrl
:
positionIcon
,
iconSize
:
[
40
,
40
],
}),
});
},
}).
addTo
(
mapgd
.
value
);
geojsonLayers
.
push
(
geojsons
);
});
// 重新设置视图中心点
if
(
data
.
length
>
0
)
{
const
jwd
=
data
[
0
].
coordinates
;
mapgd
.
value
.
flyTo
([
jwd
[
1
],
jwd
[
0
]],
17
);
}
}
function
clearMarker
()
{
if
(
layerGroups
.
value
)
{
layerGroups
.
value
.
clearLayers
();
}
}
watch
(
()
=>
props
.
data
,
async
(
val
)
=>
{
await
nextTick
();
setTimeout
(()
=>
{
position
(
val
);
},
500
)
},
{
deep
:
true
,
immediate
:
true
}
);
</
script
>
<
style
lang=
"less"
scoped
></
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论