提交代码

This commit is contained in:
wangchengming 2025-09-13 22:24:35 +08:00
parent 0e4d4a83f0
commit 6997ad22f9
2 changed files with 18 additions and 11 deletions

View File

@ -5,9 +5,9 @@
<el-col :span="12"> <el-col :span="12">
<el-form :model="queryParams" ref="queryRef" :inline="true" class="searchInputForm"> <el-form :model="queryParams" ref="queryRef" :inline="true" class="searchInputForm">
<el-form-item label="" prop="templateName"> <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" reserve-keyword :remote-method="getLocaleListList" :loading="selectLoading"
@change="currentSelect" placeholder="请输入关键字" remote-show-suffix clearable @change="currentSelect" placeholder="请输入内容以设置中心点" remote-show-suffix clearable
style="width: 400px"> style="width: 400px">
<el-option v-for="item in localeList" :key="item.id" :label="item.name" :value="item" <el-option v-for="item in localeList" :key="item.id" :label="item.name" :value="item"
class="one-text"> class="one-text">
@ -57,6 +57,8 @@ const { proxy } = getCurrentInstance()
const { apiKey, secretKey } = window._CONFIG const { apiKey, secretKey } = window._CONFIG
//
const centerPointName = ref(null)
// map // map
const mapInstance = ref(null) const mapInstance = ref(null)
const massMarks = ref(null) const massMarks = ref(null)
@ -92,7 +94,7 @@ const points = ref([])
const data = reactive({ const data = reactive({
queryParams: { queryParams: {
keyword: undefined, keyword: undefined, //
x: undefined, // x: undefined, //
y: undefined, // y: undefined, //
distance: undefined, distance: undefined,
@ -103,7 +105,7 @@ const { queryParams } = toRefs(data)
/** 清除条件操作 */ /** 清除条件操作 */
const resetQuery = () => { const resetQuery = () => {
queryParams.value = { queryParams.value = {
keyword: undefined, keyword: undefined, //
x: undefined, // x: undefined, //
y: undefined, // y: undefined, //
distance: undefined, distance: undefined,
@ -152,7 +154,8 @@ const getLocaleListList = (searchValue) => {
const currentSelect = (val) => { const currentSelect = (val) => {
console.log('val', val) console.log('val', val)
selectConfig.value = 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.x = val.location.lng
queryParams.value.y = val.location.lat queryParams.value.y = val.location.lat
queryParams.value.distance = circleRadius.value queryParams.value.distance = circleRadius.value

View File

@ -296,6 +296,9 @@ const getOutMediaPageList = () => {
outdoorMediaList.value = res.data.rows outdoorMediaList.value = res.data.rows
total.value = res.data.total total.value = res.data.total
loading.value = false loading.value = false
//
renderMassMarks();
}) })
} }
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -382,8 +385,8 @@ const loadMap = () => {
// //
mapInstance.value.on('zoomchange', handleZoomChange); mapInstance.value.on('zoomchange', handleZoomChange);
// ////
renderMassMarks(); //renderMassMarks();
resolve(); resolve();
}).catch(e => { }).catch(e => {
@ -556,10 +559,11 @@ const renderMassMarks = () => {
]; ];
// //
points.value = [] points.value = []
// outdoorMediaList.value.forEach(itemPoint => { outdoorMediaList.value.forEach(itemPoint => {
// if (itemPoint.businessType == 1) points.value.push({ "lnglat": [itemPoint.x, itemPoint.y], "name": itemPoint.mediaId, "style": 0 }) console.log('itemPoint', itemPoint)
// if (itemPoint.businessType == 2) points.value.push({ "lnglat": [itemPoint.x, itemPoint.y], "name": itemPoint.mediaId, "style": 1 }) 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) console.log('points', points.value)
// MassMarks // MassMarks
massMarks.value = new AMap.MassMarks(points.value, { massMarks.value = new AMap.MassMarks(points.value, {