tanghaolin
2022-11-08 c8c3f384040bad0044dcabf72e162e35b5786afa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<view wx:if="{{currentTabIndex==0}}">
  <view class="ec_header">
    <view class="ec_header_left">
      <view class="ec_header_left_view">{{pointName}}</view>
      <view class="ec_header_left_view">
        <span class="ec_header_val">{{currentRecordParas.RecordValue}}</span><span
          class="ec_header_name">{{pointUnit}}</span>
        <icon
          wx:if="{{currentRecordParas.HistoryRecordValue=='' || currentRecordParas.RecordValue == currentRecordParas.HistoryRecordValue}}">
        </icon>
        <icon wx:elif="{{currentRecordParas.RecordValue > currentRecordParas.HistoryRecordValue}}"
          class="iconfont icon-shangsheng red">
        </icon>
        <icon wx:elif="{{currentRecordParas.RecordValue < currentRecordParas.HistoryRecordValue}}"
          class="iconfont icon-xiajiang"></icon>
      </view>
    </view>
    <view class="ec_header_right">
      <view class="ec_header_right_view">
        <view>状态:{{currentRecordParas.RecordStatusName}}</view>
        <view>警报:{{currentRecordParas.AlarmNumber}}</view>
      </view>
      <view class="ec_header_right_view">
        <view>{{currentRecordParas.RecordTime}}</view>
        <view>{{lastRefreshTime}}后刷新</view>
      </view>
    </view>
  </view>
 
  <view class="container">
    <ec-canvas id="mychart-dom-line1" canvas-id="mychart-line1" ec="{{ec1}}"></ec-canvas>
    <!-- <view class="y_dataTine">
      <view class="y_dataTine_left">当前时间:{{lastRefreshTime}}</view>
      <view class="y_dataTine_right">{{lastRefreshTime}}后刷新</view>
    </view> -->
  </view>
  <!--  -->
  <view class="ykt-detail-wraper">
    <view class="ykt-head" bindtap="hiddenList" style="justify-content:flex-end">
      <icon class="iconfont icon-youjian {{ishidden?'.down':'.xia'}}" style="margin-left:24rpx;"></icon>
      <text class="ykt-type-name" style="margin:0rpx auto">{{pointParas.RecordName}}详情</text>
    </view>
    <view class="detail-list" wx:if="{{ishidden}}">
      <view class="detail-item">
        <text class="detail-item-label">测点编号</text>
        <text class="detail-item-value">{{pointID}}</text>
      </view>
      <view class="detail-item">
        <text class="detail-item-label">监控名称</text>
        <text class="detail-item-value">{{pointName}}</text>
      </view>
      <view class="detail-item">
        <text class="detail-item-label">单位</text>
        <text class="detail-item-value">{{pointUnit}}</text>
      </view>
      <view class="detail-item">
        <text class="detail-item-label">上次报警</text>
        <text class="detail-item-value">{{pointParas.LastAlarmTime}}</text>
      </view>
      <view class="detail-item">
        <text class="detail-item-label" style="width:unset;">是否显示报警点</text>
        <view class="detail-item-value">
          <switch checked="{{isChecked}}" bindchange="isShowPoint"></switch>
        </view>
      </view>
      <view class="detail-item" style="flex-direction: column;">
        <view style="display: flex;justify-content: space-between;align-items: center;width: 100%;">
          <text>警报类型</text>
          <text>阈值</text>
        </view>
        <view wx:if="{{pointParas.AlarmConfigures.length !=null}}" wx:for="{{pointParas.AlarmConfigures}}"
          wx:key="index" class="text-grey"
          style="display: flex;justify-content: space-between;align-items: center;width: 100%;">
          <text>{{item.AlarmType}}</text>
          <text>{{item.ThresholdValue}}</text>
        </view>
        <view wx:if="{{pointParas.AlarmConfigures.length == null}}" class="text-grey"
          style="display: flex;justify-content: center;align-items: center;width: 100%;">
          <view>未设置报警配置</view>
        </view>
      </view>
    </view>
  </view>
 
  <view class="ykt-detail-wrapers">
    <view class="hykt_header">
      <view class="hykt_span">时间</view>
      <view class="hykt_span" bindtap="changeMonitorStatus" style="{{isMonitorChange?'color:red;':''}}">状态</view>
      <view class="hykt_span">监控值</view>
    </view>
    <scroll-view scroll-y style="width:100%;height:52vh;" bindscroll="scrollListView" scroll-top="{{scrollTop}}"
      scroll-into-view="{{scrollOneId}}">
      <view class="hykt_li"
        style="margin-bottom:10rpx;{{nowDayMonitorTime == monitor.RecordTime?'border: 1rpx solid #16b5cb;':''}}"
        wx:key="index" wx:for="{{isMonitorChange?monitorAlam:monitorList}}" wx:for-item="monitor" wx:for-index="index"
        id="T{{monitor.RecordTime}}">
        <view class="hykt_span">{{monitor.RecordTime}}</view>
        <view class="hykt_span" wx:if="{{monitor.RecordStatus.length>0}}" style="color:red">
          {{monitor.RecordStatusText}}
        </view>
        <view class="hykt_span" wx:else>
          {{monitor.RecordStatusText}}
        </view>
        <view class="hykt_span">{{monitor.RecordValue}}</view>
      </view>
    </scroll-view>
  </view>
  <!-- 刷新 -->
  <view class="iconfont iconfont_view icon-shuaxin" style="bottom: 140px;" bindtap="onTapRefresh"></view>
  <!-- 间隔 -->
  <view class="iconfont iconfont_view {{Fixed.ec1.interval=='onTapInterval' ? 'icon-jiange' : 'icon-quxiaojianju'}}"
    style="bottom: 200px;" bindtap="{{Fixed.ec1.interval}}"></view>
