Browse Source

党员中心户

shibei_master
zhaoyongnian 3 years ago
parent
commit
d86deddcfb
  1. 182
      src/views/modules/plugins/power/kernelhousehold.vue
  2. 2
      src/views/modules/plugins/power/kernelhouseholdForm.vue
  3. 2
      src/views/modules/plugins/power/kernelhouseholdTable.vue

182
src/views/modules/plugins/power/kernelhousehold.vue

@ -1,31 +1,48 @@
<template>
<div class="div_main">
<div :style="{height:rowHeight}"
class="div_tree">
<el-input placeholder="输入关键字进行过滤"
v-model="filterText">
</el-input>
<el-scrollbar :style="{height:treeHeight}"
class="scrollar">
<el-tree ref="ref_tree"
v-loading="treeLoading"
class="filter_tree"
:data="treeData"
:props="defaultProps"
:highlight-current="true"
node-key="id"
:expand-on-click-node="false"
default-expand-all
:filter-node-method="filterNode"
@node-click="handleNodeClick">
</el-tree>
</el-scrollbar>
<div>
<div class="div_search">
<el-form :rules="dataRule" :inline="true">
<el-form-item label="所属组织" prop="deptName">
<el-cascader
style="width:350px"
placeholder="请选择所属组织"
:options="agencytree"
v-model="agencyId"
:props="{ expandTrigger: 'hover', label: 'orgName', value: 'orgId', children: 'subOrgList' }"
clearable/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="loadTree()">加载动力主轴</el-button>
</el-form-item>
</el-form>
</div>
<div :style="{height:rowHeight}"
class="div_table">
<kernelhousehold-table :axisStructId="axisStructId" ref="ref_communityTable"></kernelhousehold-table>
<div class="div_main">
<div :style="{height:rowHeight}"
class="div_tree">
<el-input placeholder="输入关键字进行过滤"
v-model="filterText">
</el-input>
<el-scrollbar :style="{height:treeHeight}"
class="scrollar">
<el-tree ref="ref_tree"
v-loading="treeLoading"
class="filter_tree"
:data="treeData"
:props="defaultProps"
:highlight-current="true"
node-key="id"
:expand-on-click-node="false"
default-expand-all
:filter-node-method="filterNode"
@node-click="handleNodeClick">
</el-tree>
</el-scrollbar>
</div>
<div :style="{height:rowHeight}"
class="div_table">
<kernelhousehold-table :axisStructId="axisStructId" ref="ref_communityTable"></kernelhousehold-table>
</div>
</div>
</div>
</template>
@ -34,14 +51,13 @@ import CDialog from '@c/CDialog'
import kernelhouseholdTable from './kernelhouseholdTable'
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
let loading //
export default {
data () {
return {
agencytree: [], //
agencyId: '',
filterText: '',
treeLoading: true,
treeLoading: false,
treeData: [],
defaultProps: {
children: 'children',
@ -53,37 +69,42 @@ export default {
}
},
async mounted () {
this.treeLoading = true
await this.loadTree()
this.treeLoading = false
// this.treeLoading = true
// await this.loadTree()
await this.getAgencyTree()
// this.treeLoading = false
},
computed: {
rowHeight () {
return this.$store.state.inIframe ? this.clientHeight - 120 + this.iframeHeight + 'px' : this.clientHeight - 120 + 'px'
return this.$store.state.inIframe ? this.clientHeight - 230 + this.iframeHeight + 'px' : this.clientHeight - 230 + 'px'
},
treeHeight () {
return this.$store.state.inIframe ? this.clientHeight - 200 + this.iframeHeight + 'px' : this.clientHeight - 200 + 'px'
return this.$store.state.inIframe ? this.clientHeight - 310 + this.iframeHeight + 'px' : this.clientHeight - 310 + 'px'
},
...mapGetters(['clientHeight', 'iframeHeight'])
...mapGetters(['clientHeight', 'iframeHeight']),
dataRule () {
return {
deptName:[
{ required: true, message: "请选择", trigger: "blur" }
]
}
}
},
methods: {
async loadTree (isRefresh) {
async loadTree () {
if (this.agencyId.length === 0 || !this.agencyId) {
return this.$message.error('请选择所属组织')
}
this.treeLoading = true
const url = "/pli/power/data/axis/structTree"
let params = {
agencyId: '1495655378069753857'
agencyId: this.agencyId[this.agencyId.length-1]
}
const { data, code, msg } = await requestPost(url, params)
this.treeLoading = false
if (code === 0) {
this.treeData = data
if (!isRefresh && data.length > 0) {
this.selTreeObj = data[0]
if (!this.selTreeObj.latitude) {
this.selTreeObj.latitude = this.centerPoint[0]
}
if (!this.selTreeObj.longitude) {
this.selTreeObj.longitude = this.centerPoint[1]
}
}
} else {
this.$message.error(msg)
}
@ -95,20 +116,55 @@ export default {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
//
async getAgencyTree(){
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)
}
}
} else {
this.$message.error(msg)
}
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
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;
}
},
watch: {
@ -122,7 +178,15 @@ export default {
}
</script>
<style lang="scss" scoped >
.div_search {
width: calc(100% - 5px);
background: #ffffff;
border-radius: 4px;
padding: 30px 20px 5px;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
}
.div_main {
margin-top: 10px;
display: flex;
}
.scrollar {

2
src/views/modules/plugins/power/kernelhouseholdForm.vue

@ -97,7 +97,7 @@ export default {
},
computed: {
tableHeight () {
return this.$store.state.inIframe ? this.clientHeight - 300 + this.iframeHeight : this.clientHeight - 300
return this.$store.state.inIframe ? this.clientHeight - 410 + this.iframeHeight : this.clientHeight - 410
},
...mapGetters(['clientHeight', 'iframeHeight'])
},

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

@ -105,7 +105,7 @@ export default {
},
computed: {
tableHeight () {
return this.$store.state.inIframe ? this.clientHeight - 300 + this.iframeHeight : this.clientHeight - 300
return this.$store.state.inIframe ? this.clientHeight - 410 + this.iframeHeight : this.clientHeight - 410
},
...mapGetters(['clientHeight', 'iframeHeight'])
},

Loading…
Cancel
Save