|
|
@@ -9,7 +9,7 @@
|
|
|
控制台
|
|
|
</div>
|
|
|
<div class="cslist cubeContent">
|
|
|
- <div class="cstitle">
|
|
|
+ <div class="cstitle" @click="ClickGetInfo(0,0)">
|
|
|
安全监控首页
|
|
|
</div>
|
|
|
<div class="loft cspart">
|
|
|
@@ -19,31 +19,43 @@
|
|
|
<el-row :gutter="21">
|
|
|
<el-col :span="8" v-for="(loft,i) in loftList">
|
|
|
<div :class="[{'active':loftIndex == i+1 }]" @click="ClickGetInfo(1,i)">
|
|
|
- <div class="grid-content bg-purple"> {{loft.name}}</div>
|
|
|
+ <div class="grid-content bg-purple"> {{loft.Name}}</div>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
- <div class="manage cspart">
|
|
|
+ <div class="manage cspart" v-show="manageList.length != 0">
|
|
|
<div class="lt_title">
|
|
|
楼层管理区域
|
|
|
</div>
|
|
|
<el-row :gutter="21">
|
|
|
<el-col :span="8" v-for="(manage,j) in manageList">
|
|
|
<div :class="[{'active':manageIndex ==j+1 }]" @click="ClickGetInfo(2,j)">
|
|
|
- <div class="grid-content bg-purple">{{manage.name}}</div>
|
|
|
+ <div class="grid-content bg-purple">{{manage.Name}}</div>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
- <div class="equip cspart">
|
|
|
+ <div class="manage cspart" v-show="RoomList.length != 0">
|
|
|
+ <div class="lt_title">
|
|
|
+ 房间管理区域
|
|
|
+ </div>
|
|
|
+ <el-row :gutter="21">
|
|
|
+ <el-col :span="8" v-for="(Room,j) in RoomList">
|
|
|
+ <div :class="[{'active':RoomIndex ==j+1 }]" @click="ClickGetInfo(3,j)">
|
|
|
+ <div class="grid-content bg-purple">{{Room.Name}}</div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <div class="equip cspart" v-show="equipList.length != 0">
|
|
|
<div class="lt_title">
|
|
|
SignalDigger设备
|
|
|
</div>
|
|
|
<el-row :gutter="21">
|
|
|
<el-col :span="8" v-for="(equip,t) in equipList">
|
|
|
- <div :class="[{'active':equipIndex == t+1 }]" @click="ClickGetInfo(3,t)">
|
|
|
- <div class="grid-content bg-purple"> {{equip.name}}</div>
|
|
|
+ <div :class="[{'active':equipIndex == t+1 }]" @click="ClickGetInfo(4,t)">
|
|
|
+ <div class="grid-content bg-purple"> {{equip.Name}}</div>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -55,16 +67,20 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {getLoftInfo} from '../api/getApiRes.js'
|
|
|
+ import {GetRegionAndDectorSelect} from '../api/getApiRes.js'
|
|
|
|
|
|
+ let qs = require('qs');
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
loftList: [],
|
|
|
manageList: [],
|
|
|
+ RoomList: [],
|
|
|
equipList: [],
|
|
|
+ FullChildlRs: [],
|
|
|
loftIndex: 0,
|
|
|
manageIndex: 0,
|
|
|
+ RoomIndex: 0,
|
|
|
equipIndex: 0,
|
|
|
};
|
|
|
},
|
|
|
@@ -73,13 +89,15 @@
|
|
|
},
|
|
|
methods: {
|
|
|
// 获取楼层信息
|
|
|
- ClickGetInfo(list, index) {
|
|
|
+ ClickGetInfo(level, index) {
|
|
|
// 切换到选中
|
|
|
this.loftIndex = 0;
|
|
|
this.manageIndex = 0;
|
|
|
this.equipIndex = 0;
|
|
|
let thisBtn = {};
|
|
|
- switch (parseInt(list)) {
|
|
|
+ switch (parseInt(level)) {
|
|
|
+ case 0:
|
|
|
+ break;
|
|
|
case 1:
|
|
|
this.loftIndex = index + 1;
|
|
|
thisBtn = this.loftList[index];
|
|
|
@@ -89,20 +107,85 @@
|
|
|
thisBtn = this.manageList[index];
|
|
|
break;
|
|
|
case 3:
|
|
|
+ this.RoomIndex = index + 1;
|
|
|
+ thisBtn = this.RoomList[index];
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
this.equipIndex = index + 1;
|
|
|
thisBtn = this.equipList[index];
|
|
|
break;
|
|
|
}
|
|
|
+ this.$emit('refreshList', level, thisBtn);
|
|
|
+ if (thisBtn) {
|
|
|
+ this.showMyChild(level, thisBtn);
|
|
|
+ this.thisShowPart(level, thisBtn);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 展示下层节点
|
|
|
+ showMyChild(level, thisBtn) {
|
|
|
+ let that = this;
|
|
|
+ switch (parseInt(level)) {
|
|
|
+ case 1:
|
|
|
+ that.manageList = [];
|
|
|
+ that.RoomIndex = 0;
|
|
|
+ that.equipIndex = 0;
|
|
|
+ that.RoomList = [];
|
|
|
+ that.equipList = [];
|
|
|
+ for (var i = 0; i < that.FullChildlRs.length; i++) {
|
|
|
+ if (that.FullChildlRs[i].Id == thisBtn.Id) {
|
|
|
+ that.manageList = that.FullChildlRs[i].ChildSelect;
|
|
|
+ that.equipList = that.FullChildlRs[i].Detselect;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ that.RoomIndex = 0;
|
|
|
+ that.equipIndex = 0;
|
|
|
+ that.RoomList = [];
|
|
|
+ that.equipList = [];
|
|
|
+ for (var i = 0; i < that.FullChildlRs.length; i++) {
|
|
|
+ for (var t = 0; t < that.FullChildlRs[i].ChildSelect.length; t++) {
|
|
|
+ if (that.FullChildlRs[i].ChildSelect[t].Id == thisBtn.Id) {
|
|
|
+ that.RoomList = that.FullChildlRs[i].ChildSelect[t].ChildSelect;
|
|
|
+ that.equipList = that.FullChildlRs[i].ChildSelect[t].Detselect;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ that.equipList = [];
|
|
|
+ for (var i = 0; i < that.FullChildlRs.length; i++) {
|
|
|
+ for (var t = 0; t < that.FullChildlRs[i].ChildSelect.length; t++) {
|
|
|
+ for (var j = 0; j < that.FullChildlRs[i].ChildSelect[t].ChildSelect.length; j++) {
|
|
|
+ if (that.FullChildlRs[i].ChildSelect[t].ChildSelect[j].Id == thisBtn.Id) {
|
|
|
+ that.equipList = that.FullChildlRs[i].ChildSelect[t].ChildSelect[j].Detselect;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ that.RoomIndex = 0;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ thisShowPart(level, thisBtn) {
|
|
|
+
|
|
|
},
|
|
|
// 获取楼层信息
|
|
|
getLoftList() {
|
|
|
- let postdata = {};
|
|
|
- getLoftInfo(postdata).then(res => {
|
|
|
+ let param = {
|
|
|
+ 'token': localStorage.token,
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ GetRegionAndDectorSelect(postdata).then(res => {
|
|
|
let json = res;
|
|
|
if (json.Code == 0) {
|
|
|
- this.loftList = json.Rs;
|
|
|
- this.manageList = json.Rs;
|
|
|
- this.equipList = json.Rs;
|
|
|
+ this.loftList = json.Region1Rs;//所有1级
|
|
|
+ this.manageList = json.Region2Rs;//所有2级
|
|
|
+ this.RoomList = json.Region3Rs;//所有3级
|
|
|
+ this.equipList = json.DectectorRs;//所有设备
|
|
|
+ this.FullChildlRs = json.FullChildlRs;//全部关系
|
|
|
} else {
|
|
|
that.$message.error(json.Memo);
|
|
|
}
|
|
|
@@ -134,6 +217,7 @@
|
|
|
border: 1px solid #005EA2;
|
|
|
line-height: 45px;
|
|
|
margin-bottom: 26px;
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
|
|
|
|
.cspart {
|