</view>
 
 
<!-- 历史数据图表 -->
<view wx:if="{{currentTabIndex==1}}">
  <view class="weui-cells weui-cells_after-title">
    <view class="weui-cell weui-cell_input weui-cell-date">
      <view class="weui-cell__bd weui-date">
        <button class='lastHistoryDay' bindtap='lastHistoryDay'><</button>
        <picker mode="date" end="{{yestday}}" value="{{historyDate}}" fields="day" bindchange="tapChangeHistoryDay">
          <view class="weui-input view-center">{{historyDate}}</view>
        </picker>
        <button class='nextHistoryDay' disabled="{{!isNextDayAble}}" bindtap='nextHistoryDay'>></button>
      </view>
    </view>
  </view>
 
  <view class="container">
    <ec-canvas id="mychart-dom-line2" canvas-id="mychart-line2" ec="{{ec2}}"></ec-canvas>
    <!-- <ec-canvas id="mychart-dom-line2" canvas-id="mychart-line2" ec="{{ecLine2}}"></ec-canvas> -->
  </view>
  <!--  -->
  <view class="ykt-detail-wrapers">
    <view class="hykt_header">
      <view class="hykt_span">时间</view>
      <view class="hykt_span" bindtap="changeHistoryStatus" style="{{isHistoryChange?'color:red;':''}}">状态</view>
      <view class="hykt_span">监控值</view>
    </view>
    <scroll-view scroll-y style="width:100%;height:52vh;" bindscroll="scrollListView" scroll-top="{{historyScrollTop}}"
      scroll-into-view="{{scrollTwoId}}">
      <view class="hykt_li"
        style="margin-bottom:10rpx;{{nowHistoryMonitorTime == history.RecordTime?'border: 1rpx solid #16b5cb;':''}}"
        wx:key="key" wx:for="{{isHistoryChange?historyAlam:recordsHistory}}" wx:for-item="history"
        id="T{{history.RecordTime}}">
        <view class="hykt_span">{{history.RecordTime}}</view>
 
        <!-- <view class="hykt_span" style="color:{{(history.RecordStatus & 2) == 2?'red':''}}">
          {{(history.RecordStatus & 2) == 2?'警报':'正常'}}
        </view> -->
 
       <view class="hykt_span" wx:if="{{history.RecordStatus.length>0}}" style="color:red">
          {{history.RecordStatusText}}
        </view>
        <view class="hykt_span" wx:else>
          {{history.RecordStatusText}}
        </view>
        <view class="hykt_span">{{history.RecordValue}}</view>
      </view>
    </scroll-view>
    <!-- <view class="detail-item">
      <text class="detail-item-label">监控名称</text>
      <text class="detail-item-value">{{pointParas.RecordName}}</text>
    </view>
    <view class="detail-item">
      <text class="detail-item-label">设备编号</text>
      <text class="detail-item-value">{{pointParas.RecordType}}</text>
    </view>
    <view class="detail-item">
      <text class="detail-item-label">结束时间</text>
      <text class="detail-item-value">{{recordsHistory.RecordTime}}</text>
    </view>
    <view class="detail-item">
      <text class="detail-item-label">监控值</text>
      <text class="detail-item-value">{{recordsHistory.RecordValue}}</text>
    </view>
    <view class="detail-item">
      <text class="detail-item-label">单位</text>
      <text class="detail-item-value">{{pointParas.UnitName}}</text>
    </view>
    <view class="detail-item">
      <text class="detail-item-label">状态</text>
      <text class="detail-item-value">断开</text>
    </view> -->
  </view>
  <!-- 刷新 -->
  <view class="iconfont iconfont_view icon-shuaxin" style="bottom: 140px;" bindtap="onTapRefreshHistory"></view>
  <!-- 间隔 -->
  <view
    class="iconfont iconfont_view {{Fixed.ec2.interval=='onTapIntervalHistory' ? 'icon-jiange' : 'icon-quxiaojianju'}}"
    style="bottom: 200px;" bindtap="{{Fixed.ec2.interval}}">
  </view>
  <!-- 回到顶部 -->
  <view class="iconfont iconfont_view icon-weibiaoti- {{animationFloatMenu}}"
    wx:if="{{isShowFloatMenu && currentTabIndex == 1}}" style=" bottom: 80px;" bindtap="goTop">
  </view>
 
