Ming 4 سال پیش
والد
کامیت
3b7b031ba1

+ 94 - 14
data/json.js

@@ -1,5 +1,72 @@
 // 本地模拟json数据
 // 首页九宫格
+let cuIconList=[{
+						imgUrl: '../../static/square1.png',
+						badge: 120,
+						name: '综合报警',
+						redirectUrl: '/pages/siteList/siteList?type=1'
+					}, {
+						imgUrl: '../../static/square2.png',
+						badge: 0,
+						name: '设备管理',
+						redirectUrl: '/pages/siteList/siteList?type=2'
+					},
+					{
+						imgUrl: '../../static/square-xf.png',
+						badge: 0,
+						name: '消防督查单',
+						redirectUrl: ''
+					},
+					{
+						imgUrl: '../../static/square-xj.png',
+						badge: 0,
+						badge: 0,
+						name: '巡检',
+						redirectUrl: ''
+					},
+					{
+						imgUrl: '../../static/square-bx.png',
+						badge: 0,
+						name: '报修',
+						redirectUrl: ''
+					}, {
+						imgUrl: '../../static/square-wb.png',
+						badge: 0,
+						name: '维保',
+						redirectUrl: ''
+					},
+					{
+						imgUrl: '../../static/square-sp.png',
+						badge: 0,
+						badge: 0,
+						name: '视频监测',
+						redirectUrl: ''
+					},
+					{
+						imgUrl: '../../static/square-bz.png',
+						badge: 0,
+						badge: 0,
+						name: '风险保障',
+						redirectUrl: ''
+					}, {
+						imgUrl: '../../static/square-rl.png',
+						badge: 0,
+						name: '人脸识别',
+						redirectUrl: ''
+					},
+					{
+						imgUrl: '../../static/square-sb.png',
+						badge: 0,
+						name: '设备注册',
+						redirectUrl: ''
+					},
+					{
+						imgUrl: '../../static/square-yh.png',
+						badge: 0,
+						name: '用户管理',
+						redirectUrl: ''
+					}
+				]
 
 // 首页报警数据
 
@@ -143,80 +210,93 @@ let deviceType = [{
 		"id": "1",
 		"title": "火警",
 		"num": "3",
-		"imgUrl": "/static/dt-alarmIcon.png"
+		"imgUrl": "/static/dt-alarmIcon.png",
+		"dwtype":1
 	},
 	{
 		"id": "2",
 		"title": "水警",
 		"num": "4",
-		"imgUrl": "/static/dt-waterIcon.png"
+		"imgUrl": "/static/dt-waterIcon.png",
+		"dwtype":2
 	},
 	{
 		"id": "3",
 		"title": "电气火灾",
 		"num": "4",
-		"imgUrl": "/static/dt-dqIcon.png"
+		"imgUrl": "/static/dt-dqIcon.png",
+		"dwtype":7
 	},
 	{
 		"id": "4",
 		"title": "RTU",
 		"num": "4",
-		"imgUrl": "/static/dt-rtuIcon.png"
+		"imgUrl": "/static/dt-rtuIcon.png",
+		"dwtype":6
 	},
 	{
 		"id": "5",
 		"title": "烟感",
 		"num": "4",
-		"imgUrl": "/static/dt-ygIcon.png"
+		"imgUrl": "/static/dt-ygIcon.png",
+		"dwtype":3
 	},
 	{
 		"id": "6",
 		"title": "视频",
 		"num": "4",
-		"imgUrl": "/static/dt-videoIcon.png"
+		"imgUrl": "/static/dt-videoIcon.png",
+		"dwtype":16
 	},
 {
 		"id": "7",
 		"title": "电梯",
 		"num": "4",
-		"imgUrl": "/static/dt.png"
+		"imgUrl": "/static/dt.png",
+		"dwtype":17
 	},
 	{
 		"id": "8",
 		"title": "井盖",
 		"num": "4",
-		"imgUrl": "/static/dt-jgIcon.png"
+		"imgUrl": "/static/dt-jgIcon.png",
+		"dwtype":128
 	},
 	{
 		"id": "9",
 		"title": "消防栓",
 		"num": "4",
-		"imgUrl": "/static/dt-xfsIcon.png"
+		"imgUrl": "/static/dt-xfsIcon.png",
+		"dwtype":4
 	},
 	
 	{
 		"id": "10",
 		"title": "液位设备",
 		"num": "4",
-		"imgUrl": "/static/dt-ywIcon.png"
+		"imgUrl": "/static/dt-ywIcon.png",
+		"dwtype":5
 	},
 	{
 		"id": "11",
 		"title": "地磁设备",
 		"num": "4",
-		"imgUrl": "/static/dt-dcIcon.png"
+		"imgUrl": "/static/dt-dcIcon.png",
+		"dwtype":129
 	},
 	{
 		"id": "12",
 		"title": "门禁设备",
 		"num": "4",
-		"imgUrl": "/static/dt-mjIcon.png"
+		"imgUrl": "/static/dt-mjIcon.png",
+		"dwtype":130
 	},
 	{
 		"id": "13",
 		"title": "天然气体设备",
 		"num": "4",
-		"imgUrl": "/static/dt-trIcon.png"
+		"imgUrl": "/static/dt-trIcon.png",
+		"dwtype":131
 	},
 	
 ];
@@ -532,7 +612,7 @@ module.exports = {
 
 	staticData: staticData,
 
-	// cuIconList: cuIconList,
+	cuIconList: cuIconList,
 	unprocessList: unprocessList,
 	processedList: processedList,
 	alarmingSquareList: alarmingSquareList,

+ 2 - 9
pages/alarmingList/alarmingList.vue

@@ -35,11 +35,8 @@
 			}
 		},
 		onLoad(option) {
-
-			// console.log(option.companyCode)
-			this.getSiteType(option.companyCode)
+			this.getSiteType(uni.getStorageSync('selectedCode'))
 			this.companyCode=option.companyCode
-
 		},
 		methods: {
 
@@ -50,7 +47,6 @@
 						"company_code": params,
 					}
 				})
-				
 				this.getData=res.data.data[0]
 				this.alarmingSquareList[0].badge=this.getData.untreated_alarm_host_count;
 				this.alarmingSquareList[1].badge=this.getData.untreated_fire_water_count;
@@ -62,15 +58,12 @@
 				this.alarmingSquareList[7].badge=this.getData.untreated_gas_count; //可燃气体
 				this.alarmingSquareList[8].badge=this.getData.untreated_manhole_cover_count;  //井盖
 				this.alarmingSquareList[9].badge=this.getData.untreated_fire_hydrant_count; //消防栓
