Procházet zdrojové kódy

首页横向柱状图,设备清单全选功能,导出,删除前的验证等页面完善

Ming před 4 roky
rodič
revize
d4517677d2

+ 1 - 1
common/common.scss

@@ -560,7 +560,7 @@ radio,checkbox {
 	
 	
 		.title {
-			width: 170rpx;
+			width: 200rpx;
 			position: relative;
 	
 			.necessary {

+ 9 - 14
data/json.js

@@ -232,12 +232,7 @@ let deviceType = [{
 		"num": "4",
 		"imgUrl": "/static/dt-videoIcon.png"
 	},
-	{
-		"id": "6",
-		"title": "电梯",
-		"num": "4",
-		"imgUrl": "/static/dt-dtIcon.png"
-	},
+
 	{
 		"id": "7",
 		"title": "井盖",
@@ -253,56 +248,56 @@ let deviceType = [{
 ];
 //设备管理
 let deviceManage = [{
-		"id": "561",
+		"id": "1",
 		"title": "测试用传装置",
 		"des": "三楼茶水间",
 		"time": "2021-01-20 15:23:43",
 		"status": 0
 	},
 	{
-		"id": "561",
+		"id": "2",
 		"title": "测试用传装置",
 		"des": "三楼茶水间",
 		"time": "2021-01-20 15:23:43",
 		"status": 0
 	},
 	{
-		"id": "561",
+		"id": "3",
 		"title": "测试用传装置",
 		"des": "三楼茶水间",
 		"time": "2021-01-20 15:23:43",
 		"status": 0
 	},
 	{
-		"id": "561",
+		"id": "4",
 		"title": "测试用传装置",
 		"des": "三楼茶水间",
 		"time": "2021-01-20 15:23:43",
 		"status": 0
 	},
 	{
-		"id": "561",
+		"id": "5",
 		"title": "测试用传装置",
 		"des": "三楼茶水间",
 		"time": "2021-01-20 15:23:43",
 		"status": 0
 	},
 	{
-		"id": "561",
+		"id": "6",
 		"title": "测试用传装置",
 		"des": "三楼茶水间",
 		"time": "2021-01-20 15:23:43",
 		"status": 0
 	},
 	{
-		"id": "561",
+		"id": "7",
 		"title": "测试用传装置",
 		"des": "三楼茶水间",
 		"time": "2021-01-20 15:23:43",
 		"status": 1
 	},
 	{
-		"id": "561",
+		"id": "8",
 		"title": "测试用传装置",
 		"des": "三楼茶水间",
 		"time": "2021-01-20 15:23:43",

+ 1 - 0
pages.json

@@ -696,6 +696,7 @@
             }
             
         }
+        
     ],
 	
 	

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

@@ -1,7 +1,7 @@
 <template>
 	<view class="content">
 
-		<view @click="echarts.onClick" :prop="option" :change:prop="echarts.updateEcharts" id="echarts2" class="echarts"></view>
+		<view @click="echarts.onClick" :prop="option" :change:prop="echarts.updateEcharts" id="echarts" class="echarts"></view>
 
 	</view>
 </template>
@@ -43,7 +43,7 @@
 					},
 					tooltip: {
 						trigger: 'item',
-						formatter: "{a} <br/>{b}: {c} ({d}%)"
+						formatter: "{a}\n{b}: {c} ({d}%)"
 					},
 
 					title: [{ //aa标题
@@ -181,14 +181,14 @@
 				// 动态引入较大类库避免影响页面展示
 				const script = document.createElement('script')
 				// view 层的页面运行在 www 根目录,其相对路径相对于 www 计算
-				script.src = '/static/echarts.js'
+				script.src = '/static/echarts.min.js'
 				script.onload = this.initEcharts.bind(this)
 				document.head.appendChild(script)
 			}
 		},
 		methods: {
 			initEcharts() {
-				myChart = echarts.init(document.getElementById('echarts2'))
+				myChart = echarts.init(document.getElementById('echarts'))
 				// 观测更新的数据在 view 层可以直接访问到
 				myChart.setOption(this.option)
 			},

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

@@ -0,0 +1,342 @@
+<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>

+ 60 - 0
pages/deviceDetail/components/table-detail.vue

@@ -0,0 +1,60 @@
+<template>
+	<view>
+		<view class="processStatus">
+			<view class="info-tit margin-left-xs">
+				<text class="cuIcon-titles margin-right-xs"></text>
+				表格
+			</view>
+			<view 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>
+						<td>消防泵手自动状态</td>
+						<td>开关量</td>
+						<td>01</td>
+						<td>关闭</td>
+						<td>2021-01-19 11:06:40</td>
+					</tr>
+					<tr>
+						<td>消防泵手自动状态</td>
+						<td>开关量</td>
+						<td>01</td>
+						<td>关闭</td>
+						<td>2021-01-19 11:06:40</td>
+					</tr>
+					<tr>
+						<td>消防泵手自动状态</td>
+						<td>开关量</td>
+						<td>01</td>
+						<td>关闭</td>
+						<td>2021-01-19 11:06:40</td>
+					</tr>
+				</table>
+			</view>
+		</view>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+
+			}
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 23 - 1
pages/deviceDetail/deviceDetail.vue

@@ -56,6 +56,26 @@
 				</view>
 			</view>
 			<!-- 图表end -->
+			
+			
+			
+			<!-- 图表start -->
+			<view class="processStatus">
+				<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>
+			</view>
+			<!-- 图表end -->
+			
+			
+			<!-- 表格start -->
+			<table-detail></table-detail>
+			<!-- 表格end -->
+			<br>
 		</view>
 
 
@@ -64,9 +84,11 @@
 
 <script>
 	import chart from './components/chart.vue';
+	import chart2 from './components/chart2.vue';
+	import tableDetail from './components/table-detail.vue';
 	export default {
 		components: {
-			chart
+			chart,chart2,tableDetail
 
 		},
 		data() {

+ 42 - 0
pages/deviceManage/component/exportModal.vue

@@ -0,0 +1,42 @@
+<template>
+	
+	<view class="cu-modal export-modal" :class="modalName=='DialogModal'?'show':''">
+		<view class="cu-dialog">
+			<view class="cu-bar bg-white justify-end">
+				<view class="action" @tap="hideModal2">
+					<text class="cuIcon-close"></text>
+				</view>
+			</view>
+			<view class="padding-sm bg-white">
+				<image src="../../../static/ok.png" style="width:100rpx;height:100rpx"></image>
+				<view style="margin:20rpx 0">已导出文件,是否打开?</view>
+			</view>
+			<view class="cu-bar operate bg-white" style="min-height: 100rpx;">
+				<view class="action margin-0   " @tap="hideModal2">
+					另存为</view>
+				<view class="action margin-0  solid-left text-blue" @tap="hideModal2">打开</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		 props: ['modalName'],
+		data() {
+			return {
+				// modalName: null,
+			}
+		},
+		methods: {
+			hideModal2() {
+			        this.$emit('fatherHideModal');
+			      }
+		}
+	}
+	
+	
+</script>
+
+<style>
+</style>

+ 53 - 0
pages/deviceManage/component/searchArea.vue

@@ -0,0 +1,53 @@
+<template>
+
+	<view>
+		<view style="height:206rpx"></view>
+		<view class="ding">
+			<view class="cu-bar search bg-gray filter-section" style="with:50%;">
+				<view class="search-form round bg-white">
+					<select name="" id="" placeholder="">
+						<option value="">请选择设备类型</option>
+						<option value="">类型1</option>
+						<option value="">类型2</option>
+					</select>
+				</view>
+				<view class="search-form round bg-white">
+					<input type="text" placeholder="选输入设备点位" confirm-type="search"></input>
+				</view>
+			</view>
+
+			<view class="cu-bar search bg-gray filter-section">
+				<view class="search-form round bg-white" style="margin-bottom:26rpx">
+					<input class="" @focus="InputFocus" v-model="siteName" @blur="InputBlur" :adjust-position="false"
+						type="text" placeholder="选择传输方式" confirm-type="search"></input>
+				</view>
+				<view class="action">
+					<button class="cu-btn bg-blue round">查询</button>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				siteName: '',
+			}
+		},
+		methods: {
+
+			InputFocus(e) {
+				this.InputBottom = e.detail.height
+			},
+			InputBlur(e) {
+				this.InputBottom = 0
+			},
+
+		}
+	}
+</script>
+
+<style>
+</style>

+ 54 - 0
pages/deviceManage/component/shareArea.vue

@@ -0,0 +1,54 @@
+<template>
+	
+	<view class="share grid col-3 ">
+		<view class="share-item  text-center">
+			<view><text class="icon iconfont margin-xs" style="color:#19A402">&#xe66d;</text></view>
+			<view @tap="goDeviceAdd()">新增</view>
+		</view>
+		<view class="share-item  text-center">
+			<view><text class="icon iconfont margin-xs" style="color:#FF0303">&#xe66c;</text></view>
+			<view @tap="deleteItem" data-target="DialogModal2">删除</view>
+		</view>
+		<view class="share-item  text-center">
+			<view><text class="icon iconfont margin-xs" style="color:#FF642E">&#xe66e;</text></view>
+			<view @tap="showModal2" data-target="DialogModal">导出</view>
+	
+		</view>
+		<view class="checkAll" style="display:inline-block">
+	
+			<checkbox-group @change="allChoose">
+				<label>
+					<checkbox value="all" :class="{'checked':allChecked}" :checked="allChecked?true:false">
+					</checkbox> <text class="margin-left-xs">全选</text>
+				</label>
+			</checkbox-group>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		 props: ['allChecked'],
+		data() {
+			return {
+				// modalName: null,
+			}
+		},
+		methods: {
+			// 页面跳转
+			goDeviceAdd() {
+				uni.navigateTo({
+					url: '/pages/deviceManage/deviceAdd/deviceAdd',
+				});
+			},
+			showModal2() {
+			        this.$emit('showFatherModal');
+			}
+			
+			
+		}
+	}
+</script>
+
+<style>
+</style>

+ 80 - 1
pages/deviceManage/deviceAdd/deviceAdd.vue

@@ -1,6 +1,6 @@
 
 <template>
-	<view class="appWrapper padding-top">
+	<view class="appWrapper padding-top" style="height:calc(100vh - 250rpx);overflow:scroll">
 
 		<form action="">
 			<view class="form-item ">
@@ -68,6 +68,85 @@
 					</label>
 				</radio-group>
 			</view>
+			
+			<view class="form-item">
+				<view class="title"><text class="necessary">*</text>传输方式:</view>
+				<select name="" id="">
+					<option value="">方式一</option>
+					<option value="">方式一</option>
+					<option value="">方式一</option>
+				</select>
+			</view>
+			
+			<view class="form-item">
+				<view class="title"><text class="necessary">*</text>NB类型:</view>
+				<select name="" id="">
+					<option value="">方式一</option>
+					<option value="">方式一</option>
+					<option value="">方式一</option>
+				</select>
+			</view>
+			
+			<view class="form-item">
+				<view class="title"><text class="necessary">*</text>NB厂商名称:</view>
+				<select name="" id="">
+					<option value="">方式一</option>
+					<option value="">方式一</option>
+					<option value="">方式一</option>
+				</select>
+			</view>
+			
+			<view class="form-item">
+				<view class="title"><text class="necessary">*</text>NB设备型号:</view>
+				<select name="" id="">
+					<option value="">方式一</option>
+					<option value="">方式一</option>
+					<option value="">方式一</option>
+				</select>
+			</view>
+			
+			<view class="form-item">
+				<view class="title"><text class="necessary">*</text>NB地址:</view>
+				<input name="input" v-model="formMess.deviceNo"></input>
+			</view>
+			
+			<view class="form-item">
+				<view class="title"><text class="necessary">*</text>NB协议:</view>
+				<input name="input" v-model="formMess.deviceNo"></input>
+			</view>
+			
+			<view class="form-item">
+				<view class="title"><text class="necessary">*</text>NB厂商id:</view>
+				<select name="" id="">
+					<option value="">方式一</option>
+					<option value="">方式一</option>
+					<option value="">方式一</option>
+				</select>
+			</view>
+			<view class="form-item">
+				<view class="title"><text class="necessary">*</text>解析方法:</view>
+				<select name="" id="">
+					<option value="">方式一</option>
+					<option value="">方式一</option>
+					<option value="">方式一</option>
+				</select>
+			</view>
+			<view class="form-item">
+				<view class="title"></view>
+				<select name="" id="">
+					<option value="">方式一</option>
+					<option value="">方式一</option>
+					<option value="">方式一</option>
+				</select>
+			</view>
+			<view class="form-item">
+				<view class="title"></view>
+				<select name="" id="">
+					<option value="">方式一</option>
+					<option value="">方式一</option>
+					<option value="">方式一</option>
+				</select>
+			</view>
 		
 
 			<view class="btn-area submitBottomBtn padding-lr-sm">

+ 114 - 138
pages/deviceManage/deviceManage.vue

@@ -2,83 +2,58 @@
 	<view class="deviceRegistWrapper" ref="contentWrapper">
 
 		<!-- 筛选框start -->
-		<view>
-			<view style="height:206rpx"></view>
-			<view class="ding">
-				<view class="cu-bar search bg-gray filter-section" style="with:50%;">
-					<view class="search-form round bg-white">
-						<select name="" id="" placeholder="">
-							<option value="">请选择设备类型</option>
-							<option value="">类型1</option>
-							<option value="">类型2</option>
-						</select>
-					</view>
-					<view class="search-form round bg-white">
-						<input type="text" placeholder="选输入设备点位" confirm-type="search"></input>
-					</view>
-				</view>
-
-				<view class="cu-bar search bg-gray filter-section">
-					<view class="search-form round bg-white" style="margin-bottom:26rpx">
-						<input class="" @focus="InputFocus" v-model="siteName" @blur="InputBlur"
-							:adjust-position="false" type="text" placeholder="选择传输方式" confirm-type="search"></input>
-					</view>
-					<view class="action">
-						<button class="cu-btn bg-blue round" @click="searchData()">查询</button>
-					</view>
-				</view>
-			</view>
-		</view>
+		<search-area></search-area>
 		<!-- 筛选框end -->
 
-
 		<!-- 设备注册列表start -->
 		<block class="">
 			<view class="processList deviceRegistList" style="height: calc(100vh - 241px);">
+				<checkbox-group  @change="changeCheckbox">
 				<view class="cu-list menu-avatar ">
-					<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
-						v-for="(item,index) in newDeviceManage" :key="index" :data-target="'move-box-' + index">
-						<view class="cu-form-group margin-top">
-							<checkbox class='blue' @click="selectedProduct(item)" :class="{'checked':item.checked}"
-								value="A"></checkbox>
-						</view>
-						<view class="cu-avatar round lg" style="background-image:url(../../static/device-icon.png)">
-						</view>
-						<view class="content" @longpress="showDetail(item)">
-							<view class="pro-title">
-								<view class="cut">{{item.title}}</view>
+						<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
+							v-for="(item,index) in newDeviceManage" :key="index" :data-target="'move-box-' + index">
+							<view class="cu-form-group margin-top">
+								<checkbox :value="String(item.id)" :checked="checkedArr.includes(String(item.id))"
+									:class="{'checked':checkedArr.includes(String(item.id))}"></checkbox>
 							</view>
-							<view class="pro-des  ">
-								<view class="text-cut">
-									{{item.des}}
-								</view>
+							<view class="cu-avatar round lg" style="background-image:url(../../static/device-icon.png)">
 							</view>
-							<view class="pro-date ">{{item.time}}</view>
+							<view class="content" @longpress="showDetail(item)">
+								<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}}</view>
 
