Browse Source

补充

origin/feature/monitoring
曲树通 4 years ago
parent
commit
dfb209127e
  1. 158
      src/views/modules/sys/dept-add-or-update.vue
  2. 30
      src/views/modules/sys/map-select.vue

158
src/views/modules/sys/dept-add-or-update.vue

@ -88,16 +88,106 @@
:min="0"
:label="$t('dept.sort')"></el-input-number>
</el-form-item>
<el-form-item prop="introduction"
label="组织信息">
<el-input class="input-width-jg" v-model="dataForm.introduction"
type="textarea"
:rows="3"
placeholder="概况介绍"></el-input>
</el-form-item>
<el-form-item prop="acreage"
label="辖区面积">
<el-input class="input-width-jg" v-model="dataForm.acreage"
placeholder="辖区面积"></el-input>
</el-form-item>
<el-form-item prop="communityNum"
label="社区数量">
<el-input class="input-width-jg" v-model="dataForm.communityNum" type = "number"
placeholder="社区数量"></el-input>
</el-form-item>
<el-form-item prop="gridNum"
label="网格数量">
<el-input class="input-width-jg" v-model="dataForm.gridNum" type = "number"
placeholder="网格数量"></el-input>
</el-form-item>
<el-form-item prop="gridmanNum"
label="网格员数">
<el-input class="input-width-jg" v-model="dataForm.gridmanNum" type = "number"
placeholder="网格员数"></el-input>
</el-form-item>
<el-form-item prop="partyMemberNum"
label="党员数">
<el-input class="input-width-jg" v-model="dataForm.partyMemberNum" type = "number"
placeholder="党员数"></el-input>
</el-form-item>
<el-row>
<el-form-item label="社会治理业务流传图上传 "
v-loading="loading"
prop="deptBusinessUrl">
<el-upload class="avatar-uploader"
:action="uploadUrl"
:show-file-list="false"
:on-success="handleAvatarBannerSuccess"
:on-error="handelError"
:before-upload="beforeAvatarUpload">
<img v-if="dataForm.deptBusinessUrl"
:src="dataForm.deptBusinessUrl"
class="avatar">
<i v-else
class="el-icon-plus avatar-uploader-icon"></i>
<div slot="tip"
class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="党组织架构图上传 "
v-loading="loading"
prop="deptPartyUrl">
<el-upload class="avatar-uploader"
:action="uploadUrl"
:show-file-list="false"
:on-success="handleAvatarBannerSuccess"
:on-error="handelError"
:before-upload="beforeAvatarUpload">
<img v-if="dataForm.deptPartyUrl"
:src="dataForm.deptPartyUrl"
class="avatar">
<i v-else
class="el-icon-plus avatar-uploader-icon"></i>
<div slot="tip"
class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</el-form-item>
</el-row>
<el-form-item prop="longitude"
label="经度">
<el-input class="input-width-jg" v-model="dataForm.longitude"
placeholder="经度" :disabled="true"></el-input>
</el-form-item>
<el-form-item prop="latitude"
label="纬度">
<el-input class="input-width-jg" v-model="dataForm.latitude"
placeholder="纬度" :disabled="true"></el-input>
</el-form-item>
</el-form>
<el-button type="primary"
@click="mapSelectHandle(2)">地图选择</el-button>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary"
@click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
<map-select v-if="mapSelectVisible"
v-on:map-select = 'mapdata'
ref="mapSelect"
v-on:position="position"></map-select>
</el-dialog>
</template>
<script>
import MapSelect from './map-select'
import Cookies from 'js-cookie'
import debounce from 'lodash/debounce'
export default {
data () {
@ -117,9 +207,15 @@ export default {
typeName: '',
partyCode: '',
areaCode: '',
parentAreaCode: ''
parentAreaCode: '',
longitude: 0, //
latitude: 0, //
deptPartyUrl:'',
deptBusinessUrl:''
},
secondOrgDictList: []
uploadUrl: '',
secondOrgDictList: [],
mapSelectVisible: false
}
},
computed: {
@ -145,6 +241,8 @@ export default {
},
methods: {
init () {
console.log("11111")
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
@ -163,6 +261,9 @@ export default {
this.getAreaCodeDeptList()
})
this.getSecondOrgDicList()
this.$nextTick(() => {
this.$refs.mapSelect.init(this.dataForm)
})
},
//
changeOrgType (item) {
@ -251,6 +352,31 @@ export default {
})
}).catch(() => { })
},
handleAvatarActSuccess (res, file) {
this.loading = false
this.dataForm.headPic = res.data.url
},
handleAvatarBannerSuccess (res, file) {
this.loading = false
this.dataForm.bannerUrl = res.data.url
},
beforeAvatarUpload (file) {
this.loading = true
},
handelError () {
this.loading = false
},
mapSelectHandle (type) {
this.mapSelectVisible = true
this.$nextTick(() => {
this.$refs.mapSelect.init(type, this.dataForm.clockRadius)
})
},
position (position) {
debugger
this.dataForm.latitude = position.latitude
this.dataForm.longitude = position.longitude
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
@ -273,6 +399,9 @@ export default {
}).catch(() => { })
})
}, 1000, { 'leading': true, 'trailing': false })
},
components: {
MapSelect
}
}
</script>
@ -297,3 +426,28 @@ export default {
width: 93%;
}
</style>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style>

