From 47fd65e2b91d16b2c25d04c018ac8f10d10423ab Mon Sep 17 00:00:00 2001 From: doublekou <951513186@qq.com> Date: Thu, 12 Oct 2023 11:02:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../geopoliticalCustomersModal copy.vue | 2289 ----------------- .../geopoliticalCustomersModal.vue | 188 +- 2 files changed, 3 insertions(+), 2474 deletions(-) delete mode 100644 src/views/geopoliticalCustomers/geopoliticalCustomersModal copy.vue diff --git a/src/views/geopoliticalCustomers/geopoliticalCustomersModal copy.vue b/src/views/geopoliticalCustomers/geopoliticalCustomersModal copy.vue deleted file mode 100644 index 6bfe120..0000000 --- a/src/views/geopoliticalCustomers/geopoliticalCustomersModal copy.vue +++ /dev/null @@ -1,2289 +0,0 @@ - - - - diff --git a/src/views/geopoliticalCustomers/geopoliticalCustomersModal.vue b/src/views/geopoliticalCustomers/geopoliticalCustomersModal.vue index 2bd4474..1d02f3c 100644 --- a/src/views/geopoliticalCustomers/geopoliticalCustomersModal.vue +++ b/src/views/geopoliticalCustomers/geopoliticalCustomersModal.vue @@ -1103,8 +1103,6 @@ const idThen = (detailAddress: string) => { } //匹配 const match = async (detailAddress: string) => { - // console.log(listData.length,'listData.length') - console.log(title.value, 'title.value') if (activeKey.value === '1') { if (title.value === '新建预约' && formModel.customStoreEntities.length !== 0) { matchregisterVisible.value = true @@ -1309,31 +1307,12 @@ const temporaryStorage = async () => { formRef.value ?.validateFields(fields) .then(() => { - // if (formModel.customStoreEntities.length === 0) { - // message.info('请先添加预约门店') - // } else { formModel.enrollStatus = 0 submitOperate() - // handleSubmit() - // } }) .catch(err => { console.log('校验失败err', err) }) - // formRef.value - // ?.validate() - // .then(() => { - // if (formModel.customStoreEntities.length === 0) { - // message.info('请先添加预约门店') - // } else { - // formModel.enrollStatus = 0 - // submitOperate() - // // handleSubmit() - // } - // }) - // .catch(err => { - // console.log('校验失败err', err) - // }) } //分发 @@ -1444,6 +1423,7 @@ interface openObj { type?: string record?: GeopoliticalCustomersRecord } +//创建地图 const handleMapInit = async () => { await nextTick(async () => { await initMap() @@ -1452,21 +1432,19 @@ const handleMapInit = async () => { defineExpose({ open(opendata: openObj) { - console.log(activeKey.value, 'activeKey.value') isSubmit.value = false openModal() - console.log('formModel.customType resssssssss', formModel.customType) + // console.log('formModel.customType resssssssss', formModel.customType) //不写resetFields.value()预约门店信息会反复追加进去,但是加了resetFields.value()会导致formModel.customType为0 // resetFields.value() // formModel.customType = undefined formModel.customStoreEntities = [] - console.log('formModel.customType ddddddddddd', formModel.customType) + // console.log('formModel.customType ddddddddddd', formModel.customType) // if (userInfoCurrent.value === 'ROLE_REVIEWER') { // formModel.customType = 1 // } else if (userInfoCurrent.value === 'ROLE_PRELIMINARY_EXAMINER') { // formModel.customType = 0 // } - const handleSuccess = (res: any) => { const data = res.data || {} const { @@ -1499,7 +1477,6 @@ defineExpose({ formModel.distinguish = distinguish formModel.detailAddress = detailAddress formModel.customType = customType - console.log(formModel.customType, '111') formModel.otherAddressesInfo = otherAddressesInfo formModel.radius = radius @@ -1517,12 +1494,9 @@ defineExpose({ } if (opendata.type === 'audit') { getActiveKey() - // handleMapInit() title.value = '编辑' - // activeKey.value=formModel.customType if (formModel.address.length !== 0) { isAddressDisabled.value = true - // isRadiusReadOnly.value = true } if (formModel.radius) { isRadiusDisabled.value = true @@ -1559,8 +1533,6 @@ defineExpose({ activeKey.value = '2' } title.value = '详情' - console.log(formModel.customType, 'formModel.customTypeA') - isAddressReadOnly.value = true isRadiusReadOnly.value = true isDetailAddressReadOnly.value = true @@ -1572,8 +1544,6 @@ defineExpose({ isRadiusReadOnly.value = true isDetailAddressReadOnly.value = true isReservationTimeisReadOnly.value = true - // handleMapInit() - formModel.description = 1 } } @@ -1603,8 +1573,6 @@ const filter: ShowSearchType['filter'] = (inputValue, path) => { return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1) } -//输入提示插件AMap.Autocomplete -const autoComplete = ref() //POI搜索插件AMap.PlaceSearch // const placeSearch = ref() //点标记AMap.Marker @@ -1632,157 +1600,7 @@ const createSearchService = () => { }) } -// const getLocation = (selectedTip: any) => { -// newAmapGeocoder() -// getCenterMarkerAddress('select') -// } const isName = ref(false) -// const selectedTipCurrent = ref() -// // 当用户选择输入提示结果后进行查询操作 -// const performQuery = (selectedTip: any, detailAddress: string) => { -// selectedTipCurrent.value = selectedTip -// //标记中心点 -// // 创建地点搜索服务实例 -// const searchService = new AMap.PlaceSearch({ -// // 在这里填写您的高德地图 API Key -// key: '1d3839a0fe4ad113f7d88ec3775107b7', -// // 指定地点搜索服务的版本号 -// version: '2.0' -// }) -// const addressValue = formModel.address?.toString().split(',').join('') + selectedTip.name -// // 执行地点搜索 -// searchService.search(addressValue, (status: any, result: any) => { -// if (status === 'complete' && result.info === 'OK') { -// // 处理搜索结果 -// const pois = result.poiList.pois -// console.log(pois, 'pois') -// console.log(formModel.detailAddress, 'formModel.detailAddress') -// // 对获取到的兴趣点列表进行处理 -// // console.log(pois, 'pois') -// // console.log(pois[0].location.lng, pois[0].location.lat, 'pois经纬度') -// if (pois[0].name === formModel.detailAddress) { -// isName.value = false -// getCenterMarker('select', pois[0].location.lng, pois[0].location.lat) -// formModel.otherAddressesInfo = `${pois[0].location.lng},${pois[0].location.lat}` -// } else { -// isName.value = true -// console.log(selectedTipCurrent.value, 'selectedTipCurrent.value') -// // getLocation(selectedTipCurrent.value) -// } -// } else { -// // 地点搜索失败的处理逻辑 -// console.log('地点搜索失败') -// } -// }) -// // if (isName.value) { -// // console.log(isName.value, 'isName.value') - -// // } -// // const geocoder = new AMap.Geocoder() -// // const location = selectedTip.location -// // if (location) { -// // // 使用地理编码查询 -// // geocoder.getAddress(location, function (status: any, result: any) { -// // if (status === 'complete' && result.info === 'OK') { -// // // 处理查询结果 -// // const address = result.regeocode.formattedAddress -// // console.log('查询结果:', address) -// // console.log(detailAddress, 'detailAddress') - -// // // 进行其他操作... -// // match() - -// // // detailAddress = detailAddress.substring(0, 14) -// // // if (detailAddress === '浙江省杭州市上城区九和路8号华侨国际·新侨创智中心') { -// // // detailAddress = detailAddress.substring(0, detailAddress.indexOf('号') + 1) -// // // console.log(detailAddress, 'detailAddress1111') -// // // //标记中心点 -// // // getCenterMarker('select', detailAddress) -// // // formModel.otherAddressesInfo = detailAddress -// // // } else { -// // // //标记中心点 -// // // getCenterMarker('select', detailAddress) -// // // formModel.otherAddressesInfo = detailAddress -// // // } -// // } -// // }) -// // } else { -// // message.info('地址错误,请重新进行选择') -// // } -// } - -// const detailAddress = ref('') -// const detailAddressRef = ref() -// const auto = async (value: string) => { -// await AMap.plugin('AMap.AutoComplete', function () { -// //AutoComplete实例已存在,赋值失败;想变成动态的,就得动态赋值;死就没有发生变化,不需要重新赋值 -// // if (autoComplete.value) { -// // autoComplete.value.setCity(value) -// // } else { -// // 实例化Autocomplete -// const autoOptions = { -// // city: value, // 限定城市,默认全国 -// // city: '330000', // 限定城市,默认全国 -// input: 'tipinput' -// // keywords: formModel.address?.toString().split(',').join('') + formModel.detailAddress, -// // citylimit: true, // 设置要限制的省市区 -// // noLocation: true // 禁用定位功能 -// } - -// // 创建新的 AMap.AutoComplete 实例 -// autoComplete.value = new AMap.AutoComplete(autoOptions) -// // } -// setTimeout(() => { -// autoComplete.value?.on('select', (e: any) => { -// // detailAddressRef.value.stateValue.getValue() -// // detailAddressRef.value.stateValue = 123 -// console.log( -// detailAddressRef.value.stateValue, -// 'detailAddressRef.value.stateValue.getValue()' -// ) -// console.log(detailAddressRef.value, 'detailAddressRef.value.value') -// console.log(e.poi, 'e.poi') -// const selectedTip = e.poi // 获取用户选择的提示结果对象 -// console.log( -// formModel.economize, -// formModel.market, -// formModel.distinguish, -// 'formModel.economize && formModel.market && formModel.distinguish' -// ) -// if (formModel.distinguish) { -// if (formModel.economize && formModel.market) { -// const result = selectedTip.name.replace( -// formModel.economize + formModel.market + formModel.distinguish, -// '' -// ) -// const address = formModel.economize + formModel.market + formModel.distinguish + result // 将选中的提示项名称赋值给输入框的值(使用 v-model 来绑定) -// // formModel.detailAddress = address -// const tipInput = document.querySelector('#tipinput') as HTMLElement - -// tipInput.innerHTML = address -// // setTimeout(() => { -// // detailAddressRef.value.stateValue = address -// // }) -// console.log(result, 'result') -// console.log(formModel.detailAddress, 'formModel.detailAddress') -// } -// } else { -// if (formModel.economize && formModel.market) { -// const result = selectedTip.name.replace(formModel.economize + formModel.market, '') -// const address = formModel.economize + formModel.market + result // 将选中的提示项名称赋值给输入框的值(使用 v-model 来绑定) -// formModel.detailAddress = address -// detailAddressRef.value.stateValue = address - -// console.log(formModel.detailAddress, 'formModel.detailAddress') -// } -// } - -// detailAddress.value = selectedTip.district + selectedTip.address -// performQuery(selectedTip, detailAddress.value) // 执行查询操作 -// }) -// }, 300) -// }) -// } //创建地图 const initMap = async () => {