From cb88decb6426d87460703dfe7e3307b908513d76 Mon Sep 17 00:00:00 2001 From: lishenfeng Date: Thu, 20 Mar 2025 17:55:23 +0800 Subject: [PATCH] =?UTF-8?q?feat():=20=E5=A2=9E=E5=8A=A0=E5=B7=A1=E6=9F=A5?= =?UTF-8?q?=E5=B7=A1=E6=A3=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/homeIndex/index.vue | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/pages/homeIndex/index.vue b/pages/homeIndex/index.vue index 5645265..153376c 100644 --- a/pages/homeIndex/index.vue +++ b/pages/homeIndex/index.vue @@ -29,7 +29,7 @@ @@ -57,6 +57,8 @@ import moment from 'moment' const warnStm = moment().subtract(1, "days").format("YYYY-MM-DD HH:mm:ss") const warnetm = moment().format("YYYY-MM-DD HH:mm:ss") + const stm = moment().startOf('year').format("YYYY-MM-DD HH:mm:ss"); + const etm = moment().format("YYYY-MM-DD HH:mm:ss"); import SkInfo from '../skInfo/index.vue' import YlzList from '../ylzList/index.vue' import SwzList from "../sws/index.vue" @@ -73,6 +75,7 @@ userList: uni.getStorageSync('value'), default_src: uni.getStorageSync('avatar'), messagelist: [], + xcStatus: false, ylzList: [], swzList:[], warnStatus: false, //预警 @@ -80,6 +83,7 @@ }, onPullDownRefresh() { this.getYjData(); + this.getXcrwData(); uni.$showMsg("刷新成功"); setTimeout(function () { uni.stopPullDownRefresh(); @@ -112,6 +116,12 @@ icon: '../../static/tabs/aqjc.png', url: '/pages/aqjc/index' }, + { + value: '巡查任务', + key: 5, + icon: '../../static/tabs/xcrw.png', + url: '/pages/xcrw/index' + }, ] } }, @@ -185,6 +195,28 @@ uni.$showMsg(); } }, + // 巡查任务 + async getXcrwData() { + const userId = uni.getStorageSync('value').userId + const params = { + dateRangeSo: { + start: stm, + end: etm, + }, + inspectUserId: userId, + statusList: [0, 1] + } + try { + const res = await uni.$http.post("/gunshiApp/tsg/inspect/task/list", params) + if (res.data.data.length > 0) { + this.xcStatus = true + }else{ + this.xcStatus = false + } + } catch (error) { + uni.$showMsg(); + } + }, }, onLoad() { @@ -194,6 +226,7 @@ onShow() { var that = this; that.getList(); + this.getXcrwData(); timer = setInterval(function () { that.getList(); }, 10000);