Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZiBoYingJI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kimber
ZiBoYingJI
Commits
24bb4d62
Commit
24bb4d62
authored
Jul 24, 2024
by
xinzhedeai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
地图组件副本 修改公司
parent
c311c010
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
157 additions
and
1 deletion
+157
-1
AMapSearchPointAdd.vue
src/components/AMap/AMapSearchPointAdd.vue
+141
-0
index.vue
src/views/kd/c/enterprise/index.vue
+16
-1
No files found.
src/components/AMap/AMapSearchPointAdd.vue
0 → 100644
View file @
24bb4d62
<
template
>
<div
class=
"app-amap-search-point"
>
<el-autocomplete
v-show=
"isSearch"
v-model=
"mapInput"
style=
"width: 100%;"
:fetch-suggestions=
"querySearch"
placeholder=
"请输入地址搜素"
prefix-icon=
"el-icon-search"
@
select=
"handleSelect"
>
<template
slot-scope=
"
{ item }">
<div
style=
"text-overflow: ellipsis; overflow: hidden;"
>
{{
item
.
name
}}
</div>
<span
style=
"font-size: 12px; color: #b4b4b4;"
>
{{
item
.
district
}}
</span>
</
template
>
</el-autocomplete>
<div
id=
"amap_search_point_container_add"
:style=
"{padding: 0,margin: 0,width: '100%',height: mapHeight}"
/>
</div>
</template>
<
script
>
import
AMapLoader
from
'
@amap/amap-jsapi-loader
'
export
default
{
name
:
'
AMapSearchPoint
'
,
props
:
{
mapHeight
:
{
type
:
String
,
default
:
()
=>
{
return
'
400px
'
}
},
isSearch
:
{
type
:
Boolean
,
default
:
()
=>
{
return
true
}
},
point
:
{
type
:
Array
,
default
:
()
=>
{
return
null
}
}
},
data
()
{
return
{
mapInput
:
''
,
lnglat
:
null
,
mapMarker
:
null
}
},
computed
:
{},
watch
:
{
mapMarker
(
newValue
,
oldValue
)
{
if
(
oldValue
)
{
this
.
map
.
remove
(
oldValue
)
}
if
(
newValue
)
{
this
.
map
.
add
(
newValue
)
}
},
point
()
{
if
(
this
.
map
)
{
this
.
markPoint
(
this
.
point
)
this
.
point
&&
this
.
map
.
panTo
(
this
.
point
)
}
}
},
created
()
{
this
.
initMap
()
},
methods
:
{
// 输入选择
querySearch
(
queryString
,
callback
)
{
this
.
autoComplete
.
search
(
queryString
,
(
status
,
result
)
=>
{
// result.tips[0].{name,district,location{lng,lat}}
if
(
result
&&
result
.
tips
)
{
callback
(
result
.
tips
.
filter
(
tip
=>
tip
.
location
))
}
else
{
callback
(
null
)
}
})
},
// 点选搜索结果
handleSelect
(
amapTip
)
{
if
(
amapTip
.
location
.
lng
&&
amapTip
.
location
.
lat
)
{
this
.
$emit
(
'
choosePoint
'
,
[
amapTip
.
location
.
lng
,
amapTip
.
location
.
lat
])
}
else
{
this
.
$message
({
message
:
'
您所选的地点无法精确定位
'
,
type
:
'
warning
'
})
}
},
// 选中点
markPoint
(
lnglatArray
)
{
if
(
lnglatArray
&&
lnglatArray
.
length
===
2
)
{
this
.
mapMarker
=
new
this
.
AMap
.
Marker
({
position
:
new
this
.
AMap
.
LngLat
(
lnglatArray
[
0
],
lnglatArray
[
1
])
})
this
.
lnglat
=
lnglatArray
}
else
{
this
.
mapMarker
=
null
}
},
initMap
()
{
AMapLoader
.
load
({
key
:
'
a0efee399e638b35211705625d786e83
'
,
version
:
'
2.0
'
,
plugins
:
[]
}).
then
((
AMap
)
=>
{
this
.
AMap
=
AMap
// 加载地图
let
center
=
[
119.969873
,
36.753901
]
// 平度市
if
(
this
.
defaultPoint
&&
this
.
defaultPoint
.
length
===
2
)
{
center
=
this
.
defaultPoint
}
this
.
map
=
new
this
.
AMap
.
Map
(
'
amap_search_point_container_add
'
,
{
resizeEnable
:
true
,
center
:
center
,
zoom
:
12
})
if
(
this
.
defaultPoint
&&
this
.
defaultPoint
.
length
===
2
)
{
this
.
markPoint
(
center
)
}
// 点击选取
this
.
map
.
on
(
'
click
'
,
res
=>
{
if
(
this
.
isSearch
)
{
if
(
res
&&
res
.
lnglat
&&
res
.
lnglat
.
lng
&&
res
.
lnglat
.
lat
)
{
this
.
$emit
(
'
choosePoint
'
,
[
res
.
lnglat
.
lng
,
res
.
lnglat
.
lat
])
}
}
})
// 输入框选择位置
this
.
AMap
.
plugin
([
'
AMap.AutoComplete
'
],
()
=>
{
this
.
autoComplete
=
new
this
.
AMap
.
AutoComplete
({
city
:
'
全国
'
})
})
// 初始化位置
if
(
this
.
point
)
{
this
.
markPoint
(
this
.
point
)
this
.
point
&&
this
.
map
.
panTo
(
this
.
point
)
}
}).
catch
(
e
=>
{
console
.
error
(
e
)
})
}
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
</
style
>
src/views/kd/c/enterprise/index.vue
View file @
24bb4d62
...
@@ -536,7 +536,9 @@
...
@@ -536,7 +536,9 @@
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作"
width=
"200px"
align=
"center"
fixed=
"right"
>
<el-table-column
label=
"操作"
width=
"200px"
align=
"center"
fixed=
"right"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
v-show=
"scope.row.auditState!=1"
size=
"mini"
round
@
click=
"showEnterpriseInfo(scope.row.id)"
>
查看详情
</el-button>
<el-button
size=
"mini"
round
@
click=
"showEnterpriseInfo(scope.row.id)"
>
查看详情
</el-button>
<!--
<el-button
size=
"mini"
round
@
click=
"editEnterpriseInfo(scope.row)"
>
修改
</el-button>
-->
<!--
<el-button
v-show=
"scope.row.auditState==1"
size=
"mini"
round
@
click=
"auditBtn(scope.row, 2)"
>
通过
</el-button>
<!--
<el-button
v-show=
"scope.row.auditState==1"
size=
"mini"
round
@
click=
"auditBtn(scope.row, 2)"
>
通过
</el-button>
<el-button
v-show=
"scope.row.auditState==1"
size=
"mini"
round
@
click=
"auditBtn(scope.row, 3)"
>
不通过
</el-button>
-->
<el-button
v-show=
"scope.row.auditState==1"
size=
"mini"
round
@
click=
"auditBtn(scope.row, 3)"
>
不通过
</el-button>
-->
</
template
>
</
template
>
...
@@ -866,6 +868,19 @@ export default {
...
@@ -866,6 +868,19 @@ export default {
dialog2Submit
()
{
dialog2Submit
()
{
this
.
doAudit
(
this
.
dialog2Data
)
this
.
doAudit
(
this
.
dialog2Data
)
},
},
editEnterpriseInfo
(
row
){
this
.
addCompanyShow
=
true
this
.
mainDataEditing
=
row
if
(
this
.
mainDataEditing
.
workLicenseFilePath
)
{
this
.
mainDataEditing
.
_workLicenseFileList
=
JSON
.
parse
(
this
.
mainDataEditing
.
workLicenseFilePath
)
this
.
mainDataEditing
.
_workLicenseFileListShow
=
JSON
.
parse
(
this
.
mainDataEditing
.
workLicenseFilePath
)
// 数据存放与原始绑定分开,可以防止中途赋值产生的闪烁问题
}
if
(
this
.
mainDataEditing
.
safetyLicenseFilePath
)
{
this
.
mainDataEditing
.
_safetyLicenseFileList
=
JSON
.
parse
(
this
.
mainDataEditing
.
safetyLicenseFilePath
)
this
.
mainDataEditing
.
_safetyLicenseFileListShow
=
JSON
.
parse
(
this
.
mainDataEditing
.
safetyLicenseFilePath
)
// 数据存放与原始绑定分开,可以防止中途赋值产生的闪烁问题
}
this
.
mainDataEditing
.
_administrativeAreaCascade
=
row
.
deptId
},
showEnterpriseInfo
(
enterpriseId
)
{
showEnterpriseInfo
(
enterpriseId
)
{
enterpriseApi
.
getById
(
enterpriseId
).
then
(
response
=>
{
enterpriseApi
.
getById
(
enterpriseId
).
then
(
response
=>
{
this
.
dialog1Data
=
response
this
.
dialog1Data
=
response
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment