Browse Source

代码规范修改

master
zhangyongzhangyong 6 years ago
parent
commit
10fda6c50c
  1. 352
      src/views/modules/heart/actinfo-add-or-update.vue
  2. 13
      src/views/modules/heart/actinfo-list.vue
  3. 430
      src/views/modules/heart/map-select.vue

352
src/views/modules/heart/actinfo-add-or-update.vue

@ -289,12 +289,12 @@ export default {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id:"", id: '',
title: '', title: '',
headPic: '', headPic: '',
signupStartTime: '', signupStartTime: '',
signupEndTime: '', signupEndTime: '',
actQuotaCategory:'1', actQuotaCategory: '1',
actStartTime: '', actStartTime: '',
actEndTime: '', actEndTime: '',
actAddress: '', actAddress: '',
@ -317,88 +317,87 @@ export default {
deptId: '', deptId: '',
punishmentPoints: '', punishmentPoints: '',
reward: '', reward: '',
isBanner:"1", isBanner: '1',
actUserDefaultState: '1', actUserDefaultState: '1',
bannerUrl:"" bannerUrl: ''
}, },
isSignupEndTime: { isSignupEndTime: {
disabledDate(time) { disabledDate (time) {
return time < Date.now() - 8.64e7;//8.64e7=1000*60*60*24 return time < Date.now() - 8.64e7 // 8.64e7=1000*60*60*24
}
},
isImgRequired: true,
mapSelectVisible: false,
signInIsAble: true,
isAble: false,
loading: false,
//
quillEditor: null,
quillEditorToolbarOptions: [
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block', 'image'],
[{ 'header': 1 }, { 'header': 2 }],
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
[{ 'script': 'sub' }, { 'script': 'super' }],
[{ 'indent': '-1' }, { 'indent': '+1' }],
[{ 'direction': 'rtl' }],
[{ 'size': ['small', false, 'large', 'huge'] }],
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }],
[{ 'font': [] }],
[{ 'align': [] }],
['clean']
],
uploadUrl: '',
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.actStartTime
if (beginDateVal) {
return time.getTime() > new Date(beginDateVal).getTime()
}
}
},
pickerBeginSignInDateAfter: {
disabledDate: (time) => {
let EndDateVal = this.dataForm.signinEndTime
if (EndDateVal) {
return time.getTime() < new Date(EndDateVal).getTime()
} }
},
isImgRequired: true,
mapSelectVisible:false,
signInIsAble: true,
isAble: false,
loading: false,
//
quillEditor: null,
quillEditorToolbarOptions: [
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block', 'image'],
[{ 'header': 1 }, { 'header': 2 }],
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
[{ 'script': 'sub' }, { 'script': 'super' }],
[{ 'indent': '-1' }, { 'indent': '+1' }],
[{ 'direction': 'rtl' }],
[{ 'size': ['small', false, 'large', 'huge'] }],
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }],
[{ 'font': [] }],
[{ 'align': [] }],
['clean']
],
uploadUrl: '',
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.actStartTime
if (beginDateVal) {
return time.getTime() > new Date(beginDateVal).getTime()
}
}
},
pickerBeginSignInDateAfter: {
disabledDate: (time) => {
let EndDateVal = this.dataForm.signinEndTime
if (EndDateVal) {
return time.getTime() < new Date(EndDateVal).getTime()
}
}
},
pickerBeginDateAfter: {
disabledDate: (time) => {
let EndDateVal = this.dataForm.actEndTime
if (EndDateVal) {
return time.getTime() < new Date(EndDateVal).getTime()
}
}
} }
},
pickerBeginDateAfter: {
disabledDate: (time) => {
let EndDateVal = this.dataForm.actEndTime
if (EndDateVal) {
return time.getTime() < new Date(EndDateVal).getTime()
}
}
}
} }
}, },
created () { created () {
this.$http this.$http
.get(`/sys/user/deptOptions/getByLoginUser`) .get(`/sys/user/deptOptions/getByLoginUser`)
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.options = res.data.options this.options = res.data.options
}) })
.catch(() => {}) .catch(() => {})
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
// //
this.hideUpload = false this.hideUpload = false
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}` this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
if (this.quillEditor) { if (this.quillEditor) {
this.quillEditor.deleteText(0, this.quillEditor.getLength()) this.quillEditor.deleteText(0, this.quillEditor.getLength())
} else { } else {
this.quillEditorHandle() this.quillEditorHandle()
} }
// end // end
}) })
}, },
computed: { computed: {
dataRule () { dataRule () {
return { return {
@ -525,10 +524,9 @@ export default {
} }
}, },
backToActList () { backToActList () {
this.$emit('refreshDataList') this.$emit('refreshDataList')
this.$parent.selectComponent = 'ActInfoList' this.$parent.selectComponent = 'ActInfoList'
this.$router.push({ path: '/heart-actinfo'}) this.$router.push({ path: '/heart-actinfo'})
}, },
init () { init () {
this.visible = true this.visible = true
@ -539,60 +537,60 @@ export default {
} }
}) })
}, },
position(position){ position(position){
if(position.type == 1 ){ if(position.type == 1 ){
this.dataForm.actAddress = position.address; this.dataForm.actAddress = position.address
this.dataForm.actLatitude = position.latitude; this.dataForm.actLatitude = position.latitude
this.dataForm.actLongitude = position.longitude; this.dataForm.actLongitude = position.longitude
this.dataForm.signinAddress = position.address; this.dataForm.signinAddress = position.address
this.dataForm.signinLatitude = position.latitude; this.dataForm.signinLatitude = position.latitude
this.dataForm.signinLongitude = position.longitude; this.dataForm.signinLongitude = position.longitude
} else { } else {
this.dataForm.signinAddress = position.address; this.dataForm.signinAddress = position.address
this.dataForm.signinLatitude = position.latitude; this.dataForm.signinLatitude = position.latitude
this.dataForm.signinLongitude = position.longitude; this.dataForm.signinLongitude = position.longitude
}
},
//
quillEditorHandle () {
this.quillEditor = new Quill('#J_quillEditor', {
modules: {
toolbar: this.quillEditorToolbarOptions
},
theme: 'snow'
})
this.quillEditor.container.style.height = `${300}px`
// // (使element upload)
this.quillEditor.getModule('toolbar').addHandler('image', () => {
this.$refs.uploadBtn.$el.click()
})
//
this.quillEditor.on('text-change', () => {
this.dataForm.actContent = this.quillEditor.root.innerHTML
if ((this.dataForm.actContent).length > 10000) {
return this.$message.error('您输入的的内容已超过字数')
} }
}, })
// },
quillEditorHandle () { // ()
this.quillEditor = new Quill('#J_quillEditor', { uploadBeforeUploadHandle (file) {
modules: { if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
toolbar: this.quillEditorToolbarOptions this.$message.error(this.$t('upload.tip', { 'format': 'jpg、png、gif' }))
}, return false
theme: 'snow' }
}) },
this.quillEditor.container.style.height = `${300}px` // ()
// // (使element upload) uploadSuccessHandle (res, file, fileList) {
this.quillEditor.getModule('toolbar').addHandler('image', () => { if (res.code !== 0) {
this.$refs.uploadBtn.$el.click() return this.$message.error(res.msg)
}) }
// this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url)
this.quillEditor.on('text-change', () => { },
this.dataForm.actContent = this.quillEditor.root.innerHTML setRegistTime () {
if ((this.dataForm.actContent).length > 10000) { this.dataForm.newsReleaseStartTime = this.time[0]
return this.$message.error('您输入的的内容已超过字数') this.dataForm.newsReleaseEndTime = this.time[1]
} },
}) // ends
},
// ()
uploadBeforeUploadHandle (file) {
if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
this.$message.error(this.$t('upload.tip', { 'format': 'jpg、png、gif' }))
return false
}
},
// ()
uploadSuccessHandle (res, file, fileList) {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url)
},
setRegistTime () {
this.dataForm.newsReleaseStartTime = this.time[0]
this.dataForm.newsReleaseEndTime = this.time[1]
},
// ends
// //
getInfo () { getInfo () {
this.$http.get(`/heart/actinfo/${this.dataForm.id}`).then(({ data: res }) => { this.$http.get(`/heart/actinfo/${this.dataForm.id}`).then(({ data: res }) => {
@ -607,30 +605,26 @@ export default {
}, },
// //
dataFormSubmitHandle: debounce(function () { dataFormSubmitHandle: debounce(function () {
if (this.dataForm.isActQuota == 0){ if (this.dataForm.isActQuota == 0){
this.dataForm.actQuota = 0 this.dataForm.actQuota = 0
} }
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (!valid) { if (!valid) {
return false return false
} }
var signUpEndTime = new Date(Date.parse(this.dataForm.signupEndTime)); var signUpEndTime = new Date(Date.parse(this.dataForm.signupEndTime))
var actStarTime = new Date(Date.parse(this.dataForm.actStartTime)); var actStarTime = new Date(Date.parse(this.dataForm.actStartTime))
var actEndTime = new Date(Date.parse(this.dataForm.actEndTime)); var actEndTime = new Date(Date.parse(this.dataForm.actEndTime))
var signinEndTime = new Date(Date.parse(this.dataForm.signinEndTime)); var signinEndTime = new Date(Date.parse(this.dataForm.signinEndTime))
if (signUpEndTime > actStarTime) { if (signUpEndTime > actStarTime) {
return this.$message.error('活动开始时间必须大于报名截止时间.')
return this.$message.error('活动开始时间必须大于报名截止时间。'); }
} if (actEndTime < actStarTime) {
if (actEndTime < actStarTime) { return this.$message.error('活动结束时间必须大于活动开始时间.')
}
return this.$message.error('活动结束时间必须大于活动开始时间。'); if (signinEndTime < actEndTime) {
} return this.$message.error('签到结束时间必须大于活动结束时间.')
if (signinEndTime < actEndTime) { }
return this.$message.error('签到结束时间必须大于活动结束时间。');
}
this.isAble = true this.isAble = true
this.$http[!this.dataForm.id ? 'post' : 'put']('/heart/actinfo/', this.dataForm).then(({ data: res }) => { this.$http[!this.dataForm.id ? 'post' : 'put']('/heart/actinfo/', this.dataForm).then(({ data: res }) => {
this.isAble = false this.isAble = false
@ -647,34 +641,36 @@ export default {
} }
}) })
this.$parent.selectComponent = 'ActInfoList' this.$parent.selectComponent = 'ActInfoList'
this.$router.push({ path: '/heart-actinfo'}) this.$router.push({
path: '/heart-actinfo'
})
}).catch(() => {}) }).catch(() => {})
}) })
}, 1000, { 'leading': true, 'trailing': false }), }, 1000, { 'leading': true, 'trailing': false }),
handleAvatarActSuccess (res, file) { handleAvatarActSuccess (res, file) {
this.loading = false this.loading = false
this.dataForm.headPic = res.data.url this.dataForm.headPic = res.data.url
}, },
handleAvatarBannerSuccess (res, file) { handleAvatarBannerSuccess (res, file) {
this.loading = false this.loading = false
this.dataForm.bannerUrl = res.data.url this.dataForm.bannerUrl = res.data.url
}, },
beforeAvatarUpload (file) { beforeAvatarUpload (file) {
this.loading = true this.loading = true
}, },
handelError () { handelError () {
this.loading = false this.loading = false
}, },
mapSelectHandle (type) { mapSelectHandle (type) {
this.mapSelectVisible = true this.mapSelectVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.mapSelect.init(type,this.dataForm.clockRadius) this.$refs.mapSelect.init(type, this.dataForm.clockRadius)
}) })
} }
}, },
components: { components: {
MapSelect MapSelect
} }
} }
</script> </script>
<style> <style>

13
src/views/modules/heart/actinfo-list.vue

@ -101,7 +101,7 @@ export default {
dataForm: { dataForm: {
actStatus: '', actStatus: '',
startTime: '', startTime: '',
endTime:'' endTime: ''
}, },
addOrUpdateVisible: false, addOrUpdateVisible: false,
actInfoDetailVisible: false, actInfoDetailVisible: false,
@ -134,7 +134,7 @@ export default {
ActUserClockLog ActUserClockLog
}, },
created: function () { created: function () {
this.getDataList(); this.getDataList()
}, },
methods: { methods: {
detailAction (id) { detailAction (id) {
@ -143,7 +143,9 @@ export default {
}, },
addAction () { addAction () {
this.$parent.selectComponent = 'ActInfoAdd' this.$parent.selectComponent = 'ActInfoAdd'
this.$router.push({ path: '/heart-actinfo'}) this.$router.push(
{ path: '/heart-actinfo'}
)
}, },
joinManage (id) { joinManage (id) {
this.$parent.selectComponent = 'ActUserRelation' this.$parent.selectComponent = 'ActUserRelation'
@ -161,12 +163,11 @@ export default {
return '下架' return '下架'
} }
}, },
cancelHandle(row){ cancelHandle (row) {
let state = row.actStatus let state = row.actStatus
if(state === '1'){ if (state === '1') {
this.actInfoCancelVisible = true this.actInfoCancelVisible = true
this.$nextTick(() => { this.$nextTick(() => {
console.log(this.$refs.actinfoCancel.dataForm);
this.$refs.actinfoCancel.dataForm.id = row.id this.$refs.actinfoCancel.dataForm.id = row.id
this.$refs.actinfoCancel.init() this.$refs.actinfoCancel.init()
}) })

430
src/views/modules/heart/map-select.vue

@ -1,243 +1,249 @@
<template> <template>
<el-dialog :visible.sync="visible" :close-on-click-modal="false" :close-on-press-escape="false"> <el-dialog :visible.sync="visible" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :inline="true" <el-form
:model="dataForm" :inline="true"
:label-width="$i18n.locale === 'en-US' ? '120px' : '120px'"> :model="dataForm"
<el-row> :label-width="$i18n.locale === 'en-US' ? '120px' : '120px'"
<el-form-item label="活动地点:" >
prop="address"> <el-row>
<el-input v-model="dataForm.address" <el-form-item label="活动地点:" prop="address">
type="text" <el-input v-model="dataForm.address" type="text" clearable style="width:400px"></el-input>&emsp;
clearable <el-button type="primary" @click="searchKeyword()">搜索</el-button>
style="width:400px"> </el-form-item>
</el-input>&emsp; </el-row>
<el-button type="primary" <el-row>
@click="searchKeyword()">搜索</el-button> <el-form-item label=" " prop="map">
</el-form-item> <div>
</el-row> <div id="container" style="width:500px;height:400px;"></div>
<el-row> </div>
<el-form-item label=" " </el-form-item>
prop="map"> </el-row>
<div> </el-form>
<div id="container" style="width:500px;height:400px;"></div> <address-check v-if="addressCheckVisible" ref="addressCheck" v-on:checkOk="checkOk"></address-check>
</div>
</el-form-item>
</el-row>
</el-form>
<address-check v-if="addressCheckVisible" ref="addressCheck" v-on:checkOk="checkOk"></address-check>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
var searchService;
import jsonp from 'jsonp' import jsonp from 'jsonp'
import AddressCheck from './address-check' import AddressCheck from './address-check'
var searchService
export default { export default {
name:'maps', name: 'maps',
data () { data () {
return { return {
dataForm: { dataForm: {
address: "", address: '',
longitude:0,// longitude: 0, //
latitude:0,// latitude: 0, //
city:'', city: '',
type: 1, type: 1,
radius:200 radius: 200
}, },
visible: false, visible: false,
addressCheckVisible:false addressCheckVisible: false
} }
}, },
methods: { methods: {
init (type,radius) { init (type, radius) {
this.visible = true this.visible = true
this.dataForm.address = '' this.dataForm.address = ''
this.dataForm.type = type this.dataForm.type = type
this.dataForm.radius = radius this.dataForm.radius = radius
this.getMyLocation(); this.getMyLocation()
}, },
getAddress(lat,lng) { getAddress (lat, lng) {
this.dataForm.longitude = lng; this.dataForm.longitude = lng
this.dataForm.latitude = lat; this.dataForm.latitude = lat
var url3 = "https://apis.map.qq.com/ws/geocoder/v1/?location=" + lat + "," + lng + "&key=MQFBZ-LTWW6-R7XSK-MFXUQ-DVSIE-BGB4M&output=jsonp"; var url3 =
jsonp(url3, null, (err, data) => { 'https://apis.map.qq.com/ws/geocoder/v1/?location=' +
if (err) { lat +
console.log(err) ',' +
} lng +
console.log(data) '&key=MQFBZ-LTWW6-R7XSK-MFXUQ-DVSIE-BGB4M&output=jsonp'
this.dataForm.address = data.result.address jsonp(url3, null, (err, data) => {
}) if (err) {
console.log(err)
}
console.log(data)
this.dataForm.address = data.result.address
})
}, },
getMyLocation() { getMyLocation () {
var geolocation = new qq.maps.Geolocation("MQFBZ-LTWW6-R7XSK-MFXUQ-DVSIE-BGB4M", "e家党群-管理端"); var geolocation = new qq.maps.Geolocation(
geolocation.getIpLocation(this.showPosition, this.showErr); 'MQFBZ-LTWW6-R7XSK-MFXUQ-DVSIE-BGB4M',
}, 'e家党群-管理端'
showPosition(position) { )
console.log(position); geolocation.getIpLocation(this.showPosition, this.showErr)
this.dataForm.latitude = position.lat; },
this.dataForm.longitude = position.lng; showPosition (position) {
this.dataForm.city = position.city; console.log(position)
this.setMap(); this.dataForm.latitude = position.lat
}, this.dataForm.longitude = position.lng
showErr() { this.dataForm.city = position.city
console.log("定位失败"); this.setMap()
this.getMyLocation();//使 },
}, showErr () {
setMap() { console.log('定位失败')
const that = this this.getMyLocation() // 使
var markerList =[]; },
var radiusList =[]; setMap () {
//map qq.maps.Map() const that = this
// var markerList = []
var myLatlng = new qq.maps.LatLng(this.dataForm.latitude,this.dataForm.longitude); var radiusList = []
// // map qq.maps.Map()
var zoom = this.capacity(); //
var myOptions = { var myLatlng = new qq.maps.LatLng(
zoom: zoom, // this.dataForm.latitude,
center: myLatlng, // this.dataForm.longitude
mapTypeId: qq.maps.MapTypeId.ROADMAP //MapType )
//
var zoom = this.capacity()
var myOptions = {
zoom: zoom, //
center: myLatlng, //
mapTypeId: qq.maps.MapTypeId.ROADMAP // MapType
}
// dom
var map = new qq.maps.Map(
document.getElementById('container'),
myOptions
)
//
var radius = new qq.maps.Circle({
center: new qq.maps.LatLng(
this.dataForm.latitude,
this.dataForm.longitude
),
radius: this.dataForm.radius,
map: map
})
radiusList.push(radius)
var marker = new qq.maps.Marker({
position: myLatlng,
map: map
})
markerList.push(marker)
//
qq.maps.event.addListener(map, 'click', function (event) {
that.cleanMarkRadius(markerList, radiusList)
that.getAddress(event.latLng.lat, event.latLng.lng)
var myLatlng = new qq.maps.LatLng(event.latLng.lat, event.latLng.lng)
map.setCenter(myLatlng)
var marker = new qq.maps.Marker({
position: event.latLng,
map: map
})
//
var radius = new qq.maps.Circle({
center: new qq.maps.LatLng(event.latLng.lat, event.latLng.lng),
radius: that.dataForm.radius,
map: map
})
radiusList.push(radius)
markerList.push(marker)
qq.maps.event.addListener(map, 'click', function (event) {
that.cleanMarkRadius(markerList, radiusList)
})
qq.maps.event.addListener(marker, 'click', function (event) {
that.addressCheckHandle()
})
})
//
searchService = new qq.maps.SearchService({
complete: function (result) {
var pois = result.detail.pois
if (pois == null || pois.length <= 0) {
alert('未找到地址!')
that.getAddress(that.dataForm.latitude, that.dataForm.longitude)
return
} }
// //dom map.setCenter(pois[0].latLng)
var map = new qq.maps.Map(document.getElementById("container"), myOptions); that.getAddress(pois[0].latLng.lat, pois[0].latLng.lng)
//
var radius = new qq.maps.Circle({
center:new qq.maps.LatLng(this.dataForm.latitude,this.dataForm.longitude),
radius: this.dataForm.radius,
map: map
});
radiusList.push(radius);
var marker = new qq.maps.Marker({ var marker = new qq.maps.Marker({
position:myLatlng, map: map,
map:map position: pois[0].latLng
}); })
//
var radius = new qq.maps.Circle({
center: new qq.maps.LatLng(pois[0].latLng.lat, pois[0].latLng.lng),
radius: that.dataForm.radius,
map: map
})
radiusList.push(radius)
markerList.push(marker) markerList.push(marker)
// that.cleanMarkRadius(markerList, radiusList)
qq.maps.event.addListener(map, 'click', function(event) { qq.maps.event.addListener(marker, 'click', function (event) {
that.addressCheckHandle()
that.cleanMarkRadius(markerList,radiusList);
that.getAddress(event.latLng.lat,event.latLng.lng);
var myLatlng = new qq.maps.LatLng(event.latLng.lat,event.latLng.lng);
map.setCenter(myLatlng);
var marker = new qq.maps.Marker({
position:event.latLng,
map:map
});
//
var radius = new qq.maps.Circle({
center:new qq.maps.LatLng(event.latLng.lat,event.latLng.lng),
radius: that.dataForm.radius,
map: map
});
radiusList.push(radius);
markerList.push(marker)
qq.maps.event.addListener(map, 'click', function(event) {
that.cleanMarkRadius(markerList,radiusList);
});
qq.maps.event.addListener(marker, 'click', function(event) {
that.addressCheckHandle();
});
});
//
searchService = new qq.maps.SearchService({
complete : function(result){
var pois = result.detail.pois;
if(pois == null || pois.length <= 0){
alert("未找到地址!");
that.getAddress(that.dataForm.latitude,that.dataForm.longitude);
return
}
map.setCenter(pois[0].latLng);
that.getAddress(pois[0].latLng.lat,pois[0].latLng.lng);
var marker = new qq.maps.Marker({
map:map,
position: pois[0].latLng
});
//
var radius = new qq.maps.Circle({
center:new qq.maps.LatLng(pois[0].latLng.lat,pois[0].latLng.lng),
radius: that.dataForm.radius,
map: map
});
radiusList.push(radius);
markerList.push(marker);
that.cleanMarkRadius(markerList,radiusList);
qq.maps.event.addListener(marker, 'click', function(event) {
that.addressCheckHandle();
});
}
});
},
searchKeyword() {
searchService.setLocation(this.dataForm.city);
searchService.search(this.dataForm.address);
},
addressCheckHandle() {
if (this.dataForm.address =='' || !(this.dataForm.latitude > 0)){
alert("请选择地址!");
return
}
this.addressCheckVisible = true
this.$nextTick(() => {
this.$refs.addressCheck.init(this.dataForm)
}) })
},
checkOk(checkOk){
if (checkOk){
this.$emit('position', this.dataForm)
this.visible = false
} }
}, })
cleanMarkRadius(markerList,radiusList) { },
if (markerList) { searchKeyword () {
if(markerList.length > 1){ searchService.setLocation(this.dataForm.city)
for (var i = 0; i < markerList.length-1; i++) { searchService.search(this.dataForm.address)
markerList[i].setMap(null); },
} addressCheckHandle () {
} else { if (this.dataForm.address === '' || !(this.dataForm.latitude > 0)) {
for (var i = 0; i < markerList.length; i++) { alert('请选择地址!')
markerList[i].setMap(null); return
} }
} this.addressCheckVisible = true
this.$nextTick(() => {
this.$refs.addressCheck.init(this.dataForm)
})
},
checkOk (checkOk) {
if (checkOk) {
this.$emit('position', this.dataForm)
this.visible = false
}
},
cleanMarkRadius (markerList, radiusList) {
if (markerList) {
if (markerList.length > 1) {
for (var i4 = 0; i4 < markerList.length - 1; i4++) {
markerList[i4].setMap(null)
} }
if (radiusList) { } else {
if(radiusList.length > 1){ for (var i3 = 0; i3 < markerList.length; i3++) {
for (var i = 0; i < radiusList.length-1; i++) { markerList[i3].setMap(null)
radiusList[i].setMap(null);
}
} else {
for (var i = 0; i < markerList.length; i++) {
radiusList[i].setMap(null);
}
}
} }
},
capacity() {
if(0 < this.dataForm.radius && this.dataForm.radius <= 25){
return 18
} else if (25 < this.dataForm.radius && this.dataForm.radius <= 50){
return 17
} else if (50 < this.dataForm.radius && this.dataForm.radius <= 100){
return 16
} else if (100 < this.dataForm.radius && this.dataForm.radius <= 200){
return 15
} else if (200 < this.dataForm.radius && this.dataForm.radius <= 500){
return 14
} else if (500 < this.dataForm.radius && this.dataForm.radius <= 1000){
return 13
} else if (1000 < this.dataForm.radius && this.dataForm.radius <= 2000){
return 12
} else if (2000 < this.dataForm.radius && this.dataForm.radius <= 5000){
return 11
} }
} }
}, if (radiusList) {
components: { if (radiusList.length > 1) {
AddressCheck for (var i2 = 0; i2 < radiusList.length - 1; i2++) {
radiusList[i2].setMap(null)
}
} else {
for (var i1 = 0; i1 < markerList.length; i1++) {
radiusList[i1].setMap(null)
}
}
}
},
capacity () {
if (this.dataForm.radius > 0 && this.dataForm.radius <= 25) {
return 18
} else if (this.dataForm.radius > 25 && this.dataForm.radius <= 50) {
return 17
} else if (this.dataForm.radius > 50 && this.dataForm.radius <= 100) {
return 16
} else if (this.dataForm.radius > 100 && this.dataForm.radius <= 200) {
return 15
} else if (this.dataForm.radius > 200 && this.dataForm.radius <= 500) {
return 14
} else if (this.dataForm.radius > 500 && this.dataForm.radius <= 1000) {
return 13
} else if (this.dataForm.radius > 1000 && this.dataForm.radius <= 2000) {
return 12
} else if (this.dataForm.radius > 2000 && this.dataForm.radius <= 5000) {
return 11
}
} }
},
components: {
AddressCheck
}
} }
</script> </script>

Loading…
Cancel
Save