|
|
@ -109,10 +109,22 @@ |
|
|
|
<el-input v-model="placeForm.address" placeholder="输入地址" /> |
|
|
|
<el-input v-model="placeForm.address" placeholder="输入地址" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="经度" prop="lng"> |
|
|
|
<el-form-item label="经度" prop="lng"> |
|
|
|
<el-input v-model="placeForm.lng" placeholder="输入经度" /> |
|
|
|
<el-input-number |
|
|
|
|
|
|
|
v-model="placeForm.lng" |
|
|
|
|
|
|
|
:min="1" |
|
|
|
|
|
|
|
:controls="false" |
|
|
|
|
|
|
|
placeholder="输入经度" |
|
|
|
|
|
|
|
style="width: 100%" |
|
|
|
|
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="纬度" prop="lat"> |
|
|
|
<el-form-item label="纬度" prop="lat"> |
|
|
|
<el-input v-model="placeForm.lat" placeholder="输入纬度" /> |
|
|
|
<el-input-number |
|
|
|
|
|
|
|
v-model="placeForm.lat" |
|
|
|
|
|
|
|
:min="1" |
|
|
|
|
|
|
|
:controls="false" |
|
|
|
|
|
|
|
placeholder="输入纬度" |
|
|
|
|
|
|
|
style="width: 100%" |
|
|
|
|
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="所属区域" prop="area"> |
|
|
|
<el-form-item label="所属区域" prop="area"> |
|
|
|
<el-select v-model="placeForm.area" placeholder="请选择" clearable class="w-full"> |
|
|
|
<el-select v-model="placeForm.area" placeholder="请选择" clearable class="w-full"> |
|
|
@ -130,10 +142,10 @@ |
|
|
|
<el-form-item label="负责人" prop="contact"> |
|
|
|
<el-form-item label="负责人" prop="contact"> |
|
|
|
<el-input v-model="placeForm.contact" placeholder="输入负责人" /> |
|
|
|
<el-input v-model="placeForm.contact" placeholder="输入负责人" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="是否推荐" prop="contact"> |
|
|
|
<!-- <el-form-item label="是否推荐" prop="contact"> |
|
|
|
<el-radio v-model="placeForm.recommend" :label="true">是</el-radio> |
|
|
|
<el-radio v-model="placeForm.recommend" :label="true">是</el-radio> |
|
|
|
<el-radio v-model="placeForm.recommend" :label="false">否</el-radio> |
|
|
|
<el-radio v-model="placeForm.recommend" :label="false">否</el-radio> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> --> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="描述" name="desc"> |
|
|
|
<el-tab-pane label="描述" name="desc"> |
|
|
@ -145,6 +157,19 @@ |
|
|
|
<el-button @click="closePlaceDialog">取消</el-button> |
|
|
|
<el-button @click="closePlaceDialog">取消</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
<el-autocomplete |
|
|
|
|
|
|
|
:style="{ |
|
|
|
|
|
|
|
position: 'absolute', |
|
|
|
|
|
|
|
top: '20px', |
|
|
|
|
|
|
|
left: placeDialogShow ? '380px' : '20px', |
|
|
|
|
|
|
|
width: '200px' |
|
|
|
|
|
|
|
}" |
|
|
|
|
|
|
|
v-model="areaValue" |
|
|
|
|
|
|
|
clearable |
|
|
|
|
|
|
|
placeholder="输入并搜索位置" |
|
|
|
|
|
|
|
:fetch-suggestions="remoteMethod" |
|
|
|
|
|
|
|
@select="currentSelect" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 底部驾校场地列表 --> |
|
|
|
<!-- 底部驾校场地列表 --> |
|
|
|
<el-card |
|
|
|
<el-card |
|
|
@ -234,6 +259,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
<script setup name="Place"> |
|
|
|
<script setup name="Place"> |
|
|
|
import * as PlaceApi from '@/api/school/place' |
|
|
|
import * as PlaceApi from '@/api/school/place' |
|
|
|
|
|
|
|
import { getConfigByConfigKey } from '@/api/system/set' |
|
|
|
import { getAreaSimpleList } from '@/api/school/setting/area' |
|
|
|
import { getAreaSimpleList } from '@/api/school/setting/area' |
|
|
|
import { checkPermi } from '@/utils/permission' |
|
|
|
import { checkPermi } from '@/utils/permission' |
|
|
|
|
|
|
|
|
|
|
@ -267,18 +293,35 @@ const mapHelpText = ref('') |
|
|
|
const tipPostion = ref({}) |
|
|
|
const tipPostion = ref({}) |
|
|
|
const placeTab = ref('info') |
|
|
|
const placeTab = ref('info') |
|
|
|
|
|
|
|
|
|
|
|
function initMap() { |
|
|
|
const defaultLatLng = ref({ |
|
|
|
|
|
|
|
lat: 31.86119, |
|
|
|
|
|
|
|
lng: 117.283042 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
const defaultCity = ref('合肥') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let AutoComplete = ref(null) |
|
|
|
|
|
|
|
async function initMap() { |
|
|
|
|
|
|
|
const data = await getConfigByConfigKey({ configKey: 'defaultLocation' }) |
|
|
|
|
|
|
|
const cityInfo = JSON.parse(data.configValue) |
|
|
|
|
|
|
|
defaultLatLng.value = { |
|
|
|
|
|
|
|
lat: cityInfo.lat, |
|
|
|
|
|
|
|
lng: cityInfo.lng |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
defaultCity.value = cityInfo.locationName |
|
|
|
AMapLoader.load({ |
|
|
|
AMapLoader.load({ |
|
|
|
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key |
|
|
|
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key |
|
|
|
version: '2.0', |
|
|
|
version: '2.0', |
|
|
|
plugins: ['AMap.Geocoder'] |
|
|
|
plugins: ['AMap.Geocoder', 'AMap.AutoComplete'] |
|
|
|
}).then((AMap) => { |
|
|
|
}).then((AMap) => { |
|
|
|
aMap.value = AMap |
|
|
|
aMap.value = AMap |
|
|
|
geoCoder.value = new AMap.Geocoder() |
|
|
|
geoCoder.value = new AMap.Geocoder() |
|
|
|
dialogMap.value = new AMap.Map('dialogMap', { |
|
|
|
dialogMap.value = new AMap.Map('dialogMap', { |
|
|
|
zoom: 12, |
|
|
|
zoom: 12, |
|
|
|
zooms: [2, 22], |
|
|
|
zooms: [2, 22], |
|
|
|
center: [117.283042, 31.86119] |
|
|
|
center: [defaultLatLng.value.lng, defaultLatLng.value.lat] |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
AutoComplete.value = new AMap.AutoComplete({ |
|
|
|
|
|
|
|
city: defaultCity.value |
|
|
|
}) |
|
|
|
}) |
|
|
|
locationMarker.value = new AMap.Marker({ |
|
|
|
locationMarker.value = new AMap.Marker({ |
|
|
|
icon: FlagRed |
|
|
|
icon: FlagRed |
|
|
@ -313,6 +356,32 @@ function initMap() { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const areaValue = ref('') |
|
|
|
|
|
|
|
function remoteMethod(searchValue, cb) { |
|
|
|
|
|
|
|
if (searchValue) { |
|
|
|
|
|
|
|
AutoComplete.value?.search(searchValue, (status, result) => { |
|
|
|
|
|
|
|
if (result.tips?.length) { |
|
|
|
|
|
|
|
// areaList.value = result?.tips |
|
|
|
|
|
|
|
const list = result.tips.map((it) => ({ |
|
|
|
|
|
|
|
...it, |
|
|
|
|
|
|
|
value: it.name |
|
|
|
|
|
|
|
})) |
|
|
|
|
|
|
|
cb(list) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
cb([]) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
cb([]) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function currentSelect(val) { |
|
|
|
|
|
|
|
if (val) { |
|
|
|
|
|
|
|
dialogMap.value.setCenter([val.location?.lng, val.location?.lat], true) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function regeoCode() { |
|
|
|
function regeoCode() { |
|
|
|
geoCoder.value.getAddress([placeForm.value.lng, placeForm.value.lat], (status, result) => { |
|
|
|
geoCoder.value.getAddress([placeForm.value.lng, placeForm.value.lat], (status, result) => { |
|
|
|
if (status === 'complete' && result.regeocode) { |
|
|
|
if (status === 'complete' && result.regeocode) { |
|
|
|