-							<view class="showDetail" v-if="item.isShow">
-								<view @tap="goDeviceEdit()">修改设备</view>
-								<view @tap="deleteItem" data-target="DialogModal2">删除设备</view>
+								<view class="showDetail" v-if="item.isShow">
+									<view @tap="goDeviceEdit(item)">修改设备</view>
+									<view @tap="deleteItem2" data-target="DialogModal2" :data-id='item.id'>删除设备</view>
+								</view>
 							</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 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>
-					</view>
 				</view>
+				</checkbox-group>
 			</view>
 		</block>
 		<!-- 设备注册列表end -->
 
-
+		<!-- 分享区域  start-->
 		<view class="share grid col-3 ">
 			<view class="share-item  text-center">
 				<view><text class="icon iconfont margin-xs" style="color:#19A402">&#xe66d;</text></view>
-				<view @tap="goDeviceAdd()">新增</view>
+				<view @tap="goDeviceAdd">新增</view>
 			</view>
 			<view class="share-item  text-center">
 				<view><text class="icon iconfont margin-xs" style="color:#FF0303">&#xe66c;</text></view>
@@ -89,40 +64,22 @@
 				<view @tap="showModal" data-target="DialogModal">导出</view>
 
 			</view>
-			<view class="checkAll">
-				<checkbox-group class="block" @change="CheckboxChange" style="display:inline-block">
-					<view class="cu-form-group margin-top">
-						<checkbox class='blue' :class="checkbox[0].checked?'checked':''"
-							:checked="checkbox[0].checked?true:false" value="A"></checkbox>
-					</view>
+			<view class="checkAll" style="display:inline-block">
+
+				<checkbox-group @change="allChoose">
+					<label>
+						<checkbox value="all" :class="{'checked':allChecked}" :checked="allChecked?true:false">
+						</checkbox> <text class="margin-left-xs">全选</text>
+					</label>
 				</checkbox-group>
