Commit 76a25b5bec738769a82035663b724a0a69b5f9aa
1 parent
14291309
fix:DEFECT-364 DEFECT-367 DEFECT-368(都是属于告警的问题)修复告警名称筛选,数据上拉加载位全部数据问题,修改告警筛选弹窗日期…
…选择样式问题,修改告警筛选日期筛选无数据问题
Showing
1 changed file
with
80 additions
and
35 deletions
@@ -229,10 +229,17 @@ export default { | @@ -229,10 +229,17 @@ export default { | ||
229 | timeArea, | 229 | timeArea, |
230 | ordId: '', | 230 | ordId: '', |
231 | detailStatus: false, | 231 | detailStatus: false, |
232 | - alertTotal: 0 | 232 | + alertTotal: 0, |
233 | + searchAlarmText: '', | ||
234 | + startTimeVa: '', | ||
235 | + endTimeVa: '', | ||
236 | + startTimeArea: '', | ||
237 | + endTimeArea: '', | ||
238 | + type: null | ||
233 | }; | 239 | }; |
234 | }, | 240 | }, |
235 | onShow() { | 241 | onShow() { |
242 | + this.page.num = 1; | ||
236 | if (this.detailStatus) { | 243 | if (this.detailStatus) { |
237 | this.loadData(1, null, null, null, null, null, null); | 244 | this.loadData(1, null, null, null, null, null, null); |
238 | } | 245 | } |
@@ -243,6 +250,7 @@ export default { | @@ -243,6 +250,7 @@ export default { | ||
243 | onHide() { | 250 | onHide() { |
244 | this.ordId = ''; | 251 | this.ordId = ''; |
245 | this.detailStatus = false; | 252 | this.detailStatus = false; |
253 | + this.type = null; | ||
246 | }, | 254 | }, |
247 | onLoad(e) { | 255 | onLoad(e) { |
248 | // 隐藏原生的tabbar | 256 | // 隐藏原生的tabbar |
@@ -251,13 +259,12 @@ export default { | @@ -251,13 +259,12 @@ export default { | ||
251 | this.loadData(1, null, null, null, null, null, null); | 259 | this.loadData(1, null, null, null, null, null, null); |
252 | } else { | 260 | } else { |
253 | let params = JSON.parse(e.type); | 261 | let params = JSON.parse(e.type); |
254 | - let type; | ||
255 | if (Array.isArray(params)) { | 262 | if (Array.isArray(params)) { |
256 | - type = params.join(','); | 263 | + this.type = params.join(','); |
257 | } else { | 264 | } else { |
258 | - type = params; | 265 | + this.type = params; |
259 | } | 266 | } |
260 | - this.loadData(1, type, null, null, null, null, null); | 267 | + this.loadData(1, this.type, null, null, null, null, null); |
261 | } | 268 | } |
262 | }, | 269 | }, |
263 | watch: { | 270 | watch: { |
@@ -267,6 +274,10 @@ export default { | @@ -267,6 +274,10 @@ export default { | ||
267 | }, | 274 | }, |
268 | methods: { | 275 | methods: { |
269 | inputChanged(e) { | 276 | inputChanged(e) { |
277 | + this.resetData(); | ||
278 | + this.topBack(); | ||
279 | + this.searchAlarmText = e; | ||
280 | + this.page.num = 1; | ||
270 | this.loadData(1, null, null, null, null, null, null, e); | 281 | this.loadData(1, null, null, null, null, null, null, e); |
271 | }, | 282 | }, |
272 | getAlertStatus(e, i) { | 283 | getAlertStatus(e, i) { |
@@ -285,44 +296,39 @@ export default { | @@ -285,44 +296,39 @@ export default { | ||
285 | this.current4 = i; | 296 | this.current4 = i; |
286 | this.selectTimeVal = e.value; | 297 | this.selectTimeVal = e.value; |
287 | let curTime = new Date(); | 298 | let curTime = new Date(); |
288 | - const formatS = curTime | ||
289 | - .getTime() | ||
290 | - .toString() | ||
291 | - .substring(0, 10); | 299 | + const formatS = curTime.getTime(); |
292 | let addMinute = new Date(curTime.setMinutes(curTime.getMinutes() + this.selectTimeVal)); | 300 | let addMinute = new Date(curTime.setMinutes(curTime.getMinutes() + this.selectTimeVal)); |
293 | - const formatE = addMinute | ||
294 | - .getTime() | ||
295 | - .toString() | ||
296 | - .substring(0, 10); | 301 | + const formatE = addMinute.getTime(); |
297 | this.timeData.getTimeGapS = formatS; | 302 | this.timeData.getTimeGapS = formatS; |
298 | this.timeData.getTimeGapE = formatE; | 303 | this.timeData.getTimeGapE = formatE; |
299 | }, | 304 | }, |
300 | queryData() { | 305 | queryData() { |
306 | + this.topBack(); | ||
307 | + this.page.num = 1; | ||
301 | let date1 = new Date(this.timeData.selectTime[0]); | 308 | let date1 = new Date(this.timeData.selectTime[0]); |
302 | let date2 = new Date(this.timeData.selectTime[1]); | 309 | let date2 = new Date(this.timeData.selectTime[1]); |
303 | - let startTimeVa, endTimeVa; | ||
304 | if (this.timeData.selectTime.length == 0) { | 310 | if (this.timeData.selectTime.length == 0) { |
305 | - startTimeVa = ''; | ||
306 | - endTimeVa = ''; | 311 | + this.startTimeVa = ''; |
312 | + this.endTimeVa = ''; | ||
307 | } else { | 313 | } else { |
308 | - startTimeVa = date1 | ||
309 | - .getTime() | ||
310 | - .toString() | ||
311 | - .substring(0, 10); | ||
312 | - endTimeVa = date2 | ||
313 | - .getTime() | ||
314 | - .toString() | ||
315 | - .substring(0, 10); | 314 | + this.startTimeVa = date1.getTime(); |
315 | + this.endTimeVa = date2.getTime(); | ||
316 | } | 316 | } |
317 | - let startTimeArea, endTimeArea; | ||
318 | if (this.timeData.getTimeGapS == '') { | 317 | if (this.timeData.getTimeGapS == '') { |
319 | - startTimeArea = ''; | ||
320 | - endTimeArea = ''; | 318 | + this.startTimeArea = ''; |
319 | + this.endTimeArea = ''; | ||
321 | } else { | 320 | } else { |
322 | - startTimeArea = this.timeData.getTimeGapS; | ||
323 | - endTimeArea = this.timeData.getTimeGapE; | 321 | + this.startTimeArea = this.timeData.getTimeGapS; |
322 | + this.endTimeArea = this.timeData.getTimeGapE; | ||
324 | } | 323 | } |
325 | - this.loadData(1, this.alertStatusVal, startTimeVa ? startTimeVa : startTimeArea, endTimeVa ? endTimeVa : endTimeArea, this.alertLevelVal, this.deviceTypeVal); | 324 | + this.loadData( |
325 | + 1, | ||
326 | + this.alertStatusVal, | ||
327 | + this.startTimeVa ? this.startTimeVa : this.startTimeArea, | ||
328 | + this.endTimeVa ? this.endTimeVa : this.endTimeArea, | ||
329 | + this.alertLevelVal, | ||
330 | + this.deviceTypeVal | ||
331 | + ); | ||
326 | this.show = false; | 332 | this.show = false; |
327 | }, | 333 | }, |
328 | resetData() { | 334 | resetData() { |
@@ -338,6 +344,13 @@ export default { | @@ -338,6 +344,13 @@ export default { | ||
338 | this.timeDatagetTimeGapS = ''; | 344 | this.timeDatagetTimeGapS = ''; |
339 | this.timeDatagetTimeGapE = ''; | 345 | this.timeDatagetTimeGapE = ''; |
340 | this.range = []; | 346 | this.range = []; |
347 | + this.searchAlarmText = ''; | ||
348 | + this.startTimeVa = ''; | ||
349 | + this.endTimeVa = ''; | ||
350 | + this.startTimeArea = ''; | ||
351 | + this.endTimeArea = ''; | ||
352 | + this.ordId = ''; | ||
353 | + this.type = null; | ||
341 | }, | 354 | }, |
342 | bindImageUrl(e) { | 355 | bindImageUrl(e) { |
343 | switch (e) { | 356 | switch (e) { |
@@ -361,18 +374,50 @@ export default { | @@ -361,18 +374,50 @@ export default { | ||
361 | break; | 374 | break; |
362 | } | 375 | } |
363 | }, | 376 | }, |
377 | + //筛选数据让它回到顶部 | ||
378 | + topBack() { | ||
379 | + uni.pageScrollTo({ | ||
380 | + scrollTop: 0, // 滚动到页面的目标位置 这个是滚动到顶部, 0 | ||
381 | + duration: 300 // 滚动动画的时长 | ||
382 | + }); | ||
383 | + }, | ||
364 | /*下拉刷新的回调 */ | 384 | /*下拉刷新的回调 */ |
365 | downCallback() { | 385 | downCallback() { |
366 | //联网加载数据 | 386 | //联网加载数据 |
367 | this.list.length = 0; | 387 | this.list.length = 0; |
368 | this.page.num = 1; | 388 | this.page.num = 1; |
369 | - this.loadData(1); | 389 | + this.loadData(this.page.num, null, null, null, null, null, null, null); |
390 | + this.resetData(); | ||
370 | }, | 391 | }, |
371 | /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */ | 392 | /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */ |
372 | upCallback() { | 393 | upCallback() { |
373 | - //联网加载数据 | ||
374 | - this.page.num += 1; | ||
375 | - this.loadData(this.page.num); | 394 | + if ( |
395 | + this.type != null || | ||
396 | + this.alertStatusVal != '' || | ||
397 | + this.searchAlarmText != '' || | ||
398 | + this.deviceTypeVal != '' || | ||
399 | + this.alertLevelVal != '' || | ||
400 | + this.startTimeVa != '' || | ||
401 | + this.startTimeArea != '' || | ||
402 | + this.ordId != '' | ||
403 | + ) { | ||
404 | + //联网加载数据 | ||
405 | + this.page.num += 1; | ||
406 | + this.loadData( | ||
407 | + this.page.num, | ||
408 | + this.alertStatusVal ? this.alertStatusVal : this.type, | ||
409 | + this.startTimeVa, | ||
410 | + this.endTimeVa, | ||
411 | + this.alertLevelVal, | ||
412 | + this.deviceTypeVal, | ||
413 | + this.ordId, | ||
414 | + this.searchAlarmText | ||
415 | + ); | ||
416 | + } else { | ||
417 | + //联网加载数据 | ||
418 | + this.page.num += 1; | ||
419 | + this.loadData(this.page.num); | ||
420 | + } | ||
376 | }, | 421 | }, |
377 | loadData(pageNo, statusV, startTimeV, endTimeV, severityV, deviceTypeV, organizationV, alarmName) { | 422 | loadData(pageNo, statusV, startTimeV, endTimeV, severityV, deviceTypeV, organizationV, alarmName) { |
378 | let that = this; | 423 | let that = this; |
@@ -463,6 +508,6 @@ export default { | @@ -463,6 +508,6 @@ export default { | ||
463 | margin-top: -55rpx !important; | 508 | margin-top: -55rpx !important; |
464 | } | 509 | } |
465 | /deep/ .uni-calendar--fixed { | 510 | /deep/ .uni-calendar--fixed { |
466 | - bottom: 72rpx !important; | 511 | + bottom: 172rpx !important; |
467 | } | 512 | } |
468 | </style> | 513 | </style> |