Browse Source

代码BUG修复

fanghuisheng 2 years ago
parent
commit
f413a3988a

BIN
favicon.ico


+ 24 - 0
src/api/mine/info.js

@@ -0,0 +1,24 @@
+import upload from "@/utils/upload";
+import request from "@/utils/request";
+
+/**
+ * @列表数据请求
+ */
+export function getKnowledgeBaseList(param) {
+  return request({
+    url: "KnowledgeBase/getKnowledgeBaseList",
+    method: "GET",
+    data: param,
+  });
+}
+
+/**
+ * @详情页数据请求
+ */
+export function getKnowledgeBaseDetails(param) {
+  return request({
+    url: "KnowledgeBase/getKnowledgeBaseDetails",
+    method: "GET",
+    data: param,
+  });
+}

+ 13 - 0
src/api/setting/building.js

@@ -0,0 +1,13 @@
+import upload from "@/utils/upload";
+import request from "@/utils/request";
+
+/**
+ * @建筑基础数据请求
+ */
+export function getBuildingManagement(param) {
+  return request({
+    url: "BuildingInformation/getBuildingManagement",
+    method: "GET",
+    data: param,
+  });
+}

+ 25 - 0
src/api/setting/funReport.js

@@ -0,0 +1,25 @@
+import upload from "@/utils/upload";
+import request from "@/utils/request";
+
+/**
+ * @删除请求接口
+ */
+
+export function del(param) {
+  return request({
+    url: "AlarmReport/del",
+    method: "POST",
+    data: param,
+  });
+}
+
+/**
+ * @设备类型数据请求
+ */
+export function index(param) {
+  return request({
+    url: "AlarmReport/index",
+    method: "GET",
+    data: param,
+  });
+}

+ 24 - 0
src/api/setting/index.js

@@ -0,0 +1,24 @@
+import upload from "@/utils/upload";
+import request from "@/utils/request";
+
+/**
+ * @
+ */
+export function getAuthorization(param) {
+  return request({
+    url: "Com/getAuthorization",
+    method: "GET",
+    data: param,
+  });
+}
+
+/**
+ * @
+ */
+export function setperm(param) {
+  return request({
+    url: "PushSettings/setperm",
+    method: "GET",
+    data: param,
+  });
+}

+ 7 - 7
src/pages.json

@@ -356,15 +356,15 @@
       // {
       //   "pagePath": "pages/analyse/analyse",
       //   "iconPath": "static/images/tabBar/analyse.png",
-      //   "selectedIconPath": "static/tabBar/analyse-selected.png",
+      //   "selectedIconPath": "static/images/tabBar/analyse-selected.png",
       //   "text": "分析"
       // },
-      // {
-      //   "pagePath": "pages/info/info",
-      //   "iconPath": "static/images/tabBar/info.png",
-      //   "selectedIconPath": "static/tabBar/info-selected.png",
-      //   "text": "消息"
-      // },
+      {
+        "pagePath": "pages/info/info",
+        "iconPath": "static/images/tabBar/info.png",
+        "selectedIconPath": "static/images/tabBar/info-selected.png",
+        "text": "消息"
+      },
       // {
       //   "pagePath": "pages/work/index",
       //   "iconPath": "static/images/tabBar/work.png",

+ 26 - 2
src/pages/analyse/analyse.vue

@@ -1,5 +1,5 @@
 <template>
-  <view class="analyse-wrapper" style="height: 100%">
+  <view class="analyse-wrapper" style="height: 100%; background-color: #f5f6f7">
     <view class="justify-center align-center text-center">
       <u-image src="@/static/images/analyse/analyse-bg.png" width="100%" height="273rpx" :showLoading="false" :fade="false"></u-image>
     </view>
@@ -60,4 +60,28 @@ body {
 }
 </style>
 
-<style lang="scss"></style>
+<style lang="scss">
+//消息页面
+.image-bg {
+  width: 100%;
+  height: 100%;
+}
+
+//分析页面
+.analyse-wrapper {
+  .cu-list.menu-avatar .cu-item {
+    border-radius: 5px;
+    padding: 30rpx 0;
+    box-shadow: 1px 1px 4px rgb(26 26 26 / 10%);
+    .cu-avatar {
+      background-color: rgba(0, 0, 0, 0);
+      left: 26rpx;
+    }
+
+    .content {
+      left: 130rpx;
+      font-size: 32rpx;
+    }
+  }
+}
+</style>

+ 0 - 0
src/pages/business/mhxf/unitInfoCollection/index.vue


+ 57 - 71
src/pages/info/fireBase/fireBase.vue

@@ -1,79 +1,65 @@
 <template>
-	<view class="fireBashWrapper">
-		
-		<block>
-			<view class="" style="margin-top:0">
-				<view class="cu-list menu-avatar ">
-					<view class="cu-item" v-for="(item,index) in this.getData" :key="index"  @tap="goDetail(item)">
-						
-						<view class="cu-avatar">
-							<image class="image-bg" src="@/static/images/info/fire-base1.png" />
-						</view>
-						
-						<view class="content">
-							<view class="pro-title">
-								<view class="cut">{{item.title}}</view>
-							</view>
-							<view class="pro-des  ">
-								<view class="text-cut">
-									{{item.author}}
-								</view>
-							</view>
-							<view class="pro-date">{{item.release_time}}</view>
-						</view>
-						
-					</view>
-				</view>
-			</view>
-		</block>
-	</view>
+  <view class="fireBashWrapper">
+    <block>
+      <view class="" style="margin-top: 0">
+        <view class="cu-list menu-avatar">
+          <view class="cu-item" v-for="(item, index) in getData" :key="index" @tap="goDetail(item)">
+            <view class="cu-avatar">
+              <image class="image-bg" src="@/static/images/info/fire-base1.png" />
+            </view>
+
+            <view class="content">
+              <view class="pro-title">
+                <view class="cut">{{ item.title }}</view>
+              </view>
+              <view class="pro-des">
+                <view class="text-cut">
+                  {{ item.author }}
+                </view>
+              </view>
+              <view class="pro-date">{{ item.release_time }}</view>
+            </view>
+          </view>
+        </view>
+      </view>
+    </block>
+  </view>
 </template>
 
