浏览代码

告警通知模块完成

fanghuisheng 1 年之前
父节点
当前提交
a21145d717

+ 9 - 0
src/api/business/fireIot/alarmManage.js

@@ -34,4 +34,13 @@ export function baseAlarm(param) {
         method: "PUT",
         data: param,
     });
+}
+
+// 告警类型列表
+export function getTypePage(data) {
+    return request({
+        url: '/service-iot/baseAlarmType/page',
+        method: 'POST',
+        data,
+    })
 }

+ 0 - 0
src/api/common/applicationInfo.js → src/api/common/message.js


+ 10 - 10
src/pages.json

@@ -91,13 +91,6 @@
             "navigationBarTitleText": "浏览文本"
           }
         },
-        {
-          "path": "export/index",
-          "style": {
-            "navigationBarTitleText": "导出",
-            "enablePullDownRefresh": false
-          }
-        },
         {
           "path": "square/index",
           "style": {
@@ -150,12 +143,19 @@
           }
         },
         {
-          "path": "applicationInfo/index",
+          "path": "appMessage/index",
           "style": {
             "navigationBarTitleText": "应用消息",
             "enablePullDownRefresh": false
           }
         },
+        {
+          "path": "alarmMessage/index",
+          "style": {
+            "navigationBarTitleText": "告警通知",
+            "enablePullDownRefresh": false
+          }
+        },
         {
           "path": "repairReport/index",
           "style": {
@@ -327,7 +327,7 @@
           }
         },
         {
-          "path": "xunJian/record/record",
+          "path": "xunJian/record/index",
           "style": {
             "navigationBarTitleText": "巡检记录",
             "enablePullDownRefresh": false
@@ -642,4 +642,4 @@
       }
     ]
   }
-}
+}

+ 1 - 1
src/pages/business/fireIot/alarmManage/alarmDetailsList/index.vue

@@ -4,7 +4,7 @@
   </u-sticky>
 
   <oa-scroll
-    customClass=" scroll-height"
+    customClass="scroll-height"
     :pageSize="pageSize"
     :total="total"
     :refresherLoad="true"

+ 8 - 8
src/pages/business/mhxf/xunJian/record/record.vue → src/pages/business/mhxf/xunJian/record/index.vue

@@ -31,7 +31,14 @@ import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni
 import { getInspectionRecordList } from "@/api/business/mhxf/xunJian/record.js";
 
 const modalName = ref(null);
-const getData = ref([]);
+const getData = ref([
+  {
+    plan_name: "计划咦",
+    spot_name: "点位1",
+    wc_time: "2023-10-22 14:14:14",
+    spot_abnormal: 0,
+  },
+]);
 
 const { proxy } = getCurrentInstance();
 
@@ -48,13 +55,6 @@ function goDetail(item) {
   });
 }
 
-onNavigationBarButtonTap((e) => {
-  console.log(e);
-  uni.navigateTo({
-    url: "/pages/common/export/index",
-  });
-});
-
 onLoad((option) => {
   goRecordList({ company_code: uni.getStorageSync("selectedCode") });
 });

+ 0 - 7
src/pages/business/zhxf/funReport/index.vue

@@ -215,13 +215,6 @@ onReachBottom(() => {
     loadData();
   }
 });
-
-onNavigationBarButtonTap((e) => {
-  console.log(e);
-  uni.navigateTo({
-    url: "./common/export/index?dwtype=" + dwtype.value,
-  });
-});
 </script>
 
 <style lang="scss">

+ 185 - 0
src/pages/common/alarmMessage/index.vue