-				
-				
-
 			},
 
 			// 页面跳转
 			goProcessList(item) {
 					uni.navigateTo({
-						url: '/pages/processList/processList?type='+item.type+'&&companyCode='+this.companyCode,
+						url: '/pages/processList/processList?type='+item.type,
 						success: res => {},
 						fail: () => {},
 						complete: () => {}

+ 106 - 46
pages/device-Manage/device-Manage.vue

@@ -1,69 +1,129 @@
 <template>
 
 	<view class="">
-		<view class="cu-list menu-avatar">
-			<view class="cu-item"  :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in deviceManage"
-			 :key="index" :data-target="'move-box-' + index" @tap="goDeviceDetail(item)">
-				<view class="cu-avatar round lg" style="background-image:url(../../static/device-icon.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.des}}
-						</view>
-					</view>
-					<view class="pro-date ">{{item.time}}111</view>
-				</view>
-				<view class="nav-right num">
-					<view class="text-grey">
-						<span class="online" v-if="item.status==0">在线</span>
-						<span class="offline" v-if="item.status==1">离线</span>
-						<span class="error" v-if="item.status==2">故障</span>
-						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
-					</view>
-				</view>
+		<view class="cu-list menu-avatar">
+			<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
+				v-for="(item,index) in getData" :key="index" :data-target="'move-box-' + index"
+				@tap="goDeviceDetail(item)">
+				<view class="cu-avatar round lg" style="background-image:url(../../static/device-icon.png)"></view>
+				<view class="content">
+					<view class="pro-title">
+						<view class="cut">{{item.owner_name}}</view>
+					</view>
+					<view class="pro-des  ">
+						<view class="text-cut">
+							{{item.unitinfo}}
+						</view>
+					</view>
+					<view class="pro-date ">{{item.install_time}}</view>
+				</view>
+				<view class="nav-right num">
+					<view class="text-grey">
+						<span class="online">{{item.device_state}}</span>
+						<!-- <span class="offline" v-if="item.status==1">离线</span>
+						<span class="error" v-if="item.status==2">故障</span> -->
+						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
+					</view>
+				</view>
 			</view>
 		</view>
 	</view>
 </template>
 
-<script>
+<script>
 	import json from '../../data/json.js';
 	export default {
 		data() {
-			return {
+			return {
 				deviceManage: json.deviceManage,
 				modalName: null,
+				getData:[]
 			};
-		},
-		
-		onLoad:function(option){
-			
-		},
-		onNavigationBarButtonTap(e) {
-			console.log(e)
-			uni.navigateTo({
-				url: '/pages/export/export',
-	
-			});
 		},
-		methods: {
-		
-			// 页面跳转
-			goDeviceDetail(item) {
-				uni.navigateTo({
-					url: '/pages/deviceDetail/deviceDetail',
-				});
+
+		onLoad: function(option) {
+			let url = "";
+			switch (parseInt(option.dwtype)) {
+				case 1:
+					url = "火警"
+					break;
+				case 2:
+					url = "水警"
+					break;
+				case 3:
+					url = "烟感"
+					break;
+				case 4:
+					url = "消防栓监测"
+					break;
+				case 6:
+					url = "RTU测控终端"
+					break;
+				case 7:
+					url = "电气火灾"
+					break;
+				case 16:
+					url = "视频告警"
+					break;
+				case 17:
+					url = "电梯报警"
+					break;
+				case 128:
+					url = "井盖监测"
+					break;
+				case 129:
+					url = "地磁"
+					break;
+				case 130:
+					url = "门磁"
+					break;
+				case 131:
+					url = "可燃气体"
+					break;
+				default:
+					break;
+			}
+			uni.setNavigationBarTitle({
+				title: "设备管理(" + url + ")",
+			});
+			
+			this.getDeviceList({'company_code':uni.getStorageSync('selectedCode'),"dwtype":option.dwtype})
+
+		},
+		onNavigationBarButtonTap(e) {
+			console.log(e)
+			uni.navigateTo({
+				url: '/pages/export/export',
+
+			});
+		},
+		methods: {
+
+			// 页面跳转
+			goDeviceDetail(item) {
+				uni.navigateTo({
+					url: '/pages/deviceDetail/deviceDetail?id='+item.id,
+				});
+			},
+			
+			// 设备类型数据请求
+			async getDeviceList(params = {}) {
+				const res = await this.$myRequest({
+					url: 'DeviceManagement/getDeviceList',
+					data:params,
+					showLoading: true
+				})
+				this.getData=res.data.data;
+				console.log(this.getData);
 			},
+			
 		}
 
 	}
 </script>
 
-<style lang="scss">
-	.cu-item{
-		height:180rpx!important
+<style lang="scss">
+	.cu-item {
+		height: 180rpx !important
 	}
 </style>

+ 4 - 4
pages/deviceDetail/components/chart.vue

@@ -47,7 +47,7 @@
 					},
 
 					title: [{ //aa标题
-						text: '{val|' +(parseInt(this.bindData.wubao)+parseInt(this.bindData.unSolve)+ parseInt(this.bindData.truely))+ '}\n{name|' + title + '}',
+						text: '{val|' +(parseInt(this.bindData.misinformation)+parseInt(this.bindData.unprocessed)+ parseInt(this.bindData.real_alarm))+ '}\n{name|' + title + '}',
 						top: '35%',
 						left: 'center',
 						textStyle: {
@@ -103,15 +103,15 @@
 
 						data: [{
 								name: "误报数",
-								value: this.bindData.wubao
+								value: this.bindData.misinformation
 							},
 							{
 								name: "未解决次数",
-								value: this.bindData.unSolve
+								value: this.bindData.unprocessed
 							},
 							{
 								name: "真实报警",
-								value: this.bindData.truely
+								value: this.bindData.real_alarm
 							},
 
 						],

+ 0 - 342
pages/deviceDetail/components/chart2.vue

@@ -1,342 +0,0 @@
-<template>
-	<view class="content">
-
-		<view @click="echarts.onClick" :prop="option" :change:prop="echarts.updateEcharts" id="echarts2"
-			class="echarts"></view>
-
-	</view>
-</template>
-
-<script>
-	var dwtype = "2";
-	var tes = '0';
-	var tes2 = '';
-	var tyss = "";
-	if (dwtype == 2) {
-		tes = '一周设备数值变化';
-		tes2 = '水压值';
-		tyss = "兆帕";
-	}
-	if (dwtype == 5) {
-		tes = '一周水位值变化 (m)';
-		tes2 = '水位值';
-		tyss = "米";
-		document.getElementById('dev_title_lab').innerHTML = '当前水位:';
-		document.getElementById('dev_title_unit').innerHTML = 'm';
-	}
-
-	export default {
-		props: {
-			bindData: {
-				type: Object,
-				default: ''
-			}
-		},
-		data() {
-			return {
-				option: {
-					title: {
-						x: 'center',
-						text: tes
-					},
-					// tooltip: {
-					//     trigger: 'axis',
-					//     formatter:'{b}<br>{a} : {c} '+tyss+'<br>电量:{a} : {c}'
-					// },
-					tooltip: {
-						trigger: 'axis',
-						axisPointer: {
-							type: 'cross',
-							animation: false,
-							label: {
-								backgroundColor: '#505765'
-							}
-						}
-					},
-
-					grid: {
-						left: '3%',
-						right: '4%',
-						bottom: '3%',
-						containLabel: true
-					},
-					toolbox: {
-						// feature: {
-						//     saveAsImage: {}
-						// }
-					},
-					legend: {
-						data: ['水压/水位(兆帕/米)', '电量/信号(%)'],
-						left: 10
-					},
-					xAxis: {
-						type: 'category',
-						// boundaryGap: false,
-						axisTick: {
-							alignWithLabel: true
-						},
-						data: ["2021-06-11 12:48:19", "2021-06-11 12:18:17", "2021-06-11 11:48:17", "2021-06-11 11:18:17",
-							"2021-06-11 10:48:17", "2021-06-11 10:18:17", "2021-06-11 09:48:17", "2021-06-11 09:18:19",
-							"2021-06-11 08:48:19", "2021-06-11 08:18:19", "2021-06-11 07:48:17", "2021-06-11 07:18:17",
-							"2021-06-11 06:48:17", "2021-06-11 06:18:18", "2021-06-11 05:48:17", "2021-06-11 05:18:18",
-							"2021-06-11 04:48:19", "2021-06-11 04:18:17", "2021-06-11 03:48:17", "2021-06-11 03:18:17",
-							"2021-06-11 02:48:17", "2021-06-11 02:18:17", "2021-06-11 01:48:17", "2021-06-11 01:18:24",
-							"2021-06-11 00:48:17", "2021-06-11 00:18:16", "2021-06-10 23:48:17", "2021-06-10 23:18:17",
-							"2021-06-10 22:48:21", "2021-06-10 22:18:19", "2021-06-10 21:48:17", "2021-06-10 21:18:21",
-							"2021-06-10 20:48:17", "2021-06-10 20:18:16", "2021-06-10 19:48:17", "2021-06-10 19:18:16",
-							"2021-06-10 18:48:17", "2021-06-10 18:18:17", "2021-06-10 17:48:19", "2021-06-10 17:18:19",
-							"2021-06-10 16:48:19", "2021-06-10 16:18:17", "2021-06-10 15:48:18", "2021-06-10 15:18:16",
-							"2021-06-10 14:48:16", "2021-06-10 14:18:17", "2021-06-10 13:48:16", "2021-06-10 13:18:18",
-							"2021-06-10 12:48:17", "2021-06-10 12:18:16", "2021-06-10 11:48:16", "2021-06-10 11:18:16",
-							"2021-06-10 10:48:16", "2021-06-10 10:18:18", "2021-06-10 09:48:16", "2021-06-10 09:18:17",
-							"2021-06-10 08:48:18", "2021-06-10 08:18:16", "2021-06-10 07:48:18", "2021-06-10 07:18:16",
-							"2021-06-10 06:48:16", "2021-06-10 06:18:16", "2021-06-10 05:48:16", "2021-06-10 05:18:16",
-							"2021-06-10 04:48:18", "2021-06-10 04:18:16", "2021-06-10 03:48:18", "2021-06-10 03:18:18",
-							"2021-06-10 02:48:18", "2021-06-10 02:18:16", "2021-06-10 01:48:18", "2021-06-10 01:18:18",
-							"2021-06-10 00:48:18", "2021-06-10 00:18:16", "2021-06-09 23:48:16", "2021-06-09 23:18:16",
-							"2021-06-09 22:48:16", "2021-06-09 22:18:16", "2021-06-09 21:48:18", "2021-06-09 21:18:16",
-							"2021-06-09 20:48:18", "2021-06-09 20:18:16", "2021-06-09 19:48:16", "2021-06-09 19:18:22",
-							"2021-06-09 18:48:15", "2021-06-09 18:18:16", "2021-06-09 17:48:15", "2021-06-09 17:18:18",
-							"2021-06-09 16:48:15", "2021-06-09 16:18:21", "2021-06-09 15:48:18", "2021-06-09 15:18:16",
-							"2021-06-09 14:48:15", "2021-06-09 14:18:15", "2021-06-09 13:48:15", "2021-06-09 13:18:15",
-							"2021-06-09 12:48:15", "2021-06-09 12:18:15", "2021-06-09 11:48:17", "2021-06-09 11:18:16",
-							"2021-06-09 10:48:17", "2021-06-09 10:18:18", "2021-06-09 09:48:18", "2021-06-09 09:18:15",
-							"2021-06-09 08:48:17", "2021-06-09 08:18:15", "2021-06-09 07:48:17", "2021-06-09 07:18:17",
-							"2021-06-09 06:48:17", "2021-06-09 06:18:17", "2021-06-09 05:48:18", "2021-06-09 05:18:17",
-							"2021-06-09 04:48:17", "2021-06-09 04:18:17", "2021-06-09 03:48:17", "2021-06-09 03:18:15",
-							"2021-06-09 02:48:17", "2021-06-09 02:18:18", "2021-06-09 01:48:17", "2021-06-09 01:18:17",
-							"2021-06-09 00:48:18", "2021-06-09 00:18:17", "2021-06-08 23:48:17", "2021-06-08 23:18:17",
-							"2021-06-08 22:48:17", "2021-06-08 22:18:16", "2021-06-08 21:48:15", "2021-06-08 21:18:16",
-							"2021-06-08 20:48:17", "2021-06-08 20:18:14", "2021-06-08 19:48:17", "2021-06-08 19:18:14",
-							"2021-06-08 18:48:25", "2021-06-08 18:18:16", "2021-06-08 17:48:15", "2021-06-08 17:18:16",
-							"2021-06-08 16:48:15", "2021-06-08 16:18:16", "2021-06-08 15:18:14", "2021-06-08 14:48:17",
-							"2021-06-08 14:18:16", "2021-06-08 13:48:19", "2021-06-08 13:18:14", "2021-06-08 12:48:14",
-							"2021-06-08 12:18:19", "2021-06-08 11:48:15", "2021-06-08 11:18:16", "2021-06-08 10:48:14",
-							"2021-06-08 10:18:21", "2021-06-08 09:48:16", "2021-06-08 09:18:16", "2021-06-08 08:48:17",
-							"2021-06-08 08:18:14", "2021-06-08 07:48:16", "2021-06-08 07:18:16", "2021-06-08 06:48:14",
-							"2021-06-08 06:18:17", "2021-06-08 05:48:16", "2021-06-08 05:18:16", "2021-06-08 04:48:17",
-							"2021-06-08 04:18:16", "2021-06-08 03:48:17", "2021-06-08 03:18:17", "2021-06-08 02:48:14",
-							"2021-06-08 02:18:16", "2021-06-08 01:48:16", "2021-06-08 01:18:14", "2021-06-08 00:48:17",
-							"2021-06-08 00:18:16", "2021-06-07 23:48:16", "2021-06-07 23:18:16", "2021-06-07 22:48:16",
-							"2021-06-07 22:18:15", "2021-06-07 21:48:14", "2021-06-07 21:18:16", "2021-06-07 20:48:16",
-							"2021-06-07 20:18:16", "2021-06-07 19:48:14", "2021-06-07 19:18:16", "2021-06-07 18:48:13",
-							"2021-06-07 18:18:16", "2021-06-07 17:48:15", "2021-06-07 17:18:16", "2021-06-07 16:48:17",
-							"2021-06-07 16:18:14", "2021-06-07 15:48:13", "2021-06-07 15:18:16", "2021-06-07 14:48:13",
-							"2021-06-07 14:18:14", "2021-06-07 13:48:15", "2021-06-07 13:18:14", "2021-06-07 12:48:13",
-							"2021-06-07 12:18:15", "2021-06-07 11:48:15", "2021-06-07 11:18:14", "2021-06-07 10:48:16",
-							"2021-06-07 10:18:13", "2021-06-07 09:48:14", "2021-06-07 09:18:14", "2021-06-07 08:48:13",
-							"2021-06-07 08:18:13", "2021-06-07 07:48:16", "2021-06-07 07:18:15", "2021-06-07 06:48:15",
-							"2021-06-07 06:18:16", "2021-06-07 05:48:15", "2021-06-07 05:18:15", "2021-06-07 04:48:13",
-							"2021-06-07 04:18:16", "2021-06-07 03:48:15", "2021-06-07 03:18:15", "2021-06-07 02:48:15",
-							"2021-06-07 02:18:13", "2021-06-07 01:48:15", "2021-06-07 01:18:14", "2021-06-07 00:48:15",
-							"2021-06-07 00:18:18", "2021-06-06 23:48:17", "2021-06-06 23:18:15", "2021-06-06 22:48:13",
-							"2021-06-06 22:18:14", "2021-06-06 21:48:22", "2021-06-06 21:18:18", "2021-06-06 20:48:13",
-							"2021-06-06 20:18:15", "2021-06-06 19:48:16", "2021-06-06 19:18:15", "2021-06-06 18:48:15",
-							"2021-06-06 18:18:13", "2021-06-06 17:48:13", "2021-06-06 17:18:16", "2021-06-06 16:48:13",
-							"2021-06-06 16:18:12", "2021-06-06 15:48:13", "2021-06-06 15:18:12", "2021-06-06 14:48:15",
-							"2021-06-06 14:18:17", "2021-06-06 13:48:14", "2021-06-06 13:18:18", "2021-06-06 12:48:14",
-							"2021-06-06 12:18:12", "2021-06-06 11:48:15", "2021-06-06 11:18:15", "2021-06-06 10:48:13",
-							"2021-06-06 10:18:15", "2021-06-06 09:48:13", "2021-06-06 09:18:13", "2021-06-06 08:48:17",
-							"2021-06-06 08:18:12", "2021-06-06 07:48:13", "2021-06-06 07:18:12", "2021-06-06 06:48:12",
-							"2021-06-06 06:18:15", "2021-06-06 05:48:15", "2021-06-06 05:18:14", "2021-06-06 04:48:14",
-							"2021-06-06 04:18:15", "2021-06-06 03:48:14", "2021-06-06 03:18:18", "2021-06-06 02:48:17",
-							"2021-06-06 02:18:14", "2021-06-06 01:48:18", "2021-06-06 01:18:14", "2021-06-06 00:48:14",
-							"2021-06-06 00:18:14", "2021-06-05 23:48:14", "2021-06-05 23:18:14", "2021-06-05 22:48:14",
-							"2021-06-05 22:18:17", "2021-06-05 21:48:17", "2021-06-05 21:18:14", "2021-06-05 20:48:14",
-							"2021-06-05 20:18:14", "2021-06-05 19:48:14", "2021-06-05 19:18:14", "2021-06-05 18:48:13",
-							"2021-06-05 18:18:12", "2021-06-05 17:48:13", "2021-06-05 17:18:16", "2021-06-05 16:48:12",
-							"2021-06-05 16:18:14", "2021-06-05 15:48:16", "2021-06-05 15:18:15", "2021-06-05 14:48:11",
-							"2021-06-05 14:18:13", "2021-06-05 13:48:11", "2021-06-05 13:18:13", "2021-06-05 12:48:11",
-							"2021-06-05 12:18:12", "2021-06-05 11:48:13", "2021-06-05 11:18:13", "2021-06-05 10:48:11",
-							"2021-06-05 10:18:11", "2021-06-05 09:48:13", "2021-06-05 09:18:11", "2021-06-05 08:48:10",
-							"2021-06-05 08:18:11", "2021-06-05 07:48:10", "2021-06-05 07:18:10", "2021-06-05 06:48:11",
-							"2021-06-05 06:18:11", "2021-06-05 05:48:10", "2021-06-05 05:18:11", "2021-06-05 04:48:10",
-							"2021-06-05 04:18:11", "2021-06-05 03:48:10", "2021-06-05 03:18:11", "2021-06-05 02:48:10",
-							"2021-06-05 02:18:13", "2021-06-05 01:48:10", "2021-06-05 01:18:10", "2021-06-05 00:48:12",
-							"2021-06-05 00:18:10", "2021-06-04 23:48:13", "2021-06-04 23:18:10", "2021-06-04 22:48:10",
-							"2021-06-04 22:18:10", "2021-06-04 21:48:10", "2021-06-04 21:18:10", "2021-06-04 20:48:12",
-							"2021-06-04 20:18:12", "2021-06-04 19:48:10", "2021-06-04 19:18:10", "2021-06-04 18:48:10",
-							"2021-06-04 18:18:10", "2021-06-04 17:48:12", "2021-06-04 17:18:12", "2021-06-04 16:48:10",
-							"2021-06-04 16:18:12", "2021-06-04 15:48:10", "2021-06-04 15:18:10", "2021-06-04 14:48:10",
-							"2021-06-04 14:18:12", "2021-06-04 13:48:10", "2021-06-04 13:18:12"
-						]
-					},
-					yAxis: [{
-						name: '水压/水位',
-						type: 'value',
-						max: 1
-					}, {
-						name: '电量/信号',
-						nameLocation: 'start',
-						max: 100,
-						type: 'value',
-						// inverse: true
-					}],
-					dataZoom: [{
-						type: 'slider',
-						xAxisIndex: 0,
-						filterMode: 'empty',
-						start: 0,
-						end: 100
-					}, {
-						type: 'inside',
-						xAxisIndex: 0,
-						filterMode: 'empty',
-						start: 0,
-						end: 100
-					}],
-
-					series: [{
-						name: tes2,
-						type: 'line',
-						stack: 'Pa',
-						animation: false,
-						data: ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"
-						],
-						color: ['#2699fb'],
-						yAxisIndex: 0
-					}, {
-						name: "信号强度",
-						type: 'line',
-						stack: '%',
-						animation: false,
-						data: [40, 40, 60, 60, 60, 60, 40, 60, 60, 60, 60, 60, 40, 40, 40, 60, 40, 60, 60, 60, 40,
-							60, 60, 60, 40, 40, 60, 40, 60, 60, 60, 40, 40, 60, 40, 40, 60, 60, 60, 40, 40, 40,
-							60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 60, 60, 40, 60, 60, 60, 40, 40, 60, 60, 60,
-							60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 40, 60, 60, 60, 60, 40, 40, 40, 60,
-							60, 40, 40, 40, 60, 40, 60, 40, 60, 40, 60, 40, 60, 60, 60, 40, 60, 60, 60, 40, 40,
-							40, 40, 40, 40, 40, 60, 40, 40, 60, 40, 40, 60, 60, 40, 40, 60, 40, 40, 60, 40, 40,
-							40, 40, 60, 40, 40, 40, 40, 60, 60, 60, 60, 60, 60, 40, 40, 60, 60, 40, 40, 60, 60,
-							40, 40, 60, 60, 60, 60, 60, 40, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 40, 60, 60,
-							60, 60, 60, 40, 60, 60, 40, 60, 40, 60, 60, 60, 40, 40, 40, 40, 60, 40, 40, 40, 60,
-							60, 40, 40, 40, 60, 60, 60, 60, 40, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
-							60, 60, 60, 40, 60, 60, 40, 60, 60, 60, 60, 40, 60, 60, 40, 60, 60, 60, 60, 60, 60,
-							60, 60, 60, 60, 60, 40, 60, 40, 40, 60, 60, 60, 60, 60, 60, 60, 40, 40, 60, 60, 60,
-							60, 60, 60, 60, 60, 60, 40, 60, 60, 40, 60, 60, 60, 60, 40, 60, 40, 60, 60, 60, 60,
-							60, 40, 60, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 60, 40, 60, 40, 40, 40, 60, 40,
-							60, 60, 60, 60, 40, 60, 60, 40, 60, 60, 60, 60, 60, 40, 60, 40, 60, 60, 60, 60, 60,
-							60, 60, 60, 60, 60, 60, 60, 40, 40, 40, 40, 40, 40, 40, 40, 40, 60, 40, 60, 40
-						],
-						color: ['#ffff00'],
-						yAxisIndex: 1
-					}, {
-						name: "电池电量",
-						type: 'line',
-						stack: 'a',
-						animation: false,
-						data: ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0",
-							"0", "0", "0", "0", "2", "3", "4", "5", "5", "6", "6", "6", "8", "8", "8", "9",
-							"10", "10", "10", "9", "8", "9", "9", "10", "11", "12", "10", "11", "11", "12",
-							"11", "11", "12", "13", "12", "12", "12", "12", "12", "12", "12", "11", "11", "10",
-							"11", "11", "9", "10", "11", "10", "10", "11", "10", "10", "11", "11", "11", "11",
-							"11", "11", "10", "10", "10", "10", "11", "9", "10", "9", "9", "10", "10", "10",
-							"10", "10", "9", "10", "9", "11"
-						],
-						color: ['#ff0000'],
-						yAxisIndex: 1
-					}]
-				}
-			}
-		},
-		onLoad() {
-
-		},
-		methods: {
-			changeOption() {
-				const data = this.option.series[0].data
-				// 随机更新示例数据
-				data.forEach((item, index) => {
-					data.splice(index, 1, Math.random() * 40)
-				})
-			},
-			onViewClick(options) {
-				console.log(options)
-			}
-		}
-	}
-</script>
-
-<script module="echarts" lang="renderjs">
-	let myChart
-	export default {
-		mounted() {
-			if (typeof window.echarts === 'function') {
-				this.initEcharts()
-			} else {
-				// 动态引入较大类库避免影响页面展示
-				const script = document.createElement('script')
-				// view 层的页面运行在 www 根目录,其相对路径相对于 www 计算
-				script.src = 'static/echarts.min.js'
-				script.onload = this.initEcharts.bind(this)
-				document.head.appendChild(script)
-			}
-		},
-		methods: {
-			initEcharts() {
-				myChart = echarts.init(document.getElementById('echarts2'))
-				// 观测更新的数据在 view 层可以直接访问到
-				myChart.setOption(this.option)
-			},
-			updateEcharts(newValue, oldValue, ownerInstance, instance) {
-				// 监听 service 层数据变更
-				myChart.setOption(newValue)
-			},
-			onClick(event, ownerInstance) {
-				// 调用 service 层的方法
-				ownerInstance.callMethod('onViewClick', {
-					test: 'test'
-				})
-			}
-		}
-	}
-</script>
-
-<style>
-	.content {
-		display: flex;
-		flex-direction: column;
-		align-items: center;
-		justify-content: center;
-	}
-
-	.echarts {
-		width: 100%;
-		height: 500rpx;
-		margin-bottom: 70rpx;
-	}
-</style>

+ 43 - 0
pages/deviceDetail/components/fireTable.vue

@@ -0,0 +1,43 @@
+<template>
+	<view>
+		<view class="info-content padding" style="overflow:auto;width:97%">
+			<table style="width:140%">
+				<tr>
+					<th>名称</th>
+					<th>最后上传值</th>
+					<th>最后上传时间</th>
+				</tr>
+				<tr v-for="(item,index) in this.bindData" :key="index">
+					<td>{{item.point_name}}</td>
+					<td>{{item.point_data}}</td>
+					<td>{{item.time}}</td>
+				</tr>
+			</table>
+		</view>
+
+
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			bindData: {
+				type: Array,
+				default: ''
+			}
+		},
+		data() {
+			return {
+
+			}
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 195 - 0
pages/deviceDetail/components/waterChart.vue

@@ -0,0 +1,195 @@
+<template>
+	<view class="content">
+
+		<view @click="echarts.onClick" :prop="option" :change:prop="echarts.updateEcharts" id="echarts2"
+			class="echarts"></view>
+
+	</view>
+</template>
+
+<script>
+	var dwtype = "2";
+	var tes = '0';
+	var tes2 = '';
+	var tyss = "";
+	if (dwtype == 2) {
+		tes = '一周设备数值变化';
+		tes2 = '水压值';
+		tyss = "兆帕";
+	}
+	if (dwtype == 5) {
+		tes = '一周水位值变化 (m)';
+		tes2 = '水位值';
+		tyss = "米";
+		document.getElementById('dev_title_lab').innerHTML = '当前水位:';
+		document.getElementById('dev_title_unit').innerHTML = 'm';
+	}
+
+	export default {
+		props: {
+			bindData: {
+				type: Object,
+				default: ''
+			}
+		},
+		data() {
+			return {
+				option: {
+					title: {
+						x: 'center',
+						text: tes
+					},
+	
+					tooltip: {
+						trigger: 'axis',
+						axisPointer: {
+							type: 'cross',
+							animation: false,
+							label: {
+								backgroundColor: '#505765'
+							}
+						}
+					},
+
+					grid: {
+						left: '7%',
+						right: '4%',
+						bottom: '3%',
+						containLabel: true
+					},
+					toolbox: {
+						// feature: {
+						//     saveAsImage: {}
+						// }
+					},
+					legend: {
+						data: ['水压/水位(兆帕/米)', '电量/信号(%)'],
+						left: 10
+					},
+					xAxis: {
+						type: 'category',
+						axisTick: {
+							alignWithLabel: true
+						},
+						data: this.bindData.stiem
+					},
+					yAxis: [{
+						name: '水压/水位',
+						type: 'value',
+						max: 1
+					}, {
+						name: '电量/信号',
+						nameLocation: 'start',
+						max: 100,
+						type: 'value',
+						// inverse: true
+					}],
+					dataZoom: [{
+						type: 'slider',
+						xAxisIndex: 0,
+						filterMode: 'empty',
+						start: 0,
+						end: 100
+					}, {
+						type: 'inside',
+						xAxisIndex: 0,
+						filterMode: 'empty',
+						start: 0,
+						end: 100
+					}],
+
+					series: [{
+						name: tes2,
+						type: 'line',
+						stack: 'Pa',
+						animation: false,
+						data: this.bindData.water_data,
+						color: ['#2699fb'],
+						yAxisIndex: 0
+					}, {
+						name: "信号强度",
+						type: 'line',
+						stack: '%',
+						animation: false,
+						data: this.bindData.signal_data,
+						color: ['#ffff00'],
+						yAxisIndex: 1
+					}, {
+						name: "电池电量",
+						type: 'line',
+						stack: 'a',
+						animation: false,
+						data: this.bindData.battery_data,
+						color: ['#ff0000'],
+						yAxisIndex: 1
+					}]
+				}
+			}
+		},
+		onLoad() {
+
+		},
+		methods: {
+			changeOption() {
+				const data = this.option.series[0].data
+				// 随机更新示例数据
+				data.forEach((item, index) => {
+					data.splice(index, 1, Math.random() * 40)
+				})
+			},
+			onViewClick(options) {
+				console.log(options)
+			}
+		}
+	}
+</script>
+
+<script module="echarts" lang="renderjs">
+	let myChart
+	export default {
+		mounted() {
+			if (typeof window.echarts === 'function') {
+				this.initEcharts()
+			} else {
+				// 动态引入较大类库避免影响页面展示
+				const script = document.createElement('script')
+				// view 层的页面运行在 www 根目录,其相对路径相对于 www 计算
+				script.src = 'static/echarts.min.js'
+				script.onload = this.initEcharts.bind(this)
+				document.head.appendChild(script)
+			}
+		},
+		methods: {
+			initEcharts() {
+				myChart = echarts.init(document.getElementById('echarts2'))
+				// 观测更新的数据在 view 层可以直接访问到
+				myChart.setOption(this.option)
+			},
+			updateEcharts(newValue, oldValue, ownerInstance, instance) {
+				// 监听 service 层数据变更
+				myChart.setOption(newValue)
+			},
+			onClick(event, ownerInstance) {
+				// 调用 service 层的方法
+				ownerInstance.callMethod('onViewClick', {
+					test: 'test'
+				})
+			}
+		}
+	}
+</script>
+
+<style>
+	.content {
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+	}
+
+	.echarts {
+		width: 100%;
+		height: 500rpx;
+		margin-bottom: 70rpx;
+	}
+</style>

+ 164 - 35
pages/deviceDetail/deviceDetail.vue

@@ -1,11 +1,11 @@
 <template>
 	<view>
 		<view class="timeBox flex justify-between align-center padding-lr-sm">
-			<view class="time">测试用传装置</view>
-			<button class="cu-btn radius bg-offLine sm">
-				<view class="radiusStatus offLine"></view>
-				离线
-			</button>
+			<view class="time">{{getData.owner_name}}</view>
+			<!-- <button class="cu-btn radius bg-offLine sm">
+				<view class="radiusStatus offLine"></view>
+				离线
+			</button> -->
 		</view>
 
 		<view>
@@ -18,7 +18,7 @@
 				<view class="info-content">
 					<view class="info-one-info ">
 						<text>设备类型:</text>
-						<text>报警主机</text>
+						<text>{{getData.type_name}}</text>
 					</view>
 
 					<view>
@@ -27,54 +27,160 @@
 					</view>
 					<view>
 						<text>物联网卡号:</text>
-						<text></text>
+						<text>{{getData.sim}}</text>
 					</view>
 					<view>
 						<text>安装位置:</text>
-						<text>物联网开发</text>
+						<text>{{getData.unitinfo}}</text>
 					</view>
 					<view>
 						<text>添加时间:</text>
-						<text>2019-05-28 16:12:45</text>
+						<text>{{getData.install_time}}</text>
 					</view>
 					<view>
 						<text>设备地址:</text>
-						<text>青浦区徐乐路208c幢</text>
+						<text>{{getData.owner_address}}</text>
 					</view>
 				</view>
 			</view>
 			<!-- 基本信息end -->
 
-			<!-- 图表start -->
-			<view class="processStatus">
+			<!-- 报警主机图表start -->
+			<view class="processStatus" v-if="this.getData.dwtype==1">
 				<view class="info-tit margin-left-xs">
 					<text class="cuIcon-titles margin-right-xs"></text>
 					图表
 				</view>
-				<view class="info-content" >
+				<view class="info-content">
 					<chart :bindData="staticData"></chart>
 				</view>
 			</view>
-			<!-- 图表end -->
-			
-			
-			
-			<!-- 图表start -->
-			<view class="processStatus">
+			<!-- 报警主机图表end -->
+
+
+
+			<!-- 报警主机图表start -->
+			<view class="processStatus" v-if="this.getData.dwtype==2">
 				<view class="info-tit margin-left-xs">
 					<text class="cuIcon-titles margin-right-xs"></text>
 					图表
 				</view>
-				<view class="info-content" >
-					<chart2 :bindData="staticData"></chart2>
+				<view class="info-content">
+					<water-chart :bindData="getData"></water-chart>
+				</view>
+			</view>
+			<!-- 报警主机图表end -->
+
+
+			<view class="processStatus" v-if="this.getData.dwtype!=1&&this.getData.dwtype!=2">
+				<view class="info-tit margin-left-xs">
+					<text class="cuIcon-titles margin-right-xs"></text>
+					表格
+				</view>
+
+				<!-- 电气火灾start -->
+				<fire-table v-if="this.getData.dwtype==7" :bindData="getFireData"></fire-table>
+				<!-- 电气火灾end -->
+
+				<!-- RTU start -->
+				<view v-if="this.getData.dwtype==6" class="info-content padding" style="overflow:auto;width:97%">
+					<table style="width:140%">
+						<tr>
+							<th>名称</th>
+							<th>类型</th>
+							<th>端口</th>
+							<th>状态</th>
+							<th>最后上传时间</th>
+						</tr>
+						<tr v-for="(item,index) in this.rtu_data" :key="index">
+							<td>{{item.data4}}</td>
+							<td>{{item.types}}</td>
+							<td>{{item.ncmd}}</td>
+							<td>{{item.data2}}</td>
+							<td>{{item.time}}</td>
+						</tr>
+					</table>
+				</view>
+				<!-- RTU end -->
+
+				<!-- 视频 start -->
+				<view v-if="this.getData.dwtype==16" class="info-content padding">
+					<table>
+						<tr>
+							<th>最后上传值</th>
+							<th>最后上传时间</th>
+
+						</tr>
+						<tr>
+							<td>{{this.video_data.data4}}</td>
+							<td>{{this.video_data.time}}</td>
+
+						</tr>
+					</table>
+				</view>
+				<!-- 视频 end -->
+
+				<!-- 井盖 start -->
+				<view v-if="this.getData.dwtype==128" class="info-content padding">
+					<table>
+						<tr>
+							<th>最后上传值</th>
+							<th>最后上传时间</th>
+						</tr>
+						<tr>
+							<td>{{this.mc_data.data4}}</td>
+						</tr>
+					</table>
+				</view>
+				<!-- 井盖 end -->
+				
+				<!-- 消防栓 start -->
+				<view v-if="this.getData.dwtype==4" class="info-content padding">
+					<table>
+						<tr>
+							<th>最后上传值</th>
+							<th>最后上传时间</th>
+						</tr>
+						<tr>
+							<td>
+							<!-- {{this.getData.device_status}} -->
+							</td>
+							<td>{{this.getData.stime}}</td>
+						</tr>
+					</table>
 				</view>
+				<!-- 消防栓 end -->
+				
+				<!-- 液位 start -->
+				<view v-if="this.getData.dwtype==5" class="info-content padding">
+					<table>
+						<tr>
+							<th>液位水位值</th>
+							<th>液位统计时间</th>
+						</tr>
+						<tr>
+							<td>
+							{{this.getData.water_data?this.getData.water_data:'-'}}
+							</td>
+							<td>{{this.getData.stime?this.getData.stime:'-'}}</td>
+						</tr>
+					</table>
+				</view>
+				<!-- 液位 end -->
+
+
+
 			</view>
-			<!-- 图表end -->
-			
-			
+
+
 			<!-- 表格start -->
-			<table-detail></table-detail>
+			<!-- <table-detail v-if="this.getData.dwtype==4"></table-detail> -->
 			<!-- 表格end -->
+
+
+
+
+
 			<br>
 		</view>
 
@@ -84,29 +190,52 @@
 
 <script>
 	import chart from './components/chart.vue';
-	import chart2 from './components/chart2.vue';
+	import waterChart from './components/waterChart.vue';
 	import tableDetail from './components/table-detail.vue';
+	import fireTable from './components/fireTable.vue';
 	export default {
 		components: {
-			chart,chart2,tableDetail
+			chart,
+			waterChart,
+			tableDetail,
+			fireTable
 
 		},
 		data() {
 			return {
-				staticData: {
-					wubao:9,
-					unSolve:6,
-					truely:20
-				},
+				getData: {},
+				mc_data: {},
+				video_data: {}
 			}
 		},
 		onLoad: function(option) {
+			this.getDeviceDetails({
+				"id": option.id
+			})
+		},
+		methods: {
+			// 设备详情数据请求
+			async getDeviceDetails(params = {}) {
+				const res = await this.$myRequest({
+					url: 'DeviceManagement/getDeviceDetails',
+					data: params,
+					showLoading: true
+				})
+				this.getData = res.data.data[0];
+				this.staticData = res.data.data[0]
 
 
+				this.getFireData = res.data.data[0].electric_data;
+				this.rtu_data = res.data.data[0].rtu_data;
+				if (this.getData.dwtype == 16) {
+					this.video_data = res.data.data[0].video_data[0];
+				}
+				if (this.getData.dwtype == 128) {
+					this.mc_data = res.data.data[0].mc_data[0];
+				}
+				console.log(this.mc_data);
+			},
 
-		},
-		methods: {
-		
 
 		}
 	}

+ 4 - 5
pages/deviceType/deviceType.vue

@@ -2,7 +2,7 @@
 
 	<view class="">
 		<view class="cu-list menu-avatar">
-			<view class="cu-item deviceTypeItem" v-for="(item,index) in deviceType" :key="index" @tap="goDeviceType">
+			<view class="cu-item deviceTypeItem" v-for="(item,index) in deviceType" :key="index" @tap="goDeviceType(item)">
 				<view class="cu-avatar round" :style="`background-image:url(${item.imgUrl})`"></view>
 				<view class="content">
 					<view class="title">{{item.title}}</view>
@@ -30,14 +30,13 @@
 			};
 		},
 		onLoad: function(option) {
-			this.getDeviceData({'company_code':option.companyCode})
-
+			this.getDeviceData({'company_code':uni.getStorageSync('selectedCode')})
 		},
 
 		methods: {
-			goDeviceType() {
+			goDeviceType(item) {
 				uni.navigateTo({
-					url: '/pages/device-Manage/device-Manage',
+					url: '/pages/device-Manage/device-Manage?dwtype='+item.dwtype,
 				});
 			},
 			

+ 32 - 78
pages/index/index.vue

@@ -100,87 +100,17 @@
 			return {
 				staticData: {},
 				alarmCount: json.staticData.data[0].alarmCount,
-				// cuIconList: json.cuIconList,
+				cuIconList: json.cuIconList,
 				Inv: 0,
 
 				
 				flag: false,
 				searchList: [],
 				searchList2: [],
-				
-				
+
 				searchInput: '',
 				selectedCode:10012,
-				
-				
-				cuIconList : [{
-						imgUrl: '../../static/square1.png',
-						badge: 120,
-						name: '综合报警',
-						redirectUrl: '/pages/siteList/siteList?type=1'
-					}, {
-						imgUrl: '../../static/square2.png',
-						badge: 0,
-						name: '设备管理',
-						redirectUrl: '/pages/siteList/siteList?type=2'
-					},
-					{
-						imgUrl: '../../static/square-xf.png',
-						badge: 0,
-						name: '消防督查单',
-						redirectUrl: ''
-					},
-					{
-						imgUrl: '../../static/square-xj.png',
-						badge: 0,
-						badge: 0,
-						name: '巡检',
-						redirectUrl: ''
-					},
-					{
-						imgUrl: '../../static/square-bx.png',
-						badge: 0,
-						name: '报修',
-						redirectUrl: ''
-					}, {
-						imgUrl: '../../static/square-wb.png',
-						badge: 0,
-						name: '维保',
-						redirectUrl: ''
-					},
-					{
-						imgUrl: '../../static/square-sp.png',
-						badge: 0,
-						badge: 0,
-						name: '视频监测',
-						redirectUrl: ''
-					},
-					{
-						imgUrl: '../../static/square-bz.png',
-						badge: 0,
-						badge: 0,
-						name: '风险保障',
-						redirectUrl: ''
-					}, {
-						imgUrl: '../../static/square-rl.png',
-						badge: 0,
-						name: '人脸识别',
-						redirectUrl: ''
-					},
-					{
-						imgUrl: '../../static/square-sb.png',
-						badge: 0,
-						name: '设备注册',
-						redirectUrl: ''
-					},
-					{
-						imgUrl: '../../static/square-yh.png',
-						badge: 0,
-						name: '用户管理',
-						redirectUrl: ''
-					}
-				]
-				
+
 			};
 		},
 
@@ -195,6 +125,19 @@
 
 		onLoad(option) {
 			
+			var res=uni.getStorageSync('selectedCode');
+			var res2=uni.getStorageSync('selectedName');
+			console.log('res');
+			console.log(res);
+			console.log(res2);
+			if(res){
+				uni.setNavigationBarTitle({
+					title: res2
+				});
+			}
+			
+			
+			
 			// 数据渲染
 			this.getHomeData();
 			
@@ -216,10 +159,10 @@
 				let url = "";
 				switch (index) {
 					case 0:
-						url = "/pages/alarmingList/alarmingList?companyCode="+this.selectedCode
+						url = "/pages/alarmingList/alarmingList"
 						break;
 					case 1:
-						url = "/pages/deviceType/deviceType?companyCode="+this.selectedCode
+						url = "/pages/deviceType/deviceType"
 						break;
 					case 2:
 						url = "/pages/inspectList/inspectList"
@@ -290,7 +233,7 @@
 				})
 				res.data.data.forEach(item => {
 					this.searchList.push(item)
-					this.searchList2.push(item)
+					this.searchList2.push(item);
 				});
 			},
 			
@@ -305,6 +248,17 @@
 				this.getSearchList({
 					"owner_code": item.owner_code
 				});
+				
+				
+				uni.setStorageSync('selectedCode',item.owner_code);
+				uni.setStorageSync('selectedName',item.owner_name);
+				
+				
+				this.searchInput=item.owner_name;
+				
+				uni.setNavigationBarTitle({
+					title: this.searchInput
+				});
 				this.flag = false
 			},
 			handleInput() {
@@ -343,8 +297,8 @@
 					showLoading: true
 				})
 				
-				this.cuIconList[0].badge = res.data.data[0].fire_brigade_inspector_count;
-				this.cuIconList[2].badge = res.data.data[0].comprehensive_alarm_count
+				this.cuIconList[0].badge = res.data.data[0].comprehensive_alarm_count;
+				this.cuIconList[2].badge = res.data.data[0].fire_brigade_inspector_count
 			},
 
 

+ 126 - 86
pages/processList/processList.vue

@@ -3,8 +3,8 @@
 		<view style="height:98rpx"></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-item" :class="index==TabCur?'text-blue cur':''" v-for="(item,index) in tabNav"
+					:key="index" @tap="tabSelect" :data-id="index">
 					<view v-if="TabCur==index" class="cu-tag badge">
 						<block class="cu-tag badge">{{TabCur? unporcessList.length:porcessedList.length}} </block>
 					</view>
@@ -15,52 +15,53 @@
 
 		<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="index">
-							<view class="cu-avatar lg" style="background-image:url(../../static/process-icon.png);"></view>
-							<view class="content">
-								<view class="pro-title">
-									<view class="cut">{{item.owner_name}}</view>
-								</view>
-								<view class="pro-des  ">
-									<view class="text-cut">
-										{{item.unitinfo}}
-									</view>
-								</view>
-								<view class="pro-date ">{{item.time}}</view>
+				<view class="cu-list menu-avatar">
+
+					<view class="cu-item" v-for="(item,index) in unporcessList" :key="index">
+						<view class="cu-avatar lg" style="background-image:url(../../static/process-icon.png);"></view>
+						<view class="content">
+							<view class="pro-title">
+								<view class="cut">{{item.owner_name}}</view>
 							</view>
-							<view class="action" style="z-index:99">
-								<view class="unProcess"  @tap="goUnprocessDetail(item)">未处理</view>
+							<view class="pro-des  ">
+								<view class="text-cut">
+									{{item.unitinfo}}
+								</view>
 							</view>
-						</view>
-						<view class=" text-center margin-top" v-if="unporcessList.length === 0">暂无数据...</view>
+							<view class="pro-date ">{{item.time}}</view>
+						</view>
+						<view class="action" style="z-index:99">
+							<view class="unProcess" @tap="goUnprocessDetail(item)">未处理</view>
+						</view>
 					</view>
+					<view class=" text-center margin-top" v-if="unporcessList.length === 0">暂无数据...</view>
+				</view>
 			</view>
-		</block>
-		
+		</block>
+
 		<block v-if="TabCur==1">
 			<view class="processList">
-					<view class="cu-list menu-avatar "  >
-						<view class="cu-item" 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">
-									<view class="cut">{{item.owner_name}}</view>
-								</view>
-								<view class="pro-des  ">
-									<view class="text-cut">
-										{{item.unitinfo}}
-									</view>
-								</view>
-								<view class="pro-date ">{{item.time}}</view>
+				<view class="cu-list menu-avatar ">
+					<view class="cu-item" 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">
+								<view class="cut">{{item.owner_name}}</view>
 							</view>
-							<view class="action" style="z-index:99">
-								<view class="processed"  @tap="goProcessedDetail(item)">已处理</view>
+							<view class="pro-des  ">
+								<view class="text-cut">
+									{{item.unitinfo}}
+								</view>
 							</view>
-						</view>
-						<view class="text-center margin-top" v-if="porcessedList.length === 0">暂无数据...</view>
+							<view class="pro-date ">{{item.time}}</view>
+						</view>
+						<view class="action" style="z-index:99">
+							<view class="processed" @tap="goProcessedDetail(item)">已处理</view>
+						</view>
 					</view>
+					<view class="text-center margin-top" v-if="porcessedList.length === 0">暂无数据...</view>
+				</view>
 			</view>
 		</block>
 
@@ -72,9 +73,9 @@
 	export default {
 		data() {
 			return {
-				 unporcessList: [],
-				 porcessedList: [],
-				 
+				unporcessList: [],
+				porcessedList: [],
+
 				type: '0',
 				modalName: null,
 				listTouchStart: 0,
@@ -82,98 +83,134 @@
 				CustomBar: this.CustomBar,
 				TabCur: 0,
 				tabNav: ['未处理', '已处理'],
-				
-		
+
+
 			};
 		},
+
+
 		onLoad: function(option) {
-			
+
 			this.getProcessData({
-				"company_code": option.companyCode,
+				"company_code": uni.getStorageSync('selectedCode'),
 				"type": option.type,
 				"processing_status": 0
-			},0);
+			}, 0);
+
+
 			this.companyCode = option.companyCode;
 			this.processingStatus = 1
+
 			this.type = option.type;
 
-			
-		},
-		
-		onNavigationBarButtonTap(e) {
-			console.log(e)
-			uni.navigateTo({
-				url: '/pages/export/export',
-				success: res => {},
-				fail: () => {},
-				complete: () => {}
-			});
+			let url = "";
+			switch (parseInt(option.type)) {
+				case 1:
+					url = "报警主机"
+					break;
+				case 2:
+					url = "水系统"
+					break;
+				case 4:
+					url = "消防栓监测"
+					break;
+				case 6:
+					url = "RTU测控终端"
+					break;
+				case 7:
+					url = "电气火灾"
+					break;
+				case 16:
+					url = "视频告警"
+					break;
+				case 17:
+					url = "电梯报警"
+					break;
+				case 128:
+					url = "井盖监测"
+					break;
+				case 129:
+					url = "地磁"
+					break;
+				case 130:
+					url = "门磁"
+					break;
+				case 131:
+					url = "可燃气体"
+					break;
+				default:
+					break;
+			}
+			uni.setNavigationBarTitle({
+				title: url
+			});
+
+
+		},
+
+		onNavigationBarButtonTap(e) {
+			console.log(e)
+			uni.navigateTo({
+				url: '/pages/export/export',
+				success: res => {},
+				fail: () => {},
+				complete: () => {}
+			});
 		},
 		methods: {
-			
-			
+
 			async getProcessData(params = {}, whichTab) {
 				const res = await this.$myRequest({
 					url: 'ComprehensiveAlarm/getIntegratedAlarmList',
 					data: params,
-					showLoading:true
-			
+					showLoading: true
 				})
 				this.unporcessList = res.data.data;
-			
+				console.log('this.unporcessList')
+				console.log(this.unporcessList)
+
 				if (whichTab == 0) {
 					this.unporcessList = res.data.data;
 					this.alarmUntreatedCount = parseInt(res.data.alarmUntreatedCount)
 				} else {
 					this.porcessedList = res.data.data;
 					this.alarmUntreatedCount1 = parseInt(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({
-					"company_code": this.companyCode,
+					"company_code": uni.getStorageSync('selectedCode'),
 					"type": this.type,
 					"processing_status": e.currentTarget.dataset.id
-				},1);
+				}, 1);
 			},
 
 			// 页面跳转
 			goUnprocessDetail(item) {
-				if(item.type==1||item.type==3)
-				uni.navigateTo({
-					url: '/pages/unprocessDetail/unprocessDetail?companyCode=' + this.companyCode + '&id=' + item.id +'&type='+this.type+'&deviceCode='+item.device_code+'&data2='+item.data2+'&data3='+item.data3+'&data5='+item.data5,
-				});
+				if (item.type == 1 || item.type == 3)
+					uni.navigateTo({
+						url: '/pages/unprocessDetail/unprocessDetail?id=' + item
+							.id + '&type=' + this.type + '&deviceCode=' + item.device_code + '&data2=' + item.data2 +
+							'&data3=' + item.data3 + '&data5=' + item.data5,
+					});
 			},
-		
+
 			goProcessedDetail(item) {
 				uni.navigateTo({
-					url: '/pages/processedDetail/processedDetail?id=' + item.id + '&type='+item.type,
+					url: '/pages/processedDetail/processedDetail?id=' + item.id + '&type=' + item.type,
 					success: res => {},
 					fail: () => {},
 					complete: () => {}
 				});
 			},
 
-			
+
 		}
 	}
 </script>
@@ -184,13 +221,16 @@
 		position: relative;
 		border-bottom: 8rpx solid;
 	}
+
 	.cu-tag.badge {
 		top: 14rpx;
 		right: 96rpx;
 	}
+
 	.nav .cu-item {
 		width: 50%;
 		margin: 0;
+
 		.text-blue,
 		.line-blue,
 		.lines-blue {

+ 3 - 1
util/api.js

@@ -1,4 +1,6 @@
-const BASE_URL = 'https://iot.usky.cn/USKYZHAF/USKYZHAF.php/Home/'
+// const BASE_URL = 'https://iot.usky.cn/USKYZHAF/USKYZHAF.php/Home/'
+const BASE_URL = 'https://qhome.usky.cn/USKYZHAF/USKYZHAF.php/Home/'
+
 // 同时发送异步代码的次数,防止一次点击中有多次请求,用于处理
 let ajaxTimes = 0;