diff --git a/src/views/geopoliticalCustomers/geopoliticalCustomers.vue b/src/views/geopoliticalCustomers/geopoliticalCustomers.vue index 6a2139f..9f27f89 100644 --- a/src/views/geopoliticalCustomers/geopoliticalCustomers.vue +++ b/src/views/geopoliticalCustomers/geopoliticalCustomers.vue @@ -123,7 +123,16 @@ const columns: ProColumns[] = [ }, { title: '联系方式', - dataIndex: 'customNid' + // dataIndex: 'customNid', + customRender: function ({ record }: any) { + if (record.enrollStatus === 2) { + const phoneNumber = record.customNid.toString() + const hiddenPhoneNumber = phoneNumber.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2') + return h('div', hiddenPhoneNumber) + } else { + return h('div', record.customNid) + } + } }, { title: '报名状态', diff --git a/src/views/geopoliticalCustomers/geopoliticalCustomersModal copy.vue b/src/views/geopoliticalCustomers/geopoliticalCustomersModal copy.vue deleted file mode 100644 index f96667f..0000000 --- a/src/views/geopoliticalCustomers/geopoliticalCustomersModal copy.vue +++ /dev/null @@ -1,1279 +0,0 @@ - - - - diff --git a/src/views/geopoliticalCustomers/geopoliticalCustomersModal.vue b/src/views/geopoliticalCustomers/geopoliticalCustomersModal.vue index f2afb7e..f8567d0 100644 --- a/src/views/geopoliticalCustomers/geopoliticalCustomersModal.vue +++ b/src/views/geopoliticalCustomers/geopoliticalCustomersModal.vue @@ -75,7 +75,13 @@ : { sm: { span: 24 }, md: { span: 19 } } " > - --> + { map.value.clearMap() AMap.plugin('AMap.Geocoder', function () { geocoder.value = new AMap.Geocoder({ - city: '杭州' // city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode + city: '全国' // city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode }) }) //标记中心点 @@ -993,6 +1000,8 @@ const filter: ShowSearchType['filter'] = (inputValue, path) => { //输入提示插件AMap.Autocomplete const autoComplete = ref() //POI搜索插件AMap.PlaceSearch +const placeSearch = ref() +//POI搜索插件AMap.PlaceSearch // const placeSearch = ref() //点标记AMap.Marker //创建的一个 Marker 实例 @@ -1041,6 +1050,21 @@ const getCenterMarker = (type: string) => { } }) } +// 当用户选择输入提示结果后进行查询操作 +const performQuery = (selectedTip: any) => { + const geocoder = new AMap.Geocoder() + const location = selectedTip.location + + // 使用地理编码查询 + geocoder.getAddress(location, function (status: any, result: any) { + if (status === 'complete' && result.info === 'OK') { + // 处理查询结果 + const address = result.regeocode.formattedAddress + console.log('查询结果:', address) + // 进行其他操作... + } + }) +} //创建地图 const initMap = () => { @@ -1080,9 +1104,23 @@ const initMap = () => { // city: '010' //城市设为北京,默认:“全国” // }) }) + // AMap.plugin('AMap.PlaceSearch', function () { + // // PlaceSearch + // const placeOptions = { + // map: map.value + // } + // placeSearch.value = new AMap.PlaceSearch(placeOptions) + // }) + setTimeout(() => { + autoComplete.value?.on('select', (e: any) => { + const selectedTip = e.poi // 获取用户选择的提示结果对象 + formModel.detailAddress = selectedTip.name // 将选中的提示项名称赋值给输入框的值(使用 v-model 来绑定) + performQuery(selectedTip) // 执行查询操作 + }) + }, 300) AMap.plugin('AMap.Geocoder', function () { geocoder.value = new AMap.Geocoder({ - city: '杭州' // city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode + city: '全国' // city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode }) }) //标记中心点 diff --git a/src/views/geopoliticalCustomers/geopoliticalCustomersSearch.vue b/src/views/geopoliticalCustomers/geopoliticalCustomersSearch.vue index 41c13ba..04292d8 100644 --- a/src/views/geopoliticalCustomers/geopoliticalCustomersSearch.vue +++ b/src/views/geopoliticalCustomers/geopoliticalCustomersSearch.vue @@ -18,11 +18,11 @@ /> - +