30
src/views/modules/sys/map-select.vue

@ -12,17 +12,7 @@
<el-button type="primary" @click="searchKeyword()">搜索</el-button>
</el-form-item>
</el-row>
<el-form-item prop="longitude"
label="经度">
<el-input class="input-width-jg" v-model="dataForm.longitude"
placeholder="经度" :disabled="true"></el-input>
</el-form-item>
<el-form-item prop="latitude"
label="纬度">
<el-input class="input-width-jg" v-model="dataForm.latitude"
placeholder="纬度" :disabled="true"></el-input>
</el-form-item>
<el-row v-if = "mapvisible">
<el-row>
<el-form-item label=" " prop="map">
<div>
<div id="container" style="width:500px;height:400px;"></div>
@ -46,23 +36,20 @@ export default {
longitude: 0, //
latitude: 0, //
city: '',
type: 2,
type: 1,
radius: 200
},
visible: false,
mapvisible: false,
addressCheckVisible: false
}
},
methods: {
init (dataP) {
init (type, radius) {
this.visible = true
this.dataForm.address = ''
this.dataForm.type = 2
this.dataForm.radius = 200
this.getMyLocation()
this.dataForm.latitude = dataP.latitude
this.dataForm.longitude = dataP.longitude
// var center = new qq.maps.LatLng(39.916527,116.397128)
// searchService.searchNearBy("",center,200)
},
getAddress (lat, lng) {
this.dataForm.longitude = lng
@ -79,7 +66,6 @@ export default {
}
console.log(data)
this.dataForm.address = data.result.address
this.$emit('map-select',this.dataForm)
})
},
getMyLocation () {
@ -90,6 +76,7 @@ export default {
geolocation.getIpLocation(this.showPosition, this.showErr)
},
showPosition (position) {
console.log(position)
this.dataForm.latitude = position.lat
this.dataForm.longitude = position.lng
this.dataForm.city = position.city
@ -110,7 +97,6 @@ export default {
this.dataForm.latitude,
this.dataForm.longitude
)
console.log('11111')
//
var zoom = this.capacity()
var myOptions = {
@ -143,7 +129,6 @@ export default {
markerList.push(marker)
//
qq.maps.event.addListener(map, 'click', function (event) {
console.log('111111111')
that.cleanMarkRadius(markerList, radiusList)
that.getAddress(event.latLng.lat, event.latLng.lng)
var myLatlng = new qq.maps.LatLng(event.latLng.lat, event.latLng.lng)
@ -198,8 +183,6 @@ export default {
})
},
searchKeyword () {
this.mapvisible = true
this.getMyLocation()
searchService.setLocation(this.dataForm.city)
searchService.search(this.dataForm.address)
},
@ -214,6 +197,7 @@ export default {
})
},
checkOk (checkOk) {
debugger
if (checkOk) {
this.$emit('position', this.dataForm)
this.visible = false

Loading…
Cancel
Save