@@ -0,0 +1,185 @@
+<template>
+  <oa-scroll
+    customClass="alarmMessage-container scroll-height"
+    :pageSize="pageSize"
+    :total="total"
+    :refresherLoad="true"
+    :refresherEnabled="true"
+    :refresherDefaultStyle="'none'"
+    :refresherThreshold="44"
+    :refresherBackground="'#f5f6f7'"
+    @load="load"
+    @refresh="refresh"
+    :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
+  >
+    <template #default>
+      <view class="content-area">
+        <view :id="index == allInfoList.length - 1 ? 'bottomInfo' : ''" v-for="(el, index) in allInfoList" :key="index" v-show="allInfoList.length > 0" @click="goContentDetails(all)">
+          <view class="content-area-time font24">{{ el.time }}</view>
+          <view class="content-area-center radius bg-white">
+            <image class="content-area-center-img radius mb10" v-if="el.img" :src="el.img" />
+            <view class="content-area-center-title mb10">{{ el.deviceName }}</view>
+            <view class="content-area-center-cont">
+              <span class="label">设备号:</span>
+              {{ el.deviceId }}
+            </view>
+            <view class="content-area-center-cont">
+              <span class="label">告警类型:</span>
+              {{ mapping("typeName", el.alarmType, alarmTypeData) }}
+            </view>
+            <view class="content-area-center-cont">
+              <span class="label">告警时间:</span>
+              {{ el.alarmTime }}
+            </view>
+            <view class="content-area-center-buttom font24">查看详情 </view>
+          </view>
+        </view>
+      </view>
+    </template>
+  </oa-scroll>
+</template>
+
+<script setup>
+import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
+import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
+import { publicStores, useStores } from "@/store/modules/index";
+
+import { infoList } from "@/api/common/message.js";
+import { baseAlarmList, getTypePage } from "@/api/business/fireIot/alarmManage.js";
+
+const useStore = useStores();
+const { proxy } = getCurrentInstance();
+
+const pageSize = ref(20);
+const current = ref(1);
+const total = ref(0);
+const data = reactive({
+  allInfoList: [],
+  alarmTypeData: [],
+});
+
+const { allInfoList, alarmTypeData } = toRefs(data);
+
+/**
+ * @初始化
+ */
+function init() {
+  getTypePage({
+    current: 1,
+    size: 1000,
+  }).then((requset) => {
+    if (requset.status === "SUCCESS") {
+      alarmTypeData.value = requset.data.records;
+    }
+  });
+
+  proxy.$modal.loading("加载中");
+  baseAlarmList({
+    productCode: "",
+    current: current.value,
+    size: pageSize.value,
+  }).then((requset) => {
+    if (requset.status === "SUCCESS") {
+      requset.data.records.forEach((el) => {
+        allInfoList.value.push({
+          img: "",
+          time: proxy.$common.jktTimes(el.alarmTime),
+          deviceId: el.deviceId,
+          deviceName: el.deviceName,
+          alarmType: el.alarmType,
+          alarmTime: el.alarmTime,
+        });
+      });
+      total.value = requset.data.total;
+
+      proxy.$modal.closeLoading();
+    }
+  });
+}
+
+/** 映射 */
+function mapping(type, val, data) {
+  for (let i = 0; i < data.length; i++) {
+    if (val == data[i].typeCode) {
+      return data[i][type];
+    }
+  }
+}
+
+/**
+ * @跳转
+ */
+function goContentDetails(e) {
+  proxy.$tab.navigateTo(`/pages/business/fireIot/alarmManage/alarmDetails/index?deviceName=${e.deviceName}&alarmTime=${e.alarmTime}`);
+}
+
+/**
+ * @scrollView加载数据
+ */
+function load() {
+  pageSize.value += 10;
+  init();
+}
+
+/**
+ * @scrollView刷新数据
+ */
+function refresh() {
+  pageSize.value = 20;
+  total.value = 0;
+  init();
+}
+
+onLoad((options) => {
+  init();
+});
+
+onReady(() => {});
+
+onShow(() => {
+  //调用系统主题颜色
+  proxy.$settingStore.systemThemeColor([1]);
+});
+</script>
+
+<style lang="scss" scoped>
+.alarmMessage-container {
+  .content-area {
+    padding-bottom: 1px;
+
+    &-time {
+      padding: 10px 0;
+      text-align: center;
+      color: #909399;
+    }
+
+    &-center {
+      margin: 0 10px 20px 10px;
+      padding: 15px;
+      overflow: hidden;
+
+      &-img {
+        display: flex;
+        max-width: 100%;
+        max-height: 100px !important;
+        margin: 0 auto 15px auto;
+      }
+
+      &-title {
+        margin: 0 0 15px 0;
+        font-weight: 600;
+        color: #000000;
+      }
+
+      &-cont {
+        color: #909399;
+      }
+
+      &-buttom {
+        float: right;
+        color: #2a98ff;
+      }
+    }
+  }
+}
+</style>

