新增了标记中心点

master
doublekou 1 year ago
parent e16ceac219
commit 11df93224e

@ -7,6 +7,7 @@
<a-button type="primary" :loading="props.loading" @click="emits('search')"></a-button>
<a-button @click="emits('reset')"></a-button>
</a-space>
<!-- <a v-if="props.collapsible" @click="() => toggleCollapsed()"> -->
<a v-if="props.collapsible" @click="() => toggleCollapsed()">
{{ innerCollapsed ? '展开' : '收起' }}
<DownOutlined v-if="innerCollapsed" />

@ -23,7 +23,7 @@
</template>
<template #menuFooterRender="props">
<a
<!-- <a
:style="{
display: 'flex',
height: '16px',
@ -34,7 +34,7 @@
target="_blank"
rel="noreferrer"
>
<!-- <img
<img
alt="pro-logo"
src="https://procomponents.ant.design/favicon.ico"
:style="{
@ -43,9 +43,9 @@
margin: '0 16px',
marginRight: 10
}"
/> -->
<!-- <template v-if="!props?.collapsed"> Preview Pro</template> -->
</a>
/>
<template v-if="!props?.collapsed"> Preview Pro</template>
</a> -->
</template>
<!-- <template #headerContentRender>-->

@ -26,7 +26,7 @@
<template v-if="column.key === 'operate'">
<operation-group>
<!-- <a v-if="record.enrollStatus !== 2" @click="handleAudit(record)"></a> -->
<a v-if="record.enrollStatus !== 2" @click="handleAudit(record)"></a>
<a v-if="record.enrollStatus !== 2" @click="handleEdit(record)"></a>
<a v-if="record.enrollStatus !== 2" @click="handleDistribute(record)"></a>
<span v-else>-</span>
</operation-group>
@ -90,7 +90,7 @@ const searchTable = (params: GeopoliticalCustomersPageParam) => {
}
//
const handleAudit = (record: GeopoliticalCustomersRecord) => {
const handleEdit = (record: GeopoliticalCustomersRecord) => {
geopoliticalCustomersModalRef.value?.open({
newFormAction: FormAction.UPDATE,
type: 'audit',

@ -71,14 +71,14 @@
:label-col="{ sm: { span: 24 }, md: { span: 5 } }"
:wrapper-col="
title === '详情' || title === '分发'
? { sm: { span: 24 }, md: { span: 9 } }
? { sm: { span: 24 }, md: { span: 19 } }
: { sm: { span: 24 }, md: { span: 19 } }
"
>
<a-input
v-model:value="formModel.remark"
placeholder="请输入备注"
:style="{ width: title === '详情' || title === '分发' ? '37%' : '38%' }"
:style="{ width: title === '详情' || title === '分发' ? '83%' : '100%' }"
:readonly="title === '详情' || title === '分发'"
/>
</a-form-item>
@ -361,6 +361,7 @@
>
<div v-if="title === '编辑'">
<!-- <a-button @click="retrial"></a-button> -->
<a-button @click="storeResetForm"></a-button>
<a-button @click="handleClose"></a-button>
<a-button type="primary" html-type="submit" style="margin-left: 10px" @click="distribute"
>确定</a-button
@ -564,7 +565,7 @@ const pagingQuery = () => {
})
pois.push(...listData.value)
// ,
const targetZoom = 10
const targetZoom = 12
//
const placeSearch_CallBack = (data: any) => {
@ -618,6 +619,7 @@ const pagingQuery = () => {
}
)
}
//
const match = () => {
const fields = ['address', 'detailAddress', 'radius'] //
@ -634,16 +636,8 @@ const match = () => {
city: '杭州' // city adcode citycode
})
})
const addressValue =
formModel.address?.toString().split(',').join('') + formModel.detailAddress
geocoder.value.getLocation(addressValue, function (status: any, result: any) {
if (status === 'complete' && result.info === 'OK') {
// result
lng.value = result.geocodes[0].location.lng
lat.value = result.geocodes[0].location.lat
}
pagingQuery()
})
//
getCenterMarker('match')
})
.catch(() => {
//
@ -679,15 +673,10 @@ const addStore = (item: any) => {
//
const delReservationStore = (i: any) => {
console.log(i, 'i')
// console.log(formModel.customStoreEntities, 'formModel.customStoreEntities')
console.log(listData.value, 'listData.value')
listData.value.forEach((item: any) => {
// console.log(i.storeId, 'id')
if (item.id == i.storeId) {
item.disabled = false
}
console.log(item, 'item')
})
formModel.customStoreEntities = formModel.customStoreEntities.filter((item: any) => {
return item.storeId != i.storeId
@ -697,12 +686,13 @@ const delReservationStore = (i: any) => {
const storeResetForm = () => {
formModel.customName = ''
formModel.customNid = ''
formModel.remark = ''
if (title.value !== '编辑预约') {
formModel.address = []
formModel.detailAddress = ''
formModel.radius = ''
formModel.customStoreEntities.length = 0
}
formModel.customStoreEntities.length = 0
listData.value.length = 0
//
@ -740,7 +730,7 @@ interface customStoreEntitiesItem {
//,
const isSubmit = ref(false)
//
const submitOperate = (type: string, status?: number) => {
const submitOperate = () => {
//address
const filteredObj = Object.fromEntries(
Object.entries(formModel).filter(([key]) => key !== 'address')
@ -753,7 +743,7 @@ const submitOperate = (type: string, status?: number) => {
reservationTime: item.reservationTime,
reservationDate: item.reservationDate
}
if (title.value === '编辑预约') {
if (title.value === '编辑预约' || title.value === '编辑') {
if (item.customStoreId) {
obj.customStoreId = item.customStoreId
}
@ -786,13 +776,7 @@ const submitOperate = (type: string, status?: number) => {
}
//
const handleOk = async () => {
if (title.value === '编辑') {
//
await submitOperate('cs', 1)
} else {
//
await submitOperate('bm')
}
await submitOperate()
}
//
const temporaryStorage = async () => {
@ -803,7 +787,7 @@ const temporaryStorage = async () => {
message.info('请先添加预约门店')
} else {
formModel.enrollStatus = 0
submitOperate('zc')
submitOperate()
// handleSubmit()
}
})
@ -813,9 +797,9 @@ const temporaryStorage = async () => {
}
//
const retrial = () => {
submitOperate('cs', 0)
}
// const retrial = () => {
// submitOperate()
// }
//
const distribute = () => {
registerVisible.value = true
@ -935,13 +919,23 @@ defineExpose({
formModel.detailAddress = detailAddress
formModel.radius = radius
formModel.customStoreEntities.push(...customStoreVOList)
//
formModel.customStoreEntities.forEach((i: any) => {
i.option = generateTimeSlots(i.tradeStartTime, i.tradeEndTime)
})
console.log(formModel.customStoreEntities, 'formModel.customStoreEntities')
}
if (opendata.type === 'audit') {
// isReadOnly.value = true
// reservationTimeisReadOnly.value = true
handleMapInit()
title.value = '编辑'
// formModel.description = 1
} else if (opendata.type === 'edit') {
isDisabled.value = true
handleMapInit()
title.value = '编辑预约'
}
}
const handleMapInit = () => {
nextTick(() => {
initMap()
@ -960,23 +954,27 @@ defineExpose({
isReadOnly.value = true
reservationTimeisReadOnly.value = true
title.value = '详情'
} else if (opendata.type === 'audit') {
// isReadOnly.value = true
// reservationTimeisReadOnly.value = true
handleMapInit()
title.value = '编辑'
formModel.description = 1
} else if (opendata.type === 'distribute') {
}
// else if (opendata.type === 'audit') {
// // isReadOnly.value = true
// // reservationTimeisReadOnly.value = true
// handleMapInit()
// title.value = ''
// // formModel.description = 1
// }
else if (opendata.type === 'distribute') {
isReadOnly.value = true
reservationTimeisReadOnly.value = true
handleMapInit()
title.value = '分发'
formModel.description = 1
} else {
isDisabled.value = true
handleMapInit()
title.value = '编辑预约'
}
// else {
// isDisabled.value = true
// handleMapInit()
// title.value = ''
// }
}
formAction.value = opendata.newFormAction
}
@ -1006,12 +1004,49 @@ const map = ref<any>({})
// AMap.GeocodergetAddress
const geocoder = ref<any>({})
//
//
const getCenterMarker = (type: string) => {
const addressValue =
//
formModel.address?.toString().split(',').join('') + formModel.detailAddress
geocoder.value.getLocation(addressValue, function (status: any, result: any) {
if (status === 'complete' && result.info === 'OK') {
// result
lng.value = result.geocodes[0].location.lng
lat.value = result.geocodes[0].location.lat
//
map.value.setCenter([lng.value, lat.value]) //
if (type === 'match') {
//
map.value.setZoom(12) // 12
}
//
const marker = new AMap.Marker({
position: [lng.value, lat.value], //
zIndex: 100 // z-index 100
})
//
marker.setIcon(
new AMap.Icon({
image: 'https://webapi.amap.com/theme/v1.3/markers/n/mark_r.png', // 使 URL
size: new AMap.Size(18, 30), //
imageSize: new AMap.Size(18, 30) //
})
)
marker.setMap(map.value) //
}
if (type === 'match') {
pagingQuery()
}
})
}
//
const initMap = () => {
map.value = new AMap.Map('draw-station-container', {
center: [120.1551, 30.2741], //
zoom: 10 //
// center: [120.1551, 30.2741], //
zoom: 18 //
})
// marker.value = new AMap.Marker({
@ -1045,6 +1080,13 @@ const initMap = () => {
// city: '010' //
// })
})
AMap.plugin('AMap.Geocoder', function () {
geocoder.value = new AMap.Geocoder({
city: '杭州' // city adcode citycode
})
})
//
getCenterMarker('init')
// map.value.add(marker.value)
}
@ -1177,7 +1219,7 @@ const storeItemClick = (item: any, index: number) => {
// map.value.add(marker.value)
//
const targetPosition = [item.lng, item.lat]
const targetZoom = 10 //
const targetZoom = 12 //
infoWindows.value.open(map.value, targetPosition)
//

@ -182,6 +182,15 @@ defineExpose({
record = res.data
record.comprehensiveAddress = `${record?.economize}${record?.market}${record?.distinguish}${record?.detailAddress}`
overrideProperties(formModel, record)
record.customStoreVOList.forEach((item: any) => {
const targetObj = formModel.customStoreVOList.find(
(i: any) => i.storeId === item.storeId
)
if (targetObj) {
targetObj.reservationTime =
item.reservationDate.split(' ')[0] + ' ' + item.reservationTime
}
})
formAction.value = newFormAction
}
})

@ -118,8 +118,8 @@ const search = () => {
param.distributeStartTime = distributeTime.value[0].format('YYYY-MM-DD HH:mm:ss')
param.distributeEndTime = distributeTime.value[1].format('YYYY-MM-DD HH:mm:ss')
} else {
param.startTime = ''
param.endTime = ''
param.distributeStartTime = ''
param.distributeEndTime = ''
}
emits('search', param)
}

@ -137,6 +137,7 @@ import { reactive, ref, onMounted, toRefs } from 'vue'
import { useModal } from '@/hooks/modal'
import type { FormRequestMapping } from '@/hooks/form'
import { overrideProperties } from '@/utils/bean-utils'
import { message } from 'ant-design-vue'
// import type { shopDTO } from '@/api/geopoliticalCustomers/types'
import { storeUserQueryAll, createUser, updateUser } from '@/api/shopManage/index'
import { provincesAndCitiesAndAutonomousRegions } from '@/utils/geopolitical-customers'
@ -272,30 +273,35 @@ const handleClose = () => {
/* 表单提交处理 */
const handleSubmit = () => {
formRef.value?.validate().then(res => {
const addkey: any = {}
if (title.value == '添加门店') {
addkey.province = anchorData.pname
addkey.city = anchorData.cityname
addkey.county = anchorData.adname
addkey.detail = anchorData.address
addkey.longitude = anchorData.location.lng
addkey.latitude = anchorData.location.lat
}
anchorData &&
validateAndSubmit(
{
...formModel,
...addkey,
tradeStartTime: formModel.tradeTime[0],
tradeEndTime: formModel.tradeTime[1]
},
{
onSuccess: () => {
closeModal()
emits('submit-success')
if (anchorData && anchorData.location && anchorData.location.lng) {
console.log(anchorData.location, 'anchorData.location')
const addkey: any = {}
if (title.value == '添加门店') {
addkey.province = anchorData.pname
addkey.city = anchorData.cityname
addkey.county = anchorData.adname
addkey.detail = anchorData.address
addkey.longitude = anchorData.location.lng
addkey.latitude = anchorData.location.lat
}
anchorData &&
validateAndSubmit(
{
...formModel,
...addkey,
tradeStartTime: formModel.tradeTime[0],
tradeEndTime: formModel.tradeTime[1]
},
{
onSuccess: () => {
closeModal()
emits('submit-success')
}
}
}
)
)
} else {
message.info('请先选择具体门店')
}
})
}
defineExpose({
@ -465,5 +471,4 @@ defineExpose({
max-height: 70vh;
overflow-y: auto;
}
</style>

@ -22,7 +22,7 @@ import { antdvStyleDeps } from './src/utils/resolvers'
//项目
// const serverAddress = 'http://admin.ballcat.cn'
//xy
const serverAddress = 'http://172.18.0.225:8000'
// const serverAddress = 'http://172.18.0.225:8000'
//jt
// const serverAddress = 'http://172.18.1.8:8000'
//ts
@ -31,7 +31,7 @@ const serverAddress = 'http://172.18.0.225:8000'
// const serverAddress = 'http://39.100.77.21:8000'
//线上ip
// const serverAddress = 'http://175.27.212.74:80'
const serverAddress = 'http://175.27.212.74:80'
//线上域名
// const serverAddress = 'https://baiyea.net'
// const serverAddress = 'http://8.130.96.163:8100'

Loading…
Cancel
Save