Browse Source

动态展示数据

V1.0
PLUTO 2 years ago
parent
commit
102e6c1863
  1. 46
      src/views/dataBoard/cpts/homeDetails/index.vue

46
src/views/dataBoard/cpts/homeDetails/index.vue

@ -167,6 +167,7 @@ export default {
}, },
getUnitList(id) { getUnitList(id) {
this.loading = true;
this.$http.get(`/actual/base/streetOverview/getUnitHouseList?unitId=` + id).then((res) => { this.$http.get(`/actual/base/streetOverview/getUnitHouseList?unitId=` + id).then((res) => {
const { const {
code, code,
@ -189,35 +190,36 @@ export default {
}, },
getList(buid) { getList(buid) {
this.loading = true;
const homeType = this.$route.query.typeB; const homeType = this.$route.query.typeB;
if (homeType === "building") { if (homeType === "building") {
this.$http.get(`/actual/base/streetOverview/getUnitListByBuilding?buildingId=` + "1514914015259979777").then((res) => { // 1514914015259979777
this.$http.get(`/actual/base/streetOverview/getUnitListByBuilding?buildingId=` + this.$route.query.id).then((res) => {
const { code, data } = res.data; const { code, data } = res.data;
if (code === 0) { if (code === 0) {
this.buildingList = data; this.buildingList = data;
this.homeText = this.buildingList[0].buildingName + this.buildingList[0].unitName; this.homeText = this.buildingList[0].buildingName + this.buildingList[0].unitName;
if (buid) { if (this.buildingList && this.buildingList.length > 0) {
this.buildingList.forEach((item, i) => { if (buid) {
console.log(item); this.buildingList.forEach((item, i) => {
if (item.id === buid) { console.log(item);
item.ifActive = true; if (item.id === buid) {
this.getUnitList(item.id); item.ifActive = true;
} else { this.getUnitList(item.id);
item.ifActive = false; } else {
} item.ifActive = false;
}); }
} else { });
this.buildingList.forEach((item, i) => { } else {
if (i === 0) { this.buildingList.forEach((item, i) => {
item.ifActive = true; if (i === 0) {
this.getUnitList(item.id); item.ifActive = true;
} else { this.getUnitList(item.id);
item.ifActive = false; } else {
} item.ifActive = false;
}); }
});
}
} }
this.loading = false; this.loading = false;
} else { } else {
this.loading = false; this.loading = false;

Loading…
Cancel
Save