-				<text class="margin-left-xs">全选</text>
 			</view>
 		</view>
-
+		<!-- 分享区域  end-->
 
 		<!-- 导出弹框 -->
-		<view class="cu-modal export-modal" :class="modalName=='DialogModal'?'show':''">
-			<view class="cu-dialog">
-				<view class="cu-bar bg-white justify-end">
-					<view class="action" @tap="hideModal">
-						<text class="cuIcon-close"></text>
-					</view>
-				</view>
-				<view class="padding-sm bg-white">
-					<image src="../../static/ok.png" style="width:100rpx;height:100rpx"></image>
-					<view style="margin:20rpx 0">已导出文件,是否打开?</view>
-				</view>
-				<view class="cu-bar operate bg-white" style="min-height: 100rpx;">
-					<view class="action margin-0   " @tap="hideModal">
-						另存为</view>
-					<view class="action margin-0  solid-left text-blue" @tap="hideModal">打开</view>
-				</view>
-			</view>
-		</view>
+		<export-modal :modalName='modalName'  @fatherHideModal="hideModal()"></export-modal>
 		<!-- 导出弹框 end -->
 
-
 		<!-- 删除弹框 -->
 		<view class="cu-modal export-modal" :class="modalName=='DialogModal2'?'show':''">
 			<view class="cu-dialog">
