|
@@ -2,14 +2,14 @@
|
|
|
<view>
|
|
|
<u-navbar title="异常报警记录" title-color="#101010"></u-navbar>
|
|
|
<view class="dropdown">
|
|
|
- <view class="dropdown-item">
|
|
|
- 2024年2月 <u-icon name="arrow-down" color="#999999"></u-icon>
|
|
|
+ <view class="dropdown-item" @click="show1=true">
|
|
|
+ {{time}} <u-icon name="arrow-down" color="#999999"></u-icon>
|
|
|
</view>
|
|
|
- <view class="dropdown-item">
|
|
|
- 全部状态 <u-icon name="arrow-down" color="#999999"></u-icon>
|
|
|
+ <view class="dropdown-item" @click="show2=true">
|
|
|
+ {{state}} <u-icon name="arrow-down" color="#999999"></u-icon>
|
|
|
</view>
|
|
|
- <view class="dropdown-item">
|
|
|
- 全部设备 <u-icon name="arrow-down" color="#999999"></u-icon>
|
|
|
+ <view class="dropdown-item" @click="show3=true">
|
|
|
+ {{device}} <u-icon name="arrow-down" color="#999999"></u-icon>
|
|
|
</view>
|
|
|
<!-- <u-dropdown-change ref="uDropdown">
|
|
|
<u-dropdown-item v-model="value1" title="全部时间" :options="options1"></u-dropdown-item>
|
|
@@ -19,79 +19,38 @@
|
|
|
</view>
|
|
|
|
|
|
<u-picker mode="time" :defaultTime="defaultTime" v-model="show1" :params="params" @confirm="timeChange"></u-picker>
|
|
|
+
|
|
|
+ <u-select v-model="show2" mode="single-column" :list="stateList" @confirm="stateChange"></u-select>
|
|
|
+
|
|
|
+ <u-select v-model="show3" mode="single-column" :list="deviceList" @confirm="deviceChange"></u-select>
|
|
|
|
|
|
<view class="records">
|
|
|
<view class="records-item" v-for="(item, index) in abnormalRecordsList" :key="index"
|
|
|
- @click="gotoUrl('/pages/abnormal/abnormalAlarmDetails?id=')">
|
|
|
+ @click="gotoUrl('/pages/abnormal/abnormalAlarmDetails?id='+item.id)">
|
|
|
<view class="icon icon1">
|
|
|
<image class="img" src="@/assets/img/riFill-temp-cold-fill.svg" mode=""></image>
|
|
|
</view>
|
|
|
- <view class="title">
|
|
|
- <view class="name">
|
|
|
- 温度异常
|
|
|
- </view>
|
|
|
- <view class="date">
|
|
|
- 2024-02-14 09:00:01
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="equipment">
|
|
|
- <view class="equipment1">
|
|
|
- 荆鹏软件园01
|
|
|
- </view>
|
|
|
- <view class="equipment2">
|
|
|
- 荆鹏集团
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="more">
|
|
|
- <u-icon name="arrow-right" color="#acacac"></u-icon>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="records-item">
|
|
|
- <view class="icon icon2">
|
|
|
+ <!-- <view class="icon icon2">
|
|
|
<image class="img" src="@/assets/img/riFill-cloud-off-fill.svg" mode=""></image>
|
|
|
</view>
|
|
|
- <view class="title">
|
|
|
- <view class="name">
|
|
|
- 温度异常
|
|
|
- </view>
|
|
|
- <view class="date">
|
|
|
- 2024-02-14 09:00:01
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="equipment">
|
|
|
- <view class="equipment1">
|
|
|
- 荆鹏软件园01
|
|
|
- </view>
|
|
|
- <view class="equipment2">
|
|
|
- 荆鹏集团
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="more">
|
|
|
- <u-icon name="arrow-right" color="#acacac"></u-icon>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="records-item">
|
|
|
<view class="icon icon3">
|
|
|
<image class="img" src="@/assets/img/outputVoltage.svg" mode=""></image>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
<view class="title">
|
|
|
<view class="name">
|
|
|
- 电压异常
|
|
|
+ {{item.configName}}
|
|
|
</view>
|
|
|
<view class="date">
|
|
|
- 2024-02-14 09:00:01
|
|
|
+ {{item.createTime}}
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="equipment">
|
|
|
<view class="equipment1">
|
|
|
- 荆鹏软件园01
|
|
|
+ {{item.meterName}}
|
|
|
</view>
|
|
|
<view class="equipment2">
|
|
|
- 荆鹏集团
|
|
|
+ {{item.companyName}}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="more">
|
|
@@ -99,13 +58,28 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <u-divider :isnone="abnormalRecordsList.length==0" nonetext="暂无异常报警记录" border-color="#CFD2D5">
|
|
|
+ 已经到底了</u-divider>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import {
|
|
|
+ parseUnixTime,
|
|
|
+ beforeTimeStamp,
|
|
|
+ getWeek
|
|
|
+ } from '@/apis/utils'
|
|
|
+ import * as API from '@/apis/pagejs/energy/index.js'
|
|
|
+
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ abnormalRecordsList: [], // 异常告警记录
|
|
|
+ configId: '',
|
|
|
+ pageIndex: 1,
|
|
|
+ recordsTotal: 0,
|
|
|
+ companyId: '',
|
|
|
show1: false, // 时间选择
|
|
|
defaultTime: '',
|
|
|
params: {
|
|
@@ -117,7 +91,13 @@
|
|
|
second: false,
|
|
|
timestamp: false
|
|
|
},
|
|
|
- abnormalRecordsList: [], // 异常告警记录
|
|
|
+ time: '全部时间',
|
|
|
+ show2: false, // 状态选择
|
|
|
+ state: '全部状态',
|
|
|
+ stateList: [],
|
|
|
+ show3: false, // 设备选择
|
|
|
+ device: '全部设备',
|
|
|
+ deviceList: [],
|
|
|
value1: 1,
|
|
|
value2: 1,
|
|
|
value3: 1,
|
|
@@ -166,18 +146,118 @@
|
|
|
],
|
|
|
}
|
|
|
},
|
|
|
+ onLoad() {
|
|
|
+ var date = new Date();
|
|
|
+ var year = date.getFullYear();
|
|
|
+ var month = date.getMonth()+1 > 0 ? date.getMonth()+1 : '0'+(date.getMonth()+1);
|
|
|
+ this.defaultTime = year + '-' +month;
|
|
|
+ this.time = year + '年' + parseInt(month) + '月';
|
|
|
+
|
|
|
+ this.getAbnormalAlarmRecord();
|
|
|
+ this.getAlarmConfiguration();
|
|
|
+ },
|
|
|
+ onReady() {
|
|
|
+
|
|
|
+ },
|
|
|
+ onReachBottom() {
|
|
|
+ if (this.abnormalRecordsList.length < this.recordsTotal) {
|
|
|
+ this.myLoadmore();
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ // 异常告警记录
|
|
|
+ getAbnormalAlarmRecord(bl) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+ if (bl) {
|
|
|
+ this.abnormalRecordsList = [];
|
|
|
+ this.pageIndex = 1;
|
|
|
+ }
|
|
|
+ API.alarmRecord({
|
|
|
+ configId: this.configId,
|
|
|
+ pageIndex: this.pageIndex,
|
|
|
+ pageSize: 10,
|
|
|
+ companyId: this.companyId
|
|
|
+ }).then((res) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ this.abnormalRecordsList = [
|
|
|
+ ...this.abnormalRecordsList,
|
|
|
+ ...res.data.data
|
|
|
+ ];
|
|
|
+ this.recordsTotal = res.data.recordsTotal;
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ myLoadmore() {
|
|
|
+ this.pageIndex += 1;
|
|
|
+ this.getAbnormalAlarmRecord();
|
|
|
+ },
|
|
|
+ // 异常查询条件
|
|
|
+ getAlarmConfiguration() {
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+ API.alarmConfiguration().then((response) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ var list1 = response.data.alarmConfigList.map(item => {
|
|
|
+ return {
|
|
|
+ label: item.name,
|
|
|
+ value: item.id
|
|
|
+ }
|
|
|
+ });
|
|
|
+ list1.unshift({
|
|
|
+ value: '',
|
|
|
+ label: '全部状态'
|
|
|
+ });
|
|
|
+ var list2 = response.data.companyInfoList.map(item => {
|
|
|
+ return {
|
|
|
+ label: item.name,
|
|
|
+ value: item.id
|
|
|
+ }
|
|
|
+ });
|
|
|
+ list2.unshift({
|
|
|
+ value: '',
|
|
|
+ label: '全部设备'
|
|
|
+ });
|
|
|
+
|
|
|
+ this.stateList = list1;
|
|
|
+ this.deviceList = list2;
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
// 时间查询
|
|
|
timeChange(params) {
|
|
|
console.log(params)
|
|
|
+ this.time = params.year + '年' + parseInt(params.month) + '月';
|
|
|
+
|
|
|
+ this.getAbnormalAlarmRecord(true);
|
|
|
},
|
|
|
// 状态查询
|
|
|
- stateChange() {
|
|
|
+ stateChange(e) {
|
|
|
+ console.log(e);
|
|
|
+ this.configId = e[0].value;
|
|
|
+ this.state = e[0].label;
|
|
|
|
|
|
+ this.getAbnormalAlarmRecord(true);
|
|
|
},
|
|
|
// 设备查询
|
|
|
- deviceChange() {
|
|
|
+ deviceChange(e) {
|
|
|
+ console.log(e);
|
|
|
+ this.companyId = e[0].value;
|
|
|
+ this.device = e[0].label;
|
|
|
|
|
|
+ this.getAbnormalAlarmRecord(true);
|
|
|
}
|
|
|
}
|
|
|
}
|