| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401 |
- <template>
- <div class="mainContainer">
- <div class="mlt">
- <Console @refreshList="changPanel"></Console>
- </div>
- <div class="mcenter">
- <div class="cube">
- <div class="total">
- <div class="other-people">
- <div class="image-border image-border1"></div>
- <div class="image-border image-border2"></div>
- <div class="image-border image-border3"></div>
- <div class="image-border image-border4"></div>
- <div class="other-people-title">
- 实时监测
- </div>
- <div class="totalContianer" v-if="TotalPanel || LoftPanel">
- <div class="tlt">
- <h5>正在监测</h5>
- <BigRader :total-rs="totalRs"></BigRader>
- </div>
- <div class="trt">
- <h5>实时监测记录</h5>
- <Watching :total-rs="totalRs"></Watching>
- </div>
- </div>
- <!--</div>-->
- <!--</div>-->
- <!--<div class="manageContainer" v-if="managePanel">-->
- <!--<div class="tlt">-->
- <!--<h5></h5>-->
- <!--<SmallRader :strs="totalRs"></SmallRader>-->
- <!--</div>-->
- <!--<div class="trt">-->
- <!--<Loft></Loft>-->
- <!--</div>-->
- <!--</div>-->
- <!--<div class="RoomContainer" v-if="RoomPanel">-->
- <!--<div class="tlt">-->
- <!--<h5></h5>-->
- <!--<SmallRader :strs="totalRs"></SmallRader>-->
- <!--</div>-->
- <!--<div class="trt">-->
- <!--<Room></Room>-->
- <!--</div>-->
- <!--</div>-->
- <!--<div class="DetctorContianer" v-if="DetctorPanel">-->
- <!--<div class="tlt">-->
- <!--<h5>正在监测</h5>-->
- <!--<BigRader :total-rs="totalRs"></BigRader>-->
- <!--</div>-->
- <!--<div class="trt">-->
- <!--<h5>实时监测记录</h5>-->
- <!--<Watching :total-rs="totalRs"></Watching>-->
- <!--</div>-->
- <!--</div>-->
- </div>
- </div>
- </div>
- <div class="cube">
- <WifiSign></WifiSign>
- </div>
- <Scan></Scan>
- </div>
- <div class="mrt">
- <div class="cube" v-if="pageLevel == 0||pageLevel == 4">
- <HistoryRecord></HistoryRecord>
- </div>
- <div class="cube" v-if="pageLevel == 1||pageLevel == 2||pageLevel == 3">
- <runTimeRecord></runTimeRecord>
- </div>
- <div v-if="pageLevel != 4">
- <EquipInfo></EquipInfo>
- </div>
- <!--单个设备情况-->
- <div v-if="pageLevel == 4">
- <SingleEquipInfo></SingleEquipInfo>
- </div>
- </div>
- </div>
- </template>
- <script>
- import Console from '@/components/Console.vue'
- import WifiSign from '@/components/WifiSign.vue'
- import Scan from '@/components/Scan.vue'
- import HistoryRecord from '@/components/HistoryRecord.vue'
- import EquipInfo from '@/components/EquipInfo.vue'
- import SingleEquipInfo from '@/components/SingleEquipInfo.vue'
- import runTimeRecord from '@/components/runTimeRecord.vue'
- import BigRader from '@/components/BigRader.vue'
- import SmallRader from '@/components/SmallRader.vue'
- import Watching from '@/components/Watching.vue'
- import Loft from '@/components/Loft.vue'
- import Room from '@/components/Room.vue'
- import {RegionDetInfolist} from '../api/getApiRes.js'
- let qs = require('qs');
- export default {
- data() {
- return {
- loadingState: false,
- pageLevel: 0,//操作层级 默认0查 全部 层级
- regionId: 0,//默认查全部
- TotalPanel: true,//总控
- LoftPanel: false,//楼层
- managePanel: false,//区域
- RoomPanel: false,//房间
- DetctorPanel: false,//设备
- totalRs: [],
- // pageLevel: 1,//当前为楼层
- // pageLevel: 2,//当前为楼层区域
- // pageLevel: 3,//当前为房间
- // pageLevel: 4,//当前为单个设备
- }
- },
- mounted() {
- let that = this;
- that.loadingState = false;
- // 获取数据
- that.getDate();
- // 定时查询
- that.timer = setInterval(() => {
- that.getDate();
- }, 2800);
- },
- destroyed() {
- //页面销毁时清除定时器
- clearInterval(this.timer);
- //页面销毁时清除添加条数动画的定时器
- clearInterval(this.wordDisplay);
- },
- methods: {
- changPanel(level, btn) {
- let that = this;
- this.regionId = btn.Id ? btn.Id : 0;
- if (btn == 0) {
- // 首页单独处理
- this.pageLevel = 0
- } else {
- this.pageLevel = parseInt(level);
- }
- that.getDate();
- },
- // 根据层级和地区ID调用不同的Ajax接口
- getDate() {
- let that = this;
- if(that.pageLevel != 4){
- // 非设备层级
- let param = {
- token: localStorage.token,
- regionId: this.regionId
- };
- let postdata = qs.stringify(param);
- that.getRegionDetInfolist(postdata);
- }else{
- // 单个设备层级
- // todo
- }
- },
- getRegionDetInfolist(postdata) {
- let that = this;
- RegionDetInfolist(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.totalRs = json;
- } else {
- that.$message.error(json.Memo);
- }
- })
- },
- wordDisplay(word) {
- let index = 0;
- let that = this;
- setTimeout(function () {
- that.list.unshift(word[index]);
- index = index + 1;
- }, 300);
- }
- },
- components: {
- Console,
- WifiSign,
- Scan,
- HistoryRecord,
- EquipInfo,
- runTimeRecord,
- SingleEquipInfo,
- BigRader,
- Watching,
- SmallRader,
- Loft,
- Room
- }
- }
- </script>
- <style scoped>
- @import "../assets/css/cube.css";
- ul, li {
- list-style: none;
- padding: 0;
- margin: 0;
- }
- em, s, i {
- font-style: normal;
- }
- .mainContainer {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- }
- .mlt {
- width: 365px;
- float: left;
- overflow: hidden;
- margin-right: 10px;
- }
- .mcenter {
- width: 976px;
- /*height: 906px;*/
- float: left;
- overflow: hidden;
- }
- .mrt {
- width: 452px;
- float: right;
- overflow: hidden;
- margin-right: 0;
- }
- .cube {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- margin-bottom: 5px;
- }
- /*total */
- .other-people {
- width: 963px;
- height: 481px;
- margin-left: 0;
- overflow: hidden;
- background: #000F2A;
- }
- ul, li {
- list-style: none;
- padding: 0;
- margin: 0;
- }
- .totalContianer {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- margin-top: 55px;
- }
- .totalContianer .tlt {
- width: 48%;
- float: left;
- padding-left: 10px;
- }
- .totalContianer .trt {
- width: 48%;
- float: right;
- padding-right: 20px;
- overflow: hidden;
- }
- .totalContianer h5 {
- width: 126px;
- height: 26px;
- line-height: 26px;
- text-align: center;
- color: #6DC1FF;
- font-size: 14px;
- margin: 0;
- margin-left: 33%;
- margin-bottom: 19px;
- background: url("../assets/img/main/title.png") top center no-repeat;
- background-size: 100% 100%;
- }
- .total .image-border2 {
- right: 0;
- }
- .total .image-border4 {
- right: 0;
- }
- .loftContainer .tlt {
- width: 48%;
- float: left;
- padding-left: 10px;
- }
- .loftContainer .trt {
- width: 48%;
- float: right;
- padding-right: 20px;
- overflow: hidden;
- }
- .loftContainer {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- margin-top: 55px;
- }
- .RoomContainer .tlt {
- float: left;
- padding-left: 10px;
- margin-top: 60px;
- }
- .RoomContainer .trt {
- float: right;
- padding-right: 20px;
- overflow: hidden;
- margin-top: 30px;
- }
- .DetctorContianer {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- margin-top: 55px;
- }
- .DetctorContianer .tlt {
- width: 48%;
- float: left;
- padding-left: 10px;
- }
- .DetctorContianer .trt {
- width: 48%;
- float: right;
- padding-right: 20px;
- overflow: hidden;
- }
- .DetctorContianer h5 {
- width: 126px;
- height: 26px;
- line-height: 26px;
- text-align: center;
- color: #6DC1FF;
- font-size: 14px;
- margin: 0;
- margin-left: 33%;
- margin-bottom: 19px;
- background: url("../assets/img/main/title.png") top center no-repeat;
- background-size: 100% 100%;
- }
- .manageContainer .tlt {
- float: left;
- padding-left: 10px;
- margin-top: 60px;
- }
- .manageContainer .trt {
- float: right;
- padding-right: 20px;
- overflow: hidden;
- margin-top: 30px;
- }
- .loftContainer h5 {
- width: 126px;
- height: 26px;
- line-height: 26px;
- text-align: center;
- color: #6DC1FF;
- font-size: 14px;
- margin: 0;
- margin-left: 33%;
- margin-bottom: 19px;
- background: url("../assets/img/main/title.png") top center no-repeat;
- background-size: 100% 100%;
- }
- </style>
|