From 85a15646ffe20ed2bbb2042ec500df8c850a69cc Mon Sep 17 00:00:00 2001
From: zhuguifei <zhuguifei@zhuguifeideiMac.local>
Date: 星期五, 25 七月 2025 15:29:41 +0800
Subject: [PATCH] 首次提交

---
 pages/tabBar/warning.vue |  847 ++++++++++++++++++++-----------------------------------
 1 files changed, 313 insertions(+), 534 deletions(-)

diff --git a/pages/tabBar/warning.vue b/pages/tabBar/warning.vue
index 71ced45..c3aed9d 100644
--- a/pages/tabBar/warning.vue
+++ b/pages/tabBar/warning.vue
@@ -1,591 +1,363 @@
 <template>
 	<view class="app">
-		<cu-custom bgColor="bg-gradual-blue" :isBack="false" :isRight="true" @rightclick="rclick">
-			<block slot="content">鎶ヨ</block>
+		<z-paging ref="paging" v-model="dataList" show-refresher-update-time @query="queryList">
+			<!-- 闇�瑕佸浐瀹氬湪椤堕儴涓嶆粴鍔ㄧ殑view鏀惧湪slot="top"鐨剉iew涓紝濡傛灉闇�瑕佽窡鐫�婊氬姩锛屽垯涓嶈璁剧疆slot="top" -->
+			<template #top>
+				<cu-custom bgColor="bg-gradual-blue" :isBack="false" :isRight="true" @rightclick="rclick">
+					<block slot="content">鎶ヨ缁熻</block>
 
-		</cu-custom>
-		<u-notice-bar text="12:20:10 1杞﹂棿GM001鏈哄彴鐢垫満杩囨祦(鐢垫皵)鎶ヨ" mode="closable"></u-notice-bar>
+				</cu-custom>
 
-		<!--寮瑰嚭灞俿tart-->
-		<view style="width: 100%; position: absolute;z-index: 1000;top:300rpx;padding: 20rpx;" @touchmove.prevent >
-			<dropdown-menu v-show="filterMenuShow"@reset='resetMenu'  @change='changeMenu' :list='equList' ref='dropdownMenuRef'/>
-			
-		</view>
-		<view class="lock-page dropdown-mask" @touchmove.prevent @click.stop="1==1" v-if="filterMenuShow"></view>
-		
-		<!--寮瑰嚭灞俥nd-->
-
-		<view class="card-box dynamic shadow">
-			<view class="title-box margin-bottom-sm">
-				<view style="width: 100vw;" class="left justify-between">
-					<view class="flex align-center">
-						<uni-text class="cuIcon-titles text-blue"></uni-text>
-						<view class="title">鎬昏</view>
-					</view>
-					<view>
-						<text class="text-gray text-sm">2024-10-01 鑷� 2024-12-01</text>
-					</view>
+				<!--寮瑰嚭灞俿tart-->
+				<view style="width: 100%; position: absolute;z-index: 1000;top:300rpx;padding: 20rpx;"
+					@touchmove.prevent>
+					<dropdown-menu v-show="filterMenuShow" @closeMenu="filterMenuShow = false " @reset='resetMenu' @change='changeMenu' :list='equList'
+						ref='dropdownMenuRef' />
 
 				</view>
+				<view class="lock-page dropdown-mask" @touchmove.prevent v-if="filterMenuShow"></view>
 
-			</view>
-			<view class="flex flex-direction padding-xs">
-				<view class="flex">
-					<view class="flex-sub flex flex-direction">
-						<text class="text-df">鎶ヨ鎬绘暟</text>
-						<text class="text-bold text-sl margin-top-xs text-red margin-top-sm">10
-							<text class="text-gray text-sm margin-left-xs">娆�</text></text>
+				<!--寮瑰嚭灞俥nd-->
 
