Browse Source

逻辑处理 tree网格 新增小区 为新增网格上一级id和label

kersd
井乐禹 2 years ago
parent
commit
a57993550f
  1. 72
      src/views/modules/base/community/community.vue

72
src/views/modules/base/community/community.vue

@ -250,18 +250,18 @@
</template>
<script>
import CDialog from '@c/CDialog'
import communityTable from './communityTable'
import buildTable from './buildTable'
import roomTable from './roomTable'
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import nextTick from 'dai-js/tools/nextTick'
import CDialog from '@c/CDialog';
import nextTick from 'dai-js/tools/nextTick';
import { Loading } from 'element-ui'; // Loading
import { mapGetters } from 'vuex';
import buildTable from './buildTable';
import communityTable from './communityTable';
import roomTable from './roomTable';
let loading //
export default {
data () {
data() {
let endDisabledDate = (time) => {//datareturn
let nowData = Date.now()
if (this.updateStartDate) {
@ -353,7 +353,7 @@ export default {
components: {
CDialog
},
async mounted () {
async mounted() {
this.treeLoading = true
await this.loadOrgData()
@ -372,12 +372,12 @@ export default {
},
computed: {
rowHeight () {
rowHeight() {
return this.$store.state.inIframe ? this.clientHeight - 140 + this.iframeHeight + 'px' : this.clientHeight - 140 + 'px'
},
treeHeight () {
treeHeight() {
return this.$store.state.inIframe ? this.clientHeight - 200 + this.iframeHeight + 'px' : this.clientHeight - 200 + 'px'
},
@ -385,7 +385,7 @@ export default {
...mapGetters(['clientHeight', 'iframeHeight'])
},
methods: {
handleChangeV (val) {
handleChangeV(val) {
this.buildingId = "";
this.buildingUnitId = "";
@ -394,19 +394,19 @@ export default {
// this.getUniList();
// this.getHouseList();
},
handleChangeB (val) {
handleChangeB(val) {
this.buildingUnitId = "";
this.houseId = "";
this.getUniList();
// this.getHouseList();
},
handleChangeD () {
handleChangeD() {
this.houseId = "";
this.getHouseList();
},
async getValiheList () {
async getValiheList() {
const { user } = this.$store.state;
if (!this.selGridId) {
this.selAgencyId = this.selAgencyId ? this.selAgencyId : user.agencyId
@ -436,7 +436,7 @@ export default {
},
async getBuildList () {
async getBuildList() {
const url = "/gov/org/icbuilding/buildingoption";
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/epidemicPrevention/page"
let params = {
@ -456,7 +456,7 @@ export default {
},
async getUniList () {
async getUniList() {
const url = "/gov/org/icbuildingunit/unitoption";
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/epidemicPrevention/page"
@ -476,7 +476,7 @@ export default {
},
getHouseList () {
getHouseList() {
this.$http
.post("/gov/org/ichouse/houseoption", { unitId: this.buildingUnitId })
.then(({ data: res }) => {
@ -493,7 +493,7 @@ export default {
});
},
handleSearch () {
handleSearch() {
// if (this.ownerName || this.ownerPhone || this.rentFlag || this.purpose || this.remark) {
this.showRoomTable = true
@ -508,7 +508,7 @@ export default {
},
//
resetSearch () {
resetSearch() {
this.ownerName = ''
this.ownerPhone = ''
this.rentFlag = ''
@ -527,7 +527,7 @@ export default {
// this.loadTable()
},
async loadOpenNode () {
async loadOpenNode() {
const url = "/gov/org/building/tree-ids"
let params = {}
@ -541,7 +541,7 @@ export default {
this.$message.error(msg)
}
},
async loadTree (isRefresh) {
async loadTree(isRefresh) {
const url = "/gov/org/building/treelist"
let params = {}
@ -570,7 +570,7 @@ export default {
},
//
async loadOrgData () {
async loadOrgData() {
const url = "/gov/org/agency/maporg"
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/agency/maporg"
let params = {}
@ -589,7 +589,17 @@ export default {
},
async handleNodeClick (obj) {
async handleNodeClick(obj) {
if (obj.level == "grid") {
obj.id = obj.pid
this.treeData[0]['children'].forEach(f => {
f['children'].forEach(item => {
if (item.id == obj.id) {
obj.label = item.label
}
})
})
}
this.ownerName = ''
this.ownerPhone = ''
this.rentFlag = ''
@ -643,7 +653,7 @@ export default {
},
//
async refreshTree () {
async refreshTree() {
this.treeLoading = true
await this.loadTree(this.selTreeObj.id)
this.$nextTick(() => {
@ -654,7 +664,7 @@ export default {
},
//
toNextLevel (row, level) {
toNextLevel(row, level) {
if (level === 'community') {
this.selTreeObj = this.$refs.ref_tree.getNode(row.neighborHoodId).data
@ -683,7 +693,7 @@ export default {
},
//
getTreeObj (obj) {
getTreeObj(obj) {
//
// idtype
// idtypeidid
@ -734,13 +744,13 @@ export default {
},
filterNode (value, data) {
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
startLoading () {
startLoading() {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
@ -748,7 +758,7 @@ export default {
})
},
//
endLoading () {
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close()
@ -756,7 +766,7 @@ export default {
}
},
watch: {
filterText (val) {
filterText(val) {
this.$refs.ref_tree.filter(val);
}
},

Loading…
Cancel
Save