@@ -145,7 +102,6 @@
 		</view>
 		<!-- 删除弹框 end -->
 
-
 		<!-- 再次确认删除弹框 -->
 		<view class="cu-modal export-modal" :class="modalName=='DialogModal3'?'show':''">
 			<view class="cu-dialog">
@@ -155,21 +111,17 @@
 					</view>
 				</view>
 				<view class="padding-sm bg-white">
-
 					<view style="margin:20rpx 0">请输入图片中的验证码</view>
 					<valid-code :value.sync="validCode"></valid-code>
-
 				</view>
 				<view class="cu-bar operate bg-white" style="min-height: 100rpx;">
 					<view class="action margin-0   " @tap="hideModal">
 						取消</view>
-					<view class="action margin-0  solid-left text-blue" @tap="hideModal">确定</view>
+					<view class="action margin-0  solid-left text-blue" @tap="confirmDelete">确定</view>
 				</view>
 			</view>
 		</view>
 		<!-- 再次确认删除弹框 end -->
-
-
 	</view>
 
 </template>
@@ -177,10 +129,12 @@
 <script>
 	import json from '../../data/json.js';
 	import validCode from './component/validCode/validCode';
+	import searchArea from './component/searchArea.vue';
+	import exportModal from './component/exportModal.vue';
 
 	export default {
 		components: {
-			validCode
+			validCode,searchArea,exportModal
 		},
 		data() {
 			return {
@@ -193,14 +147,23 @@
 
 				deviceManage: json.deviceManage,
 				siteListRes: 0,
-				siteName: '',
+			
 				type: '0',
 				siteListData: [],
 				modalName: null,
-				// modalName2: null,
 				listTouchStart: 0,
 				listTouchDirection: null,
 				CustomBar: this.CustomBar,
+				
+				deleteId:'',
+
+
+				// checkAllFlag:false,
+
+
+				isChecked: false,
+				checkedArr: [], //复选框选中的值
+				allChecked: false //是否全选
 			};
 		},
 
@@ -221,7 +184,6 @@
 
 		},
 
