|
@@ -6,26 +6,22 @@
|
|
ref="scrollDiv">
|
|
ref="scrollDiv">
|
|
<div class="sub-sensor-for-box" v-for="(item,index) in dataList" :key="index">
|
|
<div class="sub-sensor-for-box" v-for="(item,index) in dataList" :key="index">
|
|
<div class="sub-sensor-for-name">
|
|
<div class="sub-sensor-for-name">
|
|
- <p>实验室名称</p>
|
|
|
|
- <p>楼栋</p>
|
|
|
|
- <p>楼层</p>
|
|
|
|
- <p>房间号</p>
|
|
|
|
|
|
+ <p>{{item.subName}}</p>
|
|
|
|
+ <p>{{item.buildName}}</p>
|
|
|
|
+ <p>{{item.floorName}}</p>
|
|
|
|
+ <p>{{item.roomNum}}</p>
|
|
</div>
|
|
</div>
|
|
<div class="sub-sensor-for-list">
|
|
<div class="sub-sensor-for-list">
|
|
- <!--<p v-for="(minItem,minIndex) in item.list" :key="minIndex">{{item.percentage}}</p>-->
|
|
|
|
- <p>{{item.percentage}}</p>
|
|
|
|
- <p>{{item.percentage}}</p>
|
|
|
|
- <p>{{item.percentage}}</p>
|
|
|
|
|
|
+ <p v-for="(minItem,minIndex) in item.sensorModelList" :key="minIndex">{{minItem.deviceName}}:{{minItem.deviceValue?minItem.deviceValue:'-'}}{{minItem.unit}}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<p v-if="!dataList[0]" class="null-p">- 暂无数据 -</p>
|
|
<p v-if="!dataList[0]" class="null-p">- 暂无数据 -</p>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
- // import {
|
|
|
|
- // queryHazardList,
|
|
|
|
- // } from "@/api/http"
|
|
|
|
-
|
|
|
|
|
|
+ import {
|
|
|
|
+ laboratoryBigViewFindSubSensor
|
|
|
|
+ } from "@/api/index";
|
|
export default {
|
|
export default {
|
|
name: 'subSensorComponent',
|
|
name: 'subSensorComponent',
|
|
data() {
|
|
data() {
|
|
@@ -45,31 +41,31 @@
|
|
|
|
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- // this.getList();
|
|
|
|
|
|
+ this.getList();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
//获取数据
|
|
//获取数据
|
|
getList(){
|
|
getList(){
|
|
window.clearInterval(this.tableTimer);
|
|
window.clearInterval(this.tableTimer);
|
|
- queryHazardList(this.queryParams).then(response => {
|
|
|
|
- if(response.rows.length == this.queryParams.pageSize || this.queryParams.pageNum == 1){
|
|
|
|
|
|
+ laboratoryBigViewFindSubSensor(this.queryParams).then(response => {
|
|
|
|
+ if(response.data.records.length == this.queryParams.pageSize || this.queryParams.pageNum == 1){
|
|
let list = JSON.parse(JSON.stringify(this.dataListA));
|
|
let list = JSON.parse(JSON.stringify(this.dataListA));
|
|
- let newList = JSON.parse(JSON.stringify(list.concat(response.rows)));
|
|
|
|
- if(response.rows.length == 2){
|
|
|
|
- this.$set(this,'dataListA',response.rows);
|
|
|
|
|
|
+ let newList = JSON.parse(JSON.stringify(list.concat(response.data.records)));
|
|
|
|
+ if(response.data.records.length == 2){
|
|
|
|
+ this.$set(this,'dataListA',response.data.records);
|
|
}else{
|
|
}else{
|
|
- this.$set(this,'dataListA',response.rows.slice(-2));
|
|
|
|
|
|
+ this.$set(this,'dataListA',response.data.records.slice(-2));
|
|
}
|
|
}
|
|
this.$set(this,'dataList',newList);
|
|
this.$set(this,'dataList',newList);
|
|
- this.$set(this, 'total', response.total);
|
|
|
|
|
|
+ this.$set(this, 'total', response.data.total);
|
|
this.tableActionFun();
|
|
this.tableActionFun();
|
|
}else{
|
|
}else{
|
|
let obj = JSON.parse(JSON.stringify(this.queryParams));
|
|
let obj = JSON.parse(JSON.stringify(this.queryParams));
|
|
obj.pageNum = 1;
|
|
obj.pageNum = 1;
|
|
- queryHazardList(obj).then(responseOne => {
|
|
|
|
|
|
+ laboratoryBigViewFindSubSensor(obj).then(responseOne => {
|
|
let list = JSON.parse(JSON.stringify(this.dataListA));
|
|
let list = JSON.parse(JSON.stringify(this.dataListA));
|
|
- let ListA = response.rows;
|
|
|
|
- let ListB = responseOne.rows;
|
|
|
|
|
|
+ let ListA = response.data.records;
|
|
|
|
+ let ListB = responseOne.data.records;
|
|
let newList = JSON.parse(JSON.stringify(ListA.concat(ListB)));
|
|
let newList = JSON.parse(JSON.stringify(ListA.concat(ListB)));
|
|
if(ListB.length == 2){
|
|
if(ListB.length == 2){
|
|
this.$set(this,'dataListA',ListB);
|
|
this.$set(this,'dataListA',ListB);
|
|
@@ -77,7 +73,7 @@
|
|
this.$set(this,'dataListA',ListB.slice(-2));
|
|
this.$set(this,'dataListA',ListB.slice(-2));
|
|
}
|
|
}
|
|
this.$set(this,'dataList',list.concat(newList));
|
|
this.$set(this,'dataList',list.concat(newList));
|
|
- this.$set(this, 'total', response.total);
|
|
|
|
|
|
+ this.$set(this, 'total', response.data.total);
|
|
this.$set(this.queryParams,'pageNum',1);
|
|
this.$set(this.queryParams,'pageNum',1);
|
|
this.tableActionFun();
|
|
this.tableActionFun();
|
|
});
|
|
});
|
|
@@ -88,9 +84,9 @@
|
|
tableActionFun() {
|
|
tableActionFun() {
|
|
let self = this;
|
|
let self = this;
|
|
this.$refs.scrollDiv.scrollTop = 0;
|
|
this.$refs.scrollDiv.scrollTop = 0;
|
|
- if(this.dataList[1]){
|
|
|
|
|
|
+ if(this.dataList[2]){
|
|
this.tableTimerFun();
|
|
this.tableTimerFun();
|
|
- }else if(!this.dataList[1] && this.queryParams.pageNum != 1){
|
|
|
|
|
|
+ }else if(!this.dataList[2] && this.queryParams.pageNum != 1){
|
|
setTimeout(function(){
|
|
setTimeout(function(){
|
|
self.tableTimerFun();
|
|
self.tableTimerFun();
|
|
},2000);
|
|
},2000);
|
|
@@ -99,9 +95,9 @@
|
|
//暂停后开始
|
|
//暂停后开始
|
|
tableActionStart(){
|
|
tableActionStart(){
|
|
let self = this;
|
|
let self = this;
|
|
- if(this.dataList[1]){
|
|
|
|
|
|
+ if(this.dataList[2]){
|
|
this.tableTimerFun();
|
|
this.tableTimerFun();
|
|
- }else if(!this.dataList[1] && this.queryParams.pageNum != 1){
|
|
|
|
|
|
+ }else if(!this.dataList[2] && this.queryParams.pageNum != 1){
|
|
setTimeout(function(){
|
|
setTimeout(function(){
|
|
self.tableTimerFun();
|
|
self.tableTimerFun();
|
|
},2000);
|
|
},2000);
|
|
@@ -166,7 +162,6 @@
|
|
margin:0;
|
|
margin:0;
|
|
}
|
|
}
|
|
.sub-sensor-for-box {
|
|
.sub-sensor-for-box {
|
|
- height:30px;
|
|
|
|
margin: 0 30px 6px;
|
|
margin: 0 30px 6px;
|
|
padding: 10px 0;
|
|
padding: 10px 0;
|
|
background: rgba(30, 118, 142, 0.2);
|
|
background: rgba(30, 118, 142, 0.2);
|
|
@@ -193,7 +188,6 @@
|
|
}
|
|
}
|
|
.sub-sensor-for-list {
|
|
.sub-sensor-for-list {
|
|
padding:0 20px;
|
|
padding:0 20px;
|
|
- /*margin-top:10px;*/
|
|
|
|
p {
|
|
p {
|
|
margin:0;
|
|
margin:0;
|
|
display: inline-block;
|
|
display: inline-block;
|
|
@@ -202,7 +196,7 @@
|
|
font-weight: 400;
|
|
font-weight: 400;
|
|
color: #FFFFFF;
|
|
color: #FFFFFF;
|
|
line-height: 14px;
|
|
line-height: 14px;
|
|
- margin-right: 30px;
|
|
|
|
|
|
+ margin-right: 10px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|