</view>
 
<!-- 警报 -->
<view wx:if='{{currentTabIndex==2}}'>
  <view class='filterTimeScopeView' style='display: flex;justify-content: center;font-size: 26rpx;'>
    <view style="display: flex;justify-content: center;align-items: center;">
      <label style="color:red;margin-top:0;">{{alarmListInfo.length}}条</label>
      <label style='display: flex;margin-top:0;'>时间</label>
      <label style='display: flex;padding-right:20rpx;margin-top:0;'>从 </label>
    </view>
    <view style="display: flex;justify-content: center;align-items: center;">
      <picker class='timePicker' mode="date" end="{{endDate}}" value="{{startAlarmDate}}" fields="day"
        bindchange="bindStartAlarmDateChange">
        <view style='display: flex' class="weui-input view-center">{{startAlarmDate}}</view>
      </picker>
      <view style='display: flex;padding-left:20rpx;padding-right:20rpx;align-items:center;margin-top:0'
        class='fenView'>到</view>
      <picker class='timePicker' mode="date" start="{{startAlarmDate}}" end="{{today}}" value="{{endAlarmDate}}"
        fields="day" bindchange="bindEndAlarmDateChange">
        <view style='display: flex' class="weui-input view-center">{{endAlarmDate}}</view>
      </picker>
      <image bindtap='tapRefreshAlarm' src='../../images/icons/refresh.png'
        style='width:32px;height:32px;display: flex;margin-top:3px;'></image>
    </view>
  </view>
 
  <scroll-view class="tableView" lower-threshold="50" scroll-y="true"
    style="margin-top: 42px;height:calc(100vh - 164rpx)" bindscrolltolower="lowRefresh" bindscroll="scrollListView"
    scroll-top="{{scrollTop}}">
    <view class="flexItem rowStyle tableViewCellHeader marginTop10" wx:if="{{!hasAlarmData}}">
      <!-- <image class="orderImage marginLeft12"></image> -->
      <label class="color54 fontSize12"
        style="text-align: center;display: flex;align-items: center;width: 100%;justify-content: center;">{{message}}</label>
    </view>
 
    <block wx:for="{{alarmListInfo}}" wx:for-item="info" wx:for-index="index" wx:key="index" wx:if="{{hasAlarmData}}">
      <view class="flexItem rowStyle  personInfo" style="margin-top:20rpx;">
        <view class="flexItem rowStyle marginLeft12" style="display: flex;flex-direction: column;">
          <text class="color54 fontSize12">报警时间: {{info.AlarmTime}}</text>
          <text class="color54 fontSize12">恢复时间: {{info.RecoveryTime}}</text>
        </view>
      </view>
      <view class="flexItem columnStyle tableViewCell">
        <view style="display:flex;align-items: center;justify-content: space-between;width:100%;">
          <view class="flexItem rowStyle marginBottom10 cellStyle" style="width:50%;">
            <label class="color54 fontSize12" style="color:#8799a3">对象名称:</label>
            <label class="fontSize14"> {{info.MonitorPointName}}</label>
          </view>
          <view class="flexItem rowStyle marginBottom10 cellStyle" style="width:50%;">
            <label class="color54 fontSize12" style="color:#8799a3">监测名称:</label>
            <label class="fontSize14">{{info.SignalName}} </label>
          </view>
        </view>
        <view class="flexItem rowStyle marginBottom10 cellStyle" style="width:100%;">
          <label class="color54 fontSize12" style="width:50%;color:#8799a3">报警内容:{{info.AlarmContent}}</label>
          <label class="color54 fontSize12" style="width:50%;color:#8799a3">报警等级:{{info.AlarmLevelName}}</label>
        </view>
        <view class="flexItem rowStyle marginBottom10 cellStyle" style="width:100%;">
          <label class="color54 fontSize12" style="width:50%;color:#8799a3">报警类型:{{info.AlarmType}}</label>
          <label class="color54 fontSize12" style="width:50%;color:#8799a3">报警阀值:{{info.ThresholdValue}}</label>
        </view>
        <view class="flexItem rowStyle marginBottom10 cellStyle" style="width:100%;">
          <label class="color54 fontSize12" style="width:50%;color:#8799a3">监控值:{{info.DataValue}}</label>
          <label class="color54 fontSize12" style="width:50%;color:#8799a3">处理状态:{{info.HandleStatus}}</label>
        </view>
      </view>
    </block>
    <view
      style="width: 100%;height: 80rpx;display: flex;background-color: #eee;align-items: center;justify-content: center;"
      wx:if="{{bottomStatus == true}}">
      <text style="color: #bebebe;">-- 没有更多信息了 --</text>
    </view>
 
    <view class="iconfont iconfont_view icon-weibiaoti- {{animationFloatMenu}}"
      wx:if="{{isShowFloatMenu && currentTabIndex == 2}}" style=" bottom: 80px;" bindtap="goTop">
    </view>
  </scroll-view>
</view>
 
<view class="tabBar">
  <block wx:for="{{tabBar}}" wx:for-item="item" wx:key="tabBar" wx:key="key">
    <view class="tabBar-item" data-index='{{item.index}}' catchtap='tapTab'>
      <view>
        <view class="tabBarIcon iconfont {{item.index== currentTabIndex ? item.selectedIconPath : item.iconPath}}">
        </view>
      </view>
      <view class="{{item.index== currentTabIndex ? 'tabBartext' :''}}">{{item.text}}</view>
    </view>
  </block>
</view>
 
<loading hidden="{{loadingHidden}}">
  {{loadingInfo}}
</loading>