|
|
@ -109,22 +109,10 @@ |
|
|
|
<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-number |
|
|
|
<el-input v-model="placeForm.lng" placeholder="输入经度" /> |
|
|
|
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-number |
|
|
|
<el-input v-model="placeForm.lat" placeholder="输入纬度" /> |
|
|
|
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"> |
|
|
@ -142,10 +130,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"> |
|
|
@ -157,19 +145,6 @@ |
|
|
|
<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 |
|
|
@ -259,7 +234,6 @@ |
|
|
|
|
|
|
|
|
|
|
|
<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' |
|
|
|
|
|
|
|
|
|
|
@ -293,35 +267,18 @@ const mapHelpText = ref('') |
|
|
|
const tipPostion = ref({}) |
|
|
|
const tipPostion = ref({}) |
|
|
|
const placeTab = ref('info') |
|
|
|
const placeTab = ref('info') |
|
|
|
|
|
|
|
|
|
|
|
const defaultLatLng = ref({ |
|
|
|
function initMap() { |
|
|
|
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', 'AMap.AutoComplete'] |
|
|
|
plugins: ['AMap.Geocoder'] |
|
|
|
}).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: [defaultLatLng.value.lng, defaultLatLng.value.lat] |
|
|
|
center: [117.283042, 31.86119] |
|
|
|
}) |
|
|
|
|
|
|
|
AutoComplete.value = new AMap.AutoComplete({ |
|
|
|
|
|
|
|
city: defaultCity.value |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
locationMarker.value = new AMap.Marker({ |
|
|
|
locationMarker.value = new AMap.Marker({ |
|
|
|
icon: FlagRed |
|
|
|
icon: FlagRed |
|
|
@ -356,32 +313,6 @@ async 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) { |
|
|
|