tanghaolin
2022-10-27 c8fd9954bb5037e49d740ad40c58a6b4d78d1577
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
<loading hidden="{{loadingHidden}}">
  {{loadingInfo}}
</loading>
<!-- 底部导航栏 -->
<view class="tabBar">
  <block wx:for="{{tabBar}}" wx:for-item="item" wx:key="index">
    <view class="tabBar-item" data-index='{{item.index}}' catchtap='tapTab'>
      <view>
        <icon class="iconfont {{item.index == currentTabIndex ? item.selectedIconPath : item.iconPath}}"></icon>
        <!-- <image class="icon" src='{{item.index == currentTabIndex ? item.selectedIconPath : item.iconPath}}'></image> -->
      </view>
      <view class="{{item.index == currentTabIndex ? 'tabBartext' :''}}">{{item.text}}</view>
    </view>
  </block>
</view>
 
 
 
<!-- 监测 -->
<view class="container">
  <view class="y_container" wx:if="{{currentTabIndex==0}}">
    <view class="y_c_list" style="justify-content: center;color: #16b5cb;">
      <icon class="iconfont icon-zhuangtai"></icon>
      <view wx:if="{{!isInOperationByOpenOrClose}}" class="kpiText">状态<text>({{kpiParas.status?"运行":"停止"}})</text></view>
      <view wx:else class="action">
        <view class="cu-load load-icon loading">{{kpiParas.status?'停止中...':'开启中...'}}</view>
      </view>
    </view>
    <view class="y_c_list">
      <icon class="iconfont icon-taishu"></icon>
      <view class="kpiText">运行台数:<text>{{kpiParas.runNnumber}}/{{machineList.length}}</text></view>
    </view>
    <view class="y_c_list">
      <icon class="iconfont icon-guzhang"></icon>
      <view class="kpiText"><text>故障:({{kpiParas.alarmNumber}})</text></view>
    </view>
  </view>
 
  <scroll-view wx:if="{{currentTabIndex==0}}" scroll-y class='pointLists' scroll-top="{{scrollTop}}" style="height: calc(100vh - 116rpx);" scroll-with-animation bindscroll="scrollListView">
    <text wx:if="{{!hasPointData}}" class="pointCellRecordName">还未定义信号</text>
 
    <block wx:if="{{hasPointData}}" wx:for="{{allProductPoints}}" wx:key="ID" wx:for-item="product" wx:for-index="product_index">
      <label class="lineSpace4Product"> </label>
      <view class="titleView" data-productid='{{product.ID}}' bindtap='tapProductName' data-target="{{product.Name}}">
        <block wx:if="{{product.Name!='泵站'}}">
          <view>
            <view wx:if="{{product.RunStatus == '停止'}}" class="gray"></view>
            <view wx:elif="{{product.RunStatus == '故障'}}" class="red"></view>
            <view wx:else class="{{product.RunStatus?'green':''}}"></view>
          </view>
        </block>
        <view class="productName">{{product.Name}}</view>
        <label class='rightLabel'>
          <view class="productStatus" wx:if="{{product.Name!='泵站'}}">{{product.RunStatus}}</view>
          <icon class="expandImage iconfont {{product.IsExpand?'icon-down':'icon-right'}}"></icon>
          <!-- <image class="expandImage" src='../../images/icons/{{product.IsExpand?"infodown":"inforight"}}.png'></image> -->
        </label>
        <view class="move" wx:if="{{product.SignalStatus != -1}}">
          <view class="bg-green" wx:if="{{product.SignalStatus == 0}}" data-index="{{product_index}}" catchtap="changeProductRunStatus">
            <icon class="cuIcon-video" style="margin-right:10rpx"></icon>开
          </view>
          <view class="bg-grey" wx:if="{{product.SignalStatus == 1}}" data-index="{{product_index}}" catchtap="changeProductRunStatus">
            <icon class="cuIcon-roundclose" style="margin-right:10rpx"></icon>关
          </view>
          <!-- <view class="bg-green" catchtap="openProduct">开启</view> -->
        </view>
      </view>
 
      <view wx:if="{{product.IsExpand && point.isDisp}}" class="pointCell" wx:for="{{product.Items}}" wx:for-index="index" wx:key="index" wx:for-item="point" data-pointid="{{point.ID}}" data-pointname="{{point.SignalList[0].Name}}" data-pointunit="{{point.SignalList[0].UnitValue}}" data-crontype="{{point.CronType}}" bindtap='tapeMonitorPoint'>
        <label wx:if="{{index>0}}" class="lineSpace4Record"> </label>
        <!--<image class="pointCellImage" src="{{ point.image }}"></image>-->
        <view style="display:flex;justify-content: space-between;align-items: center;">
          <view>
            <view class="pointCellRecordName">{{ point.SignalList[0].Name }}</view>
          </view>
          <!-- 正常不可修改的值 -->
          <view>
            <view class="pointRightBlock pointCellUnit" style="height:100rpx;line-height: 100rpx;">
              {{point.SignalList[0].UnitValue == null?'':point.SignalList[0].UnitValue}}
            </view>
            <view class="pointRightBlock pointCellRecord">{{point.SignalList[0].SignalValue}}</view>
          </view>
        </view>
        <!-- 是否显示监测时间 -->
        <block wx:if="{{isVisibleMonitorDataTime}}">
          <view wx:if="{{point.SignalList[0].RecordTime}}" class="update_time">更新时间:{{point.SignalList[0].RecordTime}}</view>
          <view wx:else class="update_time">{{point.SignalList[0].RecordTime}}</view>
        </block>
        <!-- 点击修改的时候提示修改中 等待后台返回响应成功后关闭该提示框  -->
        <view wx:if="{{point.SignalList[0].isEdit && kpiParas.status && isInOperationByEdit}}" catchtap class="cu-load bg-black loading mode-style"></view>
      </view>
 
      <view wx:if="{{product.IsExpand && !product.isExpandAll && product.Items.length>1 && allProductPoints.length>1}}" class="y_more" data-index="{{product_index}}" data-id="{{product.ID}}" catchtap='tapMoreMonitor'>
        <icon class="iconfont icon-icon-test"></icon>
        <view>更多</view>
      </view>
 
    </block>
    <view class='refreshTimeInfoLabel'>
      <text>最后刷新时间:{{getNewDateArry[0]}}-{{getNewDateArry[1]}}-{{getNewDateArry[2]}} {{getNewDateArry[3]}}:{{getNewDateArry[4]}}</text>
      <text>{{lastRefreshTime}}秒后刷新</text>
    </view>
  </scroll-view>
 
