|
|
@ -17,8 +17,8 @@ |
|
|
|
:options="agencytree" |
|
|
|
v-model="agencyId" |
|
|
|
:show-all-levels="false" |
|
|
|
:props="{ expandTrigger: 'hover', emitPath: false, label: 'orgName', value: 'orgId', children: 'subOrgList' }" |
|
|
|
clearable/> |
|
|
|
@change="handleChangeAgencytree" |
|
|
|
:props="{ expandTrigger: 'hover', emitPath: false, label: 'orgName', value: 'orgId', children: 'subOrgList' }"/> |
|
|
|
</div> |
|
|
|
<!-- <div class="second-select "> |
|
|
|
|
|
|
@ -202,6 +202,7 @@ export default { |
|
|
|
let params = { |
|
|
|
axisStructId: this.axisStructId, |
|
|
|
pageSize: this.pageSize, |
|
|
|
agencyId: this.agencyId, |
|
|
|
pageNo: this.pageNo, |
|
|
|
} |
|
|
|
const url = "/pli/power/data/kernelHousehold/list" |
|
|
@ -284,6 +285,7 @@ export default { |
|
|
|
getMapData() { |
|
|
|
const params1 = { |
|
|
|
axisStructId: this.axisStructId, |
|
|
|
agencyId: this.agencyId, |
|
|
|
limit: 99 |
|
|
|
} |
|
|
|
// 党群服务站 |
|
|
@ -321,7 +323,7 @@ export default { |
|
|
|
this.xiaozuList.push(ob) |
|
|
|
}) |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.orgMap.addMarker(this.xiaozuList, lyxzIcon) |
|
|
|
this.$refs.orgMap.addMarker_1(this.xiaozuList, lyxzIcon) |
|
|
|
}) |
|
|
|
}).catch(err => { |
|
|
|
this.$message.error(err) |
|
|
@ -339,7 +341,7 @@ export default { |
|
|
|
this.zhongxinhuList.push(ob) |
|
|
|
}) |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.orgMap.addMarker(this.zhongxinhuList, dyzxhIcon) |
|
|
|
this.$refs.orgMap.addMarker_2(this.zhongxinhuList, dyzxhIcon) |
|
|
|
}) |
|
|
|
}).catch(err => { |
|
|
|
this.$message.error(err) |
|
|
@ -353,60 +355,80 @@ export default { |
|
|
|
// }, |
|
|
|
//获取组织数据 |
|
|
|
async getAgencylist () { |
|
|
|
const url = '/data/aggregator/org/agencytree' |
|
|
|
|
|
|
|
let params = { |
|
|
|
agencyId: this.agencyId, |
|
|
|
client:'gov' |
|
|
|
} |
|
|
|
const { data, code, msg } = await requestPost(url,params) |
|
|
|
if (code === 0) { |
|
|
|
let _data |
|
|
|
if (data) { |
|
|
|
_data = this.removeByOrgType(data, 'agency') |
|
|
|
if (_data) { |
|
|
|
this.agencytree = this.removeEmptySubOrgList(_data) |
|
|
|
this.agencyId = this.agencytree ? this.agencytree[0].orgId : '' |
|
|
|
} |
|
|
|
const url = '/data/aggregator/org/agencytree' |
|
|
|
let params = { |
|
|
|
agencyId: this.agencyId, |
|
|
|
client:'gov' |
|
|
|
} |
|
|
|
const { data, code, msg } = await requestPost(url,params) |
|
|
|
if (code === 0) { |
|
|
|
let _data |
|
|
|
if (data) { |
|
|
|
_data = this.removeByOrgType(data, 'agency') |
|
|
|
if (_data) { |
|
|
|
this.agencytree = this.removeEmptySubOrgList(_data) |
|
|
|
// 如果有子集就进入循环,如果没有就默认取第一个的id |
|
|
|
this.agencyId = this.agencytree[0].subOrgList && this.agencytree[0].subOrgList.length > 0 ? this.setListAgencyId_one(this.agencytree[0].subOrgList) : this.agencytree[0].orgId |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
}, |
|
|
|
removeByOrgType (orgArray, orgType) { |
|
|
|
if (orgArray && orgArray.length > 0) { |
|
|
|
for (let p = orgArray.length - 1; p >= 0; p--) { |
|
|
|
let orgInfo = orgArray[p] |
|
|
|
if (orgInfo) { |
|
|
|
if (orgInfo.orgType !== orgType) { |
|
|
|
orgArray.splice(p, 1) |
|
|
|
} else { |
|
|
|
this.removeByOrgType(orgInfo.subOrgList, orgType) |
|
|
|
} |
|
|
|
removeByOrgType (orgArray, orgType) { |
|
|
|
if (orgArray && orgArray.length > 0) { |
|
|
|
for (let p = orgArray.length - 1; p >= 0; p--) { |
|
|
|
let orgInfo = orgArray[p] |
|
|
|
if (orgInfo) { |
|
|
|
if (orgInfo.orgType !== orgType) { |
|
|
|
orgArray.splice(p, 1) |
|
|
|
} else { |
|
|
|
this.removeByOrgType(orgInfo.subOrgList, orgType) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return orgArray |
|
|
|
}, |
|
|
|
removeEmptySubOrgList (orgArray) { |
|
|
|
orgArray.forEach((orgInfo) => { |
|
|
|
if (orgInfo && orgInfo.subOrgList) { |
|
|
|
if (orgInfo.subOrgList.length === 0) { |
|
|
|
orgInfo.subOrgList = undefined |
|
|
|
} else { |
|
|
|
this.removeEmptySubOrgList(orgInfo.subOrgList) |
|
|
|
} |
|
|
|
} |
|
|
|
return orgArray |
|
|
|
}, |
|
|
|
removeEmptySubOrgList (orgArray) { |
|
|
|
orgArray.forEach((orgInfo) => { |
|
|
|
if (orgInfo && orgInfo.subOrgList) { |
|
|
|
if (orgInfo.subOrgList.length === 0) { |
|
|
|
orgInfo.subOrgList = undefined |
|
|
|
} else { |
|
|
|
this.removeEmptySubOrgList(orgInfo.subOrgList) |
|
|
|
} |
|
|
|
}) |
|
|
|
return orgArray; |
|
|
|
}, |
|
|
|
async handleChangeAgency (value) { |
|
|
|
let selAgency = this.$refs["myCascader"].getCheckedNodes()[0].data |
|
|
|
// this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label |
|
|
|
this.agencyName = selAgency.name |
|
|
|
this.agencyId = selAgency.agencyId |
|
|
|
this.level = selAgency.level === 'grid' ? 'grid' : 'agency' |
|
|
|
} |
|
|
|
}) |
|
|
|
return orgArray; |
|
|
|
}, |
|
|
|
// 取最后一级组织的第一条数据的 orgId |
|
|
|
setListAgencyId_one(subOrgList) { |
|
|
|
if (subOrgList[0].subOrgList && subOrgList[0].subOrgList.length > 0) { |
|
|
|
this.setAgencyId_two(subOrgList[0].subOrgList) |
|
|
|
} else { |
|
|
|
return subOrgList[0].orgId |
|
|
|
} |
|
|
|
}, |
|
|
|
setAgencyId_two(subOrgList) { |
|
|
|
if (subOrgList[0].subOrgList && subOrgList[0].subOrgList.length > 0) { |
|
|
|
this.setListAgencyId_one(subOrgList[0].subOrgList) |
|
|
|
} else { |
|
|
|
return subOrgList[0].orgId |
|
|
|
} |
|
|
|
}, |
|
|
|
async handleChangeAgencytree() { |
|
|
|
this.pageNo = 1 |
|
|
|
this.pageSize = 5 |
|
|
|
this.total = 0 |
|
|
|
this.dangqunList = [] // 党群服务站列表 |
|
|
|
this.xiaozuList = [] // 楼院小组地图坐标列表 |
|
|
|
this.zhongxinhuList = [] // 党员中心户列表 |
|
|
|
this.tableData = [] |
|
|
|
this.axisStructId = '' |
|
|
|
await this.getStructTree() |
|
|
|
await this.getCount() |
|
|
|
await this.getMapData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|