Browse Source

基础信息

shibei_master
jiangyy 4 years ago
parent
commit
a06a7eef64
  1. 30
      src/assets/scss/modules/visual/basicInfoMain.scss
  2. 3
      src/assets/scss/modules/visual/searchPerson.scss
  3. 196
      src/views/modules/visual/basicinfo/basicInfoCommunity.vue
  4. 43
      src/views/modules/visual/basicinfo/basicInfoMain.vue
  5. 47
      src/views/modules/visual/basicinfo/peopleSearch.vue
  6. 68
      src/views/modules/workSys/mapConfig.vue

30
src/assets/scss/modules/visual/basicInfoMain.scss

@ -31,6 +31,7 @@
.div_content { .div_content {
display: flex; display: flex;
.div_map { .div_map {
width: 100%; width: 100%;
height: calc(88vh - 8px); height: calc(88vh - 8px);
@ -163,21 +164,11 @@
} }
} }
.warning-box {
box-sizing: border-box;
width: 1881px;
height: 914px;
margin: auto;
color: #fff;
background: url('../../../img/modules/visual/warning-box.png') no-repeat
center;
background-size: 100% 100%;
padding: 45px 21px 35px 24px;
}
.div_community_info { .div_community_info {
box-sizing: border-box; box-sizing: border-box;
width: 100%; flex: 0 0 calc(100vw - 620px);
// width: calc(100vw - 560px);
height: calc(88vh); height: calc(88vh);
color: #fff; color: #fff;
background: url('../../../img/modules/visual/warning-box.png') no-repeat background: url('../../../img/modules/visual/warning-box.png') no-repeat
@ -188,6 +179,19 @@
margin-top: 28px; margin-top: 28px;
margin-left: 24px; margin-left: 24px;
display: flex; display: flex;
.customer_select {
display: flex;
justify-content: flex-start;
> span {
width: auto;
font-size: 22px;
font-family: PingFang SC;
font-weight: 800;
color: #ffffff;
line-height: 34px;
}
}
> img { > img {
height: 34px; height: 34px;
width: 46px; width: 46px;

3
src/assets/scss/modules/visual/searchPerson.scss

@ -32,6 +32,9 @@
color: #ffffff; color: #ffffff;
line-height: 53px; line-height: 53px;
} }
.btn:hover {
cursor: pointer;
}
} }
.list_box { .list_box {

196
src/views/modules/visual/basicinfo/basicInfoCommunity.vue

@ -7,14 +7,15 @@
<img src="../../../../assets/img/shuju/title-tip.png" <img src="../../../../assets/img/shuju/title-tip.png"
alt /> alt />
<div class="customer_select"> <div class="customer_select">
<!-- <span>{{neighborHoodName+'-'}}</span> -->
<el-select v-model="selBuildingId" <el-select v-model="selBuildingId"
:popper-append-to-body="false" :popper-append-to-body="false"
style="width:100%"
placeholder="请选择"> placeholder="请选择">
<el-option v-for="item in buildingArray" <el-option v-for="item in buildingArray"
:key="item.buildingId" :key="item.buildingId"
:label="item.buildingName" :label="item.buildingName"
:value="item.buildingId"> :value="item.buildingId"
@click="handleClickBuilding(index)">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
@ -48,7 +49,7 @@
alt /> alt />
<div class="user_list" <div class="user_list"
v-show="item.showAllUser"> v-show="item.showAllUser&&userArray.length>0">
<div v-for="(userItem,userIndex) in userArray" <div v-for="(userItem,userIndex) in userArray"
:key="userIndex" :key="userIndex"
class="user_item" class="user_item"
@ -89,56 +90,7 @@ export default {
//id //id
neighborHoodId: '', neighborHoodId: '',
neighborHoodName: '', neighborHoodName: '',
buildingArray: [ buildingArray: [],//
{
buildingId: "1",
buildingName: '1号楼'
},
{
buildingId: "2",
buildingName: '2号楼'
},
{
buildingId: "3",
buildingName: '3号楼'
},
{
buildingId: "4",
buildingName: '4号楼'
},
{
buildingId: "5",
buildingName: '5号楼'
},
{
buildingId: "6",
buildingName: '6号楼'
},
{
buildingId: "7",
buildingName: '1号楼'
},
{
buildingId: "8",
buildingName: '2号楼'
},
{
buildingId: "9",
buildingName: '3号楼'
},
{
buildingId: "10",
buildingName: '4号楼'
},
{
buildingId: "11",
buildingName: '5号楼'
},
{
buildingId: "12",
buildingName: '6号楼'
}
],//
selBuildingId: '', selBuildingId: '',
selBuildingName: '', selBuildingName: '',
@ -405,35 +357,14 @@ export default {
selHouseName: '', selHouseName: '',
selHouseIndex: 0, selHouseIndex: 0,
userArray: [ userArray: [],
{
name: '张三',
userId: '1',
},
{
name: '李三四',
userId: '2',
},
{
name: '王婷',
userId: '3',
}
,
{
name: '王婷婷婷王婷婷婷',
userId: '4',
}
],
selUserName: '', selUserName: '',
selUserId: '', selUserId: '',
orgData: {},// orgData: {},//
orgId: '', orgId: '',
orgLevel: '', orgLevel: '',
// //
runNum: 0, runNum: 0,
runAgencyArray: [], runAgencyArray: [],
@ -461,17 +392,28 @@ export default {
}, },
//
handleClickBuilding (index) {
this.selBuildingId = this.buildingArray[index].buildingId
this.selBuildingName = this.buildingArray[index].buildingName
this.$emit('refreshInfoList', this.selBuildingId, 'building')
},
// //
handleClickRoom (index) { handleClickRoom (index) {
this.selHouseIndex = index this.selHouseIndex = index
this.selHouseId = this.roomArray[index].houseId
this.selHouseName = this.roomArray[index].houseName
// this.$emit('refreshInfoList', this.selHouseId, 'room')
}, },
// //
async handleShowAllUser (selIndex) { async handleShowAllUser (selIndex) {
// this.startLoading()
this.roomArray.forEach((element, index) => { this.roomArray.forEach((element, index) => {
let obj = JSON.parse(JSON.stringify(element)) let obj = JSON.parse(JSON.stringify(element))
if (index === selIndex) { if (index === selIndex) {
obj.showAllUser = !obj.showAllUser obj.showAllUser = !obj.showAllUser
this.$set(this.roomArray, selIndex, obj) this.$set(this.roomArray, selIndex, obj)
@ -483,7 +425,7 @@ export default {
// element.showAllUser = false // element.showAllUser = false
} }
}); });
// this.endLoading()
}, },
@ -496,80 +438,33 @@ export default {
}, },
//
toSubAgency (e) {
//neighborHood
this.runNum++
this.runAgencyArray.push(this.orgData)
this.subAgencyArray.forEach(item => {
if (item.id === e.selected[0].id_) {
this.selPolygonId = item.id
this.selPolygon = item
this.orgId = item.id
this.orgLevel = item.level
}
});
console.log(this.runNum)
console.log(this.runAgencyArray)
if (this.orgLevel === 'neighborHood') {
} else {
this.refreshMap(true)
}
},
//
handleClickAgency (index) {
const cutNum = this.runAgencyArray.length - index//
this.runNum = this.runNum - cutNum
this.orgData = this.runAgencyArray[index]
for (let i = 0; i < cutNum; i++) {
this.runAgencyArray.pop()
}
this.orgId = this.orgData.id
this.orgLevel = this.orgData.level
console.log(this.runAgencyArray)
console.log(this.orgData)
if (this.orgLevel === 'neighborHood') {//
} else {
this.refreshMap(true)
}
},
// //
async loadBuilding () { async loadBuilding () {
// const url = "/gov/org/agency/baseinfofamilybuilding" const url = "/gov/org/agency/baseinfofamilybuilding"
const url = "http://yapi.elinkservice.cn/mock/245/gov/org/agency/baseinfofamilybuilding" // const url = "http://yapi.elinkservice.cn/mock/245/gov/org/agency/baseinfofamilybuilding"
let params = { let params = {
neighborHoodId: this.orgId neighborHoodId: this.neighborHoodId
} }
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
if (code === 0) { if (code === 0) {
// this.buildingArray = data this.buildingArray = data
this.buildingArray.forEach(item => { this.buildingArray.forEach(item => {
item.buildingName = this.neighborHoodName + "-" + item.buildingName if (!this.buildingArray[0].buildingName) {
item.buildingName = '楼'
}
}); });
if (this.buildingArray.length > 0) { if (this.buildingArray.length > 0) {
this.selBuildingId = this.buildingArray[0].buildingId this.selBuildingId = this.buildingArray[0].buildingId
this.selBuildingName = this.buildingArray[0].buildingName this.selBuildingName = this.buildingArray[0].buildingName
} else { } else {
this.selBuildingId = '' this.selBuildingId = ''
this.selBuildingName = '' this.selBuildingName = ''
} }
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
@ -578,8 +473,8 @@ export default {
// //
async loadRoom () { async loadRoom () {
// const url = "/gov/org/ichouse/houselist" const url = "/gov/org/ichouse/houselist"
const url = "http://yapi.elinkservice.cn/mock/245/gov/org/ichouse/houselist" // const url = "http://yapi.elinkservice.cn/mock/245/gov/org/ichouse/houselist"
let params = { let params = {
buildingId: this.selBuildingId buildingId: this.selBuildingId
} }
@ -587,15 +482,13 @@ export default {
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
if (code === 0) { if (code === 0) {
// this.roomArray = data this.roomArray = data
if (this.roomArray.length > 0) { if (this.roomArray.length > 0) {
this.selHouseId = this.roomArray[0].houseId
this.selHouseName = this.roomArray[0].houseName
this.roomArray.forEach(roomItem => { this.roomArray.forEach(roomItem => {
let iconArrayShow = JSON.parse(JSON.stringify(roomItem.categoryList)) let iconArrayShow = JSON.parse(JSON.stringify(roomItem.categoryList))
// debugger
if (iconArrayShow.length > 0) { if (iconArrayShow.length > 0) {
if (iconArrayShow[0].isSpecial === '1') {// if (iconArrayShow[0].isSpecial === '1') {//
roomItem.isParty = true roomItem.isParty = true
@ -625,8 +518,8 @@ export default {
// //
async loadUser (houseId, index) { async loadUser (houseId, index) {
// const url = "/epmetuser/icresiuser/getpeoplebyroom" const url = "/epmetuser/icresiuser/getpeoplebyroom"
const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icresiuser/getpeoplebyroom" // const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icresiuser/getpeoplebyroom"
let params = { let params = {
homeId: houseId homeId: houseId
} }
@ -634,8 +527,10 @@ export default {
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
if (code === 0) { if (code === 0) {
// this.userArray = data this.userArray = data
if (this.userArray.length === 0) {
this.$message.warning('该房间下没有住户')
}
} else { } else {
this.$message.error(msg) this.$message.error(msg)
@ -666,6 +561,11 @@ export default {
}, },
computed: { computed: {
// selectWidth () {
// let width = this.selHouseName.length * 200
// console.log(width)
// return width + 'px';
// },
mapHeight () { mapHeight () {
@ -735,8 +635,16 @@ export default {
} }
/* 修改的是el-input上下的小图标的颜色 */ /* 修改的是el-input上下的小图标的颜色 */
/deep/ .el-select .el-input .el-select__caret { /deep/ .el-select .el-input .el-select__caret::before {
color: #fff; color: #fff;
content: "";
background: url("../../../../assets/img/xiala.png") center center no-repeat;
position: absolute;
width: 100%;
height: 100%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
} }
/* 修改总体选项的样式 最外层 */ /* 修改总体选项的样式 最外层 */

43
src/views/modules/visual/basicinfo/basicInfoMain.vue

@ -14,22 +14,21 @@
</div> </div>
</div> </div>
<people-search v-if="orgLevel==='search'" <people-search v-show="orgLevel==='search'"
@toSubAgency="toSubAgency" @toSubAgency="toSubAgency"
ref="ref_search"></people-search> ref="ref_search"></people-search>
<people v-else-if="orgLevel==='people'" <people v-if="orgLevel==='people'"
:userId="selUserId" :userId="selUserId"
ref="ref_people"></people> ref="ref_people"></people>
<div v-else <div v-show="orgLevel!=='people' && orgLevel!=='search'"
class="div_content"> class="div_content">
<!-- <basic-info-community ref="ref_community"></basic-info-community> --> <basic-info-community v-show="orgLevel==='neighborHood'"
ref="ref_community"
@refreshInfoList="refreshInfoList"></basic-info-community>
<basic-info-community v-if="orgLevel==='neighborHood'" <div v-show="orgLevel!=='people' && orgLevel!=='search' && orgLevel!=='neighborHood'"
ref="ref_community"></basic-info-community>
<div v-else
id="map" id="map"
class="div_map"> class="div_map">
</div> </div>
@ -294,8 +293,8 @@ const vueGis = {
//infolist //infolist
async loadList () { async loadList () {
// const url = "/epmetuser/statsresiwarn/list" const url = "/epmetuser/statsresiwarn/list"
const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/statsresiwarn/list" // const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/statsresiwarn/list"
let params = { let params = {
id: this.orgId, id: this.orgId,
level: this.orgLevel level: this.orgLevel
@ -304,8 +303,8 @@ const vueGis = {
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
if (code === 0) { if (code === 0) {
// this.listData = data this.listData = data
this.listData = this.listData1 // this.listData = this.listData1
this.listDatashow = [] this.listDatashow = []
let itemArray = [] let itemArray = []
this.listData.forEach((item, index) => { this.listData.forEach((item, index) => {
@ -329,6 +328,12 @@ const vueGis = {
} }
}, },
//list
refreshInfoList (selId, type) {
this.orgId = houselIdseId
this.level = ''
},
// type:polygon / search people // type:polygon / search people
async toSubAgency (type, e, searchName) { async toSubAgency (type, e, searchName) {
//neighborHood //neighborHood
@ -355,7 +360,6 @@ const vueGis = {
name: '搜索' name: '搜索'
} }
this.$nextTick(() => { this.$nextTick(() => {
// ref_tree ref value node-key
this.$refs.ref_search.loadList(); this.$refs.ref_search.loadList();
}); });
@ -369,10 +373,13 @@ const vueGis = {
}); });
if (this.orgLevel === 'neighborHood') { if (this.orgLevel === 'neighborHood') {
this.loadList()
this.$nextTick(() => { this.$nextTick(() => {
// id // id
this.$refs.ref_community.initData('', '南山111小区'); this.$refs.ref_community.initData(this.orgData.id, this.orgData.name);
}); });
} else { } else {
this.refreshMap(true) this.refreshMap(true)
} }
@ -420,15 +427,19 @@ const vueGis = {
} else if (this.orgLevel === 'search') { } else if (this.orgLevel === 'search') {
this.$nextTick(() => { this.$nextTick(() => {
debugger
// ref_tree ref value node-key
this.$refs.ref_search.loadByName(this.searchName); this.$refs.ref_search.loadByName(this.searchName);
}); });
} else if (this.orgLevel === 'neighborHood') {// } else if (this.orgLevel === 'neighborHood') {//
} else { } else {
this.$nextTick(() => {
this.refreshMap(true) this.refreshMap(true)
this.$forceUpdate()
});
} }
}, },

47
src/views/modules/visual/basicinfo/peopleSearch.vue

@ -78,40 +78,7 @@ export default {
data () { data () {
return { return {
headerList: [], headerList: [],
tableData: [ tableData: [],
{
sort: 1,
name: '杨明',
gridName: '市北区第二网格市北区第二网格市北区第二网格市北区第二网格',
neighborHoodName: '南宁路小区',
buildNum: '2号楼',
userId: '1',
},
{
sort: 2,
name: '杨明',
gridName: '市北区第二网格',
neighborHoodName: '南宁路小区',
buildNum: '2号楼',
userId: '1',
},
{
sort: 3,
name: '杨明',
gridName: '市北区第二网格',
neighborHoodName: '南宁路小区',
buildNum: '2号楼',
userId: '2',
},
{
sort: 4,
name: '杨明',
gridName: '市北区第二网格',
neighborHoodName: '南宁路小区',
buildNum: '2号楼',
userId: '3',
},
],
searchName: '', searchName: '',
pageSize: 4, pageSize: 4,
pageNo: 1, pageNo: 1,
@ -125,13 +92,16 @@ export default {
loadByName (searchName) { loadByName (searchName) {
this.searchName = searchName this.searchName = searchName
if (this.searchName) {
this.loadList() this.loadList()
}
}, },
async loadList () { async loadList () {
if (this.searchName) {
// const url = "/epmetuser/icresiuser/searchbyname" const url = "/epmetuser/icresiuser/searchbyname"
const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icresiuser/searchbyname" // const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icresiuser/searchbyname"
let params = { let params = {
name: this.searchName, name: this.searchName,
pageSize: this.pageSize, pageSize: this.pageSize,
@ -146,6 +116,9 @@ export default {
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
} else {
}
}, },
// //

68
src/views/modules/workSys/mapConfig.vue

@ -2,8 +2,9 @@
<div style="position: relative"> <div style="position: relative">
<div class="div_search"> <div class="div_search">
<el-select v-model="selAgencyId" <el-select v-model="selAgencyId"
placeholder="请选择未添加标注的组织"> placeholder="无下级组织">
<el-option @click.native="orgChange(index)" <el-option @click.native="orgChange(index)"
v-for="(item,index) in subAgencyArray" v-for="(item,index) in subAgencyArray"
:key="item.id" :key="item.id"
@ -11,7 +12,7 @@
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
<div v-if="subAgencyArray.length>0">
<el-button v-if="showBtn&&!hasPolygon" <el-button v-if="showBtn&&!hasPolygon"
style="margin-left:10px" style="margin-left:10px"
type="primary" type="primary"
@ -27,7 +28,7 @@
type="primary" type="primary"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelPolygon">删除区域</el-button> --> @click="handleDelPolygon">删除区域</el-button> -->
</div>
</div> </div>
<div class="div_back"> <div class="div_back">
<el-button v-if="runNum>0" <el-button v-if="runNum>0"
@ -36,6 +37,9 @@
icon="el-icon-back" icon="el-icon-back"
@click="handleBack">返回上一级</el-button> @click="handleBack">返回上一级</el-button>
</div> </div>
<div class="div_tip">
<span>按住alt键单击标注可以进入下一级地图</span>
</div>
<div id="map" <div id="map"
class="div_map" class="div_map"
:style="{height:mapHeight+'px'}"></div> :style="{height:mapHeight+'px'}"></div>
@ -153,6 +157,7 @@ const vueGis = {
async mounted () { async mounted () {
// //
await this.loadOrgData() await this.loadOrgData()
// this.runAgency.push(this.orgData)
// //
this.initMap() this.initMap()
@ -167,7 +172,6 @@ const vueGis = {
methods: { methods: {
// //
orgChange (index) { orgChange (index) {
this.selAgencyIndex = index this.selAgencyIndex = index
selectedFeatures.clear() selectedFeatures.clear()
@ -204,20 +208,6 @@ const vueGis = {
} }
}, },
//
highlightPolygon () {
let features = polygonSource.getFeatures()
features.forEach(element => {
if (element.id_ === this.selAgencyId) {
selectedFeatures.push(element)
}
});
},
// //
handleBack () { handleBack () {
@ -248,11 +238,18 @@ const vueGis = {
if (code === 0) { if (code === 0) {
this.orgData = data this.orgData = data
this.runAgency.push(data) this.subAgencyArray = []
if (this.runNum === 0) {//
this.subAgencyArray.push(data)
this.selAgencyId = data.id
} else {
if (data.children && data.children.length > 0) { if (data.children && data.children.length > 0) {
this.subAgencyArray = data.children this.subAgencyArray = data.children
this.selAgencyId = this.subAgencyArray[0].id this.selAgencyId = this.subAgencyArray[0].id
} else {
this.subAgencyArray = []
this.selAgencyId = ''
}
} }
} else { } else {
@ -322,7 +319,6 @@ const vueGis = {
//feature //feature
selectFeature (e) { selectFeature (e) {
// console.log(e)
if (this.method === undefined || this.method === '') { if (this.method === undefined || this.method === '') {
this.selAgencyId = e.selected[0].id_ this.selAgencyId = e.selected[0].id_
@ -360,6 +356,18 @@ const vueGis = {
} }
}, },
//
highlightPolygon () {
let features = polygonSource.getFeatures()
features.forEach(element => {
if (element.id_ === this.selAgencyId) {
selectedFeatures.push(element)
}
});
},
// //
setMapLocation () { setMapLocation () {
this.centerPoint = [] this.centerPoint = []
@ -416,7 +424,7 @@ const vueGis = {
}) })
map.on('singleclick', function (e) { map.on('singleclick', function (e) {
console.log(e.coordinate) // console.log(e.coordinate)
// console.log(transform(e.coordinate, 'EPSG:3857', 'EPSG:4326')); // console.log(transform(e.coordinate, 'EPSG:3857', 'EPSG:4326'));
}) })
@ -533,7 +541,6 @@ const vueGis = {
}, },
// //
handleDelPolygon () { handleDelPolygon () {
map.removeInteraction(draw); map.removeInteraction(draw);
@ -616,6 +623,7 @@ const vueGis = {
}); });
}, },
// //
async addPolygon (coorString) { async addPolygon (coorString) {
const url = "/gov/org/agency/mapaddarea" const url = "/gov/org/agency/mapaddarea"
@ -642,7 +650,6 @@ const vueGis = {
}); });
} }
}, },
// //
@ -739,19 +746,28 @@ export default vueGis;
<style scoped> <style scoped>
.div_search { .div_search {
z-index: 9999; z-index: 10;
position: absolute; position: absolute;
top: 20px; top: 20px;
left: 20px; left: 20px;
display: flex; display: flex;
} }
.div_back { .div_back {
z-index: 9999; z-index: 10;
position: absolute; position: absolute;
top: 20px; top: 20px;
right: 20px; right: 20px;
display: flex; display: flex;
} }
.div_tip {
z-index: 10;
position: absolute;
bottom: 1px;
right: 2px;
background: rgba(255, 255, 255, 0.6);
padding: 3px 10px;
font-size: 15px;
}
.div_map { .div_map {
width: 100%; width: 100%;
} }

Loading…
Cancel
Save