+ 3 - 4
src/pages/common/applicationInfo/index.vue → src/pages/common/appMessage/index.vue

@@ -4,7 +4,7 @@
   </u-sticky>
 
   <scroll-view class="scroll-height" :scroll-y="true" :scroll-into-view="scrollIntoView" :data-theme="'theme-' + proxy.$settingStore.themeColor.name" style="padding-bottom: 44px">
-    <view class="applicationInfo-container">
+    <view class="appMessage-container">
       <view class="content-area" v-show="tabsCurrent == 0">
         <u-empty v-show="allInfoList.length <= 0" text="暂无数据" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"> </u-empty>
         <view :id="index == allInfoList.length - 1 ? 'bottomInfo' : ''" v-for="(all, index) in allInfoList" :key="index" v-show="allInfoList.length > 0" @click="goContentDetails(all)">
@@ -36,10 +36,9 @@ import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, on
 import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
 import { publicStores, useStores } from "@/store/modules/index";
 
-import { infoList } from "@/api/common/applicationInfo.js";
+import { infoList } from "@/api/common/message.js";
 
 const useStore = useStores();
-
 const { proxy } = getCurrentInstance();
 
 const data = reactive({
@@ -150,7 +149,7 @@ onNavigationBarButtonTap((e) => {
   opacity: 1 !important;
 }
 
-.applicationInfo-container {
+.appMessage-container {
   padding-bottom: 1px;
 
   .content-area {

+ 0 - 137
src/pages/common/export/index.vue

@@ -1,137 +0,0 @@
-<template>
-  <view class="processWrapper exportBody">
-    <view style="height: 98rpx"></view>
-    <view class="ding">
-      <!-- <calendar></calendar> -->
-      <view class="example-body">
-        <uni-datetime-picker
-          v-model="datetimerange"
-          type="daterange"
-          start-placeholder="请选择开始时间"
-          end-placeholder="请选择结束时间"
-          start="2000-3-20 12:00:00"
-          end="2025-10-20 20:00:00"
-          rangeSeparator="至"
-        />
-      </view>
-    </view>
-
-    <block>
-      <view class="processList">
-        <view class="cu-list menu-avatar">
-          <view class="cu-item" v-for="(item, index) in getExportData" :key="index">
-            <view class="cu-avatar lg">
-              <image class="image-bg" :src="item.clzt == 0 ? '@/static/images/export/process-icon.png' : '@/static/images/export/processed-icon.png'" />
-            </view>
-            <view class="content">
-              <view class="pro-title">
-                <view class="cut">{{ keyWords == "人工督察单" ? item.artificial_code : item.supervise_code }}</view>
-              </view>
-              <view class="pro-des">
-                <view class="text-cut">{{ item.content }}</view>
-              </view>
-              <view class="pro-date">{{ item.timestamp }}</view>
-            </view>
-            <view class="action" style="z-index: 99">
-              <view class="unProcess" style="color: #ff4e00" v-if="item.clzt == 0">未处理</view>
-              <view class="processed" style="color: #08be04" v-else>已处理</view>
-            </view>
-          </view>
-          <view class="text-center margin-top" v-if="!getExportData.length && dataRes">暂无数据...</view>
-        </view>
-      </view>
-    </block>
-    <view v-if="getExportData.length > 0" class="padding-lr padding-bottom-lg bg-white" style="position: fixed; bottom: 0; width: 100%">
-      <view class="btn-area">
-        <button class="bg-blue round missReport margin-top" @tap="exportButton()">导 出</button>
-      </view>
-    </view>
-  </view>
-</template>
-
-<script setup>
-import config from "@/config";
-import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
-import { ref, reactive, computed, getCurrentInstance, toRefs, inject, watchEffect } from "vue";
-import { publicStores, useStores } from "@/store/modules/index";
-
-const useStore = useStores();
-
-const { proxy } = getCurrentInstance();
-
-const data = reactive({
-  getExportData: [],
-  dataRes: 0,
-  datetimerange: ["", ""],
-  keyWords: "",
-});
-
-let { getExportData, dataRes, datetimerange, keyWords } = toRefs(data);
-
-onLoad((option) => {
-  keyWords = option.keywords;
-  getData({
-    company_code: uni.getStorageSync("selectedCode"),
-    start_time: "",
-    end_time: "",
-  });
-});
-
-function datetimerange1(newval) {
-  getData({
-    company_code: uni.getStorageSync("selectedCode"),
-
-    start_time: newval[0],
-    end_time: newval[1],
-  });
-}
-
-async function getData(params = {}) {
-  const res = await this.$myRequest({
-    // url: listUrl, //人员督察单渲染
-    url: keyWords == "人工督察单" ? "FireInspector/getManualInspectorList" : "FireInspector/getElectronicInspectorList",
-    data: params,
-    showLoading: true,
-  });
-  getExportData = res.data.data;
-  dataRes = 1;
-}
-
-function exportButton() {
-  let url2 = "";
-  switch (keyWords) {
-    case "人工督察单":
-      url2 = "ExportModule/getManualInspectorListExpor";
-      break;
-    case "电子督察单":
-      url2 = "ExportModule/getElectronicInspectorListExpor";
-      break;
-    default:
-      break;
-  }
-
-  //#ifdef H5
-  var start_time = datetimerange[0] ? `start_time/${datetimerange[0]}/` : "";
-  var end_time = datetimerange[1] ? `end_time/${datetimerange[1]}/` : "";
-  let exportUrl = config.BASE_URL + url2 + `/${start_time}${end_time}company_code/${uni.getStorageSync("selectedCode")}/`;
-  var ua = window.navigator.userAgent.toLowerCase();
-  if (ua.match(/MicroMessenger/i) == "micromessenger") {
-    uni.showModal({
-      showCancel: false,
-      content: "如需下载,请在默认浏览器中操作",
-      success: function (res) {
-        window.location.href = exportUrl;
-      },
-    });
-  } else {
-    window.location.href = exportUrl;
-  }
-  //#endif
-}
-
-watchEffect(() => {
-  datetimerange1();
-});
-</script>
-
-<style lang="scss"></style>

+ 30 - 38
src/pages/common/repairReport/record.vue

@@ -14,27 +14,21 @@
     :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
   >
     <template #default>
-      <view class="menu-list margin-0">
-        <view class="list-cell list-cell-arrow" v-for="(base, index) in dataList" :key="index">
-          <view class="menu-item-box">
-            <view class="content-area">
-              <view class="content-area-top">
-                <view class="content-area-top-time">
-                  {{ base.repairStatus == 1 ? (base.createTime ? base.createTime.replace("T", " ") : "") : base.handleTime ? base.handleTime.replace("T", " ") : "" }}
-                </view>
-                <view class="content-area-top-status" v-if="base.repairStatus == 1" style="background-color: #23dedc"> 受理中 </view>
-                <view class="content-area-top-status" v-if="base.repairStatus == 2" style="background-color: #12c100"> 处理完成 </view>
-              </view>
-              <view class="content-area-center">
-                <view class="content-area-center-view text-ellipsis" style="width: 17%; font-weight: 600"> {{ base.reflectName }} </view>
-                <view class="content-area-center-view text-ellipsis" style="width: 33%"> {{ base.reflectPhone }}</view>
-                <view class="content-area-center-view text-ellipsis" style="width: 50%"> {{ base.repairContent }}</view>
-              </view>
-              <view class="content-area-center">
-                <view class="content-area-center-view text-ellipsis" style="width: 40%"> {{ base.projectName }} </view>
-                <view class="content-area-center-view text-ellipsis" style="width: 60%"> {{ base.projectAddress }}</view>
-              </view>
+      <view class="menu-list m0">
+        <view class="list-cell" style="color: #666666; line-height: 25px" v-for="(base, index) in dataList" :key="index">
+          <view class="content-area-top menu-item-box">
+            <view class="content-area-top-time">
+              {{ base.repairStatus == 1 ? (base.createTime ? base.createTime.replace("T", " ") : "") : base.handleTime ? base.handleTime.replace("T", " ") : "" }}
             </view>
+            <view class="content-area-top-status" v-if="base.repairStatus == 1" style="background-color: #23dedc"> 受理中 </view>
+            <view class="content-area-top-status" v-if="base.repairStatus == 2" style="background-color: #12c100"> 处理完成 </view>
+          </view>
+          <view class="content-area-row_wrap menu-item-box">
+            <view class="content-area-row_wrap-view"> 项目名称:{{ base.projectName }} </view>
+            <view class="content-area-row_wrap-view"> 报修人:{{ base.reflectName }} </view>
+            <view class="content-area-row_wrap-view"> 报修人电话:{{ base.reflectPhone }} </view>
+            <view class="content-area-row_wrap-view"> 报修内容:{{ base.repairContent }} </view>
+            <view class="content-area-row_wrap-view"> 报修地址:{{ base.projectAddress }} </view>
           </view>
         </view>
       </view>
@@ -133,26 +127,20 @@ onLoad((options) => {
 <style lang="scss" scoped>
 .repairReport-record-container {
   .content-area {
-    width: 100%;
-    display: flex;
-    flex-flow: row wrap;
-    padding-right: 10px;
-
     &-top {
-      min-width: 100%;
-      font-size: 15px;
-      display: flex;
-      white-space: nowrap;
+      font-size: 16px;
+      font-weight: 600;
+      color: #000000;
 
       &-time {
-        width: 75%;
+        max-width: 70%;
         margin: auto 0;
         font-size: 14px;
         color: rgb(102, 102, 102);
       }
 
       &-name {
-        width: 75%;
+        max-width: 70%;
         color: #000;
       }
 
@@ -167,15 +155,19 @@ onLoad((options) => {
       }
     }
 
-    &-center {
-      display: flex;
-      min-width: 100%;
-      margin-top: 10px;
-      font-size: 14px;
-      color: rgb(102, 102, 102);
+    &-row_wrap {
+      font-size: 13px;
+      flex-flow: row wrap;
 
       &-view {
-        margin: auto 0;
+        display: flex;
+        min-width: 50%;
+        white-space: nowrap;
+        > .iconfont {
+          font-size: 14px;
+          color: #909399;
+          margin-left: 5px;
+        }
       }
     }
   }

+ 36 - 37
src/pages/common/square/index.vue

@@ -1,45 +1,44 @@
 <template>
-	<view>
-		<view class=" section  bg-white margin-top-sm">
-			<view class="cu-list grid col-3 no-border">
-				<view class="cu-item justify-center align-center" @tap="goSiteList(item.redirectUrl)"  v-for="(item,index) in cuIconList" :key="index">
-					<image :src="`${item.imgUrl}`" style="width:100rpx;height:100rpx"></image>
-					<view class="cu-tag badge" v-if="item.badge!=0">
-						<block class="cu-tag badge" v-if="item.badge!=1">{{item.badge>99?'99+':item.badge}}</block>
-					</view>
-					<text>{{item.name}}</text>
-				</view>
-			</view>
-		</view>
-		
-	</view>
+  <view>
+    <view class="section bg-white margin-top-sm">
+      <view class="cu-list grid col-3 no-border">
+        <view class="cu-item justify-center align-center" @tap="goSiteList(item.redirectUrl)" v-for="(item, index) in cuIconList" :key="index">
+          <image :src="`${item.imgUrl}`" style="width: 100rpx; height: 100rpx"></image>
+          <view class="cu-tag badge" v-if="item.badge != 0">
+            <block class="cu-tag badge" v-if="item.badge != 1">{{ item.badge > 99 ? "99+" : item.badge }}</block>
+          </view>
+          <text>{{ item.name }}</text>
+        </view>
+      </view>
+    </view>
+  </view>
 </template>
 
-<script>
-	export default {
-		props:[ 'cuIconList'] ,  //接收外界传过来的数据
-		data() {
-			return {
+<script setup>
+import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll, onBackPress, onUnload } from "@dcloudio/uni-app";
+import { reactive, getCurrentInstance, toRefs, inject } from "vue";
+import { useStores, publicStores } from "@/store/modules/index";
 
-			}
-		},
-		methods: {
-			goSiteList(url) {
-				 // console.log(url);
-				uni.navigateTo({
-					url: url,
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
-			}
-		}
-	}
+const useStore = useStores();
+const { proxy } = getCurrentInstance();
+
+const data = reactive({});
+
+const {} = toRefs(data);
+
+function goSiteList(url) {
+  // console.log(url);
+  uni.navigateTo({
+    url: url,
+    success: (res) => {},
+    fail: () => {},
+    complete: () => {},
+  });
+}
 </script>
 
 <style>
-	.cu-list.grid.no-border{
-		padding:30rpx 10rpx
-	}
-
+.cu-list.grid.no-border {
+  padding: 30rpx 10rpx;
+}
 </style>

+ 71 - 71
src/pages/common/test/export.vue

@@ -1,77 +1,77 @@
 <template>
-	<view>
-		<!-- 多个复选框,带全选 -->
-		<view>
-			<checkbox-group class="block" @change="changeCheckbox">
-				<view v-for="item in newDeviceManage" :key="item.id">				
-					<checkbox :value="String(item.id)" :checked="checkedArr.includes(String(item.id))" :class="{'checked':checkedArr.includes(String(item.id))}"></checkbox>
-					<text>{{item.title}}</text>
-				</view>
-			</checkbox-group>
-		</view>
-		<view>
-			<checkbox-group @change="allChoose">
-				<label>
-					<checkbox value="all" :class="{'checked':allChecked}" :checked="allChecked?true:false"></checkbox> 全选
-				</label>
-			</checkbox-group>
-		</view>
-	</view>
+  <view>
+    <!-- 多个复选框,带全选 -->
+    <view>
+      <checkbox-group class="block" @change="changeCheckbox">
+        <view v-for="item in newDeviceManage" :key="item.id">
+          <checkbox :value="String(item.id)" :checked="checkedArr.includes(String(item.id))" :class="{ checked: checkedArr.includes(String(item.id)) }"></checkbox>
+          <text>{{ item.title }}</text>
+        </view>
+      </checkbox-group>
+    </view>
+    <view>
+      <checkbox-group @change="allChoose">
+        <label>
+          <checkbox value="all" :class="{ checked: allChecked }" :checked="allChecked ? true : false"></checkbox>
+          全选
+        </label>
+      </checkbox-group>
+    </view>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				isChecked:false,
-				newDeviceManage:[
-					{'id':0,'title':'选项一'},
-					{'id':1,'title':'选项二'},
-					{'id':2,'title':'选项三'},
-					{'id':3,'title':'选项四'},
-					{'id':4,'title':'选项五'},
-					{'id':5,'title':'选项六'},
-					{'id':6,'title':'选项七'},
-					{'id':7,'title':'选项八'},
-					{'id':8,'title':'选项九'},
-					{'id':9,'title':'选项十'}
-				],
-				checkedArr:[], //复选框选中的值
-				allChecked:false //是否全选
-			}
-		},
-		methods: {
-			// 多选复选框改变事件
-			changeCheckbox(e){
-				this.checkedArr = e.detail.value;
-				// 如果选择的数组中有值,并且长度等于列表的长度,就是全选
-				if(this.checkedArr.length>0 && this.checkedArr.length==this.newDeviceManage.length){
-					this.allChecked=true;
-				}else{
-					this.allChecked=false;
-				}
-			},
-			// 全选事件
-			allChoose(e){
-				let chooseItem = e.detail.value;
-				// 全选
-				if(chooseItem[0]=='all'){
-					this.allChecked=true;
-					for(let item of this.newDeviceManage){
-						let itemVal=String(item.id);
-						if(!this.checkedArr.includes(itemVal)){
-							this.checkedArr.push(itemVal);
-						}
-					}					
-				}else{
-					// 取消全选
-					this.allChecked=false;
-					this.checkedArr=[];
-				}
-			}
-		}
-	}
+export default {
+  data() {
+    return {
+      isChecked: false,
+      newDeviceManage: [
+        { id: 0, title: "选项一" },
+        { id: 1, title: "选项二" },
+        { id: 2, title: "选项三" },
+        { id: 3, title: "选项四" },
+        { id: 4, title: "选项五" },
+        { id: 5, title: "选项六" },
+        { id: 6, title: "选项七" },
+        { id: 7, title: "选项八" },
+        { id: 8, title: "选项九" },
+        { id: 9, title: "选项十" },
+      ],
+      checkedArr: [], //复选框选中的值
+      allChecked: false, //是否全选
+    };
+  },
+  methods: {
+    // 多选复选框改变事件
+    changeCheckbox(e) {
+      this.checkedArr = e.detail.value;
+      // 如果选择的数组中有值,并且长度等于列表的长度,就是全选
+      if (this.checkedArr.length > 0 && this.checkedArr.length == this.newDeviceManage.length) {
+        this.allChecked = true;
+      } else {
+        this.allChecked = false;
+      }
+    },
+    // 全选事件
+    allChoose(e) {
+      let chooseItem = e.detail.value;
+      // 全选
+      if (chooseItem[0] == "all") {
+        this.allChecked = true;
+        for (let item of this.newDeviceManage) {
+          let itemVal = String(item.id);
+          if (!this.checkedArr.includes(itemVal)) {
+            this.checkedArr.push(itemVal);
+          }
+        }
+      } else {
+        // 取消全选
+        this.allChecked = false;
+        this.checkedArr = [];
+      }
+    },
+  },
+};
 </script>
 
-<style>
-</style>
+<style></style>

+ 0 - 36
src/pages/common/test/test-select-picker.vue

@@ -1,36 +0,0 @@
-<template>
-    <view>
-        <view class="uni-title uni-common-pl">地区选择器</view>
-        <view class="uni-list">
-            <view class="uni-list-cell">
-                <view class="uni-list-cell-db">
-                    <picker @change="bindPickerChange" :value="index" :range="array">
-                        <view class="uni-input">{{array[index]}}</view>
-                    </picker>
-                </view>
-            </view>
-        </view>
-    </view>
-</template>
-
-<script>
-	export default {
-    data() {
-        return {
-            array: ['中国', '美国', '巴西', '日本'],
-            index: 0,
-        }
-    },
-    computed: {
-    },
-    methods: {
-        bindPickerChange: function(e) {
-            console.log('picker发送选择改变,携带值为', e.target.value)
-            this.index = e.target.value
-        },
-    }
-}
-</script>
-
-<style>
-</style>

+ 22 - 6
src/pages/info.vue

@@ -14,9 +14,9 @@
   </u-sticky>
 
   <scroll-view class="info-container bg-white" scroll-y :style="`height: calc(100vh - (105px + ${proxy.$settingStore.barHightTop} + ${proxy.$settingStore.tabBarHeight}))`">
-    <view class="content-area p13" v-for="item in infoList" :key="item" @tap="goApplicationInfo()">
+    <view class="content-area plr13 pt13" v-for="item in infoList" :key="item" @tap="goAppMessage(item.id)">
       <view class="content-area-avatar">
-        <image class="image-bg" src="@/static/images/common/applicationInfo.png" />
+        <image class="image-bg" :src="item.img" />
       </view>
       <view class="content-area-child">
         <view class="uni-item">
@@ -48,24 +48,39 @@ const { proxy } = getCurrentInstance();
 const data = reactive({
   infoList: [
     {
+      id: 1,
       label: "应用消息",
+      img: "/static/images/common/appMessage.png",
       time: "5月15日",
       cont: "您收到一条最新消息,请及时查看",
       badge: 0,
     },
     // {
+    //   id: 2,
     //   label: "消防知识库",
     //   time: "5月15日",
     //   cont: "您收到一条最新消息,请及时查看",
     //   badge: 0,
     // },
+    {
+      id: 3,
+      label: "告警通知",
+      img: "/static/images/common/alarmMessage.png",
+      time: "5月15日",
+      cont: "您收到一条最新消息,请及时查看",
+      badge: 0,
+    },
   ],
 });
 
 const { infoList } = toRefs(data);
 
-function goApplicationInfo() {
-  proxy.$tab.navigateTo("/pages/common/applicationInfo/index");
+function goAppMessage(id) {
+  if (id == 1) {
+    proxy.$tab.navigateTo("/pages/common/appMessage/index");
+  } else if (id == 3) {
+    proxy.$tab.navigateTo("/pages/common/alarmMessage/index");
+  }
 }
 
 function goFireBase() {
@@ -89,10 +104,11 @@ onLoad((options) => {
     display: flex;
 
     &-avatar {
+      display: flex;
       margin: auto 20upx auto 0;
       .image-bg {
-        width: 32px;
-        height: 32px;
+        width: 40px;
+        height: 40px;
       }
     }
 

二进制
src/static/images/common/alarmMessage.png


二进制
src/static/images/common/appMessage.png


二进制
src/static/images/common/applicationInfo.png