</view>
 
<!--  工作时间  -->
<view wx:if='{{currentTabIndex==1}}'>
  <view class="date_top">
    <button class="last_day" bindtap="yesterDay"><text>上一天</text></button>
    <view class="date">
      <picker mode="date" end="{{yestday}}" value="{{historyDate}}" fields="day" bindchange="tapChangeWorkTime">
        <view class="weui-input view-center">{{historyDate}}</view>
      </picker>
    </view>
    <button class="follow_day" disabled="{{!isNextDayAble}}" bindtap="tomorrow"><text style="text-align:center">下一天</text></button>
  </view>
  <view class="echart_body">
    <view class="container1">
      <ec-canvas id="mychart-dom-bar" canvas-id="mychart-bar" ec="{{ec}}"></ec-canvas>
    </view>
  </view>
  <view class="ykt-detail-wraper">
    <view class="ykt-head">
      <text class="ykt-type-name">泵组总开机时间</text>
    </view>
    <view class="detail-list">
      <view class="detail-item" wx:for="{{machineList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
        <text class="detail-item-label">{{item.TitleName}}</text>
        <text class="detail-item-value">{{item.WorkTime}}小时</text>
      </view>
    </view>
  </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;' 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.MonitorPointName}} </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>
  </scroll-view>
</view>
 
<!-- 监控摄像头 -->
<view wx:if='{{currentTabIndex==3}}'>
  <view id="video" wx:if="{{moreVideo.length >0 && stationID == '1575029532937818112'}}">
    <view class="videoBox" wx:for-items="{{moreVideo}}" wx:for-item="more" wx:for-index="list_index" wx:key="more">
      <view class="box_item">
        <view class="content" style="font-size:32rpx;">
          <text class="iconfont icon-jiankong" style="color:#8799a3"></text>
          <text style="margin-left:15rpx;color:#8799a3;">{{more.Name}}</text>
        </view>
        <view class="content" style="font-size:32rpx;" bindtap="tapCamearListDetailView" data-video-obj="{{more}}">
          <text style="margin-left:15rpx;color:#8799a3;">更多</text>
          <text class="cuIcon-moreandroid" style="color:#8799a3"></text>
        </view>
      </view>
      <video id="myVideo" src="{{more.LiveUrl}}" title='{{more.Name}}' autoplay="{{more.LiveUrl.length>0?true:false}}" enable-play-gesture show-center-play-btn="{{false}}" show-progress="{{false}}" controls="{{false}}" show-mute-btn bindloadedmetadata="onBindLoadEdmetadata">
      </video>
    </view>
  </view>
 
  <view style="height: 80rpx;text-align: center;line-height: 80rpx;" wx:if="{{stationID != '1575029532937818112'}}">
    暂无监控视频
  </view>