-<script>
-	export default {
-		data() {
-			return {
-				getData:[]
-			};
-		},
-		onLoad:function(option){
-			this.getFireBaseList({'company_code':uni.getStorageSync('selectedCode')})
-		
-		},
-		methods: {
-			
-			
-			// 列表数据请求
-			async getFireBaseList(params = {}) {
-				const res = await this.$myRequest({
-					url: 'KnowledgeBase/getKnowledgeBaseList',
-					data:params,
-					showLoading: true
-				})
-				this.getData=res.data.data;
-				console.log(this.getData)
-			},
+<script setup>
+import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
+import { ref, onMounted, inject, shallowRef, reactive } from "vue";
+
+import { getKnowledgeBaseList } from "@/api/mine/info.js";
+
+const getData = ref([]);
+
+// 列表数据请求
+function getFireBaseList(params = {}) {
+  getKnowledgeBaseList(params).then((res) => {
+    getData.value = res.data;
+    console.log(getData.value);
+  });
+}
 
-			
-			// 页面跳转
-			
-			goDetail(item){
-				uni.navigateTo({
-					url: '/pages/info/fireBashDetail/fireBashDetail?id='+item.id+'&title='+item.title,
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
-				
-			}
-		}
-	}
+// 页面跳转
+
+function goDetail(item) {
+  uni.navigateTo({
+    url: "/pages/info/fireBashDetail/fireBashDetail?id=" + item.id + "&title=" + item.title,
+    success: (res) => {},
+    fail: () => {},
+    complete: () => {},
+  });
+}
+
+onLoad((option) => {
+  getFireBaseList({ company_code: uni.getStorageSync("selectedCode") });
+});
 </script>
 
 <style lang="scss">
-
-	.processList{
-		position:static;
-	}
-	
+.processList {
+  position: static;
+}
 </style>

+ 43 - 48
src/pages/info/fireBashDetail/fireBashDetail.vue

@@ -1,23 +1,21 @@
 <template>
   <view class="padding fireBashDetailWrapper">
-    <view class="margin-bottom fireD-tit">{{ this.getData.title }}</view>
+    <view class="margin-bottom fireD-tit">{{ getData.title }}</view>
     <view class="flex justify-between align-center">
       <view>
         <!-- <view class="cu-avatar round" style="background-image:url(@/static/images/info/fireBase.png)"></view> -->
 
         <image class="cu-avatar round" src="@/static/images/info/fireBase.png" />
 
-        <text class="margin-left-sm margin-right-sm text-sm">{{
-          this.getData.author
-        }}</text>
-        <text>{{ this.getData.release_time }}</text>
+        <text class="margin-left-sm margin-right-sm text-sm">{{ getData.author }}</text>
+        <text>{{ getData.release_time }}</text>
       </view>
-      <view style="color: #999">阅读:{{ this.getData.frequency }}</view>
+      <view style="color: #999">阅读:{{ getData.frequency }}</view>
     </view>
 
     <view class="fireD-content margin-top padding-top-xs">
       <view class="">
-        <view v-html="this.getData.content"></view>
+        <view v-html="getData.content"></view>
       </view>
     </view>
 
@@ -43,49 +41,46 @@
   </view>
 </template>
 
-<script>
-export default {
-  data() {
-    return {
-      praise: false,
-      zan: false,
-      getData: {},
-    };
-  },
+<script setup>
+import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
+import { ref, onMounted, inject, shallowRef, reactive, toRefs } from "vue";
 
-  onLoad: function (option) {
-    this.getFireBaseDetail({
-      company_code: uni.getStorageSync("selectedCode"),
-      id: option.id,
-    });
-    console.log("option");
-    console.log(option);
-    uni.setNavigationBarTitle({
-      title: option.title,
-    });
-  },
+import { getKnowledgeBaseDetails } from "@/api/mine/info.js";
 
-  methods: {
-    // 详情页数据请求
-    async getFireBaseDetail(params = {}) {
-      const res = await this.$myRequest({
-        url: "KnowledgeBase/getKnowledgeBaseDetails",
-        data: params,
-        showLoading: true,
-      });
-      this.getData = res.data.data[0];
-      console.log(this.getData);
-    },
+const data = reactive({
+  praise: false,
+  zan: false,
+  getData: {},
+});
 
-    clickPraise() {
-      this.praise = !this.praise;
-    },
-    clickZan() {
-      this.zan = !this.zan;
-    },
-  },
-};
+const { praise, zan, getData } = toRefs(data);
+
+// 详情页数据请求
+function getFireBaseDetail(params = {}) {
+  getKnowledgeBaseDetails(params).then((res) => {
+    getData.value = res.data[0];
+    console.log(getDgetData.valueata);
+  });
+}
+
+function clickPraise() {
+  praise.value = !praise.value;
+}
+function clickZan() {
+  zan.value = !zan.value;
+}
+
+onLoad((option) => {
+  getFireBaseDetail({
+    company_code: uni.getStorageSync("selectedCode"),
+    id: option.id,
+  });
+  console.log("option");
+  console.log(option);
+  uni.setNavigationBarTitle({
+    title: option.title,
+  });
+});
 </script>
 
-<style>
-</style>
+<style></style>

+ 55 - 28
src/pages/info/info.vue

@@ -1,5 +1,5 @@
 <template>
-  <view class="analyse-wrapper info-wrapper" style="height: 100%">
+  <view class="info-wrapper" style="height: 100%; background-color: #f5f6f7">
     <view class="justify-center align-center text-center">
       <u-image src="@/static/images/info/info-bg.png" width="100%" height="273rpx" :showLoading="false" :fade="false"></u-image>
     </view>
@@ -35,34 +35,35 @@
   </view>
 </template>
 
-<script>
-import indexBackgroundImage from "@/static/images/info/fireBase.png";
+<script setup>
+import fireBase from "@/static/images/info/fireBase.png";
+import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
+import { ref, onMounted, inject, shallowRef, reactive, toRefs } from "vue";
 
-export default {
-  data() {
-    return {
-      indexBackgroundImage: indexBackgroundImage,
-    };
-  },
-  methods: {
-    goFireBase() {
-      uni.navigateTo({
-        url: "/pages/info/fireBase/fireBase",
-        success: (res) => {},
-        fail: () => {},
-        complete: () => {},
-      });
-    },
-    goPushList() {
-      uni.navigateTo({
-        url: "/pages/info/pushList/pushList",
-        success: (res) => {},
-        fail: () => {},
-        complete: () => {},
-      });
-    },
-  },
-};
+import {} from "@/api/mine/info.js";
+
+const data = reactive({
+  indexBackgroundImage: fireBase,
+});
+
+const { indexBackgroundImage } = toRefs(data);
+
+function goFireBase() {
+  uni.navigateTo({
+    url: "/pages/info/fireBase/fireBase",
+    success: (res) => {},
+    fail: () => {},
+    complete: () => {},
+  });
+}
+function goPushList() {
+  uni.navigateTo({
+    url: "/pages/info/pushList/pushList",
+    success: (res) => {},
+    fail: () => {},
+    complete: () => {},
+  });
+}
 </script>
 
 <style>
@@ -70,3 +71,29 @@ body {
   background: #fff;
 }
 </style>
+
+<style lang="scss">
+//消息页面
+.image-bg {
+  width: 100%;
+  height: 100%;
+}
+
+//分析页面
+.info-wrapper {
+  .cu-list.menu-avatar .cu-item {
+    border-radius: 5px;
+    padding: 30rpx 0;
+    box-shadow: 1px 1px 4px rgb(26 26 26 / 10%);
+    .cu-avatar {
+      background-color: rgba(0, 0, 0, 0);
+      left: 26rpx;
+    }
+
+    .content {
+      left: 130rpx;
+      font-size: 32rpx;
+    }
+  }
+}
+</style>

+ 177 - 174
src/pages/info/pushList/pushList.vue

@@ -1,192 +1,195 @@
 <template>
-	<view class="fireBashWrapper pushListWrapper ">
-		<view style="height:90rpx"></view>
-		<view class="ding">
-			<scroll-view scroll-x class="bg-white nav text-center">
-				<view class="cu-item" :class="index==TabCur?'text-blue cur':''" v-for="(item,index) in tabNav"
-					:key="index" @tap="tabSelect" :data-id="index">
-					<view class="cu-tag badge">
-						<block class="cu-tag badge" v-if="item.badge!=1">99</block>
-					</view>
-					{{tabNav[index]}}
-				</view>
-			</scroll-view>
-		</view>
+  <view class="fireBashWrapper pushListWrapper">
+    <view style="height: 90rpx"></view>
+    <view class="ding">
+      <scroll-view scroll-x class="bg-white nav text-center">
+        <view class="cu-item" :class="index == TabCur ? 'text-blue cur' : ''" v-for="(item, index) in tabNav" :key="index" @tap="tabSelect" :data-id="index">
+          <view class="cu-tag badge">
+            <block class="cu-tag badge" v-if="item.badge != 1">99</block>
+          </view>
+          {{ tabNav[index] }}
+        </view>
+      </scroll-view>
+    </view>
 
-		<block v-if="TabCur==0">
-			<view class="" style="margin-top:0">
-				<view class="cu-list menu-avatar ">
-					<view class="cu-item" v-for="(item,index) in unporcessList" :key="index" @tap="goFireBaseDetail">
-						<view class="cu-avatar" style="background-image:url(@/static/images/info/push-list.png);"></view>
-						<view class="content">
-							<view class="pro-title">
-								<view class="cut">{{item.title}}</view>
-							</view>
-							<view class="pro-des  ">
-								<view class="text-cut">
-									{{item.subtit}}
-								</view>
-							</view>
-							<view class="pro-date">{{item.time}}</view>
-						</view>
+    <block v-if="TabCur == 0">
+      <view class="" style="margin-top: 0">
+        <view class="cu-list menu-avatar">
+          <view class="cu-item" v-for="(item, index) in unporcessList" :key="index" @tap="goFireBaseDetail">
+            <view class="cu-avatar" style="background-image: url(@/static/images/info/push-list.png)"></view>
+            <view class="content">
+              <view class="pro-title">
+                <view class="cut">{{ item.title }}</view>
+              </view>
+              <view class="pro-des">
+                <view class="text-cut">
+                  {{ item.subtit }}
+                </view>
+              </view>
+              <view class="pro-date">{{ item.time }}</view>
+            </view>
+          </view>
+        </view>
+      </view>
+    </block>
+    <block v-if="TabCur == 1">
+      <view class="" style="margin-top: 0">
+        <view class="cu-list menu-avatar">
+          <view class="cu-item" v-for="(item, index) in unporcessList" :key="index" @tap="goFireBaseDetail">
+            <view class="cu-avatar" style="background-image: url(@/static/images/info/push-list.png)"></view>
+            <view class="content">
+              <view class="pro-title">
+                <view class="cut">{{ item.title }}</view>
+              </view>
+              <view class="pro-des">
+                <view class="text-cut">
+                  {{ item.subtit }}
+                </view>
+              </view>
+              <view class="pro-date">{{ item.time }}</view>
+            </view>
+          </view>
+        </view>
+      </view>
+    </block>
+  </view>
+</template>
 
-					</view>
-				</view>
-			</view>
-		</block>
-		<block v-if="TabCur==1">
-			<view class="" style="margin-top:0">
-				<view class="cu-list menu-avatar ">
-					<view class="cu-item" v-for="(item,index) in unporcessList" :key="index" @tap="goFireBaseDetail">
-						<view class="cu-avatar" style="background-image:url(@/static/images/info/push-list.png);"></view>
-						<view class="content">
-							<view class="pro-title">
-								<view class="cut">{{item.title}}</view>
-							</view>
-							<view class="pro-des  ">
-								<view class="text-cut">
-									{{item.subtit}}
-								</view>
-							</view>
-							<view class="pro-date">{{item.time}}</view>
-						</view>
+<script setup>
+import json from "../../../data/json.js";
+import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
+import { ref, onMounted, inject, shallowRef, reactive, toRefs } from "vue";
 
-					</view>
-				</view>
-			</view>
-		</block>
+import {} from "@/api/mine/info.js";
 
-	</view>
-</template>
+const data = reactive({
+  unporcessList: [
+    {
+      title: "火灾逃生九大要诀",
+      time: "2020-02-12",
+      subtit: "admin",
+    },
+    {
+      title: "火灾逃生九大要诀",
+      time: "2020-02-12",
+      subtit: "admin",
+    },
+    {
+      title: "火灾逃生九大要诀",
+      time: "2020-02-12",
+      subtit: "admin",
+    },
+    {
+      title: "火灾逃生九大要诀",
+      time: "2020-02-12",
+      subtit: "admin",
+    },
+    {
+      title: "火灾逃生九大要诀",
+      time: "2020-02-12",
+      subtit: "admin",
+    },
+    {
+      title: "火灾逃生九大要诀",
+      time: "2020-02-12",
+      subtit: "admin",
+    },
+    {
+      title: "火灾逃生九大要诀",
+      time: "2020-02-12",
+      subtit: "admin",
+    },
+    {
+      title: "火灾逃生九大要诀",
+      time: "2020-02-12",
+      subtit: "admin",
+    },
+    {
+      title: "火灾逃生九大要诀",
+      time: "2020-02-12",
+      subtit: "admin",
+    },
+    {
+      title: "火灾逃生九大要诀",
+      time: "2020-02-12",
+      subtit: "admin",
+    },
+  ],
 
-<script>
-	import json from '../../../data/json.js';
-	export default {
-		data() {
-			return {
-				unporcessList: [{
-						title: '火灾逃生九大要诀',
-						time: '2020-02-12',
-						subtit: 'admin'
-					}, {
-						title: '火灾逃生九大要诀',
-						time: '2020-02-12',
-						subtit: 'admin'
-					}, {
-						title: '火灾逃生九大要诀',
-						time: '2020-02-12',
-						subtit: 'admin'
-					}, {
-						title: '火灾逃生九大要诀',
-						time: '2020-02-12',
-						subtit: 'admin'
-					}, {
-						title: '火灾逃生九大要诀',
-						time: '2020-02-12',
-						subtit: 'admin'
-					}, {
-						title: '火灾逃生九大要诀',
-						time: '2020-02-12',
-						subtit: 'admin'
-					},
-					{
-						title: '火灾逃生九大要诀',
-						time: '2020-02-12',
-						subtit: 'admin'
-					},
-					{
-						title: '火灾逃生九大要诀',
-						time: '2020-02-12',
-						subtit: 'admin'
-					},
-					{
-						title: '火灾逃生九大要诀',
-						time: '2020-02-12',
-						subtit: 'admin'
-					},
-					{
-						title: '火灾逃生九大要诀',
-						time: '2020-02-12',
-						subtit: 'admin'
-					}
-				],
+  processedList: json.processedList,
 
-				processedList: json.processedList,
+  type: "0",
+  modalName: null,
+  listTouchStart: 0,
+  listTouchDirection: null,
+  CustomBar: CustomBar,
+  TabCur: 0,
+  tabNav: ["未读", "已读"],
+});
 
-				type: '0',
-				modalName: null,
-				listTouchStart: 0,
-				listTouchDirection: null,
-				CustomBar: this.CustomBar,
-				TabCur: 0,
-				tabNav: ['未读', '已读']
-			};
-		},
+const { unporcessList, processedList, type, modalName, listTouchStart, listTouchDirection, CustomBar, TabCur, tabNav } = toRefs(data);
 
-		methods: {
-			tabSelect(e) {
-				this.TabCur = e.currentTarget.dataset.id;
-				this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
-			},
+function tabSelect(e) {
+  TabCur.value = e.currentTarget.dataset.id;
+  //   scrollLeft.value = (e.currentTarget.dataset.id - 1) * 60;
+}
 
-			// 页面跳转
-			goUnprocessDetail() {
-				uni.navigateTo({
-					url: '/pages/unprocessDetail/unprocessDetail?type=1',
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
-			},
-			goProcessedDetail() {
-				uni.navigateTo({
-					url: '/pages/processedDetail/processedDetail?type=1',
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
-			},
-			goVideoUnprocessDetail() {
-				uni.navigateTo({
-					url: '/pages/unprocessDetail/unprocessDetail?type=2',
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
-			},
-			goVideoProcessedDetail() {
-				uni.navigateTo({
-					url: '/pages/processedDetail/processedDetail?type=2',
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
-			}
-		}
-	}
+// 页面跳转
+function goUnprocessDetail() {
+  uni.navigateTo({
+    url: "/pages/unprocessDetail/unprocessDetail?type=1",
+    success: (res) => {},
+    fail: () => {},
+    complete: () => {},
+  });
+}
+function goProcessedDetail() {
+  uni.navigateTo({
+    url: "/pages/processedDetail/processedDetail?type=1",
+    success: (res) => {},
+    fail: () => {},
+    complete: () => {},
+  });
+}
+function goVideoUnprocessDetail() {
+  uni.navigateTo({
+    url: "/pages/unprocessDetail/unprocessDetail?type=2",
+    success: (res) => {},
+    fail: () => {},
+    complete: () => {},
+  });
+}
+function goVideoProcessedDetail() {
+  uni.navigateTo({
+    url: "/pages/processedDetail/processedDetail?type=2",
+    success: (res) => {},
+    fail: () => {},
+    complete: () => {},
+  });
+}
 </script>
 
 <style lang="scss">
-	//已处理未处理消息个数样式
+//已处理未处理消息个数样式
 
-	.nav .cu-item.cur {
-		position: relative;
-		border-bottom: 8rpx solid;
-	}
+.nav .cu-item.cur {
+  position: relative;
+  border-bottom: 8rpx solid;
+}
 
-	.cu-tag.badge {
-		top: 14rpx;
-		right: 96rpx;
-	}
+.cu-tag.badge {
+  top: 14rpx;
+  right: 96rpx;
+}
 
-	.nav .cu-item {
-		width: 50%;
-		margin: 0;
+.nav .cu-item {
+  width: 50%;
+  margin: 0;
 
-		.text-blue,
-		.line-blue,
-		.lines-blue {
-			color: #4274E7
-		}
-	}
+  .text-blue,
+  .line-blue,
+  .lines-blue {
+    color: #4274e7;
+  }
+}
 </style>

+ 2 - 2
src/pages/mine/about/index.vue

@@ -22,7 +22,7 @@
         <view class="list-cell list-cell-arrow">
           <view class="menu-item-box">
             <view>服务热线</view>
-            <!-- <view class="text-right">400-999-9999</view> -->
+            <view class="text-right">021-65376655</view>
           </view>
         </view>
         <view class="list-cell list-cell-arrow">
@@ -37,7 +37,7 @@
     </view>
 
     <view class="copyright">
-      <!-- <view>Copyright &copy; 2022 ruoyi.vip All Rights Reserved.</view> -->
+      <view>Copyright &copy; 2021 - 2025 Usky. All Rights Reserved. 永天股份 版权所有</view>
     </view>
   </view>
 </template>

+ 23 - 42
src/pages/setting/building/building.vue

@@ -6,12 +6,7 @@
         基本信息
       </view>
       <view class="info-content padding-lr">
-        <table
-          style="border: 1px solid #ccc"
-          cellspacing="0"
-          cellpadding="0"
-          align="center"
-        >
+        <table style="border: 1px solid #ccc" cellspacing="0" cellpadding="0" align="center">
           <tr>
             <td>建筑物名称</td>
             <td>{{ this.getDetailData.build_name }}</td>
@@ -96,11 +91,7 @@
         消防设施平面布置图
       </view>
       <view class="padding-lr imgPic">
-        <image
-          v-if="!this.getDetailData.build_plan && this.dataRes == 1"
-          mode="widthFix"
-          src="@/static/images/defaultImg.jpg"
-        />
+        <image v-if="!this.getDetailData.build_plan && this.dataRes == 1" mode="widthFix" src="@/static/images/defaultImg.jpg" />
         <image v-else mode="widthFix" :src="this.getDetailData.layout_plan" />
       </view>
     </view>
@@ -111,42 +102,33 @@
         建筑平面图
       </view>
       <view class="padding-lr padding-bottom-lg imgPic">
-        <image
-          v-if="!this.getDetailData.build_plan && this.dataRes == 1"
-          mode="widthFix"
-          src="@/static/images/defaultImg.jpg"
-        />
+        <image v-if="!this.getDetailData.build_plan && this.dataRes == 1" mode="widthFix" src="@/static/images/defaultImg.jpg" />
         <image v-else :src="this.getDetailData.build_plan" mode="widthFix" />
       </view>
     </view>
   </view>
 </template>
 
-<script>
-export default {
-  data() {
-    return {
-      getDetailData: {},
-      dataRes: 0,
-    };
-  },
-  onLoad: function (option) {
-    this.getDetails({ company_code: uni.getStorageSync("selectedCode") });
-  },
-  methods: {
-    // 建筑基础数据请求
-    async getDetails(params = {}) {
-      const res = await this.$myRequest({
-        url: "BuildingInformation/getBuildingManagement",
-        data: params,
-        showLoading: true,
-      });
-      this.getDetailData = res.data.data[0];
-      console.log(this.getDetailData);
-      this.dataRes = 1;
-    },
-  },
-};
+<script setup>
+import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
+import { ref, onMounted, inject, shallowRef, reactive, toRefs } from "vue";
+
+import { getBuildingManagement } from "@/api/setting/building.js";
+
+const getDetailData = ref({});
+const dataRes = ref(0);
+
+// 建筑基础数据请求
+function getDetails(params = {}) {
+  getBuildingManagement(params).then((res) => {
+    getDetailData.value = res.data[0];
+    console.log(getDetailData.value);
+    dataRes.value = 1;
+  });
+}
+onload((option) => {
+  getDetails({ company_code: uni.getStorageSync("selectedCode") });
+});
 </script>
 
 <style lang="scss" scoped>
@@ -154,4 +136,3 @@ export default {
   background-size: cover !important;
 }
 </style>
-

+ 233 - 258
src/pages/setting/funReport/funReport.vue

@@ -1,271 +1,246 @@
 <template>
+  <view class="">
+    <!-- 筛选框start -->
+    <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>
+    <!-- 筛选框end -->
+    <view class="site-items" style="margin-top: 0; height: calc(100vh - 286rpx)">
+      <view class="cu-list menu-avatar">
+        <view
+          class="cu-item"
+          :class="modalName == 'move-box-' + index ? 'move-cur' : ''"
+          v-for="(item, index) in funcReport"
+          :key="index"
+          @touchstart="ListTouchStartCange"
+          @touchmove="ListTouchMove"
+          @touchend="ListTouchEnd"
+          :data-target="'move-box-' + index"
+        >
+          <view class="cu-avatar round lg">
+            <image class="image-bg" src="@/static/images/setting/funcList.png" />
+          </view>
+          <view class="content">
+            <view class="pro-title">
+              <view class="cut">{{ item.report_name }}</view>
+            </view>
+            <view class="pro-des">
+              <view class="text-cut">
+                {{ item.remarks }}
+              </view>
+            </view>
+            <view class="pro-date">{{ item.add_time }}</view>
+          </view>
+          <view class="nav-right num">
+            <view class="text-grey">
+              <text class="icon iconfont margin-right-sm margin-left-lg">&#xe629;</text>
+            </view>
+          </view>
+          <view class="move">
+            <view class="bg-grey" @click.stop="editItem(item)">编辑</view>
+            <view class="bg-red" @click.stop="deleteItem(item)">删除</view>
+          </view>
+        </view>
+      </view>
+      <view v-if="!funcReport.length && authListRes == 1" class="text-center margin-top"> 暂无数据</view>
+      <view v-show="isLoadMore && pages > 1" style="padding-bottom: 60px">
+        <uni-load-more :status="loadStatus"></uni-load-more>
+      </view>
 
-	<view class="">
-		
-		<!-- 筛选框start -->
-		<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>
-		<!-- 筛选框end -->
-		<view  class="site-items" style="margin-top:0;height: calc(100vh - 286rpx)">
-			<view class="cu-list menu-avatar" >
-				<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
-					v-for="(item,index) in funcReport" :key="index" 
-					@touchstart="ListTouchStart"
-					@touchmove="ListTouchMove" @touchend="ListTouchEnd" :data-target="'move-box-' + index"
-					>
-					<view class="cu-avatar round lg">
-						<image class="image-bg" src="@/static/images/setting/funcList.png"/>
-					</view>
-					<view class="content">
-						<view class="pro-title">
-							<view class="cut">{{item.report_name}}</view>
-						</view>
-						<view class="pro-des  ">
-							<view class="text-cut">
-								{{item.remarks  }}
-							</view>
-						</view>
-						<view class="pro-date ">{{item.add_time}}</view>
-					</view>
-					<view class="nav-right num">
-						<view class="text-grey">
-							<text class="icon iconfont margin-right-sm margin-left-lg">&#xe629;</text>
-						</view>
-					</view>
-					<view class="move">
-						<view class="bg-grey" @click.stop="editItem(item)">编辑</view>
-						<view class="bg-red" @click.stop="deleteItem(item)">删除</view>
-					</view>
-				</view>
-			</view>
-			<view v-if="!funcReport.length&&authListRes==1" class="text-center margin-top"> 暂无数据</view>
-			<view v-show="isLoadMore&&this.pages>1" style="padding-bottom:60px">
-				<uni-load-more :status="loadStatus"></uni-load-more>
-			</view>
-			
-			<view  style="padding-bottom:60px"></view>
-			
-			
-		</view>
-		
-		
-		
-		<!-- 新增按钮start -->
-			<view style="width: 100%;
-		position: fixed;
-		bottom: 0px;
-		right: 0px;
-		height: 64px;
-		background: #fff;">
-				<view class="plus">
-					<image src="@/static/images/setting/plus.png" style="width:100rpx;height:100rpx" @tap="goAddPage()"></image>
-				</view>
-			</view>
-			
-			<!-- 新增按钮end -->
-	</view>
+      <view style="padding-bottom: 60px"></view>
+    </view>
+
+    <!-- 新增按钮start -->
+    <view style="width: 100%; position: fixed; bottom: 0px; right: 0px; height: 64px; background: #fff">
+      <view class="plus">
+        <image src="@/static/images/setting/plus.png" style="width: 100rpx; height: 100rpx" @tap="goAddPage()"></image>
+      </view>
+    </view>
+
+    <!-- 新增按钮end -->
+  </view>
 </template>
 
-<script>
-	import json from '../../../data/json.js';
-	export default {
-		data() {
-			return {
-				funcReport: [],
-				modalName: null,
-				getData:[],
-				dwtype:0,
-				datetimerange: ['', ''],
-				
-				listTouchStart: 0,
-				listTouchDirection: null,
-				
-				
-				flag:false,
-				
-				authListRes:0,
-				
-				
-				pages: 1,
-				size: 12,
-				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
-				isLoadMore: false, //是否加载中
-				deleteStatus:false,
-			};
-		},
-		
-		onReachBottom() { //上拉触底函数
-			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
-				this.isLoadMore = true
-				this.pages += 1;
-				this.loadData()
-			}
-		},
+<script setup>
+import json from "../../../data/json.js";
+import { onLoad, onShow, onHide, onLaunch, onReachBottom, onNavigationBarButtonTap } from "@dcloudio/uni-app";
+import { ref, onMounted, inject, shallowRef, reactive, toRefs, watchEffect } from "vue";
+
+import useStore from "@/store/modules/user";
+import useXunJianStore from "@/store/modules/xunJian";
+
+import { del, index } from "@/api/setting/funReport.js";
+
+const funcReport = ref([]);
+const modalName = ref(null);
+const getData = ref([]);
+const dwtype = ref(0);
+const datetimerange = ref(["", ""]);
+
+const listTouchStart = ref(0);
+const listTouchDirection = ref(null);
+
+const flag = ref(false);
+
+const authListRes = ref(0);
+
+const pages = ref(1);
+const size = ref(12);
+const loadStatus = ref("loading"); //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
+const isLoadMore = ref(false); //是否加载中
+const deleteStatus = ref(false);
+
+function loadData() {
+  getDeviceList({
+    company_code: uni.getStorageSync("selectedCode"),
+    start_time: datetimerange.value[0],
+    end_time: datetimerange.value[1],
+    pages: pages.value,
+    size: size.value,
+  });
+}
+
+// 设备类型数据请求
+function getDeviceList(params = {}) {
+  index(params).then((res) => {
+    if (deleteStatus.value) {
+      funcReport.value = [];
+      deleteStatus.value = false;
+    }
+    authListRes.value = 1;
+
+    if (res.data.totalcount) {
+      funcReport = res.data;
+      if (res.data.length < size.value) {
+        //判断接口返回数据量小于请求数据量,则表示此为最后一页
+
+        isLoadMore.value = true;
+        loadStatus.value = "nomore";
+      } else {
+        isLoadMore.value = false;
+      }
+    } else {
+      isLoadMore.value = true;
+      loadStatus.value = "nomore";
+    }
+  });
+}
+
+//编辑
+function editItem(item) {
+  uni.redirectTo({
+    url: "/pages/setting/funReport/funcAdd/funcAdd?id=" + item.id + "",
+  });
+}
+
+//删除
+function deleteItem(item) {
+  let deleteT = 0;
+  deleteStatus.value = true;
+  uni.showModal({
+    title: "确认删除吗?",
+    content: "",
+    success: function (result) {
+      if (result.confirm) {
+        del({
+          id: item.id,
+        }).then((res) => {
+          if (!res.flag) {
+            alert("删除失败");
+            return;
+          }
+          getDeviceList({ company_code: uni.getStorageSync("selectedCode") });
+        });
+      } else if (result.cancel) {
+        console.log("用户点击取消");
+      }
+    }.bind(this),
+  });
+}
+
+// 新增
+function goAddPage(type) {
+  uni.redirectTo({
+    url: "/pages/setting/funReport/funcAdd/funcAdd",
+    success: (res) => {},
+    fail: () => {},
+    complete: () => {},
+  });
+}
+
+// ListTouch触摸开始
+function ListTouchStartCange(e) {
+  listTouchStart.value = e.touches[0].pageX;
+}
+
+// ListTouch计算方向
+function ListTouchMove(e) {
+  listTouchDirection.value = e.touches[0].pageX - listTouchStart.value < -80 ? "left" : "right";
+}
+
+// ListTouch计算滚动
+function ListTouchEnd(e) {
+  if (listTouchDirection.value == "left") {
+    modalName.value = e.currentTarget.dataset.target;
+  } else {
+    modalName.value = null;
+  }
+  listTouchDirection.value = null;
+}
 
-		onLoad: function(option) {
-			this.dwtype=option.dwtype
-			this.loadData()
+function datetimerangeChage() {
+  funcReport.value = [];
+  pages.value = 1;
+  authListRes.value = [];
+  loadData();
+}
 
-		},
-		onNavigationBarButtonTap(e) {
-			console.log(e)
-			uni.navigateTo({
-				url: './export/export?dwtype='+this.dwtype,
+watchEffect(() => {
+  datetimerangeChage();
+});
 
-			});
-		},
-		watch: {
-			
-			
-			datetimerange:function(){
-				this.funcReport=[];
-				this.pages = 1;
-				this.authListRes=[]
-				this.loadData()
-			},
-			
-			
-		},
-		methods: {
-			
-			loadData(){
-			
-				this.getDeviceList({
-					'company_code':uni.getStorageSync('selectedCode'),
-					'start_time':this.datetimerange[0],
-					'end_time':this.datetimerange[1],
-					'pages': this.pages,
-					'size': this.size
-				})
-				
-			},
+onLoad((option) => {
+  dwtype.value = option.dwtype;
+  loadData();
+});
 
-		
-			
-			// 设备类型数据请求
-			async getDeviceList(params = {}) {
-				const res = await this.$myRequest({
-					url: 'AlarmReport/index',
-					data:params,
-					showLoading: true
-				})
-				
-				if(this.deleteStatus){
-					this.funcReport=[];
-					this.deleteStatus=false;
-				}
-				this.authListRes = 1;
-				
-			
-				if (res.data.totalcount) {
-					this.funcReport = this.funcReport.concat(res.data.data)
-					if (res.data.data.length < this.size) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
-			
-						this.isLoadMore = true
-						this.loadStatus = 'nomore'
-					} else {
-						this.isLoadMore = false
-					}
-				} else {
-					this.isLoadMore = true
-					this.loadStatus = 'nomore'
-				}
-				
-	
-			},
-			
-			//编辑
-			editItem(item) {
-				uni.redirectTo({
-					url: '/pages/setting/funReport/funcAdd/funcAdd?id=' + item.id + '',
-				});
-			},
-			
-			//删除
-			deleteItem(item) {
-				 let deleteT=0;
-				 this.deleteStatus=true
-				 uni.showModal({	
-				     title: '确认删除吗?',
-				     content: '',
-				     success: function (result) {
-				         if (result.confirm) {
-							  this.deleteAlarm({
-							 	"id": item.id
-							 });
-				         } else if (result.cancel) {
-				             console.log('用户点击取消');
-				         }
-				     }.bind(this)
-				 }); 
-			},
-			
-			
-			// 删除请求接口
-			async deleteAlarm(ming = {}) {
-				let res = await  this.$myRequest({
-					url: 'AlarmReport/del ',
-					data: ming
-				})
-				if (!res.data.flag) {
-					alert('删除失败');
-					return;
-				}
-				this.getDeviceList({'company_code':uni.getStorageSync('selectedCode')})
-				
-				return res;
-			},
-			
-			// 新增
-			goAddPage(type) {
-				uni.redirectTo({
-					url: '/pages/setting/funReport/funcAdd/funcAdd',
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
-			},
-			
-			
-			
-			// ListTouch触摸开始
-			ListTouchStart(e) {
-				this.listTouchStart = e.touches[0].pageX
-			},
-			
-			// ListTouch计算方向
-			ListTouchMove(e) {
-				this.listTouchDirection = e.touches[0].pageX - this.listTouchStart < -80 ? 'left' : 'right'
-			},
-			
-			// ListTouch计算滚动
-			ListTouchEnd(e) {
-				if (this.listTouchDirection == 'left') {
-					this.modalName = e.currentTarget.dataset.target
-				} else {
-					this.modalName = null
-				}
-				this.listTouchDirection = null
-			}
-			
-		}
+onReachBottom(() => {
+  //上拉触底函数
+  if (!isLoadMore.value) {
+    //此处判断,上锁,防止重复请求
+    isLoadMore.value = true;
+    pages.value += 1;
+    loadData();
+  }
+});
 
-	}
+onNavigationBarButtonTap((e) => {
+  console.log(e);
+  uni.navigateTo({
+    url: "./export/export?dwtype=" + dwtype.value,
+  });
+});
 </script>
 
 <style lang="scss">
-	.cu-item {
-		height: 180rpx !important
-	}
-	.plus {
-	    position: fixed;
-	    bottom: 3px;
-	    right: 3px;
-	}
+.cu-item {
+  height: 180rpx !important;
+}
+.plus {
+  position: fixed;
+  bottom: 3px;
+  right: 3px;
+}
 </style>

+ 7 - 49
src/pages/setting/funReport/funcAdd/funcAdd.vue

@@ -1,8 +1,5 @@
 <template>
-  <view
-    class="appWrapper padding-top"
-    style="height: calc(100vh - 250rpx); overflow: scroll"
-  >
+  <view class="appWrapper padding-top" style="height: calc(100vh - 250rpx); overflow: scroll">
     <form action="" class="funcAdd">
       <view class="form-item selectBox">
         <view class="title"><text class="necessary">*</text>报备类型:</view>
@@ -14,10 +11,7 @@
         </el-select>
         <text class="icon iconfont margin-right-sm margin-left">&#xe63d;</text>
       </view>
-      <view
-        class="form-item selectBox"
-        v-if="report_type == 2 || report_type == 3"
-      >
+      <view class="form-item selectBox" v-if="report_type == 2 || report_type == 3">
         <view class="title"><text class="necessary">*</text>设备类型:</view>
         <el-select v-model="device_type" name="" id="" placeholder="" clearable>
           <el-option value="">请选择</el-option>
@@ -44,10 +38,7 @@
           开始时间:
         </view>
         <view class="example-body">
-          <uni-datetime-picker
-            v-model="start_time"
-            :start="this.id ? '' : now"
-          />
+          <uni-datetime-picker v-model="start_time" :start="this.id ? '' : now" />
         </view>
       </view>
       <view class="form-item" v-if="report_type">
@@ -65,10 +56,7 @@
         <input name="input" v-model="device_port" />
       </view>
 
-      <view
-        class="form-item selectBox"
-        v-if="report_type == 3 && device_type == 6"
-      >
+      <view class="form-item selectBox" v-if="report_type == 3 && device_type == 6">
         <view class="title"><text class="necessary">*</text>端口类型:</view>
         <el-select v-model="port_type" name="" id="" placeholder="" clearable>
           <el-option value="">请选择</el-option>
@@ -82,11 +70,7 @@
         <view class="title"><text class="necessary">*</text>报备设备:</view>
         <el-select v-model="device_code" name="" id="" placeholder="" clearable>
           <el-option value="">请选择</el-option>
-          <el-option
-            :value="item.owner_code"
-            v-for="(item, index) in deviceListData"
-            :key="index"
-          >
+          <el-option :value="item.owner_code" v-for="(item, index) in deviceListData" :key="index">
             {{ item.owner_name }}
           </el-option>
         </el-select>
@@ -142,15 +126,7 @@ export default {
     });
 
     var nowTemp = new Date();
-    this.now = new Date(
-      nowTemp.getFullYear(),
-      nowTemp.getMonth(),
-      nowTemp.getDate(),
-      0,
-      0,
-      0,
-      0
-    );
+    this.now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);
 
     if (option.id) {
       this.getDetailsData({ id: option.id });
@@ -162,22 +138,7 @@ export default {
     },
     report_type: function (newVal) {
       if (newVal) {
-        var array123 = [
-          "",
-          "1",
-          "2",
-          "3",
-          "4",
-          "5",
-          "6",
-          "7",
-          "16",
-          "128",
-          "131",
-          "130",
-          "129",
-          "17",
-        ];
+        var array123 = ["", "1", "2", "3", "4", "5", "6", "7", "16", "128", "131", "130", "129", "17"];
         if (array123.indexOf(this.device_type) == -1) {
           this.device_type = "";
         }
@@ -381,9 +342,6 @@ export default {
 };
 </script>
 
-
-
-
 <style lang="scss">
 input,
 select,

+ 199 - 228
src/pages/setting/messagePush/messagePush.vue

@@ -1,235 +1,206 @@
 <template>
-	<view class="padding-sm messagePush">
-
-		<form action="">
-
-			<checkbox-group class="block" @change="CheckboxChange">
-				<view class="margin-top  ">
-					<view class="flex align-center checkItems" v-for="(item,index) in checkbox">
-						<checkbox class="blue" :class="item.checked==1?'checked':''"
-							:checked="item.checked==1?true:false" :value="item.value"></checkbox>
-						<view class="title">{{item.title}}</view>
-
-
-					</view>
-				</view>
-			</checkbox-group>
-
-			<view class="btn-area submitBottomBtn padding-lr-sm">
-				<button class="bg-blue round  margin-top" @click="$noMultipleClicks(btnSubmit)">提 交 </button>
-			</view>
-
-		</form>
-
-	</view>
+  <view class="padding-sm messagePush">
+    <form action="">
+      <checkbox-group class="block" @change="CheckboxChange">
+        <view class="margin-top">
+          <view class="flex align-center checkItems" v-for="(item, index) in checkbox" :key="index">
+            <checkbox class="blue" :class="item.checked == 1 ? 'checked' : ''" :checked="item.checked == 1 ? true : false" :value="item.value"></checkbox>
+            <view class="title">{{ item.title }}</view>
+          </view>
+        </view>
+      </checkbox-group>
+
+      <view class="btn-area submitBottomBtn padding-lr-sm">
+        <button class="bg-blue round margin-top" @click="$noMultipleClicks(btnSubmit)">提 交</button>
+      </view>
+    </form>
+  </view>
 </template>
 
-<script>
-	export default {
-		data() {
-			return {
-				noClick: true,
-				flag: false,
-				getData: {},
-				checkedValue: [],
-				checkbox: [{
-						value: 'm1',
-						checked: false,
-						title: '火警报警'
-					},
-					{
-						value: 'm2',
-						checked: false,
-						title: '火警故障'
-					},
-					{
-						value: 'm3',
-						checked: false,
-						title: '水压越线'
-					},
-					{
-						value: 'm4',
-						checked: false,
-						title: '开关变化'
-					},
-					{
-						value: 'm5',
-						checked: false,
-						title: '设备离线'
-					},
-					{
-						value: 'm6',
-						checked: false,
-						title: '烟感报警'
-					},
-					{
-						value: 'm7',
-						checked: false,
-						title: '电气火灾'
-					},
-					{
-						value: 'm8',
-						checked: false,
-						title: '视频报警'
-					},
-					{
-						value: 'm9',
-						checked: false,
-						title: '电梯监测'
-					},
-					{
-						value: 'm10',
-						checked: false,
-						title: '井盖监测'
-					}
-				],
-
-			}
-		},
-		onLoad: function(option) {
-			this.getCheckList();
-		},
-		methods: {
-			CheckboxChange(e) {
-				this.flag = true;
-				var items = this.checkbox,
-					values = e.detail.value;
-				this.checkedValue = values;
-				// console.log(values)
-
-				// console.log('点击复选框时this.checkedValue')
-				// console.log(this.checkedValue)
-				for (var i = 0, lenI = items.length; i < lenI; ++i) {
-					items[i].checked = false;
-					for (var j = 0, lenJ = values.length; j < lenJ; ++j) {
-						if (items[i].value == values[j]) {
-							items[i].checked = true;
-							break
-						}
-					}
-				}
-			},
-
-
-			// 回显数据请求
-			async getCheckList(params = {}) {
-				const res = await this.$myRequest({
-					url: 'PushSettings/setperm',
-					data: params,
-					showLoading: true
-				})
-				this.getData = res.data.data[0];
-
-
-
-				// 遍历checkbox数组对象
-				for (let i = 0; i < this.checkbox.length; i++) {
-					//判断value是否存在于返回对象中.存在的话checked重新赋值
-					if (this.getData.hasOwnProperty(this.checkbox[i].value)) {
-						// console.log(this.checkbox[i].value)
-						this.checkbox[i].checked = true
-					}
-				}
-			},
-
-
-			//提交
-			async btnSubmit() {
-
-				// 提交验证
-				// alert(this.aa);
-				// alert(this.checkedValue)
-				// if (!this.aa.length) {
-				// 	uni.showToast({
-				// 		title: "请选择推送选项",
-				// 		icon: "none"
-				// 	});
-				// 	return
-				// }
-
-
-				let mingParams = {};
-				if (!this.flag) {
-					//不点击默认传参
-					var obgj = this.getData;
-					console.log('不点击默认传参obgj')
-					console.log(obgj);
-					var arr = [];
-					for (var key in obgj) {
-						console.log(key)
-						console.log(obgj[key])
-						arr.push([key][0])
-					}
-					arr.map((e) => {
-						mingParams[e] = true;
-					});
-				} else {
-					//点击复选框后传参
-					var arr = this.checkedValue;
-					console.log('自由选中复选框后传参arr')
-					console.log(arr)
-
-
-					arr.map((e) => {
-						mingParams[e] = true;
-					});
-					console.log('mingParams')
-					console.log(mingParams)
-
-
-				}
-
-
-
-				let res = await this.PushSettings(mingParams);
-				// let res = await this.PushSettings({'m1':true,"m2":true,"m6":true});
-
-				if (!res.data.flag) {
-					uni.showToast({
-						title: "添加失败",
-						icon: "none"
-					});
-				} else {
-					uni.showToast({
-						title: "添加成功",
-					});
-					setTimeout(() => {
-						uni.switchTab({
-							url: '/pages/setting/setting',
-						});
-					}, 1000);
-					
-				}
-				
-				
-
-			},
-			PushSettings(params = {}) {
-				return this.$myRequest({
-					url: 'PushSettings/setperm',
-					data: params
-				})
-			},
-
-
-		}
-	}
+<script setup>
+import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
+import { ref, onMounted, inject, shallowRef, reactive, toRefs } from "vue";
+
+import useStore from "@/store/modules/user";
+import useXunJianStore from "@/store/modules/xunJian";
+
+import { setperm } from "@/api/setting/index.js";
+
+const data = reactive({
+  noClick: true,
+  flag: false,
+  getData: {},
+  checkedValue: [],
+  checkbox: [
+    {
+      value: "m1",
+      checked: false,
+      title: "火警报警",
+    },
+    {
+      value: "m2",
+      checked: false,
+      title: "火警故障",
+    },
+    {
+      value: "m3",
+      checked: false,
+      title: "水压越线",
+    },
+    {
+      value: "m4",
+      checked: false,
+      title: "开关变化",
+    },
+    {
+      value: "m5",
+      checked: false,
+      title: "设备离线",
+    },
+    {
+      value: "m6",
+      checked: false,
+      title: "烟感报警",
+    },
+    {
+      value: "m7",
+      checked: false,
+      title: "电气火灾",
+    },
+    {
+      value: "m8",
+      checked: false,
+      title: "视频报警",
+    },
+    {
+      value: "m9",
+      checked: false,
+      title: "电梯监测",
+    },
+    {
+      value: "m10",
+      checked: false,
+      title: "井盖监测",
+    },
+  ],
+});
+
+const { noClick, flag, getData, checkedValue, checkbox } = toRefs(data);
+
+function CheckboxChange(e) {
+  flag.value = true;
+  var items = checkbox.value,
+    values = e.detail.value;
+  checkedValue.value = values;
+  // console.log(values)
+
+  // console.log('点击复选框时this.checkedValue')
+  // console.log(this.checkedValue)
+  for (var i = 0, lenI = items.length; i < lenI; ++i) {
+    items[i].checked = false;
+    for (var j = 0, lenJ = values.length; j < lenJ; ++j) {
+      if (items[i].value == values[j]) {
+        items[i].checked = true;
+        break;
+      }
+    }
+  }
+}
+
+// 回显数据请求
+function getCheckList(params = {}) {
+  setperm(params).then((res) => {
+    getData.value = res.data[0];
+
+    // 遍历checkbox数组对象
+    for (let i = 0; i < checkbox.value.length; i++) {
+      //判断value是否存在于返回对象中.存在的话checked重新赋值
+      if (getData.value.hasOwnProperty(checkbox.value[i].value)) {
+        // console.log(this.checkbox[i].value)
+        checkbox.value[i].checked = true;
+      }
+    }
+  });
+}
+
+//提交
+async function btnSubmit() {
+  // 提交验证
+  // alert(this.aa);
+  // alert(this.checkedValue)
+  // if (!this.aa.length) {
+  // 	uni.showToast({
+  // 		title: "请选择推送选项",
+  // 		icon: "none"
+  // 	});
+  // 	return
+  // }
+
+  let mingParams = {};
+  if (!flag.value) {
+    //不点击默认传参
+    var obgj = getData.value;
+    console.log("不点击默认传参obgj");
+    console.log(obgj);
+    var arr = [];
+    for (var key in obgj) {
+      console.log(key);
+      console.log(obgj[key]);
+      arr.push([key][0]);
+    }
+    arr.map((e) => {
+      mingParams[e] = true;
+    });
+  } else {
+    //点击复选框后传参
+    var arr = checkedValue.value;
+    console.log("自由选中复选框后传参arr");
+    console.log(arr);
+
+    arr.map((e) => {
+      mingParams[e] = true;
+    });
+    console.log("mingParams");
+    console.log(mingParams);
+  }
+
+  setperm(params).then((res) => {
+    if (!res.flag) {
+      uni.showToast({
+        title: "添加失败",
+        icon: "none",
+      });
+    } else {
+      uni.showToast({
+        title: "添加成功",
+      });
+      setTimeout(() => {
+        uni.switchTab({
+          url: "/pages/setting/setting",
+        });
+      }, 1000);
+    }
+  });
+}
+
+onload((option) => {
+  getCheckList();
+});
 </script>
 
 <style lang="scss">
-	.checkItems {
-		width: 50%;
-		display: inline-block;
-		text-align: center;
-		margin-bottom: 40rpx;
-
-		.title {
-			display: inline-block;
-			margin-left: 10rpx;
-		}
-	}
-	
-	.padding-sm{
-		
-	}
+.checkItems {
+  width: 50%;
+  display: inline-block;
+  text-align: center;
+  margin-bottom: 40rpx;
+
+  .title {
+    display: inline-block;
+    margin-left: 10rpx;
+  }
+}
+
+.padding-sm {
+}
 </style>

+ 8 - 9
src/pages/setting/setting.vue

@@ -8,7 +8,7 @@
       </view>
     </view>
     <view class="cu-list menu-avatar padding-lr-sm padding-top-sm">
-     <!-- <view class="cu-item margin-bottom-sm" @tap="goMessagePush()">
+      <!-- <view class="cu-item margin-bottom-sm" @tap="goMessagePush()">
         <view class="cu-avatar">
           <image class="image-bg" src="@/static/images/setting/push-icon.png" />
         </view>
@@ -82,23 +82,22 @@
 
 <script setup>
 import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
-import { ref, onMounted, inject, shallowRef } from "vue";
+import { ref, onMounted, inject, shallowRef, reactive, toRefs } from "vue";
 
 import useStore from "@/store/modules/user";
 import useXunJianStore from "@/store/modules/xunJian";
+
+import { getAuthorization } from "@/api/setting/index.js";
+
 const useStores = useStore(); //全局用户信息Store
 const settingsStore = useXunJianStore(); //全局变量值Store
 
 const permissionLabel = ref(0);
 
-async function getAuthorization(params) {
-  const res = await this.$myRequest({
-    url: "Com/getAuthorization",
-    showLoading: true,
-    data: params,
+function getAuthorizationApi(params) {
+  getAuthorization(params).then((res) => {
+    permissionLabel.value = res.data.permissionLabel;
   });
-
-  this.permissionLabel = res.data.permissionLabel;
 }
 
 function goMessagePush() {

BIN
src/static/logo.png


BIN
src/static/logo1.png


BIN
src/static/logo200.png