|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <view class="stationFaultwarn">
|
|
|
+ <view class="stationfaultwarn">
|
|
|
<view class="box-bg">
|
|
|
<uni-nav-bar :fixed="true" dark left-icon="left" background-color='#202246' :title="stationName"
|
|
|
@clickLeft="back" />
|
|
@@ -12,56 +12,92 @@
|
|
|
<view class="faultwarnLeftBot">{{item.code}}</view>
|
|
|
</view>
|
|
|
<view class="faultwarn_main_com_right">
|
|
|
- <view class="faultwarnRightTop" :style="getSty(item)">{{item.reson}}
|
|
|
+ <view class="faultwarnRightTop" :style="getSty(item)">{{item.description}}
|
|
|
</view>
|
|
|
- <view class="faultwarnRightBot" :style="getSty(item)">{{item.date}}
|
|
|
+ <view class="faultwarnRightBot" :style="getSty(item)">{{getTimeDaya(item.ts)}}
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <station-bar ref="stationBar"></station-bar>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import companyHeader from '../common/companyHeader.vue'
|
|
|
- import stationBar from '../common/stationTab.vue'
|
|
|
+ import {
|
|
|
+ companyhistoryFindAlarmlistApi
|
|
|
+ } from '../../api/warn.js'
|
|
|
export default {
|
|
|
- onLoad: function() {
|
|
|
- this.stationName = uni.getStorageSync('stationName')
|
|
|
- },
|
|
|
+ onLoad: function() {},
|
|
|
components: {
|
|
|
- companyHeader,
|
|
|
- stationBar
|
|
|
+ companyHeader
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
stationName: '',
|
|
|
+ stationWpid: '',
|
|
|
faultwarnData: []
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.faultwarnData = [{
|
|
|
- name: '乌力吉',
|
|
|
- code: 'A25',
|
|
|
- reson: '通讯站点诊断类故障',
|
|
|
- date: '2017-01-06 13:34:34'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '宝龙山',
|
|
|
- code: 'A25',
|
|
|
- reson: '通讯站点诊断类故障通讯站点诊断类故障通 讯站点诊断类故障',
|
|
|
- date: '2017-01-06 13:34:34'
|
|
|
- },
|
|
|
- ]
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.$refs.stationBar.showTab = '故障预警'
|
|
|
+ this.stationName = uni.getStorageSync('stationName')
|
|
|
+ this.stationWpid = uni.getStorageSync('stationWpid')
|
|
|
+ // this.faultwarnData = [{
|
|
|
+ // name: '乌力吉',
|
|
|
+ // code: 'A25',
|
|
|
+ // reson: '通讯站点诊断类故障',
|
|
|
+ // date: '2017-01-06 13:34:34'
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // name: '宝龙山',
|
|
|
+ // code: 'A25',
|
|
|
+ // reson: '通讯站点诊断类故障通讯站点诊断类故障通 讯站点诊断类故障',
|
|
|
+ // date: '2017-01-06 13:34:34'
|
|
|
+ // },
|
|
|
+ // ]
|
|
|
+ this.getcompanyhistoryFindAlarmlist()
|
|
|
},
|
|
|
methods: {
|
|
|
+ //获取故障数据
|
|
|
+ getcompanyhistoryFindAlarmlist() {
|
|
|
+ let that = this
|
|
|
+ that.faultwarnData = []
|
|
|
+ let params = {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 50,
|
|
|
+ alarmId: "",
|
|
|
+ alarmType: 'windturbine',
|
|
|
+ deviceType: '',
|
|
|
+ stationid: that.stationWpid,
|
|
|
+ deviceid: "",
|
|
|
+ modelId: "",
|
|
|
+ components: "",
|
|
|
+ description: "",
|
|
|
+ isclose: false,
|
|
|
+ begin: that.getTimeDaya(new Date().getTime() - 60 * 60 * 1000),
|
|
|
+ end: that.getTimeDaya(new Date().getTime()),
|
|
|
+ };
|
|
|
+ companyhistoryFindAlarmlistApi(params).then(res => {
|
|
|
+ if (res && res.data.ls.length > 0) {
|
|
|
+ that.faultwarnData = res.data.ls
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
back() {
|
|
|
this.$tab.switchTab('/pages/home/index')
|
|
|
},
|
|
|
+ //获取时间
|
|
|
+ getTimeDaya(date) {
|
|
|
+ let currentDate = new Date(date)
|
|
|
+ let year = currentDate.getFullYear()
|
|
|
+ let month = currentDate.getMonth() + 1
|
|
|
+ let day = currentDate.getDate()
|
|
|
+ let hour = currentDate.getHours() + ':'
|
|
|
+ let minute = currentDate.getMinutes() < 10 ? '0' + currentDate.getMinutes() : currentDate
|
|
|
+ .getMinutes()
|
|
|
+ let second = currentDate.getSeconds();
|
|
|
+ return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
|
|
|
+ },
|
|
|
getSty(item) {
|
|
|
let sty = ''
|
|
|
if (item.reson.length > 16) {
|
|
@@ -86,7 +122,7 @@
|
|
|
background-color: #202246;
|
|
|
}
|
|
|
|
|
|
- .stationFaultwarn {
|
|
|
+ .stationfaultwarn {
|
|
|
width: 100vw;
|
|
|
background: url('../../static/jnImage/loginPage/windBack.png'), url('../../static/jnImage/loginPage/backWav.png');
|
|
|
background-repeat: no-repeat, repeat;
|
|
@@ -106,7 +142,6 @@
|
|
|
|
|
|
.falutWarn_main {
|
|
|
padding: 0 20px;
|
|
|
- margin-top: 20px;
|
|
|
|
|
|
.faultwarn_main_com {
|
|
|
height: 60px;
|