-					</view>
-					<view class="flex-twice flex flex-direction justify-between">
-						<view class="flex-sub flex">
-							<view class="flex flex-direction flex-sub">
-								<text class="text-gray text-xs">鎶ヨ淇℃伅</text>
-								<text class="text-black">
-									<text class="text-black">鏈烘鏁呴殰:</text>
-									<text class="margin-lr-xs text-orange">0</text>
-									<text class="text-gray text-xs">娆�</text>
-								</text>
-
+				<view class="card-box dynamic shadow">
+					<view class="title-box margin-bottom-sm">
+						<view style="width: 100vw;" class="left justify-between">
+							<view class="flex align-center">
+								<uni-text class="cuIcon-titles text-blue"></uni-text>
+								<view class="title">鎬昏</view>
 							</view>
-							<view class="flex flex-direction flex-sub">
-								<text class="text-white text-xs">鐢垫皵鏁呴殰</text>
-								<text class="text-black">
-									<text class="text-black">鐢垫皵鏁呴殰:</text>
-									<text class="margin-lr-xs text-orange">1</text>
-									<text class="text-gray text-xs">娆�</text>
-								</text>
-
-							</view>
-
-						</view>
-						<view class="flex-sub flex margin-top-sm">
-							<view class="flex flex-direction flex-sub">
-								<text class="text-gray text-xs">鎶ヨ淇℃伅</text>
-								<text>
-									<text class="text-black">閫氫俊鏁呴殰:</text>
-									<text class="margin-lr-xs text-orange">4</text>
-									<text class="text-gray text-xs">娆�</text>
-								</text>
-
-							</view>
-							<view class="flex flex-direction flex-sub">
-								<text class="text-white text-xs">鍏朵粬鏁呴殰</text>
-								<text class="text-cyan">
-									<text class="text-black">鍏朵粬鏁呴殰:</text>
-									<text class="margin-lr-xs text-orange">5</text>
-									<text class="text-gray text-xs">娆�</text>
-								</text>
+							<view>
+								<text class="text-gray text-sm">{{curDate}}</text>
 							</view>
 
 						</view>
 
 					</view>
+					
+					<view class="flex flex-direction padding-xs">
+						<view class="flex">
+							<view class="flex-sub flex flex-direction">
+								<text class="text-df">鎶ヨ鎬绘暟</text>
+								<text class="text-bold text-sl margin-top-xs text-red margin-top-sm">{{count}}
+									<text class="text-gray text-sm margin-left-xs">娆�</text></text>
 
-				</view>
-				<view class="margin-top">
-					<u-scroll-list>
+							</view>
+							<view class="flex-twice flex flex-direction justify-between">
+								<view class="flex-sub flex">
+									<view class="flex flex-direction flex-sub">
+										<text class="text-gray text-xs">鎶ヨ淇℃伅</text>
 
-					</u-scroll-list>
+										<text class="text-black">鏁呴殰娆℃暟:</text>
+										<text class="margin-lr-xs text-red text-bold text-xl">{{faultCount}}</text>
+										<text class="text-gray text-xs"></text>
+
+
+									</view>
+									<view class="flex flex-direction flex-sub">
+										<text class="text-gray text-xs">鏈哄彴淇℃伅</text>
+
+										<text class="text-black">鏁呴殰鏈哄彴:</text>
+										<text class="margin-lr-xs text-red">{{faultEqus}}</text>
+										<text class="text-gray text-xs"></text>
+
+
+									</view>
+
+								</view>
+								<view class="flex-sub flex">
+									<view class="flex flex-direction flex-sub"  >
+										<text class="text-white text-xs">鎶ヨ淇℃伅</text>
+
+										<text class="text-black">鍛婅娆℃暟:</text>
+										<text class="margin-lr-xs text-orange text-bold text-xl">{{alarmCount}}</text>
+										<text class="text-gray text-xs"></text>
+
+
+									</view>
+									<view class="flex flex-direction flex-sub">
+										<text class="text-white text-xs">鏈哄彴淇℃伅</text>
+										<text class="text-black">鍛婅鏈哄彴:</text>
+										<text class="margin-lr-xs text-orange">{{alarmEqus}}</text>
+										<text class="text-gray text-xs"></text>
+
+									</view>
+
+								</view>
+
+							</view>
+
+						</view>
+						<view>
+							<u-scroll-list>
+
+							</u-scroll-list>
+
+						</view>
+
+					</view>
+
+
 
 				</view>
 
