|
@@ -44,21 +44,22 @@
|
|
<view class="item" @click="toDataMonitoringList">
|
|
<view class="item" @click="toDataMonitoringList">
|
|
<view class="item-top">
|
|
<view class="item-top">
|
|
<view class="img-box">
|
|
<view class="img-box">
|
|
- <u-circle-progress active-color="#2979ff" :percent="0" width="88">
|
|
|
|
|
|
+ <u-circle-progress active-color="#2979ff"
|
|
|
|
+ :percent="alarmsForm.okNum/(alarmsForm.okNum+alarmsForm.errorNum)*100" width="88">
|
|
</u-circle-progress>
|
|
</u-circle-progress>
|
|
</view>
|
|
</view>
|
|
<view class="number">
|
|
<view class="number">
|
|
<view class="normal">
|
|
<view class="normal">
|
|
- 正常:0台
|
|
|
|
|
|
+ 正常:{{alarmsForm.okNum}}台
|
|
</view>
|
|
</view>
|
|
<view class="abnormal">
|
|
<view class="abnormal">
|
|
- 异常:0台
|
|
|
|
|
|
+ 异常:{{alarmsForm.errorNum}}台
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 累计 -->
|
|
<!-- 累计 -->
|
|
<view class="total">
|
|
<view class="total">
|
|
- 本月累计报警 <text class="total-number">0</text> 次
|
|
|
|
|
|
+ 本月累计报警 <text class="total-number">{{alarmsForm.errorMonthNum}}</text> 次
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
@@ -284,7 +285,12 @@
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- companyId: '',
|
|
|
|
|
|
+ alarmsForm: {
|
|
|
|
+ okNum: 4,
|
|
|
|
+ errorNum: 0,
|
|
|
|
+ errorMonthNum: 0
|
|
|
|
+ }, // 累计报警
|
|
|
|
+ companyId: '', // 商户ID
|
|
pageIndexe: 1, // 设备数据检测
|
|
pageIndexe: 1, // 设备数据检测
|
|
totalPagee: 1,
|
|
totalPagee: 1,
|
|
deviceList: [],
|
|
deviceList: [],
|
|
@@ -305,7 +311,8 @@
|
|
this.getfindByOpenId();
|
|
this.getfindByOpenId();
|
|
this.getPowerConsumption(0);
|
|
this.getPowerConsumption(0);
|
|
this.getEquipmentDataMonitoring(0);
|
|
this.getEquipmentDataMonitoring(0);
|
|
- this.getCompanyInfoList()
|
|
|
|
|
|
+ this.getCompanyInfoList();
|
|
|
|
+ this.getAccumulatedAlarms();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
merchantChange(item,index) {
|
|
merchantChange(item,index) {
|
|
@@ -317,6 +324,8 @@
|
|
this.companyId = item.id;
|
|
this.companyId = item.id;
|
|
this.getPowerConsumption(0);
|
|
this.getPowerConsumption(0);
|
|
this.getEquipmentDataMonitoring(0);
|
|
this.getEquipmentDataMonitoring(0);
|
|
|
|
+ this.getAccumulatedAlarms();
|
|
|
|
+
|
|
this.popShow = false;
|
|
this.popShow = false;
|
|
},
|
|
},
|
|
// 单位
|
|
// 单位
|
|
@@ -421,13 +430,28 @@
|
|
},
|
|
},
|
|
// 累计报警
|
|
// 累计报警
|
|
getAccumulatedAlarms() {
|
|
getAccumulatedAlarms() {
|
|
-
|
|
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: "加载中",
|
|
|
|
+ mask: true,
|
|
|
|
+ })
|
|
|
|
+ API.deviceStatus({
|
|
|
|
+ companyId: this.companyId
|
|
|
|
+ }).then((response) => {
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ this.alarmsForm = response.data;
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: error,
|
|
|
|
+ icon: "none"
|
|
|
|
+ })
|
|
|
|
+ })
|
|
},
|
|
},
|
|
change(index) {
|
|
change(index) {
|
|
this.current = index;
|
|
this.current = index;
|
|
this.companyId = this.merchantList1[index].id;
|
|
this.companyId = this.merchantList1[index].id;
|
|
this.getPowerConsumption(0);
|
|
this.getPowerConsumption(0);
|
|
this.getEquipmentDataMonitoring(0);
|
|
this.getEquipmentDataMonitoring(0);
|
|
|
|
+ this.getAccumulatedAlarms();
|
|
},
|
|
},
|
|
toDataMonitoringList() {
|
|
toDataMonitoringList() {
|
|
return
|
|
return
|