-
 		mounted() {
 			document.addEventListener('click', (e) => {
 				if (e.target.className != 'showDetail') {
@@ -233,66 +195,61 @@
 		},
 
 		methods: {
-			selectedProduct: function(item) {
-				console.log(item)
-				if (typeof item.checked == 'undefined') {
-					this.$set(item, 'checked', true);
-				} else {
-					item.checked = !item.checked;
-				}
-			},
-
 			// 页面跳转
 			goDeviceAdd() {
 				uni.navigateTo({
 					url: '/pages/deviceManage/deviceAdd/deviceAdd',
 				});
 			},
-			goDeviceEdit() {
+			goDeviceEdit(item) {
 				uni.navigateTo({
-					url: '/pages/deviceManage/deviceEdit/deviceEdit',
+					url: '/pages/deviceManage/deviceEdit/deviceEdit?type='+item.id+'',
 				});
 			},
-
-
 			//导出弹框
 			showModal(e) {
-				this.modalName = e.currentTarget.dataset.target
+				// alert(1)
+				if(this.checkedArr.length==0){
+					alert('请选择至少一条需要导出的数据')
+				}else{
+					this.modalName = e.currentTarget.dataset.target
+					
+				}
 			},
-
+			
 			//关闭弹框
 			hideModal(e) {
 				this.modalName = null
 			},
-
 			//删除弹出框操作
 			deleteItem(e) {
+				if(this.checkedArr.length==0){
+					alert('请选择至少一条需要删除的数据')
+				}else{
+					this.modalName = e.currentTarget.dataset.target;
+				}
+			},
+			deleteItem2(e) {
+				this.deletedId=e.target.dataset.id;
+				console.log(e.target.dataset.id);
 				this.modalName = e.currentTarget.dataset.target;
-
+			},
+			confirmDelete(){
+				alert(this.deletedId)
+				
 			},
 			//再次确认弹框
 			openConfirmModal(e) {
 				this.modalName = e.currentTarget.dataset.target;
-
-			},
-
-			CheckboxChange(e) {
-				var items = this.checkbox,
-					values = e.detail.value;
-				for (var i = 0, lenI = items.length; i < lenI; ++i) {
-					items[i].checked = false;
-					for (var j = 0, lenJ = values.length; j < lenJ; ++j) {
-						if (items[i].value == values[j]) {
-							items[i].checked = true;
-							break
-						}
-					}
-				}
+			
 			},
 
+			
+			
 			// 隐藏显示
 			showDetail(e) {
-				// alert(1)
+				// console.log('e')
+				// console.log(e)
 				// 存储点击那一项的状态
 				const nowStatu = e.isShow;
 				// 将每一项列表的isShow设置为false,让所有的列表都隐藏
@@ -302,18 +259,37 @@
 				// 用于再次点击该项的取反
 				e.isShow = !nowStatu
 			},
-			InputFocus(e) {
-				this.InputBottom = e.detail.height
-			},
-			InputBlur(e) {
-				this.InputBottom = 0
+			
+			
+			// 多选复选框改变事件
+			changeCheckbox(e) {
+				this.checkedArr = e.detail.value;
+				// 如果选择的数组中有值,并且长度等于列表的长度,就是全选
+				if (this.checkedArr.length > 0 && this.checkedArr.length == this.newDeviceManage.length) {
+					this.allChecked = true;
+				} else {
+					this.allChecked = false;
+				}
 			},
-
-
-
-
-
-		}
+			// 全选事件
+			allChoose(e) {
+				let chooseItem = e.detail.value;
+				// 全选
+				if (chooseItem[0] == 'all') {
+					this.allChecked = true;
+					for (let item of this.newDeviceManage) {
+						let itemVal = String(item.id);
+						if (!this.checkedArr.includes(itemVal)) {
+							this.checkedArr.push(itemVal);
+						}
+					}
+				} else {
+					// 取消全选
+					this.allChecked = false;
+					this.checkedArr = [];
+				}
+			}
+		},
 
 	}
 </script>

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

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

+ 17 - 8
pages/index/index.vue

@@ -35,12 +35,12 @@
 
 					<chart2 :bindData="staticData"></chart2>
 				</view>
-				<view v-if="Inv == 2" class="chart3-box" @tap="goOfflineList()">
+				<view v-if="Inv == 2" class="chart3-box" >
 					<ul class="chart3-icon">
-						<li>
+						<li @tap="goOfflineList()">
 							<image src="../../static/chart3-1.png" style="width:64rpx;height:64rpx"></image>
 						</li>
-						<li>
+						<li  @tap="goFaultList()">
 							<image src="../../static/chart3-2.png" style="width:64rpx;height:64rpx"></image>
 						</li>
 						<li>
@@ -159,6 +159,9 @@
 					case 7:
 						url = "/pages/safeGuard/safeGuard"
 						break;
+						case 8:
+							url = "/pages/test/test"
+							break;
 						case 9:
 							url = "/pages/deviceManage/deviceManage"
 							break;
@@ -187,11 +190,15 @@
 			// 页面跳转
 			goOfflineList() {
 				uni.navigateTo({
-					url: '/pages/deviceOffLine/deviceOffLine',
-					success: res => {},
-					fail: () => {},
-					complete: () => {}
+					url: '/pages/deviceOffLine/deviceOffLine?type=离线',
+				});
+				
+			},
+			goFaultList() {
+				uni.navigateTo({
+					url: '/pages/deviceOffLine/deviceOffLine?type=故障',
 				});
+				
 			},
 			
 
@@ -301,9 +308,11 @@
 	}
 
 	.chart3-icon {
+		width:90%;
 		position: absolute;
 		top: 60rpx;
-		left: 30rpx
+		left: 30rpx;
+		z-index:1;
 	}
 
 	.chart3-icon li {

+ 67 - 40
pages/test/test.vue

@@ -1,50 +1,77 @@
-	<template>
-		 <div class="hello">
-		     <div v-for='item in showList'>{{item}}</div>
-		     <div @click="showAll = !showAll" class="show-more">{{word}}</div>
-		 </div>
-		</template>
+<template>
+	<view>
+		<!-- 多个复选框,带全选 -->
+		<view>
+			<checkbox-group class="block" @change="changeCheckbox">
+				<view v-for="item in newDeviceManage" :key="item.id">				
+					<checkbox :value="String(item.id)" :checked="checkedArr.includes(String(item.id))" :class="{'checked':checkedArr.includes(String(item.id))}"></checkbox>
+					<text>{{item.title}}</text>
+				</view>
+			</checkbox-group>
+		</view>
+		<view>
+			<checkbox-group @change="allChoose">
+				<label>
+					<checkbox value="all" :class="{'checked':allChecked}" :checked="allChecked?true:false"></checkbox> 全选
+				</label>
+			</checkbox-group>
+		</view>
+	</view>
+</template>
 
 <script>
 	export default {
-		data () {
-		   return {
-		     toLearnList:[
-		       'html','css','javascript','java','php'   //进行显示的数据
-		     ],
-		     showAll:false,                  //标记数据是否需要完全显示的属性
-		   }
-		 },
-		computed:{
-		   showList:function(){
-		     if(this.showAll == false){                    //当数据不需要完全显示的时候
-		       var showList = [];                //定义一个空数组
-		       if(this.toLearnList.length > 3){       //这里我们先显示前三个
-		         for(var i=0;i<3;i++){
-		           showList.push(this.toLearnList[i])
-		         }
-		       }else{
-		         showList = this.toLearnList
-		       }
-		       return showList;                 //返回当前数组
-		     }else{
-		       return this.toLearnList;
-		     }
-		   },
-		   word:function(){
-		     if(this.showAll == false){           //对文字进行处理
-		       return '点击展开'
-		     }else{
-		       return '点击收起'
-		     }
-		   }
-		 },
+		data() {
+			return {
+				isChecked:false,
+				newDeviceManage:[
+					{'id':0,'title':'选项一'},
+					{'id':1,'title':'选项二'},
+					{'id':2,'title':'选项三'},
+					{'id':3,'title':'选项四'},
+					{'id':4,'title':'选项五'},
+					{'id':5,'title':'选项六'},
+					{'id':6,'title':'选项七'},
+					{'id':7,'title':'选项八'},
+					{'id':8,'title':'选项九'},
+					{'id':9,'title':'选项十'}
+				],
+				checkedArr:[], //复选框选中的值
+				allChecked:false //是否全选
+			}
+		},
 		methods: {
-			
+			// 多选复选框改变事件
+			changeCheckbox(e){
+				this.checkedArr = e.detail.value;
+				// 如果选择的数组中有值,并且长度等于列表的长度,就是全选
+				if(this.checkedArr.length>0 && this.checkedArr.length==this.newDeviceManage.length){
+					this.allChecked=true;
+				}else{
+					this.allChecked=false;
+				}
+			},
+			// 全选事件
+			allChoose(e){
+				let chooseItem = e.detail.value;
+				// 全选
+				if(chooseItem[0]=='all'){
+					this.allChecked=true;
+					for(let item of this.newDeviceManage){
+						let itemVal=String(item.id);
+						if(!this.checkedArr.includes(itemVal)){
+							this.checkedArr.push(itemVal);
+						}
+					}					
+				}else{
+					// 取消全选
+					this.allChecked=false;
+					this.checkedArr=[];
+				}
+			}
 		}
 	}
 </script>
 
 <style>
-
 </style>