Browse Source

Merge branch 'dev_pli_power_axis'

shibei_master
YUJT 3 years ago
parent
commit
c9385171fb
  1. 2
      src/router/index.js
  2. BIN
      src/views/modules/plugins/assets/boy.png
  3. BIN
      src/views/modules/plugins/assets/girl.png
  4. 136
      src/views/modules/plugins/power/kernelhouseholdAddMember.vue
  5. 55
      src/views/modules/plugins/power/kernelhouseholdTable.vue
  6. 11
      src/views/modules/plugins/power/poweraxis_add_leader.vue
  7. 355
      src/views/modules/visual/plugin/power/components/screen-org-map.vue
  8. 2
      src/views/modules/visual/plugin/power/organization.vue

2
src/router/index.js

@ -103,7 +103,7 @@ export const moduleShujuRoutes = {
component: () => import("@/views/main-shuju/main"),
name: "main-shuju",
redirect: {
path: "/main-shuju/visual-basicinfo-basicInfoMain",
path: "/main-shuju/visual-plugin-power-organization",
},
meta: {
title: "主入口布局",

BIN
src/views/modules/plugins/assets/boy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
src/views/modules/plugins/assets/girl.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

136
src/views/modules/plugins/power/kernelhouseholdAddMember.vue

@ -0,0 +1,136 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<div>
<div class="div_table">
<el-table ref="ref_table"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%"
highlight-current-row
@selection-change="selectionChange">
<el-table-column type="selection"
width="55">
</el-table-column>
<el-table-column prop="name"
label="姓名">
</el-table-column>
<el-table-column prop="mobile"
label="联系方式">
</el-table-column>
<el-table-column prop="idCard"
label="身份证号">
</el-table-column>
</el-table>
</div>
</div>
</div>
<div class="div_btn">
<el-button size="small"
@click="handleCancle"> </el-button>
<el-button size="small"
type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { requestPost } from "@/js/dai/request";
export default {
data () {
return {
btnDisable: false,
//
tableData: [],
tableLoading: false,
selection: [],
houseId: '',
ownerName: ''
}
},
props: {
},
computed: {
tableHeight () {
return this.$store.state.inIframe ? this.clientHeight - 410 + this.iframeHeight : this.clientHeight - 410
},
...mapGetters(['clientHeight', 'iframeHeight'])
},
components: {},
// mounted () {
// this.tableLoading = true
// this.loadTable()
// },
methods: {
initForm (id, ownerName) {
this.houseId = id
this.ownerName = ownerName
this.tableLoading = true
this.loadTable()
},
selectionChange (selection) {
// console.log(selection)
this.selection = []
selection.forEach(element => {
this.selection.push({
kernelMemberId: element.id,
kernelMemberName: element.name
})
});
},
//
async handleComfirm () {
if (this.selection.length === 0 || !this.selection) {
return this.$message.error('请选择党员')
}
const url = "/pli/power/kernelMember/bind";
let params = {
houseId: this.houseId,
ownerName: this.ownerName,
kernelMemberList: this.selection
}
const { data, code, msg } = await requestPost(url, params);
this.tableLoading = false
if (code === 0) {
this.$refs.ref_table.clearSelection();
this.$emit('addMemberOk')
}
},
//
handleCancle () {
this.$refs.ref_table.clearSelection();
this.$emit('addMemberCancle')
},
//
async loadTable () {
const url = `/epmetuser/icresiuser/listhomeuserbrief/${this.houseId}`
const { data, code, msg } = await requestPost(url)
this.tableLoading = false
if (code === 0) {
this.tableData = data ? data.map((item) => { return item }) : []
}
}
},
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManage.scss";
</style>
<style lang="scss" scoped>
.div_btn{
display: flex;
align-items: center;
justify-content: center;
}
</style>

55
src/views/modules/plugins/power/kernelhouseholdTable.vue

@ -2,7 +2,7 @@
<div>
<div class="div_search">
<div class="resi-cell">
<div class="resi-cell-label">房主姓名</div>
<div class="resi-cell-label">党员名称</div>
<div class="resi-cell-value">
<el-input v-model="ownerName"
class="resi-cell-input"
@ -32,7 +32,11 @@
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%">
<el-table-column prop="ownerName"
label="姓名"
label="户主"
width="100">
</el-table-column>
<el-table-column prop="kernelMemberNameConcat"
label="中心党员"
width="100">
</el-table-column>
<el-table-column prop="address"
@ -48,7 +52,7 @@
</el-table-column>
<el-table-column label="操作"
fixed="right"
width="80"
width="150"
header-align="center"
align="center"
class="operate">
@ -57,6 +61,10 @@
class="div-table-button--delete"
size="small"
@click="handleDelete(scope.row.id)">删除</el-button>
<el-button type="text"
class="div-table-button--edit"
size="small"
@click="handleAddMember(scope.row.houseId, scope.row.ownerName)">中心党员</el-button>
</template>
</el-table-column>
</el-table>
@ -86,12 +94,26 @@
:axisStructId="axisStructId"></kernelhousehold-form>
</el-dialog>
<!-- 添加党员 -->
<el-dialog :visible.sync="addMemberShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="addMemberTitle"
width="850px"
top="5vh"
class="dialog-h"
@closed="addMemberClose">
<kernelhousehold-Add-Member ref="ref_table_Member"
@addMemberCancle="addMemberCancle"
@addMemberOk="addMemberOk"></kernelhousehold-Add-Member>
</el-dialog>
</div>
</template>
<script>
import KernelhouseholdForm from './kernelhouseholdForm'
import KernelhouseholdAddMember from './kernelhouseholdAddMember'
import { requestPost, requestGet } from "@/js/dai/request";
import { mapGetters } from 'vuex'
export default {
@ -105,11 +127,15 @@ export default {
tableData: [],
//form
formShow: false,
formTitle: '绑定'
formTitle: '绑定',
addMemberShow: false,
addMemberTitle: '绑定'
}
},
components: {
KernelhouseholdForm
KernelhouseholdForm,
KernelhouseholdAddMember
},
computed: {
tableHeight () {
@ -125,7 +151,7 @@ export default {
limit: this.pageSize,
page: this.pageNo,
axisStructId: this.axisStructId,
ownerName: this.ownerName
kernelMemberName: this.ownerName
}
const { data, code, msg, total } = await requestGet(url, params)
if (code === 0) {
@ -149,6 +175,13 @@ export default {
})
},
handleAddMember(id, ownerName) {
this.addMemberShow = true
this.$nextTick(() => {
this.$refs.ref_table_Member.initForm(id, ownerName)
})
},
async deleteKernelhousehold (id) {
const url = "/pli/power/kernelHousehold/delete"
const { data, code, msg } = await requestPost(url, [id])
@ -181,6 +214,9 @@ export default {
// this.$refs.ref_form.resetData()
this.formShow = false
},
addMemberClose () {
this.addMemberShow = false
},
handleAdd () {
if (this.axisStructId) {
this.formShow = true
@ -191,10 +227,17 @@ export default {
addFormCancle () {
this.formShow = false
},
addMemberCancle () {
this.addMemberShow = false
},
addFormOk () {
this.formShow = false
this.loadTable()
},
addMemberOk () {
this.addMemberShow = false
this.loadTable()
},
},
props: {
axisStructId: {

11
src/views/modules/plugins/power/poweraxis_add_leader.vue

@ -82,9 +82,13 @@
<script>
import debounce from 'lodash/debounce'
import { requestPost } from "@/js/dai/request";
import boy from '../assets/boy.png'
import girl from '../assets/girl.png'
export default {
data () {
return {
boy: boy,
girl: girl,
tagTab: 'add',
btnDisable: false,
uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2',
@ -164,8 +168,6 @@ export default {
},
handleImgSuccess (type, res, file) {
if (res.code === 0 && res.msg === 'success') {
// console.log('type', type)
// console.log('res.data.url', res.data.url)
this.dataForm.avatar = res.data.url
} else {
this.$message.error(res.msg)
@ -202,6 +204,11 @@ export default {
...this.dataForm,
...data
}
if (this.dataForm.gender === '1') {
this.dataForm.avatar = this.dataForm.avatar ? this.dataForm.avatar : this.boy
} else {
this.dataForm.avatar = this.dataForm.avatar ? this.dataForm.avatar : this.girl
}
} else {
this.$message.error(msg)
}

355
src/views/modules/visual/plugin/power/components/screen-org-map.vue

@ -23,6 +23,7 @@ import { createStringXY } from 'ol/coordinate'
import { defaults as defaultControls } from 'ol/control'
import { mapGetters } from "vuex"
import { Loading } from 'element-ui'
import { requestPost } from "@/js/dai/request"
let map
let mapView
@ -30,6 +31,21 @@ let gaodeMapLayer // 背景地图图层
let markerSource
let markerLayer
let parentLayer;//
let parentSource;//
let parentPolygon = []
let subAgencyArray = []
// let coordinates = "120.37330480288234,36.09522923236327,120.37414203308269,36.08471360544846,120.37538113592544,36.08156561138691,120.37856261681883,36.08273773673343,120.380806397435,36.082838206810294,120.38244737292013,36.082804716145915,120.3844902172151,36.082804716145915,120.38552838373664,36.08277122739781,120.38991547489212,36.08166608146377,120.39209227801209,36.08099629692024,120.3958095865403,36.080192555468,120.39912502242612,36.080192555468,120.40110089305742,36.08025953296422,120.40197160817334,36.082369356671684,120.4011678667211,36.08457964662348,120.40006272270334,36.08665598158284,120.3979863858277,36.08889976219901,120.39751753952164,36.09037329011105,120.39785243083527,36.09161239295379,120.3990245561818,36.09419106584173,120.39775196842349,36.09573157124999,120.3975845208504,36.09646833520601,120.37330480288234,36.09522923236327"
let polygonSource;//
let iconSource; // icon
let polygonLayer;//
let select;//
let iconLayer; // icon
let iconCoordinators = []
const iconArray = [
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/a219130b6bc74b0b80b5ddb0fce0892a.png',
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/a775d15e62374350b80e5cdf1912a4eb.png',
@ -40,21 +56,72 @@ const textColorArray = [
'rgba(0, 146, 238, 0.75)',
'rgba(238, 151, 0, 0.8)'
]
let polygonColorArray = [
'rgba(210, 2, 2, 0.24)',
'rgba(43, 231, 253, 0.25)',
'rgba(183, 185, 0, 0.16)'
];
let iconUrlArray = [
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/a219130b6bc74b0b80b5ddb0fce0892a.png',
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/a775d15e62374350b80e5cdf1912a4eb.png',
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/884efcf6d6b44224a7fda599dd1b14cb.png'
];
//
var createTextStyle = function (feature) {
return new Text({
textAlign: undefined,
font: "18px Arial",
text: feature.values_.properties.name,
//fontFamily: "Courier New, monospace",
// fontWeight: "bold",
text: feature.values_.name,
backgroundFill: new Fill({
color: textColorArray[0]
// color: 'rgba(0, 146, 238, 0.75)'
color: textColorArray[feature.values_.colorIndex]
}),
padding: [4, 10, 4, 10],
//text: "",
fill: new Fill({ color: "#ffffff" }),
// stroke: new Stroke({ color: "#ffffff", width: 3 }),
offsetY: -30,
offsetX: -50,
overflow: true,
})
}
});
};
//
var parentStyleFunction = (function () {
return function (feature) {
return new Style({
// fill: new Fill({
// color: [255, 255, 255, 0.3]
// }),
stroke: new Stroke({
color: [0, 103, 182, 1],
width: 2
}),
// text: createTextStyle(feature)
});;
};
})()
//
var polygonStyleFunction = (function () {
return function (feature) {
return new Style({
fill: new Fill({
// color: [255, 255, 255, 0.3]
color: polygonColorArray[feature.values_.colorIndex]
}),
stroke: new Stroke({
color: polygonColorArray[feature.values_.colorIndex],
width: 3
}),
text: createTextStyle(feature)
});;
};
})()
export default {
name: "screen-org-map",
data() {
@ -64,8 +131,21 @@ export default {
minZoom: 1, //
}
},
mounted() {
async mounted() {
//
await this.loadOrgData()
this.initMap()
this.addParentLayer()
this.loadParentPolygon()
//
this.addPolygonLayer()
//icontuceng
this.addIconLayer()
//
this.loadPolygon()
},
methods: {
initMap () {
@ -151,6 +231,271 @@ export default {
markerSource.addFeatures(features)
map.addLayer(markerLayer)
},
//
async loadOrgData () {
const url = "/gov/org/agency/maporg"
let params = {
orgId: '',
level: ''
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
// this.orgData = data
// this.orgId = this.orgData.id
// this.orgLevel = this.orgData.level
parentPolygon = []
parentPolygon.push(data)
if (data.children && data.children.length > 0) {
subAgencyArray = data.children
} else {
subAgencyArray = []
}
} else {
this.$message.error(msg)
}
},
//
loadParentPolygon () {
parentSource.clear()//
let featureData = []//
if (parentPolygon && parentPolygon.length > 0) {//
let oneData = {}
parentPolygon.forEach(agencyItem => {
if (agencyItem.coordinates && agencyItem.coordinates !== '') {//
oneData = {
type: 'Feature',
id: agencyItem.id,
properties: {
id: agencyItem.id,
level: agencyItem.level,
name: agencyItem.name
},
geometry: {
type: 'Polygon',
coordinates: [],
},
}
let coorArray = agencyItem.coordinates.split(',')//
let itemArray = []//[lon,lat]
let polygonArray = []//[[lon,lat],[lon,lat],[lon,lat]]
coorArray.forEach((item, index) => {
itemArray.push(item)
if (index % 2 == 0) {//
} else {//
polygonArray.push(itemArray)
itemArray = []
}
});
oneData.geometry.coordinates.push(polygonArray)
featureData.push(oneData)
}
});
}
if (featureData && featureData.length > 0) {
var geojsonObject = {
'type': 'FeatureCollection',
'features': featureData
};
let feature = (new GeoJSON()).readFeatures(geojsonObject)
parentSource.addFeatures(feature)
}
},
//
loadPolygon () {
let featureData = []//
if (subAgencyArray && subAgencyArray.length > 0) {//
let oneData = {}
let count = 0
for (let i = 0; i < subAgencyArray.length; i++) {
const agencyItem = subAgencyArray[i]
if (agencyItem.coordinates && agencyItem.coordinates !== '') {//
let urlNum = count % 3
count++
oneData = {
type: 'Feature',
id: agencyItem.id,
properties: {
id: agencyItem.id,
level: agencyItem.level,
name: agencyItem.name,
colorIndex: urlNum//
},
geometry: {
type: 'Polygon',
coordinates: [],
},
}
let coorArray = agencyItem.coordinates.split(',')//
let itemArray = []//[lon,lat]
let polygonArray = []//[[lon,lat],[lon,lat],[lon,lat]]
coorArray.forEach((item, index) => {
itemArray.push(item)
if (index % 2 == 0) {//
} else {//
polygonArray.push(itemArray)
itemArray = []
}
});
oneData.geometry.coordinates.push(polygonArray)
featureData.push(oneData)
}
}
}
if (featureData && featureData.length > 0) {
var geojsonObject = {
'type': 'FeatureCollection',
'features': featureData
};
let feature = (new GeoJSON()).readFeatures(geojsonObject)
polygonSource.addFeatures(feature)
let iconFeatures = [];
feature.forEach(oneIcon => {
var extent = boundingExtent(oneIcon.getGeometry().getCoordinates()[0]); //[minx,miny,maxx,maxy]
// var center = getCenter(extent); //
//
let x = (parseFloat(extent[0]) + parseFloat(extent[2])) / 2
let y = (parseFloat(extent[1]) + parseFloat(extent[3])) / 2
let oneArray = [x, y]
iconCoordinators.push(oneArray)
// debugger
//icon
let oneCctv = new Feature({
geometry: new Point([x, y]),
id: oneIcon.id_,
properties: {
type: "icon",
id: oneIcon.id_
}
});
let iconStyle = new Style({
image: new Icon({
// anchor: [0.5, 0.5],
// imgSize: [32, 32],
scale: 0.5,
// src: "/img/largeScreen/icon_camra.png"
// src: "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/a219130b6bc74b0b80b5ddb0fce0892a.png"
src: iconUrlArray[oneIcon.values_.colorIndex]
})
});
oneCctv.setStyle(iconStyle);
iconFeatures.push(oneCctv);
});
iconSource.addFeatures(iconFeatures);
}
},
//
addParentLayer () {
parentSource = new VectorSource({
//features: (new GeoJSON()).readFeatures(geojsonObject)
});
parentLayer = new VectorLayer({
source: parentSource,
style: parentStyleFunction,
zIndex: 50
});
map.addLayer(parentLayer)
},
//
addPolygonLayer () {
polygonSource = new VectorSource({
//features: (new GeoJSON()).readFeatures(geojsonObject)
});
polygonLayer = new VectorLayer({
source: polygonSource,
style: polygonStyleFunction,
zIndex: 50
});
//
var overlayStyle = (function () {
return function (feature) {
var styles = {};
styles['Polygon'] = [
new Style({
stroke: new Stroke({
color: '#ec9000',
width: 2
})
}),
new Style({
fill: new Fill({
color: 'rgba(0, 0, 255, 0.1)'
})
}),
new Style({
text: createTextStyle(feature)
})
];
styles['MultiPolygon'] = styles['Polygon'];
return styles[feature.getGeometry().getType()];
};
})();
select = new Select({
style: overlayStyle
});
map.addLayer(polygonLayer)
map.addInteraction(select);
// select.on('select', e => {
// this.toSubAgency('polygon', e)
// });
},
addIconLayer () {
iconSource = new VectorSource({
//features: (new GeoJSON()).readFeatures(geojsonObject)
});
iconLayer = new VectorLayer({
source: iconSource,
zIndex: 70
});
map.addLayer(iconLayer);
},
},
}
</script>

2
src/views/modules/visual/plugin/power/organization.vue

@ -129,7 +129,7 @@ export default {
return {
headerList: [
{ title: "序号", coulmn: 'index', width: '100px' },
{ title: "党员", coulmn: 'ownerName' },
{ title: "党员", coulmn: 'kernelMemberNameConcat' },
{ title: "地址", coulmn: 'address' }
],
headerStyle: [

Loading…
Cancel
Save