-			</view>
+			</template>
 
-
-
-		</view>
-
-		<u-sticky>
 			<view class="tab-box card-box top dynamic shadow">
-				<z-tabs ref="tabs" :active-style="{'font-size':'30rpx','font-weight':'bold'}" :current="tabCurrent"
-					:list="tabList" @change="tabsChange">
-					<!-- 鑷畾涔夊彸渚ф彃妲� -->
-					<!-- <template v-slot:right>
-						<u-icon name="setting"  ></u-icon>
-					</template> -->
+
+				<u-tabs :list="tabList" @click="tabsChange"></u-tabs>
+				<!-- <z-tabs ref="tabs" :active-style="{'font-size':'30rpx','font-weight':'bold'}" :current="tabCurrent"
+						:list="tabList" @change="tabsChange"> -->
+				<!-- 鑷畾涔夊彸渚ф彃妲� -->
+				<!-- <template v-slot:right>
+							<u-icon name="setting"  ></u-icon>
+						</template> -->
 				</z-tabs>
 			</view>
-		</u-sticky>
-		<!-- 鍙�氳繃璁剧疆bar-animate-mode="worm"寮�鍚瘺姣涜櫕妯″紡-->
-		<swiper :style="'height:' + swiperItemHeight[tabCurrent] + 'rpx;'" :current="tabCurrent"
-			@transition="swiperTransition" @animationfinish="swiperAnimationfinish">
-			<swiper-item :key="0">
-				<view :style="'height:' + swiperItemHeight[0] + 'rpx;'">
 
-					<view class="card-box center dynamic shadow">
-						<view class="title-box margin-bottom-sm">
-							<view style="width: 100vw;" class="left justify-between">
-								<view class="flex align-center">
-									<uni-text class="cuIcon-titles text-blue"></uni-text>
-									<view class="title">璁惧 </view>
-								</view>
-								<view>
-									<!-- <text class="text-blue text-sm">鏇村></text> -->
-								</view>
-
-							</view>
-
-						</view>
-						<view class="borderTop">
-							<image style="width: 100%;border-radius: 20rpx; " src="../../static/image/pic_gz.jpg"
-								mode="aspectFit"></image>
-						</view>
-
-					</view>
-
-					<view class="card-box center dynamic shadow">
-						<view class="title-box margin-bottom-sm">
-							<view style="width: 100vw;" class="left justify-between">
-								<view class="flex align-center">
-									<uni-text class="cuIcon-titles text-blue"></uni-text>
-									<view class="title">瀹炴椂鎶ヨ </view>
-								</view>
-								<view>
-									<!-- <text class="text-blue text-sm">鏇村></text> -->
-								</view>
-
-							</view>
-
-						</view>
-						<view class="borderTop"  v-for="i in 10">
-							<view style="height: 180rpx;display: flex;align-items: center;">
-								<view>
-									<image style="width: 80rpx;height: 80rpx;margin:20rpx;border-radius: 20rpx; "
-										src="../../static/image/pic_gz.jpg"></image>
-								</view>
-								<view
-									style="display: flex;flex: 1;flex-direction: column; justify-content: space-between;  ;height: 100%;padding: 20rpx;">
-									<view class="text-bold">
-										婊氱瓛鐢垫満杩囨祦鎶ヨ
-									</view>
-									<view class="text-gray text-sm">
-										璁惧:1鍙峰共鐕ユ満
-									</view>
-
-									<view class="text-gray text-sm">
-										鎻忚堪:鍚屾祹鍫�1鍙锋粴绛掔數鏈鸿繃娴佹姤璀︼紝闇�瑕亁xxx澶勭悊锛屼笢鏂硅埅绌虹殑鎭㈠寰堝揩鐨勫洖澶�
-									</view>
-
-								</view>
-								<view style="width: 100rpx;">{{i}}</view>
-
-							</view>
-						</view>
-
-					</view>
-
-					<view class="card-box bot dynamic shadow">
-						<view style="height: 20rpx;"></view>
-					</view>
-				</view>
-			</swiper-item>
-			<swiper-item :key="1">
-				<view :style="'height:' + swiperItemHeight[1] + 'rpx;'">
-					<view class="card-box center dynamic shadow">
-						<view class="title-box margin-bottom-sm">
-							<view style="width: 100vw;" class="left justify-between">
-								<view class="flex align-center">
-									<uni-text class="cuIcon-titles text-blue"></uni-text>
-									<view class="title">鏈�杩戞姤璀�</view>
-								</view>
-								<view>
-									<text class="text-blue text-sm">鏇村></text>
-								</view>
-
-							</view>
-
-						</view>
+			<!-- 濡傛灉甯屾湜鍏朵粬view璺熺潃椤甸潰婊氬姩锛屽彲浠ユ斁鍦▃-paging鏍囩鍐� -->
+		  <!-- <real-warning ref="realWarining" v-if="tabCurrent === 0" @handleData="realHandleData"></real-warning>  -->
+			<his-warning ref="hisWarining" v-if="tabCurrent === 0" @handleData="hisHandleData"></his-warning>
 
 
-						<view class="borderTop">
-							<view class="h-table">
-								<view class="h-tr h-tr-2 ">
-									<view class="h-td">杞﹂棿</view>
-									<view class="h-td">鏈哄彴</view>
-									<view class="h-td">鏃堕棿</view>
-									<view class="h-td">绫诲瀷</view>
-									<view class="h-td">绛夌骇</view>
-
-
-								</view>
-								<view class="h-tr h-tr-2">
-									<view class="h-td">001</view>
-									<view class="h-td">GM001</view>
-									<view class="h-td">12:00:00</view>
-									<view class="h-td">鏈烘</view>
-									<view class="h-td">楂�</view>
-
-								</view>
-								<view class="h-tr h-tr-2">
-									<view class="h-td">001</view>
-									<view class="h-td">GM001</view>
-									<view class="h-td">12:00:00</view>
-									<view class="h-td">閫氫俊</view>
-									<view class="h-td">涓�</view>
-
-								</view>
-								<view class="h-tr h-tr-2">
-									<view class="h-td">001</view>
-									<view class="h-td">GM001</view>
-									<view class="h-td">12:00:00</view>
-									<view class="h-td">鐢垫皵</view>
-									<view class="h-td">楂�</view>
-
-								</view>
-							</view>
-
-						</view>
-
-
-					</view>
-
-					<view class="card-box center dynamic shadow">
-						<view class="title-box margin-bottom-sm">
-							<view style="width: 100vw;" class="left justify-between">
-								<view class="flex align-center">
-									<uni-text class="cuIcon-titles text-blue"></uni-text>
-									<view class="title">鎶ヨ缁熻</view>
-								</view>
-								<view>
-									<text class="text-gray text-sm"></text>
-								</view>
-
-							</view>
-
-						</view>
-
-
-						<view class="chartsMain">
-							<qiun-data-charts type="mount" :opts="opts" :animation="true" :chartData="Mount" />
-						</view>
-					</view>
-
-
-					<view class="card-box center dynamic shadow">
-						<view class="title-box margin-bottom-sm">
-							<view style="width: 100vw;" class="left justify-between">
-								<view class="flex align-center">
-									<uni-text class="cuIcon-titles text-blue"></uni-text>
-									<view class="title">鎶ヨ瀵规瘮</view>
-								</view>
-								<view>
-									<text class="text-gray text-sm"></text>
-								</view>
-
-							</view>
-
-						</view>
-
-						<view class="chartsMain">
-
-							<qiun-data-charts type="pie" :opts="optsPie" :chartData="PieA" />
-
-						</view>
-					</view>
-
-
-
-					<view class="card-box center dynamic shadow">
-						<view class="title-box margin-bottom-sm">
-							<view style="width: 100vw;" class="left justify-between">
-								<view class="flex align-center">
-									<uni-text class="cuIcon-titles text-blue"></uni-text>
-									<view class="title">鎶ヨ棰戠巼</view>
-								</view>
-								<view>
-									<text class="text-gray text-sm"></text>
-								</view>
-
-							</view>
-
-						</view>
-
-
-						<view class="chartsMain">
-							<!-- <qiun-data-charts type="mount" :opts="{extra:{mount:{type:'mount',widthRatio:1.5}}}"
-					:chartData="Mount" /> -->
-							<qiun-data-charts type="word" :chartData="Word" />
-						</view>
-					</view>
-
-					<view class="card-box bot dynamic shadow">
-						<view class="title-box margin-bottom-sm">
-							<view style="width: 100vw;" class="left justify-between">
-								<view class="flex align-center">
-									<uni-text class="cuIcon-titles text-blue"></uni-text>
-									<view class="title">鎶ヨ鍒嗘瀽</view>
-								</view>
-								<view>
-									<text class="text-gray text-sm"></text>
-								</view>
-
-							</view>
-
-						</view>
-
-
-						<view class="chartsMain">
-
-							<qiun-data-charts type="radar" :opts="optsRadar" :chartData="dataRadar" />
-						</view>
-					</view>
-
-
-				</view>
-			</swiper-item>
-		</swiper>
-
-
+		</z-paging>
 	</view>
 </template>
 
 <script>
 	import dropdownMenu from '@/components/drop-down-menu/index.vue'
+	import realWarning from './components/realWarning.vue'
+	import hisWarning from './components/hisWarning.vue'
+	import dayjs from 'dayjs'
 	export default {
 		components: {
-			dropdownMenu
+			dropdownMenu,
+			realWarning,
+			hisWarning
 		},
 		data() {
 			return {
-				equList: [{
+				loading: true,
+				// v-model缁戝畾鐨勮繖涓彉閲忎笉瑕佸湪鍒嗛〉璇锋眰缁撴潫涓嚜宸辫祴鍊硷紒锛侊紒
+				dataList: [],
+				curDate: dayjs().format('YYYY-MM-DD'),
+				tabList: [
+				// 	{
+				// 	name: '瀹炴椂鎶ヨ',
+				// 	// badge: {
+				// 	// 	count: 6
+				// 	// }
+				// }, 
+				{
+					name: '鎶ヨ缁熻',
+				}],
+				equList: [/* {
 						code: 1,
 						name: '1#骞茬嚗鏈�'
-					},
+					}, */
 					{
 						code: 2,
 						name: '2#骞茬嚗鏈�'
-					} 
+					}
 				],
-				model: {},
+
+				//绛涢�夋
 				filterMenuShow: false,
+				//褰撳墠閫変腑tab
 				tabCurrent: 0,
-				swiperItemHeight: [2800, 2140],
-				tabList: [{
-					name: '瀹炴椂鎶ヨ',
-					badge: {
-						count: 6
-					}
-				}, {
-					name: '鎶ヨ缁熻',
-				}],
-				PieA: {
-					"series": [{
-						"data": [{
-							"name": "鏈烘",
-							"value": 50,
-							"labelText": "鏈烘:50娆�"
-						}, {
-							"name": "鐢垫皵",
-							"value": 30,
-							"labelText": "鐢垫皵:30娆�"
-						}, {
-							"name": "閫氫俊",
-							"value": 20,
-							"labelText": "閫氫俊:20娆�"
-						}, {
-							"name": "鍏朵粬",
-							"value": 18,
-							"labelText": "鍏朵粬:18娆�"
-						}]
-					}]
-				},
-				dataRadar: {
-
-					categories: ["鏈烘", "鐢垫皵", "閫氫俊", "鍏朵粬"],
-					series: [{
-						name: "鎶ヨ鍗犳瘮",
-						data: [99, 30, 18, 73]
-					}]
-
-				},
-
-				Mount: {
-					"series": [{
-
-						"data": [{
-							"name": "鏈烘",
-							"value": 82
-						}, {
-							"name": "鐢垫皵",
-							"value": 63
-						}, {
-							"name": "閫氫俊",
-							"value": 86
-						}, {
-							"name": "鍏朵粬",
-							"value": 65
-						}]
-					}]
-				},
-				Word: {
-					"series": [{
-						"name": "椋庢満杩囨祦",
-						"textSize": 25
-					}, {
-						"name": "鍚庨棬鏈叧闂�",
-						"textSize": 20
-					}, {
-						"name": "椋庣鍗囧紓甯�",
-						"textSize": 20
-					}, {
-						"name": "鐢垫満杩囨祦",
-						"textSize": 20
-					}, {
-						"name": "鍔犵儹浣嶄紶鎰熷櫒",
-						"textSize": 20
-					}, {
-						"name": "鍔犵儹鏃堕棿寮傚父",
-						"textSize": 20
-					}, {
-						"name": "婊氱瓛鍗囧紓甯�",
-						"textSize": 20
-					}, {
-						"name": "椋庣涓嶅湪鍔犵儹浣�",
-						"textSize": 20
-					}, {
-						"name": "婊氱瓛涓嶅湪鍔犵儹浣�",
-						"textSize": 10
-					}]
-				},
-				opts: {
-					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
-						"#ea7ccc"
-					],
-					padding: [15, 15, 0, 5],
-					enableScroll: false,
-					legend: {
-						show: true
-					},
-
-					xAxis: {
-						disableGrid: true
-					},
-					yAxis: {
-						gridColor: "rgba(230,230,230,0.6)",
-
-						data: [
-
-							{
-								min: 0
-							}
-						]
-					},
-					extra: {
-						mount: {
-							type: "bar",
-							widthRatio: 0.3,
-							borderWidth: 0,
-							barBorderRadius: [
-								50,
-								50,
-								50,
-								50
-							],
-							linearType: "custom"
-						}
-					}
-				},
-				optsPie: {
-					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
-						"#ea7ccc"
-					],
-					padding: [5, 5, 5, 5],
-					enableScroll: false,
-					extra: {
-						pie: {
-							activeOpacity: 0.5,
-							activeRadius: 10,
-							offsetAngle: 0,
-							labelWidth: 1,
-							border: true,
-							borderWidth: 3,
-							borderColor: "#FFFFFF",
-							linearType: "custom"
-						}
-					}
-				},
-				optsRadar: {
-					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
-						"#ea7ccc"
-					],
-					padding: [5, 5, 5, 5],
-					dataLabel: true,
-					dataPointShape: false,
-					enableScroll: false,
-					legend: {
-						show: false,
-						position: "right",
-						lineHeight: 25
-					},
-					extra: {
-						radar: {
-							gridType: "circle",
-							gridColor: "#CCCCCC",
-							gridCount: 3,
-							opacity: 1,
-							max: 100,
-							labelShow: true,
-							linearType: "custom",
-							border: false
-						}
-					}
-				},
-
-
-
-
+				//瀹炴椂鎶ヨ鏁版嵁鏇存柊鏃堕棿锛堜竴鑸�10s锛�
+				refreshTime: '',
+				//鎶ヨ鎬绘暟
+				count: 0,
+				//鍛婅鎬绘暟
+				alarmCount: 0,
+				//鏁呴殰鎬绘暟
+				faultCount: 0,
+				//鏁呴殰鏈哄彴
+				faultEqus: "",
+				//鍛婅鏈哄彴
+				alarmEqus: "",
 			}
 		},
