提交代码
This commit is contained in:
parent
0e4d4a83f0
commit
6997ad22f9
|
@ -5,9 +5,9 @@
|
|||
<el-col :span="12">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" class="searchInputForm">
|
||||
<el-form-item label="" prop="templateName">
|
||||
<el-select class="filterSelect" v-model="queryParams.keyword" filterable remote
|
||||
<el-select class="filterSelect" v-model="centerPointName" filterable remote
|
||||
reserve-keyword :remote-method="getLocaleListList" :loading="selectLoading"
|
||||
@change="currentSelect" placeholder="请输入关键字" remote-show-suffix clearable
|
||||
@change="currentSelect" placeholder="请输入内容以设置中心点" remote-show-suffix clearable
|
||||
style="width: 400px">
|
||||
<el-option v-for="item in localeList" :key="item.id" :label="item.name" :value="item"
|
||||
class="one-text">
|
||||
|
@ -57,6 +57,8 @@ const { proxy } = getCurrentInstance()
|
|||
|
||||
const { apiKey, secretKey } = window._CONFIG
|
||||
|
||||
// 中心点名称
|
||||
const centerPointName = ref(null)
|
||||
// map实例
|
||||
const mapInstance = ref(null)
|
||||
const massMarks = ref(null)
|
||||
|
@ -92,7 +94,7 @@ const points = ref([])
|
|||
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
keyword: undefined,
|
||||
keyword: undefined, // 媒体名称关键字
|
||||
x: undefined, //中心点经度
|
||||
y: undefined, //中心点纬度
|
||||
distance: undefined,
|
||||
|
@ -103,7 +105,7 @@ const { queryParams } = toRefs(data)
|
|||
/** 清除条件操作 */
|
||||
const resetQuery = () => {
|
||||
queryParams.value = {
|
||||
keyword: undefined,
|
||||
keyword: undefined, // 媒体名称关键字
|
||||
x: undefined, //中心点经度
|
||||
y: undefined, //中心点纬度
|
||||
distance: undefined,
|
||||
|
@ -152,7 +154,8 @@ const getLocaleListList = (searchValue) => {
|
|||
const currentSelect = (val) => {
|
||||
console.log('val', val)
|
||||
selectConfig.value = val
|
||||
queryParams.value.keyword = val.name
|
||||
centerPointName.value = val.name
|
||||
// queryParams.value.keyword = val.name
|
||||
queryParams.value.x = val.location.lng
|
||||
queryParams.value.y = val.location.lat
|
||||
queryParams.value.distance = circleRadius.value
|
||||
|
|
|
@ -296,6 +296,9 @@ const getOutMediaPageList = () => {
|
|||
outdoorMediaList.value = res.data.rows
|
||||
total.value = res.data.total
|
||||
loading.value = false
|
||||
|
||||
// 在地图完全加载后执行点数据处理
|
||||
renderMassMarks();
|
||||
})
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
|
@ -382,8 +385,8 @@ const loadMap = () => {
|
|||
// 添加缩放变化监听
|
||||
mapInstance.value.on('zoomchange', handleZoomChange);
|
||||
|
||||
// 在地图完全加载后执行点数据处理
|
||||
renderMassMarks();
|
||||
//// 在地图完全加载后执行点数据处理
|
||||
//renderMassMarks();
|
||||
|
||||
resolve();
|
||||
}).catch(e => {
|
||||
|
@ -556,10 +559,11 @@ const renderMassMarks = () => {
|
|||
];
|
||||
// 调用接口,获取数据点
|
||||
points.value = []
|
||||
// outdoorMediaList.value.forEach(itemPoint => {
|
||||
// if (itemPoint.businessType == 1) points.value.push({ "lnglat": [itemPoint.x, itemPoint.y], "name": itemPoint.mediaId, "style": 0 })
|
||||
// if (itemPoint.businessType == 2) points.value.push({ "lnglat": [itemPoint.x, itemPoint.y], "name": itemPoint.mediaId, "style": 1 })
|
||||
// });
|
||||
outdoorMediaList.value.forEach(itemPoint => {
|
||||
console.log('itemPoint', itemPoint)
|
||||
if (itemPoint.businessType == 1) points.value.push({ "lnglat": [itemPoint.mapX, itemPoint.mapY], "name": itemPoint.mediaName, "mediaId": itemPoint.id, "style": 0 })
|
||||
if (itemPoint.businessType == 2) points.value.push({ "lnglat": [itemPoint.mapX, itemPoint.mapY], "name": itemPoint.mediaName, "mediaId": itemPoint.id, "style": 1 })
|
||||
});
|
||||
console.log('points', points.value)
|
||||
// 创建MassMarks对象
|
||||
massMarks.value = new AMap.MassMarks(points.value, {
|
||||
|
|
Loading…
Reference in New Issue
Block a user