|
|
@ -60,22 +60,38 @@ |
|
|
|
:max="9999" |
|
|
|
label="容纳人数"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="负责人" |
|
|
|
style="display: block" |
|
|
|
label-width="150px" |
|
|
|
prop="principal"> |
|
|
|
<el-input v-model="formData.principal" |
|
|
|
class="item_width_1" |
|
|
|
placeholder="请输入负责人姓名"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="联系电话" |
|
|
|
style="display: block" |
|
|
|
label-width="150px" |
|
|
|
prop="mobile"> |
|
|
|
<el-input v-model="formData.mobile" |
|
|
|
class="item_width_1" |
|
|
|
placeholder="请输入联系电话"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="地址" |
|
|
|
prop="address" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<div class="item_width_1"> |
|
|
|
<el-input |
|
|
|
style="width:420px" |
|
|
|
:placeholder="'请输入所在地址'" |
|
|
|
v-model="formData.address"> |
|
|
|
<el-input style="width:420px" |
|
|
|
:placeholder="'请输入所在地址'" |
|
|
|
v-model="formData.address"> |
|
|
|
</el-input> |
|
|
|
<el-button |
|
|
|
style="margin-left: 10px" |
|
|
|
type="default" |
|
|
|
size="small" |
|
|
|
@click="handleSearchMap">查询</el-button> |
|
|
|
<div id="app" class="div_map"></div> |
|
|
|
<el-button style="margin-left: 10px" |
|
|
|
type="default" |
|
|
|
size="small" |
|
|
|
@click="handleSearchMap">查询</el-button> |
|
|
|
<div id="app" |
|
|
|
class="div_map"></div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
@ -94,357 +110,359 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
import { Loading } from 'element-ui' // 引入Loading服务 |
|
|
|
import { requestPost } from '@/js/dai/request' |
|
|
|
|
|
|
|
|
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
import { Loading } from 'element-ui' // 引入Loading服务 |
|
|
|
import { requestPost } from '@/js/dai/request' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var map |
|
|
|
var search |
|
|
|
var markers |
|
|
|
var infoWindowList |
|
|
|
var geocoder // 新建一个正逆地址解析类 |
|
|
|
|
|
|
|
let loading // 加载动画 |
|
|
|
export default { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
formType: 'add', //表单操作类型 add新增,edit编辑,detail详情 |
|
|
|
|
|
|
|
btnDisable: false, |
|
|
|
|
|
|
|
icPublicServiceId: '', |
|
|
|
keyWords: '', |
|
|
|
formData: { |
|
|
|
name: '',//场所名称 |
|
|
|
category: '', |
|
|
|
areaCovered: '',//占地面积 |
|
|
|
capacity: '',//容纳人数 |
|
|
|
address: '', //详细地址 |
|
|
|
longitude: 36.0722275, //经度 |
|
|
|
latitude: 120.38945519, //纬度 |
|
|
|
principal: '', |
|
|
|
mobile: '' |
|
|
|
}, |
|
|
|
serviceList: [],//服务list |
|
|
|
publicServiceData: {}, |
|
|
|
} |
|
|
|
}, |
|
|
|
components: {}, |
|
|
|
mounted () { |
|
|
|
this.initMap() |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
|
|
|
|
async initForm (type, icPublicServiceId) { |
|
|
|
this.startLoading() |
|
|
|
this.$refs.ref_form.resetFields(); |
|
|
|
|
|
|
|
//获取服务事项 |
|
|
|
await this.loadService() |
|
|
|
|
|
|
|
this.formType = type |
|
|
|
if (icPublicServiceId) { |
|
|
|
this.icPublicServiceId = icPublicServiceId |
|
|
|
this.formData.icPublicServiceId = icPublicServiceId |
|
|
|
await this.loadFormData() |
|
|
|
} else { |
|
|
|
// map.setCenter(new TMap.LatLng(36.0722275, 120.38945519)) |
|
|
|
// this.setMarker(36.0722275, 120.38945519) |
|
|
|
} |
|
|
|
|
|
|
|
var map |
|
|
|
var search |
|
|
|
var markers |
|
|
|
var infoWindowList |
|
|
|
var geocoder // 新建一个正逆地址解析类 |
|
|
|
this.endLoading() |
|
|
|
|
|
|
|
let loading // 加载动画 |
|
|
|
export default { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
formType: 'add', //表单操作类型 add新增,edit编辑,detail详情 |
|
|
|
|
|
|
|
btnDisable: false, |
|
|
|
|
|
|
|
icPublicServiceId: '', |
|
|
|
keyWords: '', |
|
|
|
formData: { |
|
|
|
name: '',//场所名称 |
|
|
|
category: '', |
|
|
|
areaCovered: '',//占地面积 |
|
|
|
capacity: '',//容纳人数 |
|
|
|
address: '', //详细地址 |
|
|
|
longitude: 36.0722275, //经度 |
|
|
|
latitude: 120.38945519 //纬度 |
|
|
|
}, |
|
|
|
serviceList: [],//服务list |
|
|
|
publicServiceData: {}, |
|
|
|
} |
|
|
|
}, |
|
|
|
components: {}, |
|
|
|
mounted () { |
|
|
|
this.initMap() |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
|
|
|
|
async initForm (type, icPublicServiceId) { |
|
|
|
this.startLoading() |
|
|
|
this.$refs.ref_form.resetFields(); |
|
|
|
//获取服务事项下拉框 |
|
|
|
async loadService () { |
|
|
|
const url = "/gov/org/coverage/dict-select-list/public_service" |
|
|
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/coverage/dict-select-list/public_service" |
|
|
|
let params = { |
|
|
|
} |
|
|
|
|
|
|
|
//获取服务事项 |
|
|
|
await this.loadService() |
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
|
|
|
|
this.formType = type |
|
|
|
if (icPublicServiceId) { |
|
|
|
this.icPublicServiceId = icPublicServiceId |
|
|
|
this.formData.icPublicServiceId = icPublicServiceId |
|
|
|
await this.loadFormData() |
|
|
|
} else { |
|
|
|
// map.setCenter(new TMap.LatLng(36.0722275, 120.38945519)) |
|
|
|
// this.setMarker(36.0722275, 120.38945519) |
|
|
|
} |
|
|
|
if (code === 0) { |
|
|
|
this.serviceList = data |
|
|
|
|
|
|
|
this.endLoading() |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
//获取服务事项下拉框 |
|
|
|
async loadService () { |
|
|
|
const url = "/gov/org/coverage/dict-select-list/public_service" |
|
|
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/coverage/dict-select-list/public_service" |
|
|
|
let params = { |
|
|
|
//加载组织 |
|
|
|
async loadFormData () { |
|
|
|
const url = '/gov/org/icPublicService/detail' |
|
|
|
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/icPublicService/detail' |
|
|
|
let params = { |
|
|
|
icPublicServiceId: this.icPublicServiceId |
|
|
|
} |
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
if (code === 0) { |
|
|
|
console.log(data) |
|
|
|
if (null != data) { |
|
|
|
data: this.publicServiceData |
|
|
|
} |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.serviceList = data |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
this.formData = { ...data } |
|
|
|
// let { latitude, longitude } = this.$store.state.user; |
|
|
|
// const lat = this.formData.latitude === null || this.formData.latitude === '' ? '' : this.formData.latitude; |
|
|
|
// const lon = this.formData.longitude === null || this.formData.longitude === '' ? '' : this.formData.longitude; |
|
|
|
if (this.formData.latitude !== null && this.formData.latitude !== '' && this.formData.longitude !== null && this.formData.longitude !== '') { |
|
|
|
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude)) |
|
|
|
this.setMarker(this.formData.latitude, this.formData.longitude) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//加载组织 |
|
|
|
async loadFormData () { |
|
|
|
const url = '/gov/org/icPublicService/detail' |
|
|
|
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/icPublicService/detail' |
|
|
|
let params = { |
|
|
|
icPublicServiceId: this.icPublicServiceId |
|
|
|
} |
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
if (code === 0) { |
|
|
|
console.log(data) |
|
|
|
if (null != data) { |
|
|
|
data: this.publicServiceData |
|
|
|
} |
|
|
|
|
|
|
|
this.formData = { ...data } |
|
|
|
// let { latitude, longitude } = this.$store.state.user; |
|
|
|
// const lat = this.formData.latitude === null || this.formData.latitude === '' ? '' : this.formData.latitude; |
|
|
|
// const lon = this.formData.longitude === null || this.formData.longitude === '' ? '' : this.formData.longitude; |
|
|
|
if (this.formData.latitude !== null && this.formData.latitude !== '' && this.formData.longitude !== null && this.formData.longitude !== ''){ |
|
|
|
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude)) |
|
|
|
this.setMarker(this.formData.latitude, this.formData.longitude) |
|
|
|
} |
|
|
|
async handleComfirm () { |
|
|
|
|
|
|
|
this.btnDisable = true |
|
|
|
setTimeout(() => { |
|
|
|
this.btnDisable = false |
|
|
|
}, 10000) |
|
|
|
this.$refs['ref_form'].validate((valid, messageObj) => { |
|
|
|
if (!valid) { |
|
|
|
app.util.validateRule(messageObj) |
|
|
|
this.btnDisable = false |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
this.addUnit() |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
async handleComfirm () { |
|
|
|
|
|
|
|
this.btnDisable = true |
|
|
|
setTimeout(() => { |
|
|
|
this.btnDisable = false |
|
|
|
}, 10000) |
|
|
|
this.$refs['ref_form'].validate((valid, messageObj) => { |
|
|
|
if (!valid) { |
|
|
|
app.util.validateRule(messageObj) |
|
|
|
this.btnDisable = false |
|
|
|
} else { |
|
|
|
this.addUnit() |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
async addUnit () { |
|
|
|
let url = '' |
|
|
|
if (this.formType === 'add') { |
|
|
|
url = '/gov/org/icPublicService/add' |
|
|
|
} else { |
|
|
|
url = '/gov/org/icPublicService/edit' |
|
|
|
} |
|
|
|
const { data, code, msg, internalMsg } = await requestPost(url, this.formData) |
|
|
|
if (code === 0) { |
|
|
|
this.$message({ |
|
|
|
type: 'success', |
|
|
|
message: '操作成功' |
|
|
|
}) |
|
|
|
this.resetData() |
|
|
|
this.$emit('dialogOk') |
|
|
|
this.btnDisable = false |
|
|
|
} else { |
|
|
|
this.btnDisable = false |
|
|
|
this.$message.error(internalMsg) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
async addUnit () { |
|
|
|
let url = '' |
|
|
|
if (this.formType === 'add'){ |
|
|
|
url = '/gov/org/icPublicService/add' |
|
|
|
}else { |
|
|
|
url = '/gov/org/icPublicService/edit' |
|
|
|
} |
|
|
|
const { data, code, msg,internalMsg } = await requestPost(url, this.formData) |
|
|
|
if (code === 0) { |
|
|
|
this.$message({ |
|
|
|
type: 'success', |
|
|
|
message: '操作成功' |
|
|
|
}) |
|
|
|
this.resetData() |
|
|
|
this.$emit('dialogOk') |
|
|
|
this.btnDisable = false |
|
|
|
} else { |
|
|
|
this.btnDisable = false |
|
|
|
this.$message.error(internalMsg) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
handleCancle () { |
|
|
|
this.resetData() |
|
|
|
this.$emit('dialogCancle') |
|
|
|
|
|
|
|
handleCancle () { |
|
|
|
this.resetData() |
|
|
|
this.$emit('dialogCancle') |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|
|
|
initMap () { |
|
|
|
let { latitude, longitude } = this.$store.state.user; |
|
|
|
console.log('lat' + latitude + ',lon' + longitude) |
|
|
|
if (!latitude || latitude == "" || latitude == "0") { |
|
|
|
latitude = 39.9088810666821; |
|
|
|
longitude = 116.39743841556731; |
|
|
|
} |
|
|
|
// 定义地图中心点坐标 |
|
|
|
var center = new window.TMap.LatLng(latitude, longitude); |
|
|
|
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|
|
|
map = new window.TMap.Map(document.getElementById('app'), { |
|
|
|
center: center, // 设置地图中心点坐标 |
|
|
|
zoom: 17.2, // 设置地图缩放级别 |
|
|
|
pitch: 43.5, // 设置俯仰角 |
|
|
|
rotation: 45 // 设置地图旋转角度 |
|
|
|
}) |
|
|
|
|
|
|
|
search = new window.TMap.service.Search({ pageSize: 10 }) |
|
|
|
// 新建一个地点搜索类 |
|
|
|
markers = new TMap.MultiMarker({ |
|
|
|
map: map, |
|
|
|
geometries: [] |
|
|
|
}) |
|
|
|
infoWindowList = Array(10) |
|
|
|
|
|
|
|
geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类 |
|
|
|
|
|
|
|
// 监听地图平移结束 |
|
|
|
map.on('panend', () => { |
|
|
|
this.handleMoveCenter() |
|
|
|
}) |
|
|
|
// this.handleMoveCenter() |
|
|
|
this.convert() |
|
|
|
}, |
|
|
|
|
|
|
|
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|
|
|
initMap () { |
|
|
|
let { latitude, longitude } = this.$store.state.user; |
|
|
|
console.log('lat'+latitude+',lon'+longitude) |
|
|
|
if (!latitude || latitude == "" || latitude == "0") { |
|
|
|
latitude = 39.9088810666821; |
|
|
|
longitude = 116.39743841556731; |
|
|
|
setMarker (lat, lng) { |
|
|
|
markers.setGeometries([]) |
|
|
|
markers.add([ |
|
|
|
{ |
|
|
|
id: '4', |
|
|
|
styleId: 'marker', |
|
|
|
position: new TMap.LatLng(lat, lng), |
|
|
|
properties: { |
|
|
|
title: 'marker4' |
|
|
|
} |
|
|
|
} |
|
|
|
// 定义地图中心点坐标 |
|
|
|
var center = new window.TMap.LatLng(latitude, longitude); |
|
|
|
// 定义map变量,调用 TMap.Map() 构造函数创建地图 |
|
|
|
map = new window.TMap.Map(document.getElementById('app'), { |
|
|
|
center: center, // 设置地图中心点坐标 |
|
|
|
zoom: 17.2, // 设置地图缩放级别 |
|
|
|
pitch: 43.5, // 设置俯仰角 |
|
|
|
rotation: 45 // 设置地图旋转角度 |
|
|
|
}) |
|
|
|
|
|
|
|
search = new window.TMap.service.Search({ pageSize: 10 }) |
|
|
|
// 新建一个地点搜索类 |
|
|
|
markers = new TMap.MultiMarker({ |
|
|
|
map: map, |
|
|
|
geometries: [] |
|
|
|
}) |
|
|
|
infoWindowList = Array(10) |
|
|
|
|
|
|
|
geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类 |
|
|
|
]) |
|
|
|
}, |
|
|
|
|
|
|
|
// 监听地图平移结束 |
|
|
|
map.on('panend', () => { |
|
|
|
this.handleMoveCenter() |
|
|
|
handleSearchMap () { |
|
|
|
infoWindowList.forEach((infoWindow) => { |
|
|
|
infoWindow.close() |
|
|
|
}) |
|
|
|
infoWindowList.length = 0 |
|
|
|
markers.setGeometries([]) |
|
|
|
// 在地图显示范围内以给定的关键字搜索地点 |
|
|
|
search |
|
|
|
.searchRectangle({ |
|
|
|
keyword: this.formData.address, |
|
|
|
bounds: map.getBounds() |
|
|
|
}) |
|
|
|
// this.handleMoveCenter() |
|
|
|
this.convert() |
|
|
|
}, |
|
|
|
|
|
|
|
setMarker (lat, lng) { |
|
|
|
markers.setGeometries([]) |
|
|
|
markers.add([ |
|
|
|
{ |
|
|
|
id: '4', |
|
|
|
styleId: 'marker', |
|
|
|
position: new TMap.LatLng(lat, lng), |
|
|
|
properties: { |
|
|
|
title: 'marker4' |
|
|
|
} |
|
|
|
.then((result) => { |
|
|
|
let { data } = result |
|
|
|
if (Array.isArray(data) && data.length > 0) { |
|
|
|
const { |
|
|
|
location: { lat, lng } |
|
|
|
} = data[0] |
|
|
|
|
|
|
|
|
|
|
|
map.setCenter(new TMap.LatLng(lat, lng)) |
|
|
|
this.setMarker(lat, lng) |
|
|
|
this.formData.latitude = lat |
|
|
|
this.formData.longitude = lng |
|
|
|
this.convert() |
|
|
|
} else { |
|
|
|
this.$message.error('未检索到相关位置坐标') |
|
|
|
} |
|
|
|
]) |
|
|
|
}, |
|
|
|
|
|
|
|
handleSearchMap () { |
|
|
|
infoWindowList.forEach((infoWindow) => { |
|
|
|
infoWindow.close() |
|
|
|
}) |
|
|
|
infoWindowList.length = 0 |
|
|
|
markers.setGeometries([]) |
|
|
|
// 在地图显示范围内以给定的关键字搜索地点 |
|
|
|
search |
|
|
|
.searchRectangle({ |
|
|
|
keyword: this.formData.address, |
|
|
|
bounds: map.getBounds() |
|
|
|
}) |
|
|
|
.then((result) => { |
|
|
|
let { data } = result |
|
|
|
if (Array.isArray(data) && data.length > 0) { |
|
|
|
const { |
|
|
|
location: { lat, lng } |
|
|
|
} = data[0] |
|
|
|
|
|
|
|
|
|
|
|
map.setCenter(new TMap.LatLng(lat, lng)) |
|
|
|
this.setMarker(lat, lng) |
|
|
|
this.formData.latitude = lat |
|
|
|
this.formData.longitude = lng |
|
|
|
this.convert() |
|
|
|
} else { |
|
|
|
this.$message.error('未检索到相关位置坐标') |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
handleMoveCenter () { |
|
|
|
//修改地图中心点 |
|
|
|
const center = map.getCenter() |
|
|
|
const lat = center.getLat() |
|
|
|
const lng = center.getLng() |
|
|
|
this.formData.latitude = lat |
|
|
|
this.formData.longitude = lng |
|
|
|
this.setMarker(lat, lng) |
|
|
|
this.convert(lat, lng) |
|
|
|
}, |
|
|
|
handleMoveCenter () { |
|
|
|
//修改地图中心点 |
|
|
|
const center = map.getCenter() |
|
|
|
const lat = center.getLat() |
|
|
|
const lng = center.getLng() |
|
|
|
this.formData.latitude = lat |
|
|
|
this.formData.longitude = lng |
|
|
|
this.setMarker(lat, lng) |
|
|
|
this.convert(lat, lng) |
|
|
|
}, |
|
|
|
|
|
|
|
convert (lat, lng) { |
|
|
|
markers.setGeometries([]); |
|
|
|
// var input = document.getElementById('location').value.split(','); |
|
|
|
let location |
|
|
|
if (lat && lng) { |
|
|
|
location = new TMap.LatLng(lat, lng); |
|
|
|
} else { |
|
|
|
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude); |
|
|
|
} |
|
|
|
convert (lat, lng) { |
|
|
|
markers.setGeometries([]); |
|
|
|
// var input = document.getElementById('location').value.split(','); |
|
|
|
let location |
|
|
|
if (lat && lng) { |
|
|
|
location = new TMap.LatLng(lat, lng); |
|
|
|
} else { |
|
|
|
location = new TMap.LatLng(this.formData.latitude, this.formData.longitude); |
|
|
|
} |
|
|
|
|
|
|
|
// map.setCenter(location); |
|
|
|
markers.updateGeometries([ |
|
|
|
{ |
|
|
|
id: 'main', // 点标注数据数组 |
|
|
|
position: location, |
|
|
|
}, |
|
|
|
]); |
|
|
|
geocoder |
|
|
|
.getAddress({ location: location }) // 将给定的坐标位置转换为地址 |
|
|
|
.then((result) => { |
|
|
|
console.log(this.formData) |
|
|
|
// this.formData.address = result.result.address === '' || result.result.address === null ? this.formData.address : result.result.address |
|
|
|
this.formData.address = this.formData.address !== '' && this.formData.address !== null && (this.formData.longitude === '' || this.formData.longitude === null) ? this.formData.address : result.result.address |
|
|
|
// 显示搜索到的地址 |
|
|
|
}); |
|
|
|
}, |
|
|
|
// map.setCenter(location); |
|
|
|
markers.updateGeometries([ |
|
|
|
{ |
|
|
|
id: 'main', // 点标注数据数组 |
|
|
|
position: location, |
|
|
|
}, |
|
|
|
]); |
|
|
|
geocoder |
|
|
|
.getAddress({ location: location }) // 将给定的坐标位置转换为地址 |
|
|
|
.then((result) => { |
|
|
|
console.log(this.formData) |
|
|
|
// this.formData.address = result.result.address === '' || result.result.address === null ? this.formData.address : result.result.address |
|
|
|
this.formData.address = this.formData.address !== '' && this.formData.address !== null && (this.formData.longitude === '' || this.formData.longitude === null) ? this.formData.address : result.result.address |
|
|
|
// 显示搜索到的地址 |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
resetData () { |
|
|
|
this.icPublicServiceId = '' |
|
|
|
this.keyWords = '' |
|
|
|
this.formData = { |
|
|
|
name: '', |
|
|
|
category: '', |
|
|
|
areaCovered: '', |
|
|
|
capacity: '', |
|
|
|
address: '', //详细地址 |
|
|
|
longitude: '', //经度 |
|
|
|
latitude: '' //纬度 |
|
|
|
} |
|
|
|
}, |
|
|
|
// 开启加载动画 |
|
|
|
startLoading () { |
|
|
|
loading = Loading.service({ |
|
|
|
lock: true, // 是否锁定 |
|
|
|
text: '正在加载……', // 加载中需要显示的文字 |
|
|
|
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 结束加载动画 |
|
|
|
endLoading () { |
|
|
|
// clearTimeout(timer); |
|
|
|
if (loading) { |
|
|
|
loading.close() |
|
|
|
} |
|
|
|
resetData () { |
|
|
|
this.icPublicServiceId = '' |
|
|
|
this.keyWords = '' |
|
|
|
this.formData = { |
|
|
|
name: '', |
|
|
|
category: '', |
|
|
|
areaCovered: '', |
|
|
|
capacity: '', |
|
|
|
address: '', //详细地址 |
|
|
|
longitude: '', //经度 |
|
|
|
latitude: '' //纬度 |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
dataRule () { |
|
|
|
return { |
|
|
|
|
|
|
|
name: [ |
|
|
|
{ required: true, message: '场所名称不能为空', trigger: 'blur' }, |
|
|
|
], |
|
|
|
category: [ |
|
|
|
{ required: true, message: '场所类别不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
address: [ |
|
|
|
{ required: true, message: '地址不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
/*longitude: [ |
|
|
|
{ required: true, message: '坐标不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
latitude: [ |
|
|
|
{ required: true, message: '坐标不能为空', trigger: 'blur' } |
|
|
|
]*/ |
|
|
|
} |
|
|
|
}, |
|
|
|
// 开启加载动画 |
|
|
|
startLoading () { |
|
|
|
loading = Loading.service({ |
|
|
|
lock: true, // 是否锁定 |
|
|
|
text: '正在加载……', // 加载中需要显示的文字 |
|
|
|
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 结束加载动画 |
|
|
|
endLoading () { |
|
|
|
// clearTimeout(timer); |
|
|
|
if (loading) { |
|
|
|
loading.close() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
dataRule () { |
|
|
|
return { |
|
|
|
|
|
|
|
name: [ |
|
|
|
{ required: true, message: '场所名称不能为空', trigger: 'blur' }, |
|
|
|
], |
|
|
|
category: [ |
|
|
|
{ required: true, message: '场所类别不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
address: [ |
|
|
|
{ required: true, message: '地址不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
/*longitude: [ |
|
|
|
{ required: true, message: '坐标不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
latitude: [ |
|
|
|
{ required: true, message: '坐标不能为空', trigger: 'blur' } |
|
|
|
]*/ |
|
|
|
} |
|
|
|
}, |
|
|
|
props: { |
|
|
|
|
|
|
|
typeList: { |
|
|
|
type: Array, |
|
|
|
default: [] |
|
|
|
}, |
|
|
|
}, |
|
|
|
props: { |
|
|
|
|
|
|
|
typeList: { |
|
|
|
type: Array, |
|
|
|
default: [] |
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style scoped> |
|
|
|
.div_map { |
|
|
|
position: relative; |
|
|
|
} |
|
|
|
.div_searchmap { |
|
|
|
z-index: 5000; |
|
|
|
position: absolute; |
|
|
|
top: 5px; |
|
|
|
left: 5px; |
|
|
|
} |
|
|
|
.div_map { |
|
|
|
position: relative; |
|
|
|
} |
|
|
|
.div_searchmap { |
|
|
|
z-index: 5000; |
|
|
|
position: absolute; |
|
|
|
top: 5px; |
|
|
|
left: 5px; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|
|
|
|
<style lang="scss" scoped > |
|
|
|
@import "@/assets/scss/modules/visual/communityManageForm.scss"; |
|
|
|
@import "@/assets/scss/modules/visual/communityManageForm.scss"; |
|
|
|
</style> |
|
|
|