</view>
<!-- 返回顶部 -->
<view class="iconfont icon-weibiaoti- {{animationFloatMenu}}" style="font-size:40px;color:#fff;width: 40px; height: 40px; position: fixed; right: 10px; bottom: 100px;z-index:200;display: flex;align-items: center;justify-content:center;background-color: #16b5cb;border-radius:10rpx;box-shadow: 0 2px 6px 0 rgba(114, 124, 245, .5);" bindtap="goTop" wx:if="{{isShowFloatMenu && currentTabIndex == 0 || isShowFloatMenu && currentTabIndex == 2}}"></view>
 
<!-- 开关机按钮 -->
<view wx:if="{{currentTabIndex == 0}}" class="{{kpiParas.status?'cuIcon-stop':'cuIcon-video'}} {{isInOperationByOpenOrClose || isInOperationByEdit?'bg-ban':'bg-normal'}}  {{isExpandList? '.down':'.xia'}}" style="font-size:26px;color:#fff;width: 40px; height: 40px; position: fixed; right: 10px; bottom: 155px;z-index:200;display: flex;align-items: center;justify-content:center;border-radius:10rpx;box-shadow: 0 2px 6px 0 rgba(114, 124, 245, .5);" bindtap="changeProductRunStatus"></view>
 
<!-- 开关机密码模态框 -->
<view class="cu-modal {{dialogModalVisible?'show':''}}" style="{{dialogModalVisible?'z-index: 1200;':'z-index: 1100;'}}">
  <view class="cu-dialog">
    <view class="cu-bar bg-white justify-end">
      <!-- 点击开机时显示 -->
      <view wx:if="{{!kpiParas.status}}" class='content'>开启操作</view>
      <!-- 点击关机时显示 -->
      <view wx:else class='content'>停止操作</view>
      <view class='action' bindtap='hideModal'>
        <text class='cuIcon-close text-red'></text>
      </view>
    </view>
    <!-- 点击开机时显示 -->
    <block wx:if="{{!kpiParas.status}}">
      <view class="operation_item">
        <label>自动停止模式</label>
        <view style="height: 45rpx; margin-top: 32rpx;">
          <radio class="cyan radio" checked="{{true}}" value="1" color="#16b5cb" style="margin-right: 10rpx;"></radio><text>按时长</text>
          <radio class="cyan radio" disabled="{{true}}" style="margin:0 10rpx;"></radio><text>按流量</text>
        </view>
      </view>
      <view class="operation_item">
        <label>请输入密码</label>
        <input password="{{true}}" bindinput="handleInputPwd" value="{{openPwd}}" />
        <view wx:if="{{rulePwd.visibleStatus}}" class="text-red text-sm" style="margin-top: 15rpx;">{{rulePwd.message}}</view>
      </view>
      <view class="operation_item">
        <label>请输入频率(20hz~50hz)</label>
        <input type="number" bindinput="handleFrequencyValue" value="{{frequencyValue}}" />
        <view wx:if="{{ruleFrequency.visibleStatus}}" class="text-red text-sm" style="margin-top: 15rpx;">{{ruleFrequency.message}}</view>
      </view>
      <view class="operation_item">
        <label>请输入总开机时间(小时)</label>
        <input type="digit" bindinput="handleInputOpenTime" value="{{openTime}}" />
        <view wx:if="{{ruleOpenTime.visibleStatus}}" class="text-red text-sm" style="margin-top: 15rpx;">{{ruleOpenTime.message}}</view>
      </view>
    </block>
    <!-- 停止时输入的密码 -->
    <block wx:else>
      <view class="operation_item">
        <label>请输入密码</label>
        <input password="{{true}}" bindinput="handleInputclosePwd" value="{{closePwd}}" />
        <view wx:if="{{ruleClosePwd.visibleStatus}}" class="text-red text-sm" style="margin-top: 15rpx;">{{ruleClosePwd.message}}</view>
      </view>
    </block>
    <view class="cu-bar bg-white justify-end">
      <view class='action'>
        <button class='cu-btn line-green text-green' style="color: #16b5cb;" bindtap='hideModal'>取消</button>
        <button class='cu-btn margin-left' style="background-color: #16b5cb;color: #fff;" bindtap='defindBtn'>确定</button>
      </view>
    </view>
  </view>
</view>