Commit 962395a3 authored by 杨帆's avatar 杨帆

Merge branch 'dev-yf'' into 'develop'

Dev yf'

See merge request !18
parents 3dd68a2d c3ac617c
......@@ -231,6 +231,8 @@ export default {
this.changeBuild(res.data[0].name);
this.option0 = this.changeData(res.data);
this.value0 = res.data[0].name || "";
console.log(this.value0, 222);
this.changeBuild();
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
......@@ -243,7 +245,14 @@ export default {
.then(res => {
this.option2 = this.changeData(res.data);
this.value2 = res.data[0].id || 0;
console.log(this.value2, "vlaue2");
resolve(res.data);
let risk = this.riskList(
this.planId,
this.buildingId,
this.value1,
this.value2
);
})
.catch(() => {
this.$toast.fail("加载失败,请稍后再试");
......@@ -271,31 +280,37 @@ export default {
});
});
},
async getRiskList(id) {
getRiskList(id) {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
let floor = await this.floorList(this.buildingId);
let risk = await this.riskList(id, this.buildingId);
let floor = this.floorList(this.buildingId);
let risk = this.riskList(
this.planId,
this.buildingId,
this.value1,
this.value2
);
this.$toast.clear();
},
async tabList(value) {
let floor = await this.floorList(value);
let risk = await this.riskList(this.planId, value);
},
changeBuild(name) {
console.log(name);
let arr = this.floorListData.map(item => {
if (item.name == name) {
return item.children;
}
});
this.option1 = this.changeData(arr[0]);
this.value1 = arr[0][0].id;
this.roomList(this.value1);
changeBuild() {
if (this.value0) {
console.log(this.floorListData, this.value0, 111);
let arr = this.floorListData.filter(item => item.name == this.value0)[0]
.children;
console.log(arr);
this.option1 = this.changeData(arr);
this.value1 = arr[0].id;
this.roomList(this.value1);
}
},
async changeFloor() {
let room = await this.roomList(this.value1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment