Browse Source

综合告警 运行监测接口所有对接

ming 4 years ago
parent
commit
0f6d0e30d9

+ 9 - 6
components/list-test/list-test.vue

@@ -146,12 +146,15 @@
 			
 			// 页面跳转
 			goNowUrl(item) {
-				uni.navigateTo({
-					url: this.nowUrl+'?companyCode='+item.companyCode,
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
+				if(item.siteAlarmCount){
+					uni.navigateTo({
+						url: this.nowUrl+'?companyCode='+item.companyCode,
+						success: res => {},
+						fail: () => {},
+						complete: () => {}
+					});
+				}
+				
 			},
 			
 			goNowDetailUrl() {

+ 3 - 3
data/json.js

@@ -58,7 +58,7 @@ let cuIconList = [{
 		redirectUrl: '/pages/siteList/siteList?type=1'
 	}, {
 		imgUrl: '../../static/square2.png',
-		badge: 0,
+		badge: 100,
 		name: '运行监测',
 		redirectUrl: '/pages/siteList/siteList?type=2'
 	}, {
@@ -67,8 +67,8 @@ let cuIconList = [{
 		name: '维保',
 		redirectUrl: ''
 	}, {
-		imgUrl: '../../static/square-bx.png',
-		badge: 22,
+		imgUrl: '../../static/square-bx.png',
+		badge: 0,
 		name: '报修',
 		redirectUrl: ''
 	}, {

+ 18 - 12
pages/alarmingList/alarmingList.vue

@@ -80,20 +80,26 @@
 			
 			// 页面跳转
 			goProcessList() {
-				uni.navigateTo({
-					url: '/pages/processList/processList?type=1&companyCode='+this.companyCode+'',
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
+				if(this.powerMonitoringCount){
+					uni.navigateTo({
+						url: '/pages/processList/processList?type=1&companyCode='+this.companyCode+'',
+						success: res => {},
+						fail: () => {},
+						complete: () => {}
+					});
+				}
+				
 			},
 			goProcessList2() {
-				uni.navigateTo({
-					url: '/pages/processList/processList?type=2&companyCode='+this.companyCode+'',
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
+				if(this.videoMonitoringCount){
+					uni.navigateTo({
+						url: '/pages/processList/processList?type=2&companyCode='+this.companyCode+'',
+						success: res => {},
+						fail: () => {},
+						complete: () => {}
+					});
+				}
+				
 			},
 			
 		}

+ 45 - 22
pages/deviceManage/deviceDetail/deviceDetail.vue

@@ -2,25 +2,25 @@
 	<view class="wrapper flex justify-between padding-lr-lg">
 		<view class="device-items">
 			<view class="device-item">
-				<text class="text-yellow">Uab</text>
-				<text>12</text>
-				<text>V</text>
+				<text class="text-yellow">Uab</text>
+				<text>{{deviceDetail.Uab>1000?deviceDetail.Uab/1000:deviceDetail.Uab}}</text>
+				<text v-if="deviceDetail.Uab>1000">KV</text>
+				<text v-else>V</text>
 			</view>
 			<view class="device-item">
 				<text class="text-green">Ubc</text>
-				<text>{{12000>1000?12000/1000:12000}}</text>
-
-				<text v-if="12000>1000">KV</text>
+				<text>{{deviceDetail.Ubc>1000?deviceDetail.Ubc/1000:deviceDetail.Ubc}}</text>
+				<text v-if="deviceDetail.Ubc>1000">KV</text>
 				<text v-else>V</text>
 			</view>
 			<view class="device-item">
 				<text class="text-red">Uca</text>
-				<text>12</text>
+				<text>{{deviceDetail.Uca}}</text>
 				<text>V</text>
 			</view>
 			<view class="device-item">
 				<text class="text-red">F</text>
-				<text>12</text>
+				<text>{{deviceDetail.F}}</text>
 				<text>V</text>
 			</view>
 		</view>
@@ -28,32 +28,32 @@
 		<view class="device-items">
 			<view class="device-item">
 				<text class="text-yellow">La</text>
-				<text>12</text>
+				<text>{{deviceDetail.Ia}}</text>
 				<text>A</text>
 			</view>
 			<view class="device-item">
 				<text class="text-green">Lb</text>
-				<text>12</text>
+				<text>{{deviceDetail.Ib}}</text>
 				<text>A</text>
 			</view>
 			<view class="device-item">
 				<text class="text-red">Lc</text>
-				<text>12</text>
+				<text>{{deviceDetail.Ic}}</text>
 				<text>A</text>
 			</view>
 			<view class="device-item">
 				<text class="text-yellow">P</text>
-				<text>12</text>
+				<text>{{deviceDetail.P}}</text>
 				<text>kW</text>
 			</view>
 			<view class="device-item">
 				<text class="text-green">Q</text>
-				<text>12</text>
+				<text>{{deviceDetail.Q}}</text>
 				<text>kvar</text>
 			</view>
 			<view class="device-item">
 				<text class="text-red">cos</text>
-				<text>12</text>
+				<text>{{deviceDetail.COS}}</text>
 				<text>V</text>
 			</view>
 		</view>
@@ -62,16 +62,39 @@
 <script>
 	export default {
 		data() {
-			return {
+			return {
+				deviceDetail:''
 			}
 		},
-		onLoad() {
-			uni.setNavigationBarColor({
-				frontColor: "#ffffff", //文字颜色
-				backgroundColor: "#000033", //底部背景色
-			})
-		},
-		methods: {
+	
+		
+		onLoad:function(option){
+			
+			uni.setNavigationBarColor({
+				frontColor: "#ffffff", //文字颜色
+				backgroundColor: "#000033", //底部背景色
+			})
+			console.log(111)
+			console.log(option.companyCode)
+			this.companyCode=option.companyCode
+			this.deviceType=option.deviceType
+			this.getDeviceDetail({"companyCode":option.companyCode,"deviceType":option.deviceType,"deviceCode":option.deviceCode})
+		},
+		
+		
+		methods: {
+			
+			async getDeviceDetail(ming={}) {
+				const res= await this.$myRequest({
+					url:'OperationMonitoring/getMonitoringScreen',
+					data:ming
+				})
+				console.log(res.data.data[0])
+				this.deviceDetail=res.data.data[0]
+				// this.powerDeviceCount= res.data.data[0].powerDeviceCount
+				// this.videoDeviceCount= res.data.data[0].videoDeviceCount
+				
+			},
 		}
 	}
 </script>

+ 38 - 24
pages/deviceManage/deviceManage.vue

@@ -2,18 +2,20 @@
 
 	<view class="">
 		<view class="cu-list menu-avatar">
-			<view class="cu-item deviceTypeItem" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in deviceData"
-			 :key="index" :data-target="'move-box-' + index" @tap="goDeviceDetail">
-				<view class="cu-avatar round lg" :style="`background-image:url(${item.imgUrl})`"></view>
-				<view class="content" >
-					<view class="">{{item.title}}</view>
-				</view>
-				<view class="nav-right num">
+			
+			
+			<view class="cu-item deviceTypeItem" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in deviceData"
+			 :key="index" :data-target="'move-box-' + index" @tap="goDeviceDetail(item)">
+				<view class="cu-avatar round lg" style="background-image:url(../../static/jx.png)"></view>
+				<view class="content" >
+					<view class="">{{item.deviceName}}</view>
+				</view>
+				<view class="nav-right num">
 					<view class="text-grey">
-						{{item.status}}
-						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
-					</view>
-				</view>
+						{{item.trueStatus?'离线':'在线'}}
+						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
+					</view>
+				</view>
 			</view>
 		</view>
 	</view>
@@ -22,26 +24,38 @@
 <script>
 	export default {
 		data() {
-			return {
-				deviceData: [{
-						imgUrl: '../../static/jx.png',
-						title: '进线一',
-						status:'在线'
-					}, {
-						imgUrl: '../../static/jx.png',
-						title: '进线二',
-						status:'离线'
-					}
-				],
+			return {
+				deviceData:[],
+				
 				modalName: null,
 			};
+		},
+		
+		onLoad:function(option){
+			console.log(111)
+			console.log(option.companyCode)
+			this.companyCode=option.companyCode
+			this.deviceType=option.deviceType
+			this.getDeviceManage({"companyCode":option.companyCode,"deviceType":option.deviceType})
 		},
 		methods: {
 			
+			async getDeviceManage(ming={}) {
+				const res= await this.$myRequest({
+					url:'OperationMonitoring/getDeviceList',
+					data:ming
+				})
+				console.log(res.data.data)
+				this.deviceData=res.data.data
+				// this.powerDeviceCount= res.data.data[0].powerDeviceCount
+				// this.videoDeviceCount= res.data.data[0].videoDeviceCount
+				
+			},
+			
 			// 页面跳转
-			goDeviceDetail() {
+			goDeviceDetail(item) {
 				uni.navigateTo({
-					url: '/pages/deviceManage/deviceDetail/deviceDetail',
+					url: '/pages/deviceManage/deviceDetail/deviceDetail?deviceType=1&companyCode='+this.companyCode+'&deviceCode='+item.deviceCode+'',
 					success: res => {},
 					fail: () => {},
 					complete: () => {}

+ 119 - 50
pages/deviceType/deviceType.vue

@@ -2,10 +2,10 @@
 
 	<view class="">
 		<view class="cu-list menu-avatar">
-			<view class="cu-item deviceTypeItem" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in deviceData"
+			<!-- <view class="cu-item deviceTypeItem" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in deviceData"
 			 :key="index" :data-target="'move-box-' + index" @tap="hrefKing(index)">
 				<view class="cu-avatar round lg" :style="`background-image:url(${item.imgUrl})`"></view>
-				<view class="content" >
+				<view class="content">
 					<view class="">{{item.title}}</view>
 				</view>
 				<view class="nav-right num">
@@ -14,7 +14,33 @@
 						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
 					</view>
 				</view>
-			</view>
+			</view> -->
+			
+			<view class="cu-item deviceTypeItem"  @tap="goVideoList()">
+				<view class="cu-avatar round lg" style="background-image:url(../../static/square-video.png)"></view>
+				<view class="content">
+					<view class="">视频</view>
+				</view>
+				<view class="nav-right num">
+					<view class="text-grey">
+						共{{videoDeviceCount}}个设备
+						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
+					</view>
+				</view>
+			</view>
+			<view class="cu-item deviceTypeItem" @tap="goDeviceManage()">
+				<view class="cu-avatar round lg" style="background-image:url(../../static/square-dl.png)"></view>
+				<view class="content">
+					<view class="">电力监测</view>
+				</view>
+				<view class="nav-right num">
+					<view class="text-grey">
+						共{{powerDeviceCount}}个设备
+						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
+					</view>
+				</view>
+			</view>
+			
 		</view>
 	</view>
 </template>
@@ -22,57 +48,100 @@
 <script>
 	export default {
 		data() {
-			return {
-				deviceData: [{
-						imgUrl: '../../static/square-video.png',
-						title: '视频',
-						num: 6
-					}, {
-						imgUrl: '../../static/square-dl.png',
-						title: '电力监测',
-						num: 11
-					}
-
-				],
+			return {
+				
+				powerDeviceCount:'',
+				videoDeviceCount:'',
+				companyCode:'',	
+				// deviceData: [{
+				// 		imgUrl: '../../static/square-video.png',
+				// 		title: '视频',
+				// 		num: 6
+				// 	}, {
+				// 		imgUrl: '../../static/square-dl.png',
+				// 		title: '电力监测',
+				// 		num: 11
+				// 	}
+				// ],
 
 				modalName: null,
 
 			};
-		},
-		methods: {
-			// goDeviceManage() {
-			// 	uni.navigateTo({
-			// 		url: '/pages/deviceManage/deviceManage',
-			// 		success: res => {},
-			// 		fail: () => {},
-			// 		complete: () => {}
-			// 	});
-			// },
-			hrefKing(index) {
-			                // log(index)
-			                let url = "";
-			                switch (index) {
-			                    case 0:
-			                        url = "/pages/videoList/videoList"//进口水果
-			                        break;
-			                    case 1:
-			                        url = "/pages/deviceManage/deviceManage"//热门品种
-			                        break;
-			                    
-			                    default:
-			                        break;
-			                }
-			                if (url) {
-			                    uni.navigateTo({
-			                        url: url
-			                    })
-			                } else {
-			                    uni.showToast({
-			                        title:'功能未完成~',
-			                        icon:'none'
-			                    })
-			                }
-			            },
+		},
+		onLoad:function(option){
+			console.log(111)
+			console.log(option.companyCode)
+			this.companyCode=option.companyCode
+			this.getSiteType(option.companyCode)
+		},
+		
+	
+		methods: {
+
+			async getSiteType(ming) {
+				const res= await this.$myRequest({
+					url:'OperationMonitoring/getDeviceStatistics',
+					data:{
+						"companyCode": ming,
+						
+					}
+				})
+				console.log(res.data.data[0])
+				this.powerDeviceCount= res.data.data[0].powerDeviceCount
+				this.videoDeviceCount= res.data.data[0].videoDeviceCount
+				
+			},
+			
+			goDeviceManage(item){
+				if(this.powerDeviceCount){
+					uni.navigateTo({
+						url: '/pages/deviceManage/deviceManage?deviceType=1&companyCode='+this.companyCode+'',
+						success: res => {},
+						fail: () => {},
+						complete: () => {}
+					});
+				}
+				
+			},
+			
+			goVideoList(item){
+				if(this.videoDeviceCount){
+					uni.navigateTo({
+						url: '/pages/videoList/videoList?deviceType=2&companyCode='+this.companyCode+'',
+						success: res => {},
+						fail: () => {},
+						complete: () => {}
+					});
+				}
+				
+			},
+			
+
+			hrefKing(index) {
+				// log(index)
+				let url = "";
+				switch (index) {
+					case 0:
+						url = "/pages/videoList/videoList" //进口水果
+						break;
+					case 1:
+						url = "/pages/deviceManage/deviceManage" //热门品种
+						break;
+
+					default:
+						break;
+				}
+				if (url) {
+					uni.navigateTo({
+						url: url
+					})
+				} else {
+					uni.showToast({
+						title: '功能未完成~',
+						icon: 'none'
+					})
+				}
+			},
 
 
 

+ 1 - 1
pages/index/components/chart/chart.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="content">
+	<view class="content" 	>
 		<view @click="echarts.onClick" :prop="option" :change:prop="echarts.updateEcharts" id="echarts" class="echarts"></view>
 
 	</view>

+ 1 - 1
pages/index/index.vue

@@ -21,7 +21,7 @@
 			</view>
 			<view class="time text-center">统计时段:{{staticData.statisticalPeriod}}
 			</view>
-			<view>
+			<view style="height:570rpx">
 				<view v-if="Inv == 0">
 					<chart :bindData="staticData" v-if="hackReset"></chart>
 				</view>

+ 87 - 38
pages/processList/processList.vue

@@ -5,18 +5,19 @@
 			<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" >{{alarmUntreatedCount}}</block>
-					</view> -->
-					{{tabNav[index]}}
+					<view v-if="TabCur==index" class="cu-tag badge" >
+						<block class="cu-tag badge" >{{TabCur?alarmUntreatedCount1:alarmUntreatedCount}}  </block>
+					</view>
+					{{item}}
 				</view>
 			</scroll-view>
 		</view>
 
 		<block v-if="TabCur==0">
-			<view class="processList">
-				<view class="cu-list menu-avatar ">
-					<view class="cu-item" v-for="(item,index) in unporcessList" :key="item.id">
+			<view class="processList">
+				<!-- {{alarmUntreatedCount}} -->
+				<view class="cu-list menu-avatar"  >
+					<view class="cu-item" v-if="alarmUntreatedCount !=0" v-for="(item,index) in unporcessList" :key="item.id">
 						<view class="cu-avatar lg" style="background-image:url(../../static/process-icon.png);"></view>
 						<view class="content">
 							<view class="pro-title">
@@ -31,16 +32,19 @@
 						</view>
 						<view class="action" style="z-index:99">
 							<view class="unProcess" v-if="type==1" @tap="goUnprocessDetail(item.id)">未处理</view>
-<!-- 							<view class="unProcess" v-else @tap="goVideoUnprocessDetail">未处理</view>
- -->						</view>
+							<view class="unProcess" v-else @tap="goVideoUnprocessDetail(item.id)">未处理</view>
+						</view>
 					</view>
+					<view class="cu-item" v-else>暂无数据</view>
 				</view>
+			
 			</view>
 		</block>
 		<block v-if="TabCur==1">
-			<view class="processList">
-				<view class="cu-list menu-avatar ">
-					<view class="cu-item" v-for="(item,index) in unporcessList" :key="index">
+			<view class="processList">
+				<!-- {{alarmUntreatedCount1}} -->
+				<view class="cu-list menu-avatar " >
+					<view class="cu-item" v-if="alarmUntreatedCount1 != 0" v-for="(item,index) in porcessedList" :key="index">
 						<view class="cu-avatar lg" style="background-image:url(../../static/processed-icon.png);"></view>
 						<view class="content">
 							<view class="pro-title">
@@ -55,10 +59,13 @@
 						</view>
 						<view class="action" style="z-index:99">
 							<view class="processed" v-if="type==1" @tap="goProcessedDetail(item.id)">已处理</view>
-							<view class="processed" v-else @tap="goVideoProcessedDetail">已处理</view>
+							<view class="processed" v-else @tap="goVideoProcessedDetail(item.id)">已处理</view>
 						</view>
 					</view>
-				</view>
+					<view class="cu-item"   v-else>暂无数据...</view>
+				</view>
+				
+				
 			</view>
 		</block>
 
@@ -71,7 +78,8 @@
 		data() {
 			return {
 				// unporcessList: json.unprocessList,
-				unporcessList:[],
+				unporcessList:[],
+				porcessedList:[],
 			
 
 				type: '0',
@@ -82,7 +90,8 @@
 				TabCur: 0,
 				tabNav: ['未处理', '已处理'],
 				companyCode:'',
-				alarmUntreatedCount:'',
+				alarmUntreatedCount:0,
+				alarmUntreatedCount1:0,
 				processingStatus:''
 			};
 		},
@@ -99,41 +108,88 @@
 					title: '视频告警'
 				});
 			}
-			
+			this.getProcessData({"companyCode":option.companyCode,"type":option.type,"processingStatus":"0"},0);
+			console.log('onload里')
 			
 			this.companyCode = option.companyCode;
 			this.processingStatus=1
-			this.type = 1;
-			this.getProcessData({"companyCode":option.companyCode,"type":option.type,"processingStatus":"0"});
+			this.type = option.type;
 		},
 		methods: {
-			async getProcessData(ming={}) {
+			
+			
+			
+			
+			
+			async getProcessData(ming={},whichTab) {
+				
+				
+				// uni.request({
+				//     url: 'https://iot.usky.cn/USKYOF/USKYOF.php/Home/IntegratedAlarm/getElectricAlarmUntreated',
+				// 	data:ming,
+				//     success: (res) => {
+				//         console.log(res.data);
+						
+				// 		if(whichTab == 0){
+				// 			this.unporcessList=res.data.data;
+				// 			this.alarmUntreatedCount=res.data.alarmUntreatedCount
+				// 		}else{
+				// 			this.porcessedList=res.data.data;
+				// 			this.alarmUntreatedCount1=res.data.alarmUntreatedCount
+							
+				// 		}
+				//     }
+				// });
+				
+				
+				
 				const res= await this.$myRequest({
 					url:'IntegratedAlarm/getElectricAlarmUntreated',
-					data:ming
+					data:ming,
+					
 				})
-				this.unporcessList=res.data.data;
-				this.alarmUntreatedCount=res.data.alarmUntreatedCount
-				  console.log(res.data)
+				
+				if(whichTab == 0){
+					this.unporcessList=res.data.data;
+					this.alarmUntreatedCount=res.data.alarmUntreatedCount
+				}else{
+					this.porcessedList=res.data.data;
+					this.alarmUntreatedCount1=res.data.alarmUntreatedCount
+					
+				}
+				
+				
+				//   console.log(res.data)
 			},
 
 			tabSelect(e) {
+				
 				console.log(e.currentTarget);
 				this.TabCur = e.currentTarget.dataset.id;
 				this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
-				this.getProcessData({"companyCode":this.companyCode,"type":"1","processingStatus":e.currentTarget.dataset.id});
+				
+				this.getProcessData({"companyCode":this.companyCode,"type":this.type,"processingStatus":e.currentTarget.dataset.id},this.TabCur);
+				
+			
+			
 			},
 
 			// 页面跳转
-			goUnprocessDetail(id) {
-	
-			
+			goUnprocessDetail(id) {
 				uni.navigateTo({
 					url: '/pages/unprocessDetail/unprocessDetail?companyCode='+this.companyCode+'&processingStatus=0&id='+id+'&type=1',
 					success: res => {},
 					fail: () => {},
 					complete: () => {}
 				});
+			},
+			goVideoUnprocessDetail(id) {
+				uni.navigateTo({
+					url: '/pages/unprocessDetail/unprocessDetail?companyCode='+this.companyCode+'&processingStatus=0&id='+id+'&type=2',
+					success: res => {},
+					fail: () => {},
+					complete: () => {}
+				});
 			},
 			goProcessedDetail(id) {
 				uni.navigateTo({
@@ -143,17 +199,10 @@
 					complete: () => {}
 				});
 			},
-			goVideoUnprocessDetail() {
-				uni.navigateTo({
-					url: '/pages/unprocessDetail/unprocessDetail?type=2',
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
-			},
-			goVideoProcessedDetail() {
+			
+			goVideoProcessedDetail(id) {
 				uni.navigateTo({
-					url: '/pages/processedDetail/processedDetail?type=2',
+					url: '/pages/processedDetail/processedDetail?companyCode='+this.companyCode+'&processingStatus='+this.processingStatus+'&id='+id+'&type=2',
 					success: res => {},
 					fail: () => {},
 					complete: () => {}

+ 28 - 16
pages/processedDetail/processedDetail.vue

@@ -73,7 +73,7 @@
 					</view>
 					<view>
 						<text>处理内容:</text>   
-						<text>{{detailMessage.handlerTime}}</text>
+						<text>{{detailMessage.handlerContent}}</text>
 					</view>
 			
 				</view>
@@ -93,16 +93,16 @@
 				<view class="info-content">
 					<view class="info-one-info ">
 						<text>设备名称:</text>
-						<text>火点侦测摄像机</text>
+						<text>{{detailMessage2.deviceName}}</text>
 					</view>
 					
 					<view>
-						<text>设备地址:</text>
-						<text>上海市虹口区塘沽路伍继办公室</text>
+						<text>设备地址:</text> 
+						<text>{{detailMessage2.deviceAddress}}</text>
 					</view>
 					<view>
 						<text>告警信息:</text>
-						<text>火点/高温检测告警</text>
+						<text>{{detailMessage2.alarmInformation}}</text>
 					</view>
 				</view>
 			</view>
@@ -114,7 +114,7 @@
 					报警当前情况截图
 				</view>
 				<view class="info-content padding-lr-lg">
-					<image src="../../static/video-img.png" style="width:100%"></image>
+					<image :src="detailMessage2.alarmPicture" style="width:100%"></image>
 				</view>
 			</view>
 			<!-- 报警当前情况截图end -->
@@ -127,19 +127,19 @@
 				<view class="info-content">
 					<view class="info-one-info ">
 						<text>是否误报:</text>
-						<text>误报</text>
+						<text>{{detailMessage2.alarmStatus?'误报':'非误报'}}</text>
 					</view>
 					<view>
 						<text>处理人:</text>
-						<text>13262908415</text>
+						<text>{{detailMessage2.handler}}</text>
 					</view>
 					<view>
 						<text>处理时间:</text>
-						<text>2021-01-27 09:41:12</text>
+						<text>{{detailMessage2.handlerTime}}</text>
 					</view>
 					<view>
 						<text>处理内容:</text>
-						<text>测试</text>
+						<text>{{detailMessage2.handlerContent}}</text>
 					</view>
 				</view>
 			</view>
@@ -158,7 +158,8 @@
 				radio: 'B',
 				modalName: null,
 				type: '0',
-				detailMessage:{}
+				detailMessage:{},
+				detailMessage2:{}
 			}
 		},
 		onLoad: function(option) {
@@ -166,7 +167,13 @@
 			this.companyCode = option.companyCode;
 			this.processingStatus=option.processingStatus;
 			this.alarmId = option.id;
-			this.getUnProcessDetail({"companyCode":option.companyCode,"processingStatus":option.processingStatus,"alarmId":option.id})
+			if(this.type==1){
+				this.getUnProcessDetail({"companyCode":option.companyCode,"processingStatus":option.processingStatus,"alarmId":option.id})
+			}else{
+				this.getVideoDetail({"companyCode":option.companyCode,"processingStatus":option.processingStatus,"alarmId":option.id})
+			}
+			
+			
 		},
 		methods: {
 			async getUnProcessDetail(ming={}) {
@@ -174,11 +181,18 @@
 					url:'IntegratedAlarm/getPowerAlarmDetails',
 					data:ming
 				})
-				// this.unporcessList=res.data.data;
-				// this.alarmUntreatedCount=res.data.alarmUntreatedCount
 				  console.log(res.data.data[0]);
 				  this.detailMessage=res.data.data[0]
 			},
+			async getVideoDetail(ming={}) {
+				const res= await this.$myRequest({
+					url:'IntegratedAlarm/getVideoAlarmDetails',
+					data:ming
+				})
+				  console.log(res.data.data[0]);
+				  this.detailMessage2=res.data.data[0]
+			},
+			
 			submit() {
 				uni.makePhoneCall({
 					phoneNumber: '15122423833' //仅为示例
@@ -228,12 +242,10 @@
 		height: 88rpx;
 		background: #EFF4FF;
 		line-height: 88rpx;
-
 		.time {
 			color: #333
 		}
 	}
-
 	.info-tit {
 		color: #4074E7;
 		line-height: 90rpx;

+ 24 - 5
pages/siteDetail/siteDetail.vue

@@ -12,24 +12,24 @@
 				<view class="info-content">
 					<view class="info-one-info ">
 						<text>站点名称:</text>
-						<text>火点侦测摄像机</text>
+						<text>{{data.siteName}}</text>
 					</view>
 					
 					<view>
 						<text>地址:</text>
-						<text>上海市虹口区塘沽路伍继办公室</text>
+						<text>{{data.address}}</text>
 					</view>
 					<view>
 						<text>定位:</text>
-						<text>定位地址信息</text>
+						<text>{{data.longitude}} , {{data.latitude}}</text>
 					</view>
 					<view>
 						<text>联系人:</text>
-						<text>韩正义</text>
+						<text>{{data.userName}}</text>
 					</view>
 					<view>
 						<text>联系电话:</text>
-						<text>13262908433</text>
+						<text>{{data.phone}}</text>
 					</view>
 				</view>
 			</view>
@@ -48,12 +48,31 @@
 				radio: 'A',
 				radio: 'B',
 				modalName: null,
+				data:{}
 		
 			}
 		},
+		onLoad(option) {
+		
+			console.log(option.id)
+			this.getData({"id":option.id})
+		
+		},
 		
 		methods: {
 			
+			async getData(ming) {
+				const res= await this.$myRequest({
+					url:'SiteManagement/getSiteList',
+					data:ming
+				})
+				console.log(res.data.data[0])
+				this.data=res.data.data[0]
+				// this.cuIconList=res.data.data   videoMonitoringCount
+				
+				
+			},
+			
 			submit() {
 				uni.makePhoneCall({
 					phoneNumber: '15122423833' //仅为示例

+ 60 - 33
pages/siteList/siteList.vue

@@ -24,18 +24,21 @@
 				 :key="index" :data-target="'move-box-' + index">
 					<view class="cu-avatar round lg" v-if="type==1" style="background-image: url(../../static/site-icon-alarm.png);"></view>
 					<view class="cu-avatar round lg" v-else style="background-image: url(../../static/site-icon.png);"></view>
-					<view class="content" v-if="type==1" @tap="goAlarmingList">
+					<view class="content" v-if="type==1" @tap="goAlarmingList()">
 						<view class="text-grey site-tit">
 							{{item.siteName}}
 							<text>(共3个未处理告警)</text>
 						</view>
 					</view>
-					<view class="content" v-else @tap="goDeviceType" @longpress="showDetail(item)">
+					<view class="content" v-else @tap="goDeviceType(item)" @longpress="showDetail(item)">
 						<view class="text-grey site-tit">
-							{{item.siteName}}
-							<text>(共3个设备)</text>
+							<text style="width:260rpx;" class="inOneLine">{{item.siteName}}</text>
+							
+							<text style="font-size:28rpx;text-align:right"> 
+							   ( 共{{item.count}}个未处理告警 )
+							</text>
 						</view>
-						<view class="showDetail" v-if="item.isShow" @tap.stop="goSiteDetail" >查看详情</view>
+						<view class="showDetail" v-if="item.isShow" @tap.stop="goSiteDetail(item)" >查看详情</view>
 					</view>
 					<view class="nav-right num">
 						<view class="text-grey">
@@ -59,7 +62,7 @@
 		data() {
 			return {
 				type: '0',
-				siteListData: json.siteListData,
+				siteListData: [],
 				modalName: null,
 				listTouchStart: 0,
 				listTouchDirection: null,
@@ -84,6 +87,7 @@
 
 		},
 		
+		
 		mounted() {
 			document.addEventListener('click', (e) => {
 				if (e.target.className != 'showDetail') {
@@ -93,9 +97,22 @@
 				}
 			})
 		},
+		onLoad(){
+			this.getSiteList()
+		},
 
-	
-		methods: {
+		methods: {
+			
+			
+			async getSiteList() {
+				const res= await this.$myRequest({
+					url:'OperationMonitoring/getSiteList',
+				})
+				console.log(res.data.data)
+				this.siteListData=res.data.data
+			},
+			
+			
 			// 隐藏显示
 			showDetail(e) {
 				// 存储点击那一项的状态
@@ -115,42 +132,52 @@
 			},
 
 
-
-			// 页面跳转
-			goAlarmingList() {
-				uni.navigateTo({
-					url: '/pages/alarmingList/alarmingList',
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
-			},
-			goDeviceType() {
-				uni.navigateTo({
-					url: '/pages/deviceType/deviceType',
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
-				});
+			goDeviceType(item) {
+				if(item.count){
+					uni.navigateTo({
+						url: '/pages/deviceType/deviceType?companyCode='+item.companyCode,
+						success: res => {},
+						fail: () => {},
+						complete: () => {}
+					});
+				}
+				
 			},
-			goSiteDetail() {
+			goSiteDetail(item) {
 				uni.navigateTo({
-					url: '/pages/siteDetail/siteDetail',
+					url: '/pages/siteDetail/siteDetail?id='+item.id+'',
 					success: res => {},
 					fail: () => {},
 					complete: () => {}
 				});
 			},
-
-
-
-
-
 		}
 
 	}
 </script>
 
-<style>
+<style>
+	
+	.showDetail {
+		position: absolute;
+		background: #fff;
+		box-shadow: 0 1px 6px 0 rgb(32 33 36 / 28%);
+		padding: 0rpx 32rpx;
+		border-radius: 10rpx;
+		top: 42rpx;
+		right: 45%;
+		z-index: 3000000;
+		font-size: 28rpx;
+	
+	}
+	
+	*:not(input) {
+	    -webkit-touch-callout: none;
+	    -webkit-user-select: none;
+	    -khtml-user-select: none;
+	    -moz-user-select: none;
+	    -ms-user-select: none;
+	    user-select: none;
+	}
 	
 </style>

+ 0 - 3
pages/siteListAlarming/siteListAlarming.vue

@@ -44,9 +44,6 @@
 			async getSiteList() {
 				const res= await this.$myRequest({
 					url:'IntegratedAlarm/getSiteList',
-					// data:{
-					// 	"companyCode": "13"
-					// }
 				})
 				console.log(res.data.data)
 				this.siteListData=res.data.data

+ 61 - 20
pages/unprocessDetail/unprocessDetail.vue

@@ -3,7 +3,8 @@
 		<view class="timeBox flex justify-between align-center padding-lr-sm">
 			<view class="time">2021-01-18 15:16:45</view>
 			<button class="cu-btn radius bg-red sm">未处理</button>
-		</view>
+		</view>
+		<!-- 电力start -->
 		<view v-if="type==1">
 			<view class="basic-info" >
 				<view class="info-tit margin-left-xs">
@@ -66,13 +67,13 @@
 					<form action="">
 						<view class="cu-form-group">
 							<!-- <textarea maxlength="-1" :disabled="modalName!=null" @input="textareaAInput" placeholder="备注信息,最多可输入50个字..."></textarea>-->
-							<textarea class="JTxtArea lg" placeholder="备注信息,最多可输入50个字..." :maxlength="50" :data-maxnum="reason.length+'/50'"
-							 auto-height v-model="reason"></textarea>
+							<textarea class="JTxtArea lg" v-model="msg" placeholder="备注信息,最多可输入50个字..." :maxlength="50" :data-maxnum="reason.length+'/50'"
+							 auto-height ></textarea>
 						</view>
 			
 						<view class="btn-area">
 							<!-- <button class="bg-orange round missReport margin-top">误 报 </button> -->
-							<button class="bg-blue round  missReport margin-top ">告警确认 </button>
+							<button class="bg-blue round  missReport margin-top" @click="powerSubmit()">告警确认 </button>
 						</view>
 			
 					</form>
@@ -83,6 +84,8 @@
 			</view>
 			<!-- 处理状态end -->
 		</view>
+		<!-- 电力end-->
+		
 		
 		<view v-else>
 			<view class="basic-info">
@@ -93,16 +96,16 @@
 				<view class="info-content">
 					<view class="info-one-info ">
 						<text>设备名称:</text>
-						<text>{{detailMessage.deviceName}}</text> 
+						<text>{{detailMessage2.deviceName}}</text> 
 					</view>
 					
 					<view>
 						<text>设备地址:</text>
-						<text>{{detailMessage.address}}</text>
+						<text>{{detailMessage2.deviceAddress}}</text>
 					</view>
 					<view>
 						<text>告警信息:</text>
-						<text>{{detailMessage.address}}</text>
+						<text>{{detailMessage2.alarmInformation}}</text>
 					</view>
 				</view>
 			</view>
@@ -113,7 +116,7 @@
 					报警当前情况截图
 				</view>
 				<view class="info-content padding-lr-lg">
-					<image src="../../static/video-img.png" style="width:100%"></image>
+					<image :src="detailMessage2.alarmPicture" style="width:100%"></image>
 				</view>
 			</view>
 			<!-- 报警当前情况截图end -->
@@ -139,11 +142,11 @@
 						<view class="cu-form-group">
 							<!-- <textarea maxlength="-1" :disabled="modalName!=null" @input="textareaAInput" placeholder="备注信息,最多可输入50个字..."></textarea>-->
 							<textarea class="JTxtArea lg" placeholder="备注信息,最多可输入50个字..." :maxlength="50" :data-maxnum="reason.length+'/50'"
-							 auto-height v-model="reason"></textarea>
+							 auto-height v-model="msg2"></textarea>
 						</view>
 						<view class="btn-area">
-							<button class="bg-orange round missReport margin-top">误 报 </button>
-							<button class="bg-blue round  missReport margin-top ">告警确认 </button>
+							<button class="bg-orange round missReport margin-top" @click="videoMissSubmit()">误 报 </button>
+							<button class="bg-blue round  missReport margin-top " @click="videoSubmit()">告警确认 </button>
 						</view>
 					</form>
 			
@@ -168,9 +171,13 @@
 				radio: 'A',
 				radio: 'B',
 				modalName: null,
-				reason: '',
+				reason:'',
 				type: '0',
-				detailMessage:{}
+				detailMessage:{},
+				detailMessage2:{},
+				msg:'',
+				msg2:''
+				
 			}
 		},
 		onLoad: function(option) {
@@ -178,28 +185,62 @@
 			this.companyCode = option.companyCode;
 			this.processingStatus=option.processingStatus;
 			this.alarmId = option.id;
-			this.getUnProcessDetail({"companyCode":option.companyCode,"processingStatus":option.processingStatus,"alarmId":option.id})
+			if(this.type==1){
+				this.getUnProcessDetail({"companyCode":option.companyCode,"processingStatus":option.processingStatus,"alarmId":option.id})
+			}else{
+				this.getUnProcessDetail2({"companyCode":option.companyCode,"processingStatus":option.processingStatus,"alarmId":option.id})
+				
+			}
+			
 		},
 		methods: {
-			
-			
-			async getUnProcessDetail(ming={}) {
+
+			async getUnProcessDetail(ming={}) {  //电力未处理详情接口
 				const res= await this.$myRequest({
 					url:'IntegratedAlarm/getPowerAlarmDetails',
 					data:ming
 				})
-				// this.unporcessList=res.data.data;
-				// this.alarmUntreatedCount=res.data.alarmUntreatedCount
 				  console.log(res.data.data[0]);
 				  this.detailMessage=res.data.data[0]
 			},
 			
+			async getUnProcessDetail2(ming={}) {  //电力未处理详情接口
+				const res= await this.$myRequest({
+					url:'IntegratedAlarm/getVideoAlarmDetails',
+					data:ming
+				})
+				  console.log(res.data.data[0]);
+				  this.detailMessage2=res.data.data[0]
+			},
+			
+			async powerSubmitRes(ming={}) { 
+				const res= await this.$myRequest({
+					url:'IntegratedAlarm/setAlarmHandle',
+					data:ming
+				})
+			},
+			
+			powerSubmit(){
+				
+				this.powerSubmitRes({"type":1,"deviceCode":this.detailMessage.deviceCode,"companyCode":this.companyCode,"id":this.detailMessage.id,"handlerContent":this.msg})
+			alert(成功)
+			},
+			videoSubmit(){
+				alert(1)
+				this.powerSubmitRes({"alarmStatus":0,"type":2,"deviceCode":this.detailMessage2.deviceCode,"companyCode":this.companyCode,"id":this.detailMessage2.id,"handlerContent":this.msg2})
+			},
+			videoMissSubmit(){
+				alert(1)
+				this.powerSubmitRes({"alarmStatus":1,"type":2,"deviceCode":this.detailMessage2.deviceCode,"companyCode":this.companyCode,"id":this.detailMessage2.id,"handlerContent":this.msg2})
+			},
+			
 			
 			submit() {
 				uni.makePhoneCall({
 					phoneNumber: '15122423833' //仅为示例
 				});
-			},
+			},
+			
 			mapLocation() {
 				uni.openLocation({
 					latitude: parseInt(this.detailMessage.latitude),

+ 32 - 15
pages/videoDetail/videoDetail.vue

@@ -10,28 +10,28 @@
 			</view>
 			<view class="info-content">
 				<view class="info-one-info ">
-					<text>设备类型:</text>
-					<text>视频监控</text>
+					<text>设备名称:</text>
+					<text>{{videoDetail.deviceName}}</text>
 				</view>
 				<view>
 					<text>设备编号:</text>
-					<text>YTVA00001</text>
+					<text>{{videoDetail.deviceCode}}</text>
 				</view>
 				<view>
 					<text style="width:auto!important">物联网卡号:</text>
-					<text></text>
+					<text>{{videoDetail.sim}}</text>
 				</view>
 				<view>
 					<text>安装位置:</text>
-					<text>伍继办公室</text>
+					<text>{{videoDetail.deviceInstallationPosition}}</text>
 				</view>
 				<view>
 					<text>添加时间:</text>
-					<text>2019-05-28 16:12:45</text>
+					<text>{{videoDetail.addTime}}</text>
 				</view>
 				<view>
 					<text>设备地址:</text>
-					<text>上海市虹口区塘沽路</text>
+					<text>{{videoDetail.address}}</text>
 				</view>
 			</view>
 		</view>
@@ -56,17 +56,34 @@
 	export default {
 		data() {
 			return {
-				
+				videoDetail:''
 			
 			}
 		},
-		methods: {
-			
-			
-
-			
-
-
+		onLoad:function(option){
+			
+		
+			console.log(111)
+			console.log(option.companyCode)
+			this.companyCode=option.companyCode
+			this.deviceType=option.deviceType
+			this.getDeviceDetail({"companyCode":option.companyCode,"deviceType":option.deviceType,"deviceCode":option.deviceCode})
+		},
+		
+		
+		methods: {
+			
+			async getDeviceDetail(ming={}) {
+				const res= await this.$myRequest({
+					url:'OperationMonitoring/getMonitoringScreen',
+					data:ming
+				})
+				console.log(res.data.data[0])
+				this.videoDetail=res.data.data[0]
+				// this.powerDeviceCount= res.data.data[0].powerDeviceCount
+				// this.videoDeviceCount= res.data.data[0].videoDeviceCount
+				
+			},
 		}
 	}
 </script>

+ 41 - 33
pages/videoList/videoList.vue

@@ -3,24 +3,28 @@
 	<view class="">
 		<view class="cu-list menu-avatar">
 			<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in deviceData"
-			 :key="index" :data-target="'move-box-' + index" @tap="goVideoDetail">
-				<view class="cu-avatar round lg" :style="`background-image:url(${item.imgUrl})`" style="opacity:.7"></view>
+			 :key="index" :data-target="'move-box-' + index" @tap="goVideoDetail(item)">
+				<view class="cu-avatar round lg" style="background-image:url(../../static/video-icon-off.png);opacity:.7" ></view>
 				<view class="content">
-					<view class="">{{item.title}}</view>
+					<view class="">{{item.deviceName}}</view>
 				</view>
-				<view class="nav-right num">
-					<view v-if="item.status=='在线'" class="online" >
-						{{item.status}}
+				<view class="nav-right num">
+					<view class="online" >
+						{{item.trueStatus?'离线':'在线'}}
+						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
+					</view>
+					<!-- <view v-if="item.status=='在线'" class="online" >
+						{{item.trueStatus}}
 						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
 					</view>
 					<view v-else-if="item.status=='离线'" class="text-gray" >
-						{{item.status}}
+						{{item.trueStatus}}
 						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
 					</view>
 					<view v-else="item.status=='异常'" class="error" >
-						{{item.status}}
+						{{item.trueStatus}}
 						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
-					</view>
+					</view> -->
 				</view>
 			</view>
 		</view>
@@ -31,35 +35,39 @@
 	export default {
 		data() {
 			return {
-				deviceData: [{
-						status: '离线',
-						imgUrl: '../../static/video-icon-off.png',
-						title: 'C59360332',
-						num: 6
-					}, {
-						status: '在线',
-						imgUrl: '../../static/video-icon-on.png',
-						title: 'C59360332',
-						num: 11
-					},
-					{
-						status: '异常',
-						imgUrl: '../../static/video-icon-error.png',
-						title: 'C59360332',
-						num: 6
-					}
+				deviceData: [
 				],
 				modalName: null,
 
 			};
+		},
+		onLoad:function(option){
+			console.log(111)
+			console.log(option.companyCode)
+			this.companyCode=option.companyCode
+			this.deviceType=option.deviceType
+			this.getDeviceManage({"companyCode":option.companyCode,"deviceType":option.deviceType})
 		},
-		methods: {
-			goVideoDetail() {
-				uni.navigateTo({
-					url: '/pages/videoDetail/videoDetail',
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
+		methods: {
+			
+			async getDeviceManage(ming={}) {
+				const res= await this.$myRequest({
+					url:'OperationMonitoring/getDeviceList',
+					data:ming
+				})
+				console.log(res.data.data)
+				this.deviceData=res.data.data
+				// this.powerDeviceCount= res.data.data[0].powerDeviceCount
+				// this.videoDeviceCount= res.data.data[0].videoDeviceCount
+				
+			},
+			
+			goVideoDetail(item) {
+				uni.navigateTo({
+					url: '/pages/videoDetail/videoDetail?deviceType=2&companyCode='+this.companyCode+'&deviceCode='+item.deviceCode+'',
+					success: res => {},
+					fail: () => {},
+					complete: () => {}
 				});
 			},
 

+ 20 - 2
util/api.js

@@ -1,6 +1,16 @@
-const BASE_URL = 'https://iot.usky.cn/USKYOF/USKYOF.php/Home/'
+// const BASE_URL = 'https://iot.usky.cn/USKYOF/USKYOF.php/Home/'
+const BASE_URL='https://qhome.usky.cn/USKYOF/USKYOF.php/Home/'
+// 同时发送异步代码的次数,防止一次点击中有多次请求,用于处理
+let ajaxTimes = 0;
 
 export const myRequest = (options) => {
+
+	ajaxTimes++;
+	// 显示加载中 效果
+	uni.showLoading({
+		title: "加载中",
+		mask: true,
+	});
 	return new Promise((resolve, reject) => {
 		uni.request({
 			url: BASE_URL + options.url,
@@ -10,6 +20,7 @@ export const myRequest = (options) => {
 				'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
 			},
 			success: (res) => {
+				console.log('success里')
 				if (res.data.flag == false) { //登录失效
 					return uni.showToast({
 						title: '获取数据失败',
@@ -20,10 +31,17 @@ export const myRequest = (options) => {
 			fail: (err) => {
 				uni.showToast({
 					title: '请求接口失败',
-
 				})
 				reject(err)
 
+			},
+			// 完成之后关闭加载效果
+			complete: () => {
+				ajaxTimes--;
+				if (ajaxTimes === 0) {
+					//  关闭正在等待的图标
+					uni.hideLoading();
+				}
 			}
 		})
 	})