新增页面添加地图选点获取经纬度

运输详情页逻辑修改
liujun0708-动火作业流程图逻辑修改
WenShiJun 2024-07-06 16:06:01 +08:00
parent 543408bd32
commit 039184942f
3 changed files with 500 additions and 104 deletions

View File

@ -77,12 +77,25 @@
no-children-text="暂无数据" no-children-text="暂无数据"
/> />
</el-form-item> </el-form-item>
<el-form-item label="经度" prop="LONGITUDE"> <el-row :gutter="20">
<el-input v-model="form.LONGITUDE" placeholder="请输入经度..." /> <el-col :span="12">
</el-form-item> <el-form-item :key="form.LONGITUDE" label="经度" prop="LONGITUDE">
<el-form-item label="纬度" prop="LATITUDE"> <el-input v-model="form.LONGITUDE" placeholder="请输入内容" disabled @focus="handleMap" />
<el-input v-model="form.LATITUDE" placeholder="请输入纬度..." /> </el-form-item>
</el-form-item> </el-col>
<el-col :span="12">
<el-form-item :key="form.LATITUDE" label="纬度" prop="LATITUDE">
<div style="display: flex">
<el-input v-model="form.LATITUDE" placeholder="请输入内容" disabled style="width: 100%" @focus="handleMap"/>
<el-button style="margin-left:10px" @click="handleMap">
<span class="svg-container">
<svg-icon icon-class="international" />
</span>
</el-button>
</div>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="应急通讯车数" prop="EMERGENCY_COMMUNICATION_VEHICLES"> <el-form-item label="应急通讯车数" prop="EMERGENCY_COMMUNICATION_VEHICLES">
<el-input v-model="form.EMERGENCY_COMMUNICATION_VEHICLES" placeholder="请输入应急通讯车数..." /> <el-input v-model="form.EMERGENCY_COMMUNICATION_VEHICLES" placeholder="请输入应急通讯车数..." />
</el-form-item> </el-form-item>
@ -152,7 +165,38 @@
<el-button type="primary" @click="confirm"></el-button> <el-button type="primary" @click="confirm"></el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 坐标选择 -->
<el-dialog :visible.sync="dialogFormMap" title="编辑坐标" width="800px" class="dy-dialog">
<baidu-map
v-loading="loadingMap"
:zoom="zoom"
:scroll-wheel-zoom="true"
:style="{height: clientHeight+'px'}"
@click="getClickInfo"
@ready="handler">
<bm-view style="width: 100%; height:100%; flex: 1" />
<bm-control ref="control" :offset="{width: 10, height: 10}" anchor="BMAP_ANCHOR_TOP_LEFT">
<div class="map-flex">
<div class="map-lable">关键词</div>
<div style="flex:1;">
<el-autocomplete v-model="addressKeyword" :fetch-suggestions="querySearch" :trigger-on-focus="false" placeholder="请输入详细地址" style="width:100%" @select="handleSelect" />
</div>
<!-- <el-input v-model="addressKeyword" style="width: 200px" placeholder="请输入内容" />-->
<!-- <el-button slot="append" icon="el-icon-search" @click="mapNameChange"/>-->
</div>
</bm-control>
<!-- <bm-local-search :keyword="addressKeyword" :auto-viewport="true"/>-->
</baidu-map>
<div slot="footer" class="dialog-footer">
<span>经度</span>
<el-input v-model="LONGITUDE" style="width: 200px" placeholder="请输入内容" disabled />
<span>纬度</span>
<el-input v-model="LATITUDE" style="width: 200px" placeholder="请输入内容" disabled />
<el-button @click="dialogFormMap = false"> </el-button>
<el-button type="primary" @click="setPosition"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -165,6 +209,21 @@ export default {
components: { Treeselect, Pagination }, components: { Treeselect, Pagination },
data() { data() {
return { return {
//
CORPINFO_ID: this.$parent.CORPINFO_ID,
clientHeight: 600,
loadingMap: true,
listLoading: false,
buttonloading: false,
BMap: '',
map: '',
showMap: false,
addressKeyword: '',
pointLngLat: '',
zoom: 10,
dialogFormMap: false,
LATITUDE: '',
LONGITUDE: '',
listQuery: { listQuery: {
page: 1, page: 1,
limit: 10 limit: 10
@ -376,8 +435,126 @@ export default {
console.error('获取树形数据失败', e) console.error('获取树形数据失败', e)
}) })
}, },
//* *************************************************
//* *******************************
//
mapOpen() {
this.top = this.getScrollTop()
if (this.top) {
this.setScrollTop(0)
}
},
//
mapClose() {
this.setScrollTop(this.top)
this.top = 0
this.showMap = false
},
getScrollTop() {
let scrollTop = 0
if (document.documentElement && document.documentElement.scrollTop) {
scrollTop = document.documentElement.scrollTop
} else if (document.body) {
scrollTop = document.body.scrollTop
}
return scrollTop
},
setScrollTop(top) {
if (!isNaN(top)) {
if (document.documentElement && document.documentElement.scrollTop !== undefined) {
document.documentElement.scrollTop = top
} else if (document.body) {
document.body.scrollTop = top
}
}
},
//
handler({ BMap, map }) {
this.mapOpen()
this.BMap = BMap
this.map = map
this.loadingMap = true
var geolocation = new BMap.Geolocation()
const myGeo = new BMap.Geocoder()
var $this = this
// api
geolocation.getCurrentPosition(function(r) {
myGeo.getLocation(new BMap.Point(r.point.lng, r.point.lat), function(result) {
if (result) {
$this.loadingMap = false
$this.$set($this, 'pointLngLat', { lng: result.point.lng, lat: result.point.lat })
map.enableScrollWheelZoom(true) // ,
$this.setCenter({ BMap, map })
}
})
})
},
//
querySearch(queryString, cb) {
var options = {
onSearchComplete: function(results) {
if (local.getStatus() === 0) {
//
var s = []
for (var i = 0; i < results.getCurrentNumPois(); i++) {
var x = results.getPoi(i)
var item = { value: x.address + x.title, point: x.point }
s.push(item)
cb(s)
}
} else {
cb()
}
}
}
var local = new this.BMap.LocalSearch(this.map, options)
local.search(queryString)
},
handleSelect(item) {
var { point } = item
this.map.clearOverlays() //
this.map.centerAndZoom(point, this.zoom)
const marker = new this.BMap.Marker(point) //
this.map.addOverlay(marker) //
marker.enableDragging() //
this.LONGITUDE = point.lng
this.LATITUDE = point.lat
},
//
setCenter({ BMap, map }) {
var lng = ''
var lat = ''
if (this.form.LONGITUDE == '' || this.form.LATITUDE == '') {
lng = '119.525971'
lat = '39.894727'
} else {
lng = this.form.LONGITUDE
lat = this.form.LATITUDE
}
var point = new BMap.Point(lng, lat)
// var point = new BMap.Point(this.form.LONGITUDE, this.form.LATITUDE)
const zoom = map.getZoom()
setTimeout(() => {
map.centerAndZoom(point, zoom)
}, 0)
// var marker = new BMap.Marker(point) //
// map.addOverlay(marker) //
},
handleMap() {
this.dialogFormMap = true
this.LATITUDE = this.form.LATITUDE
this.LONGITUDE = this.form.LONGITUDE
},
getClickInfo(e) {
this.LONGITUDE = e.point.lng
this.LATITUDE = e.point.lat
},
setPosition() {
this.dialogFormMap = false
this.form.LATITUDE = this.LATITUDE
this.form.LONGITUDE = this.LONGITUDE
},
//* *************************************************
getList() { getList() {
this.listLoading = true this.listLoading = true
requestFN( requestFN(
@ -454,6 +631,8 @@ export default {
handleAdd() { handleAdd() {
this.dialogFormEdit = true this.dialogFormEdit = true
this.form = {} this.form = {}
this.form.LONGITUDE = ''
this.form.LATITUDE = ''
this.dialogType = 'saveUser' this.dialogType = 'saveUser'
this.$refs.upload.clearFiles() this.$refs.upload.clearFiles()
}, },

View File

@ -1,66 +1,116 @@
<template> <template>
<div class="app-container"> <div>
<div class="filter-container" style="display: flex; justify-content: space-between;"> <div class="app-container">
<div> <div class="level-title">
<el-tag>详情</el-tag> <h1>运输保障机构详情</h1>
</div> </div>
<div> <div class="mb-20">
<el-button type="primary" @click="goBack"></el-button> <table class="table-ui">
<tr>
<td class="tbg">运输机构名称</td>
<td>{{ form.ORG_NAME }}</td>
<td class="tbg">地址</td>
<td>{{ form.ADDRESS }}</td>
</tr>
<tr>
<td class="tbg">运输机构类型</td>
<td>{{ form.ORG_TYPE }}</td>
<td class="tbg">运输机构级别</td>
<td>{{ form.ORG_LEVEL }}</td>
</tr>
<tr>
<td class="tbg">邮编</td>
<td>{{ form.POSTAL_CODE }}</td>
<td class="tbg">机构密级</td>
<td>{{ form.SECURITY_LEVEL }}</td>
</tr>
<tr>
<td class="tbg">值班电话</td>
<td>{{ form.DUTY_PHONE }}</td>
<td class="tbg">传真</td>
<td>{{ form.FAX }}</td>
</tr>
<tr>
<td class="tbg">所属区域</td>
<td colspan="3">{{ form.ADMINISTRATIVE_REGION_NAME }}</td>
</tr>
<tr>
<td class="tbg">经度</td>
<td>{{ form.LONGITUDE }}</td>
<td class="tbg">纬度</td>
<td>{{ form.LATITUDE }}</td>
</tr>
<tr>
<td class="tbg">应急运输方式</td>
<td colspan="3">{{ form.EMERGENCY_TRANSPORT_MODE }}</td>
</tr>
<tr>
<td class="tbg">负责人</td>
<td>{{ form.RESPONSIBLE_PERSON }}</td>
<td class="tbg">负责人办公电话</td>
<td>{{ form.RESPONSIBLE_OFFICE_PHONE }}</td>
</tr>
<tr>
<td class="tbg">负责人移动电话</td>
<td>{{ form.RESPONSIBLE_MOBILE_PHONE }}</td>
<td class="tbg">负责人住宅电话</td>
<td>{{ form.RESPONSIBLE_HOME_PHONE }}</td>
</tr>
<tr>
<td class="tbg">联系人</td>
<td>{{ form.CONTACT_PERSON }}</td>
<td class="tbg">联系人办公电话</td>
<td>{{ form.CONTACT_OFFICE_PHONE }}</td>
</tr>
<tr>
<td class="tbg">联系人移动电话</td>
<td>{{ form.CONTACT_MOBILE_PHONE }}</td>
<td class="tbg">联系人住宅电话</td>
<td>{{ form.CONTACT_HOME_PHONE }}</td>
</tr>
<tr>
<td class="tbg">联系人电子邮箱</td>
<td>{{ form.CONTACT_EMAIL }}</td>
</tr>
<tr>
<td class="tbg">主管单位名称</td>
<td>{{ form.SUPERVISING_UNIT_NAME }}</td>
<td class="tbg">主管单位地址</td>
<td>{{ form.SUPERVISING_UNIT_ADDRESS }}</td>
</tr>
<tr>
<td class="tbg">企业基本情况</td>
<td colspan="3">{{ form.COMPANY_OVERVIEW }}</td>
</tr>
<tr>
<td class="tbg">客运能力</td>
<td>{{ form.PASSENGER_TRANSPORT_CAPACITY }}</td>
<td class="tbg">货运能力</td>
<td>{{ form.CARGO_TRANSPORT_CAPACITY }}</td>
</tr>
<tr>
<td class="tbg">应急能力描述</td>
<td colspan="3">{{ form.EMERGENCY_CAPACITY_DESCRIPTION }}</td>
</tr>
<tr>
<td class="tbg">备注</td>
<td colspan="3">{{ form.REMARK }}</td>
</tr>
</table>
</div> </div>
</div> </div>
<el-table ref="multipleTable" :data="[form]" :header-cell-style="{'font-weight': 'bold','color': '#000'}" tooltip-effect="dark" border fit highlight-current-row> <div class="ui-height" />
<el-table-column type="index" label="序号" width="50" align="center" /> <div class="ui-foot">
<el-table-column prop="ORG_NAME" label="运输机构名称" /> <el-button type="primary" @click="goBack"></el-button>
<el-table-column prop="ORG_TYPE" label="运输机构类型" /> </div>
<el-table-column prop="ORG_LEVEL" label="运输机构级别" />
<el-table-column prop="ADDRESS" label="地址" />
<el-table-column prop="POSTAL_CODE" label="邮编" />
<el-table-column prop="SECURITY_LEVEL" label="机构密级" />
<el-table-column prop="DUTY_PHONE" label="值班电话" />
<el-table-column prop="ADMINISTRATIVE_REGION_NAME" label="所属区域" />
<el-table-column prop="LONGITUDE" label="经度" />
<el-table-column prop="LATITUDE" label="纬度" />
<el-table-column prop="EMERGENCY_TRANSPORT_MODE" label="应急运输方式" />
<el-table-column prop="RESPONSIBLE_PERSON" label="负责人" />
<el-table-column prop="RESPONSIBLE_OFFICE_PHONE" label="负责人办公电话" />
<el-table-column prop="RESPONSIBLE_MOBILE_PHONE" label="负责人移动电话" />
<el-table-column prop="RESPONSIBLE_HOME_PHONE" label="负责人住宅电话" />
<el-table-column prop="CONTACT_PERSON" label="联系人" />
<el-table-column prop="CONTACT_OFFICE_PHONE" label="联系人办公电话" />
<el-table-column prop="CONTACT_MOBILE_PHONE" label="联系人移动电话" />
<el-table-column prop="CONTACT_HOME_PHONE" label="联系人住宅电话" />
<el-table-column prop="CONTACT_EMAIL" label="联系人电子邮箱" />
<el-table-column prop="SUPERVISING_UNIT" label="主管单位" />
<el-table-column prop="SUPERVISING_UNIT_ADDRESS" label="主管单位地址" />
<el-table-column prop="COMPANY_OVERVIEW" label="企业基本情况" />
<el-table-column prop="PASSENGER_TRANSPORT_CAPACITY" label="客运能力" />
<el-table-column prop="CARGO_TRANSPORT_CAPACITY" label="货运能力" />
<el-table-column prop="EMERGENCY_CAPACITY_DESCRIPTION" label="应急能力描述" />
<el-table-column prop="REMARK" label="备注" />
</el-table>
</div> </div>
</template> </template>
<script> <script>
import Pagination from '@/components/Pagination'
import { requestFN } from '@/utils/request' import { requestFN } from '@/utils/request'
import { Treeselect } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default { export default {
components: { Pagination, Treeselect },
data() { data() {
return { return {
listQuery: {
page: 1,
limit: 10
},
total: 0,
varList: [],
KEYWORDS: '',
dialogFormEdit: false,
dialogFormShow: false,
dialogType: 'add',
form: { form: {
ORG_NAME: '', ORG_NAME: '',
ORG_TYPE: '', ORG_TYPE: '',
@ -69,6 +119,7 @@ export default {
POSTAL_CODE: '', POSTAL_CODE: '',
SECURITY_LEVEL: '', SECURITY_LEVEL: '',
DUTY_PHONE: '', DUTY_PHONE: '',
FAX: '',
ADMINISTRATIVE_REGION: '', ADMINISTRATIVE_REGION: '',
ADMINISTRATIVE_REGION_NAME: '', ADMINISTRATIVE_REGION_NAME: '',
LONGITUDE: '', LONGITUDE: '',
@ -84,62 +135,29 @@ export default {
CONTACT_HOME_PHONE: '', CONTACT_HOME_PHONE: '',
CONTACT_EMAIL: '', CONTACT_EMAIL: '',
SUPERVISING_UNIT: '', SUPERVISING_UNIT: '',
SUPERVISING_UNIT_NAME: '',
SUPERVISING_UNIT_ADDRESS: '', SUPERVISING_UNIT_ADDRESS: '',
COMPANY_OVERVIEW: '', COMPANY_OVERVIEW: '',
PASSENGER_TRANSPORT_CAPACITY: '', PASSENGER_TRANSPORT_CAPACITY: '',
CARGO_TRANSPORT_CAPACITY: '', CARGO_TRANSPORT_CAPACITY: '',
EMERGENCY_CAPACITY_DESCRIPTION: '', EMERGENCY_CAPACITY_DESCRIPTION: '',
REMARK: '', REMARK: ''
CONTENT: '',
FILE_URL: ''
}, },
Id: '', Id: ''
treeData: [],
DepartmentData: [],
normalizer(node) {
return {
id: node.DICTIONARIES_ID,
label: node.name,
children: node.nodes
}
}
} }
}, },
created() { created() {
if (this.$parent.CASE_ID) { if (this.$parent.CASE_ID) {
this.Id = this.$parent.CASE_ID this.Id = this.$parent.CASE_ID
this.getDetail(this.Id) this.getDetail(this.Id)
} }
this.getTreeList()
this.getDepartmentList()
}, },
methods: { methods: {
goBack() { goBack() {
this.$parent.activeName = 'list' this.$parent.activeName = 'list'
}, },
getTreeList() {
const params = {
PARENT_ID: '5a5d2809ed644aa6ba97a5240ff35484'
}
requestFN('/dictionaries/listTree', params).then((data) => {
this.treeData = JSON.parse(data.zTreeNodes)
}).catch((e) => {
console.error('获取树形数据失败', e)
})
},
getDepartmentList() {
requestFN('/department/listAll').then((data) => {
this.DepartmentData = data.list.map(item => ({
id: item.department_ID,
label: item.name
}))
}).catch((e) => {
console.error('获取主管单位数据失败', e)
})
},
getDetail(Id) { getDetail(Id) {
const params = { Id: Id } const params = { Id }
requestFN('/major/transportation/detail', params).then((response) => { requestFN('/major/transportation/detail', params).then((response) => {
const data = response.msg const data = response.msg
this.form = { this.form = {
@ -150,6 +168,7 @@ export default {
POSTAL_CODE: data.POSTAL_CODE, POSTAL_CODE: data.POSTAL_CODE,
SECURITY_LEVEL: data.SECURITY_LEVEL, SECURITY_LEVEL: data.SECURITY_LEVEL,
DUTY_PHONE: data.DUTY_PHONE, DUTY_PHONE: data.DUTY_PHONE,
FAX: data.FAX,
ADMINISTRATIVE_REGION: data.ADMINISTRATIVE_REGION, ADMINISTRATIVE_REGION: data.ADMINISTRATIVE_REGION,
ADMINISTRATIVE_REGION_NAME: data.ADMINISTRATIVE_REGION_NAME, ADMINISTRATIVE_REGION_NAME: data.ADMINISTRATIVE_REGION_NAME,
LONGITUDE: data.LONGITUDE, LONGITUDE: data.LONGITUDE,
@ -165,14 +184,13 @@ export default {
CONTACT_HOME_PHONE: data.CONTACT_HOME_PHONE, CONTACT_HOME_PHONE: data.CONTACT_HOME_PHONE,
CONTACT_EMAIL: data.CONTACT_EMAIL, CONTACT_EMAIL: data.CONTACT_EMAIL,
SUPERVISING_UNIT: data.SUPERVISING_UNIT, SUPERVISING_UNIT: data.SUPERVISING_UNIT,
SUPERVISING_UNIT_NAME: data.SUPERVISING_UNIT_NAME,
SUPERVISING_UNIT_ADDRESS: data.SUPERVISING_UNIT_ADDRESS, SUPERVISING_UNIT_ADDRESS: data.SUPERVISING_UNIT_ADDRESS,
COMPANY_OVERVIEW: data.COMPANY_OVERVIEW, COMPANY_OVERVIEW: data.COMPANY_OVERVIEW,
PASSENGER_TRANSPORT_CAPACITY: data.PASSENGER_TRANSPORT_CAPACITY, PASSENGER_TRANSPORT_CAPACITY: data.PASSENGER_TRANSPORT_CAPACITY,
CARGO_TRANSPORT_CAPACITY: data.CARGO_TRANSPORT_CAPACITY, CARGO_TRANSPORT_CAPACITY: data.CARGO_TRANSPORT_CAPACITY,
EMERGENCY_CAPACITY_DESCRIPTION: data.EMERGENCY_CAPACITY_DESCRIPTION, EMERGENCY_CAPACITY_DESCRIPTION: data.EMERGENCY_CAPACITY_DESCRIPTION,
REMARK: data.REMARK, REMARK: data.REMARK
CONTENT: data.CONTENT,
FILE_URL: data.FILE_URL
} }
}).catch((e) => { }).catch((e) => {
console.error('获取详情数据失败', e) console.error('获取详情数据失败', e)
@ -181,3 +199,13 @@ export default {
} }
} }
</script> </script>
<style lang="sass" scoped>
.table-ui
td
line-height: 34px
.tbg
width: 200px
.ui-foot
text-align: center
margin-top: 20px
</style>

View File

@ -74,12 +74,25 @@
no-children-text="暂无数据" no-children-text="暂无数据"
/> />
</el-form-item> </el-form-item>
<el-form-item label="经度" prop="LONGITUDE"> <el-row :gutter="20">
<el-input v-model="form.LONGITUDE" placeholder="请输入经度..." /> <el-col :span="12">
</el-form-item> <el-form-item :key="form.LONGITUDE" label="经度" prop="LONGITUDE">
<el-form-item label="纬度" prop="LATITUDE"> <el-input v-model="form.LONGITUDE" placeholder="请输入内容" disabled @focus="handleMap" />
<el-input v-model="form.LATITUDE" placeholder="请输入纬度..." /> </el-form-item>
</el-form-item> </el-col>
<el-col :span="12">
<el-form-item :key="form.LATITUDE" label="纬度" prop="LATITUDE">
<div style="display: flex">
<el-input v-model="form.LATITUDE" placeholder="请输入内容" disabled style="width: 100%" @focus="handleMap"/>
<el-button style="margin-left:10px" @click="handleMap">
<span class="svg-container">
<svg-icon icon-class="international" />
</span>
</el-button>
</div>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="应急运输方式" prop="EMERGENCY_TRANSPORT_MODE"> <el-form-item label="应急运输方式" prop="EMERGENCY_TRANSPORT_MODE">
<el-input v-model="form.EMERGENCY_TRANSPORT_MODE" placeholder="请输入应急运输方式..." /> <el-input v-model="form.EMERGENCY_TRANSPORT_MODE" placeholder="请输入应急运输方式..." />
</el-form-item> </el-form-item>
@ -117,6 +130,7 @@
placeholder="请选择主管单位" placeholder="请选择主管单位"
no-options-text="暂无数据" no-options-text="暂无数据"
no-children-text="暂无数据" no-children-text="暂无数据"
@input="handleDepartmentChange"
/> />
</el-form-item> </el-form-item>
<el-form-item label="主管单位地址" prop="SUPERVISING_UNIT_ADDRESS"> <el-form-item label="主管单位地址" prop="SUPERVISING_UNIT_ADDRESS">
@ -143,6 +157,38 @@
<el-button type="primary" @click="confirm"> </el-button> <el-button type="primary" @click="confirm"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 坐标选择 -->
<el-dialog :visible.sync="dialogFormMap" title="编辑坐标" width="800px" class="dy-dialog">
<baidu-map
v-loading="loadingMap"
:zoom="zoom"
:scroll-wheel-zoom="true"
:style="{height: clientHeight+'px'}"
@click="getClickInfo"
@ready="handler">
<bm-view style="width: 100%; height:100%; flex: 1" />
<bm-control ref="control" :offset="{width: 10, height: 10}" anchor="BMAP_ANCHOR_TOP_LEFT">
<div class="map-flex">
<div class="map-lable">关键词</div>
<div style="flex:1;">
<el-autocomplete v-model="addressKeyword" :fetch-suggestions="querySearch" :trigger-on-focus="false" placeholder="请输入详细地址" style="width:100%" @select="handleSelect" />
</div>
<!-- <el-input v-model="addressKeyword" style="width: 200px" placeholder="请输入内容" />-->
<!-- <el-button slot="append" icon="el-icon-search" @click="mapNameChange"/>-->
</div>
</bm-control>
<!-- <bm-local-search :keyword="addressKeyword" :auto-viewport="true"/>-->
</baidu-map>
<div slot="footer" class="dialog-footer">
<span>经度</span>
<el-input v-model="LONGITUDE" style="width: 200px" placeholder="请输入内容" disabled />
<span>纬度</span>
<el-input v-model="LATITUDE" style="width: 200px" placeholder="请输入内容" disabled />
<el-button @click="dialogFormMap = false"> </el-button>
<el-button type="primary" @click="setPosition"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -155,6 +201,21 @@ export default {
components: { Treeselect, Pagination }, components: { Treeselect, Pagination },
data() { data() {
return { return {
//
CORPINFO_ID: this.$parent.CORPINFO_ID,
clientHeight: 600,
loadingMap: true,
listLoading: false,
buttonloading: false,
BMap: '',
map: '',
showMap: false,
addressKeyword: '',
pointLngLat: '',
zoom: 10,
dialogFormMap: false,
LATITUDE: '',
LONGITUDE: '',
listQuery: { listQuery: {
page: 1, page: 1,
limit: 10 limit: 10
@ -189,6 +250,7 @@ export default {
CONTACT_HOME_PHONE: '', CONTACT_HOME_PHONE: '',
CONTACT_EMAIL: '', CONTACT_EMAIL: '',
SUPERVISING_UNIT: '', SUPERVISING_UNIT: '',
SUPERVISING_UNIT_NAME: '',
SUPERVISING_UNIT_ADDRESS: '', SUPERVISING_UNIT_ADDRESS: '',
COMPANY_OVERVIEW: '', COMPANY_OVERVIEW: '',
PASSENGER_TRANSPORT_CAPACITY: '', PASSENGER_TRANSPORT_CAPACITY: '',
@ -325,6 +387,12 @@ export default {
this.getDepartmentList() this.getDepartmentList()
}, },
methods: { methods: {
handleDepartmentChange(value) {
const selectedDepartment = this.DepartmentData.find(department => department.id === value)
if (selectedDepartment) {
this.form.SUPERVISING_UNIT_NAME = selectedDepartment.label
}
},
resetQuery() { resetQuery() {
this.KEYWORDS_ORG_NAME = '' this.KEYWORDS_ORG_NAME = ''
this.KEYWORDS_ORG_TYPE = '' this.KEYWORDS_ORG_TYPE = ''
@ -355,6 +423,124 @@ export default {
console.error('获取树形数据失败', e) console.error('获取树形数据失败', e)
}) })
}, },
//* *******************************
//
mapOpen() {
this.top = this.getScrollTop()
if (this.top) {
this.setScrollTop(0)
}
},
//
mapClose() {
this.setScrollTop(this.top)
this.top = 0
this.showMap = false
},
getScrollTop() {
let scrollTop = 0
if (document.documentElement && document.documentElement.scrollTop) {
scrollTop = document.documentElement.scrollTop
} else if (document.body) {
scrollTop = document.body.scrollTop
}
return scrollTop
},
setScrollTop(top) {
if (!isNaN(top)) {
if (document.documentElement && document.documentElement.scrollTop !== undefined) {
document.documentElement.scrollTop = top
} else if (document.body) {
document.body.scrollTop = top
}
}
},
//
handler({ BMap, map }) {
this.mapOpen()
this.BMap = BMap
this.map = map
this.loadingMap = true
var geolocation = new BMap.Geolocation()
const myGeo = new BMap.Geocoder()
var $this = this
// api
geolocation.getCurrentPosition(function(r) {
myGeo.getLocation(new BMap.Point(r.point.lng, r.point.lat), function(result) {
if (result) {
$this.loadingMap = false
$this.$set($this, 'pointLngLat', { lng: result.point.lng, lat: result.point.lat })
map.enableScrollWheelZoom(true) // ,
$this.setCenter({ BMap, map })
}
})
})
},
//
querySearch(queryString, cb) {
var options = {
onSearchComplete: function(results) {
if (local.getStatus() === 0) {
//
var s = []
for (var i = 0; i < results.getCurrentNumPois(); i++) {
var x = results.getPoi(i)
var item = { value: x.address + x.title, point: x.point }
s.push(item)
cb(s)
}
} else {
cb()
}
}
}
var local = new this.BMap.LocalSearch(this.map, options)
local.search(queryString)
},
handleSelect(item) {
var { point } = item
this.map.clearOverlays() //
this.map.centerAndZoom(point, this.zoom)
const marker = new this.BMap.Marker(point) //
this.map.addOverlay(marker) //
marker.enableDragging() //
this.LONGITUDE = point.lng
this.LATITUDE = point.lat
},
//
setCenter({ BMap, map }) {
var lng = ''
var lat = ''
if (this.form.LONGITUDE == '' || this.form.LATITUDE == '') {
lng = '119.525971'
lat = '39.894727'
} else {
lng = this.form.LONGITUDE
lat = this.form.LATITUDE
}
var point = new BMap.Point(lng, lat)
// var point = new BMap.Point(this.form.LONGITUDE, this.form.LATITUDE)
const zoom = map.getZoom()
setTimeout(() => {
map.centerAndZoom(point, zoom)
}, 0)
// var marker = new BMap.Marker(point) //
// map.addOverlay(marker) //
},
handleMap() {
this.dialogFormMap = true
this.LATITUDE = this.form.LATITUDE
this.LONGITUDE = this.form.LONGITUDE
},
getClickInfo(e) {
this.LONGITUDE = e.point.lng
this.LATITUDE = e.point.lat
},
setPosition() {
this.dialogFormMap = false
this.form.LATITUDE = this.LATITUDE
this.form.LONGITUDE = this.LONGITUDE
},
//* ************************************************* //* *************************************************
getList() { getList() {
@ -410,6 +596,7 @@ export default {
CONTACT_HOME_PHONE: data.CONTACT_HOME_PHONE, CONTACT_HOME_PHONE: data.CONTACT_HOME_PHONE,
CONTACT_EMAIL: data.CONTACT_EMAIL, CONTACT_EMAIL: data.CONTACT_EMAIL,
SUPERVISING_UNIT: data.SUPERVISING_UNIT, SUPERVISING_UNIT: data.SUPERVISING_UNIT,
SUPERVISING_UNIT_NAME: data.SUPERVISING_UNIT_NAME,
SUPERVISING_UNIT_ADDRESS: data.SUPERVISING_UNIT_ADDRESS, SUPERVISING_UNIT_ADDRESS: data.SUPERVISING_UNIT_ADDRESS,
COMPANY_OVERVIEW: data.COMPANY_OVERVIEW, COMPANY_OVERVIEW: data.COMPANY_OVERVIEW,
PASSENGER_TRANSPORT_CAPACITY: data.PASSENGER_TRANSPORT_CAPACITY, PASSENGER_TRANSPORT_CAPACITY: data.PASSENGER_TRANSPORT_CAPACITY,
@ -425,6 +612,8 @@ export default {
handleAdd() { handleAdd() {
this.dialogFormEdit = true this.dialogFormEdit = true
this.form = {} this.form = {}
this.form.LONGITUDE = ''
this.form.LATITUDE = ''
this.dialogType = 'saveUser' this.dialogType = 'saveUser'
this.$refs.upload.clearFiles() this.$refs.upload.clearFiles()
}, },