-		computed: {
-
-
+		onTabItemTap: function(e) {
+			getApp().globalData.selectTab = e.index
 		},
-		created() {
-			
-		},
-		beforeDestroy() {
-			
+		onShow() {
+			// //瀹炴椂鏁呴殰
+			// if(this.tabCurrent === 0){
+			// 	this.$nextTick(()=>{
+			// 		this.$refs.realWarining.queryRealFaultData()
+			// 	})
+			// }
+
+			//瀹炴椂鏁呴殰
+			if (this.tabCurrent === 0) {
+				this.queryRealFaultData()
+			}
+
+		},
+		onReady() {
+		    
 		},
 		methods: {
-			mqttTopicMessage(){
-			//澶勭悊娑堟伅閫昏緫
-			switch(topic){
-				case _this.$constant.SERVICE_BROADCAST_TENANT_REAL_FAULT.replace('%s', that.tenantId):
-				   console.error(that.$constant.SERVICE_BROADCAST_TENANT_REAL_FAULT.replace('%s', that.tenantId))
-				   console.error("鏀跺埌骞挎挱")
-				   
-				break
-			}	
-			},
-			changeMenu(selectData){
-				console.info(selectData)
-				this.filterMenuShow = false
-				
-			 
-			},
-			resetMenu(selectData){
-				console.info(selectData)
-				 
-			},
-			rclick() {
-				this.filterMenuShow=!this.filterMenuShow
+
+			queryList(pageNo, pageSize) {
+				this.loading = true;
+				// 缁勪欢鍔犺浇鏃朵細鑷姩瑙﹀彂姝ゆ柟娉曪紝鍥犳榛樿椤甸潰鍔犺浇鏃朵細鑷姩瑙﹀彂锛屾棤闇�鎵嬪姩璋冪敤
+				// 杩欓噷鐨刾ageNo鍜宲ageSize浼氳嚜鍔ㄨ绠楀ソ锛岀洿鎺ヤ紶缁欐湇鍔″櫒鍗冲彲
+				// 妯℃嫙璇锋眰鏈嶅姟鍣ㄨ幏鍙栧垎椤垫暟鎹紝璇锋浛鎹㈡垚鑷繁鐨勭綉缁滆姹�
+				const params = {
+					pageNo: pageNo,
+					pageSize: pageSize,
+				}
+				//
+
+
+				this.$api.querySampleList(params).then((res) => {
+					// 	// 灏嗚姹傜殑缁撴灉鏁扮粍浼犻�掔粰z-paging
+					//瀹炴椂鏁呴殰
+					if (this.tabCurrent === 0) {
+						this.queryRealFaultData()
+					}else if(this.tabCurrent === 1){
+						this.$refs.hisWarining.init();
+					}
+
+					this.$refs.paging.complete(res.result.records);
+					this.loading = false
+				}).catch(res => {
+					// 濡傛灉璇锋眰澶辫触鍐檛his.$refs.paging.complete(false);
+					// 娉ㄦ剰锛屾瘡娆¢兘闇�瑕佸湪catch涓啓杩欏彞璇濆緢楹荤儲锛寊-paging鎻愪緵浜嗘柟妗堝彲浠ュ叏灞�缁熶竴澶勭悊
+					// 鍦ㄥ簳灞傜殑缃戠粶璇锋眰鎶涘嚭寮傚父鏃讹紝鍐檜ni.$emit('z-paging-error-emit');鍗冲彲
+					this.$refs.paging.complete(false);
+					this.loading = false
+				})
+
+
 			},
 			//tabs閫氱煡swiper鍒囨崲
-			tabsChange(index) {
-				this.tabCurrent = index;
+			tabsChange(item) {
+				this.tabCurrent = item.index;
+				//閲嶇疆鏁呴殰缁熻鏁版嵁
+				this.count = 0;
+				this.alarmCount = 0;
+				this.faultCount = 0;
+				this.faultEqus = "";
+				this.alarmEqus = "";
+				//瀹炴椂鏁呴殰
+				if (this.tabCurrent === 0) {
+					// this.$nextTick(()=>{
+					// 	this.$refs.realWarining.queryRealFaultData()
+
+					// })
+					this.queryRealFaultData()
+					
+					this.curDate = dayjs().format('YYYY-MM-DD');
+				}else if(this.tabCurrent === 1){
+					this.curDate = dayjs().subtract(3, 'day').format('YYYY-MM-DD') +" - "+ dayjs().format('YYYY-MM-DD');
+					
+				}
+
+
 			},
-			//swiper婊戝姩涓�
-			swiperTransition(e) {
-				this.$refs.tabs.setDx(e.detail.dx);
+			realHandleData(data) {
+				if (!data) return false
+				this.count = data.length
+				this.faultCount = data.filter(item => item.faultType === 1).length;
+				this.alarmCount = data.filter(item => item.faultType === 2).length;
+
+				const faultEquList = [...new Set(
+					data
+					.filter(item => item.faultType === 1) // 鏍规嵁鏁呴殰绫诲瀷杩囨护
+					.map(item => {
+						const match = item.equName.match(/(\d+#)/);
+						return match ? match[0] : null; // 濡傛灉鍖归厤鎴愬姛锛屽垯杩斿洖鍖归厤鐨勭紪鍙凤紱鍚﹀垯杩斿洖null
+					})
+					.filter(Boolean) // 鍐嶆杩囨护鎺夊彲鑳藉瓨鍦ㄧ殑null鍊�
+				)];
+				if (faultEquList) {
+					this.faultEqus = faultEquList.join(',');
+				}
+
+
+
+				const alarmEquList = [...new Set(
+					data
+					.filter(item => item.faultType === 2) // 鏍规嵁鏁呴殰绫诲瀷杩囨护
+					.map(item => {
+						const match = item.equName.match(/(\d+#)/);
+						return match ? match[0] : null; // 濡傛灉鍖归厤鎴愬姛锛屽垯杩斿洖鍖归厤鐨勭紪鍙凤紱鍚﹀垯杩斿洖null
+					})
+					.filter(Boolean) // 鍐嶆杩囨护鎺夊彲鑳藉瓨鍦ㄧ殑null鍊�
+				)];
+
+				if (alarmEquList) {
+					this.alarmEqus = alarmEquList.join(',')
+				}
+
+
+			},
+			hisHandleData(data){
+			   if (!data) return false
+			   this.count = data.reduce((sum, item) => sum + item.ecount, 0);
+			   this.faultCount = data.filter(item => item.faultType === 1).reduce((sum, item) => sum + item.ecount, 0);
+			   this.alarmCount = data.filter(item => item.faultType === 2).reduce((sum, item) => sum + item.ecount, 0);
+			   
 			},
-			//swiper婊戝姩缁撴潫
-			swiperAnimationfinish(e) {
-				this.tabCurrent = e.detail.current;
-				this.$refs.tabs.unlockDx();
+			changeMenu(selectData) {
+				console.info(selectData)
+				this.filterMenuShow = false
+
+
+			},
+			resetMenu(selectData) {
+				console.info(selectData)
+
+			},
+			rclick() {
+				this.filterMenuShow = !this.filterMenuShow
+				if (this.filterMenuShow) {
+					uni.pageScrollTo({
+						scrollTop: 0,
+						duration: 300 // 婊氬姩鍔ㄧ敾鎸佺画鏃堕棿锛屽崟浣嶄负姣
+					});
+				}
 			},
 
-		}
+			queryRealFaultData() {
+				//鍙戦�佹暟鎹�
+				const message = {
+					req: this.deviceId,
+					tenantId: this.tenantId,
+					timeStamp: new Date(),
+
+				}
+				let opts = {
+					topic: this.$constant.MOBILE_REQ_EQU_REAL_FAULT,
+					message: JSON.stringify(message),
+				}
+
+				this.$mqttTool.publish(opts).then(res => {
+					//console.error(res)
+				})
+			},
+
+
+
+		},
+		onReady() {
+
+		},
+		computed: {
+			tenantId() {
+				const userinfo = uni.getStorageSync('userinfo');
+				const tenantid = userinfo.loginTenantId
+				return tenantid + "";
+			},
+			deviceId() {
+				return uni.getStorageSync(this.$constant.DEVICE_ID);
+			},
+
+
+		},
 	}
 </script>
 
@@ -593,8 +365,13 @@
 	@import "components/table/helang-table";
 
 	.app {
-		position: relative;
+		width: 100%;
+		max-height: 100vh;
+		overflow: hidden;
 	}
+
+
+
 
 	.card-box {
 		margin: 20rpx;
@@ -741,6 +518,7 @@
 	.dropdown-mask {
 		background: rgba(0, 0, 0, 0.5);
 	}
+
 	.lock-page {
 		height: 100vh;
 		width: 100vw;
@@ -751,5 +529,6 @@
 		bottom: 0;
 		z-index: 998;
 	}
+
 	// 寮瑰嚭灞傝儗鏅伄缃〆nd
 </style>
\ No newline at end of file

--
Gitblit v1.9.3