heyang il y a 9 mois
Parent
commit
56e775bd4d

+ 1 - 1
api/request/config.js

@@ -11,7 +11,7 @@ const config = {
 	// base_url: 'http://192.168.1.29:8080',//何成
 	// base_url: 'https://demo.zjznai.com/xzgd/',
 	// base_url: 'https://lab.zjznai.com/labNhSystem/',//43服务器高升测试
-	  base_url: 'https://lab.zjznai.com/labTest/',//1.8外网
+	 // base_url: 'https://lab.zjznai.com/labTest/',//1.8外网
 	// base_url: 'https://lab.zjznai.com/labAppTest/',//43服务器线上
 	 //base_url: 'https://lab.zjznai.com/appTest/',//88服务器线上
 	// base_url: 'https://lab.zjznai.com/labSystem/', //矿大地址

+ 74 - 1
api/request/request.js

@@ -77,6 +77,79 @@ export const apiResquest = (prams) => {
 		});
 	})
 }
+
+export const apiResquestOutside = (prams) => {
+	return new Promise((resolve, reject) => {
+		let url =  prams.url;
+		uni.showLoading({
+			title: '加载中',
+			mask: true
+		});
+		// get请求映射params参数
+		if (prams.method === 'GET' && prams.data) {
+			url = url + '?' + tansParams(prams.data);
+			url = url.slice(0, -1);
+			prams.data = {};
+		}
+
+		return uni.request({
+			url: url,
+			data: {
+				...prams.data
+			},
+			method: prams.method,
+			header: {
+				'content-type': 'application/json;charset=utf-8',
+				'Authorization': uni.getStorageSync('token')
+			},
+			success: (res) => {
+				// 成功
+				uni.hideLoading()
+				if (res.statusCode == 200) {
+					if (res.data.code == 200) {
+						resolve(res);
+					} else if (res.data.code == 401) {
+						loginTimeout();
+					} else {
+						uni.showToast({
+							mask: true,
+							icon: "none",
+							position: "center",
+							title: res.data.message,
+							duration: 2000
+						});
+						resolve(res);
+					}
+				} else if (res.statusCode == 401) {
+					loginTimeout();
+				} else {
+					uni.showToast({
+						mask: true,
+						icon: "none",
+						position: "center",
+						title: '连接异常,请联系管理员.',
+						duration: 2000
+					});
+					resolve(res);
+				}
+			},
+			fail: (err) => {
+				// 失败
+				uni.hideLoading()
+				uni.showToast({
+					mask: true,
+					icon: "none",
+					position: "center",
+					title: '出错啦~请联系管理员!',
+					duration: 2000
+				});
+			},
+			complete: () => {
+				// 完成
+			}
+		});
+	})
+}
 export const apiResquestForm = (prams) => {
 	return new Promise((resolve, reject) => {
 		let url = config.base_url + prams.url;
@@ -373,4 +446,4 @@ export function loginTimeout(params) {
 			url: '/pages/views/login/login',
 		});
 	}, 2000);
-}
+}

+ 9 - 2
pages.json

@@ -1,6 +1,6 @@
 {
 	"pages": [
-		
+
 
 		{
 			"path": "pages/views/login/login",//登录
@@ -35,7 +35,7 @@
 				"navigationBarBackgroundColor": "#363744" //导航背景色
 			}
 		},
-		
+
 		{
 			"path": "pages/views/teacherPage/laboratoryList",//实验室列表
 			"style": {
@@ -139,6 +139,13 @@
 			"root": "pages_basics",  //分包根路径
 			"name": "basics", //分包名字可写可不写
 			"pages": [
+				/* 设备管理和笼位管理页面 */
+				{
+					"path": "views/deviceCageSitePage",
+					"style": {
+						"navigationBarTitleText": ""
+					}
+				},
 				/* 离开检查 */
 				{
 					"path": "views/photoInspection",

+ 34 - 19
pages/component/topWarn.vue

@@ -9,7 +9,9 @@
 
 <script>
 	import $mqtt from '@/utils/mqtt.min.js';
-  import { controlsRestrictVerify} from '@/utils/index'
+	import {
+		controlsRestrictVerify
+	} from '@/utils/index'
 	import {
 		laboratoryBigViewSelectTriggerInfo,
 		laboratoryPlanCloseRiskPlan,
@@ -95,11 +97,21 @@
 						this.$set(this, 'planData', data.data);
 						this.$set(this, 'text', data.data[1] ? '有多个实验室发生预案' : '有实验室发生预案');
 						this.$set(this, 'pageType', true);
+						//传感器
+						let planSensorList = [];
+						data.data.forEach((item) => {
+							let list = JSON.parse(item.triggerUploadData)
+							list.forEach((minItem) => {
+								planSensorList.push(minItem.deviceNo)
+						 })
+						})
+						uni.setStorageSync("planSensorList", planSensorList);
 					} else {
 						// console.log('条幅触发-无');
 						this.$set(this, 'pageType', false);
 						this.$set(this, 'planData', []);
 						this.$set(this, 'text', '');
+						uni.setStorageSync("planSensorList", []);
 					}
 				}
 			},
@@ -107,9 +119,9 @@
 			buttonClick() {
 				let self = this;
 				let list = [];
-				if(!controlsRestrictVerify('performEvacuation')){
+				if (!controlsRestrictVerify('performEvacuation')) {
 					list = ['查看'];
-				}else{
+				} else {
 					list = ['查看', '结束预案'];
 				}
 				uni.showActionSheet({
@@ -168,7 +180,8 @@
 					groupId: this.planData[0].eventId,
 				}
 				uni.navigateTo({
-					url: '/pages_manage/views/emergencyEvacuationBig?item=' + encodeURIComponent(JSON.stringify(obj))
+					url: '/pages_manage/views/emergencyEvacuationBig?item=' + encodeURIComponent(JSON.stringify(
+						obj))
 				});
 			},
 		},
@@ -195,18 +208,20 @@
 		margin: 20rpx 30rpx 0;
 		display flex;
 		overflow hidden;
-		border-radius:20rpx;
-		.left-title{
-			width:100rpx;
-			height:40rpx;
+		border-radius: 20rpx;
+
+		.left-title {
+			width: 100rpx;
+			height: 40rpx;
 			text-align: center;
-			line-height:40rpx;
-			margin:20rpx 18rpx 0 30rpx;
-			color:#fff;
-			font-size:28rpx;
+			line-height: 40rpx;
+			margin: 20rpx 18rpx 0 30rpx;
+			color: #fff;
+			font-size: 28rpx;
 			background-color: #FF0000;
-			border-radius:10rpx;
+			border-radius: 10rpx;
 		}
+
 		.text-view {
 			color: #FF0000;
 			flex: 1;
@@ -215,13 +230,13 @@
 
 		.button-view {
 			width: 120rpx;
-			height:48rpx;
-			line-height:48rpx;
+			height: 48rpx;
+			line-height: 48rpx;
 			color: #FF0000;
-			border:1px solid #FF0000;
+			border: 1px solid #FF0000;
 			text-align center;
-			border-radius:50rpx;
-			margin:16rpx 12rpx 0 0;
+			border-radius: 50rpx;
+			margin: 16rpx 12rpx 0 0;
 		}
 	}
-</style>
+</style>

BIN
pages/images/dataBoard/dataBoard-icon5.png


BIN
pages/images/newImage/icon_sy_sjmb@1x.png


+ 9 - 3
pages/views/dataBoard/dataBoard.vue

@@ -6,7 +6,8 @@
 			<img class="header-bg" src="@/pages/images/dataBoard/dataBoard-icon1.png">
 			<view class="header-t">
 				<img class="header-t-l" :src="rectangleLogo">
-				<view class="header-t-r" @click="outButton">管理面板</view>
+				<img class="header-t-r" @click="outButton" src="@/pages/images/dataBoard/dataBoard-icon5.png">
+				<!-- <view class="header-t-r" @click="outButton">管理面板</view> -->
 			</view>
 			<view class="header-b">
 				<view class="header-b-li">
@@ -210,7 +211,12 @@
 				}
 
 				.header-t-r {
-					position: absolute;
+					width: 70rpx;
+					height: 58rpx;
+					position: fixed;
+					right: 0;
+					top: 150rpx;
+					/* position: absolute;
 					right: 0;
 					top: 20rpx;
 					font-weight: 400;
@@ -222,7 +228,7 @@
 					height: 50rpx;
 					background: rgba(54, 55, 68, 0.6);
 					padding-left: 24rpx;
-					border-radius: 24rpx 0 0 24rpx;
+					border-radius: 24rpx 0 0 24rpx; */
 				}
 			}
 

+ 3 - 2
pages/views/home/home.vue

@@ -23,9 +23,10 @@
 			}
 		},
 		onLoad() {
-			
+
 		},
 		onShow() {
+			uni.removeStorageSync('planSensorList');
 			if (uni.getStorageSync('token') && uni.getStorageSync('userId') && uni.getStorageSync('userType')) {
 				this.userType = uni.getStorageSync('userType')
 			} else {
@@ -59,4 +60,4 @@
 			flex-direction: column;
 		}
 	}
-</style>
+</style>

+ 45 - 23
pages/views/pages_patrolInspector/chemicalDetail.vue

@@ -49,8 +49,8 @@
 				<view class="list-tow-li-b">
 					<view class="list-tow-li-b-li" v-if="item.tagCode==1 || item.tagCode==3"><text>领用人:</text><text>{{item.userName}}</text></view>
 					<view class="list-tow-li-b-li" v-if="item.tagCode==1 || item.tagCode==3"><text>领用量:</text><text>{{item.collectNowNum}}{{item.specUnit}}</text></view>
-					
-					
+
+
 					<view class="list-tow-li-b-li" v-if="item.tagCode==0"><text>归还人:</text><text>{{item.userName}}</text></view>
 					<view class="list-tow-li-b-li" v-if="item.tagCode==0 || item.tagCode==3"><text>使用量:</text><text>{{item.useAmount}}{{item.specUnit}}</text></view>
 					<view class="list-tow-li-b-li" v-if="item.tagCode==0"><text>余 量:</text><text>{{item.returnStockNum}}{{item.specUnit}}</text></view>
@@ -70,7 +70,7 @@ import {chemicalAppletGetStockDetail} from '@/pages/api/index.js'
 export default {
   name: "rectifyList",
   components: {
-   
+
   },
   data() {
     return {
@@ -81,7 +81,29 @@ export default {
 		},
 		tabText:['基本信息','使用记录'],
 		curTab:0,
-		newData:{},
+		newData:{
+			chemicalName:'',
+			chemicalLevel:'',
+			status:'',
+			tagCode:'',
+			surplus:'',
+			specUnit:'',
+			casNum:'',
+			anotherName:'',
+			chemicalCategoryName:'',
+			specNum:'',
+			specUnit:'',
+			packUnit:'',
+			belongName:'',
+			deptName:'',
+			buildName:'',
+			floorName:'',
+			subName:'',
+			subRoom:'',
+			cabinetName:'',
+			doorName:'',
+			layers:'',
+		},
 		tagCode:'',
 		dataList:[],
 		nickName:'',
@@ -89,13 +111,13 @@ export default {
   },
   onLoad(option) {
 	 this.tagCode=option.code;
-	
+
   },
   onShow() {
-	  
+
   },
   mounted(){
-	 this.chemicalAppletGetStockDetail(); 
+	 this.chemicalAppletGetStockDetail();
   },
   methods: {
 		//滚动事件
@@ -111,7 +133,7 @@ export default {
 			if(data.code == 200){
 				this.$set(this, 'newData', data.data);
 			}
-		}, 
+		},
   }
 }
 </script>
@@ -184,7 +206,7 @@ export default {
 					color: #2B80FF;
 					background: rgba(43,128,255,0.2);
 				}
-				
+
 			}
 			.header-r-b{
 				font-size: 30rpx;
@@ -193,7 +215,7 @@ export default {
 				color: #333333;
 				line-height: 42rpx;
 				margin-top: 24rpx;
-				
+
 			}
 			.header-r-b2{
 				font-size: 30rpx;
@@ -205,7 +227,7 @@ export default {
 				margin-bottom: 20rpx;
 				display: flex;
 				justify-content: space-between;
-				
+
 			    .risk{
 					width: 180rpx;
 					height: 50rpx;
@@ -234,7 +256,7 @@ export default {
 					text-align: center;
 					margin-right: 24rpx;
 				}
-				
+
 			}
 		}
 	}
@@ -291,7 +313,7 @@ export default {
 					display block;
 				}
 			}
-	
+
 		}
 	}
 	.list{
@@ -329,17 +351,17 @@ export default {
 					overflow: hidden;//溢出隐藏
 					text-overflow: ellipsis;//省略号
 					white-space: nowrap;//强制文本不换行
-			
+
 				}
 			}
 			.list-li:last-child{
 				border-bottom: none;
 			}
 		}
-		
-		
+
+
 	}
-	.list-tow{	
+	.list-tow{
 		.list-tow-li{
 			width: 690rpx;
 			height:auto;
@@ -374,7 +396,7 @@ export default {
 					border-radius: 20rpx;
 					padding: 20rpx 20rpx;
 					box-sizing: border-box;
-					
+
 				}
 				.list-tow-li-t-c2{
 					background: rgba(31,165,13,0.2);
@@ -390,7 +412,7 @@ export default {
 					right: 0;
 					top: 0;
 				}
-				
+
 				.list-tow-li-t-r{
 					position: absolute;
 					right:-15rpx;
@@ -432,10 +454,10 @@ export default {
 						color: #333333;
 						line-height: 74rpx;
 					}
-					
+
 				}
 			}
-		}	
+		}
 	}
 	.tip{
 		font-size: 26rpx;
@@ -445,8 +467,8 @@ export default {
 		line-height: 37rpx;
 		text-align: center;
 		margin-top: 42rpx;
-		
+
 	}
-}	
+}
 
 </style>

+ 16 - 10
pages/views/teacherPage/teacherHome.vue

@@ -5,7 +5,8 @@
 		<view class="home-page" v-if="pageType == 2">
 			<nav-bar :title="title" :background="background"></nav-bar>
 			<view class="top-back-img" :style="{top:navHeight+'rpx'}">
-				<view class="position-data-button" @click="goPage('dataBoard')" v-if="dataPageType">数据看板</view>
+				<!-- <view class="position-data-button" @click="goPage('dataBoard')" v-if="dataPageType">数据看板</view> -->
+				<img class="position-data-button" @click="goPage('dataBoard')" v-if="dataPageType" src="@/pages/images/newImage/icon_sy_sjmb@1x.png">
 				<img class="position-img" :src="rectangleLogo">
 			</view>
 			<view class="button-one-box">
@@ -72,6 +73,7 @@
 			<img class="scan_btn" @click.stop="saoCode" src="@/pages_safetyExamine/images/icon_xyxc_sm.png" />
 			<tab-bar></tab-bar>
 		</view>
+
 	</view>
 </template>
 
@@ -172,7 +174,9 @@
 
 				} else if (type == 'deviceManagement') {
 					//设备管理
-
+					uni.navigateTo({
+						url: "/pages_basics/views/deviceCageSitePage?pageType=1",
+					});
 				} else if (type == 'emergencyDisposal') {
 					//应急处置
 					uni.navigateTo({
@@ -180,7 +184,9 @@
 					});
 				} else if (type == 'cageSiteManagement') {
 					//笼位管理
-
+					uni.navigateTo({
+						url: "/pages_basics/views/deviceCageSitePage?pageType=2",
+					});
 				} else if (type == 'snapshot') {
 					//随手拍
 					uni.navigateTo({
@@ -326,18 +332,18 @@
 
 				.position-data-button {
 					z-index: 5;
-					position: absolute;
+					position: fixed;
 					right: 0;
-					top: 40rpx;
-					width: 160rpx;
-					height: 50rpx;
-					line-height: 50rpx;
+					top: 150rpx;
+					width: 70rpx;
+					height: 58rpx;
+					/* line-height: 50rpx;
 					background-color: #0183fa;
 					color: #fff;
 					font-size: 28rpx;
 					text-align: center;
 					border-top-left-radius: 30rpx;
-					border-bottom-left-radius: 30rpx;
+					border-bottom-left-radius: 30rpx; */
 				}
 			}
 
@@ -348,7 +354,7 @@
 				border-radius: 20rpx;
 				padding: 13px 0 20px;
 				overflow: hidden;
-				margin: 450rpx 30rpx 0;
+				margin: 490rpx 30rpx 0;
 
 				.button-min {
 					display: inline-block;

+ 35 - 2
pages_basics/api/index.js

@@ -1,4 +1,4 @@
-import { apiResquest,apiResquestForm,apiResquestJsonList,apiResquestFormVideo,apiResquestTimer } from '@/api/request/request.js'
+import { apiResquest,apiResquestForm,apiResquestJsonList,apiResquestFormVideo,apiResquestTimer,apiResquestOutside} from '@/api/request/request.js'
 
 //用户修改头像接口
 export const systemMineUserEdit = (data) => {
@@ -80,6 +80,14 @@ export const laboratoryAppletAddPhotoInspect = (data) => {
 		data: { ...data }
 	})
 };
+//离开检查-直接离开
+export const laboratoryAppletSignOutSubmit = (data) => {
+	return apiResquest({
+		url: `/laboratory/applet/signOutSubmit`,
+		method: 'POST',
+		data: { ...data }
+	})
+};
 
 
 //查询用户电子签名
@@ -105,4 +113,29 @@ export const updateSignature  = (data) => {
         method: 'POST',
         data: {...data}
     })
-};
+};
+
+//设备资产管理
+export const systemMineLinkGetEquipmentDetail = (data) => {
+	return apiResquest({
+		url: `/system/mine/link/getEquipmentDetail`,
+		method: 'get',
+		data: { ...data }
+	})
+};
+//笼位管理
+export const systemMineLinkGetCagePositionDetail = (data) => {
+	return apiResquest({
+		url: `/system/mine/link/getCagePositionDetail`,
+		method: 'get',
+		data: { ...data }
+	})
+};
+//设备资产管理/笼位管理获取跳转参数
+export const menuLinkPost  = (url,data) => {
+    return apiResquestOutside({
+        url: url,
+        method: 'POST',
+        data: {...data}
+    })
+};

+ 111 - 0
pages_basics/views/deviceCageSitePage.vue

@@ -0,0 +1,111 @@
+<!--设备管理和笼位管理页面-->
+<template>
+	<view id="deviceCageSitePage">
+		<!-- 设备管理 -->
+		<web-view v-if="pageType==1" :src="'https://lab.xf100.net/ysms-h5/#/?userId='+userId"></web-view>
+		<!-- 笼位管理 -->
+		<web-view v-if="pageType==2" :src="'http://175.27.136.248:9033/#/?ticket='+ticket"></web-view>
+	</view>
+</template>
+
+<script>
+	import {
+		config
+	} from '@/api/request/config.js'
+	import {
+		systemMineLinkGetEquipmentDetail,
+		systemMineLinkGetCagePositionDetail,
+		menuLinkPost
+	} from '@/pages_basics/api/index.js'
+	export default {
+		name: "deviceCageSitePage",
+		data() {
+			return {
+				baseUrl: config.base_url,
+				pageType: 0, //1设备 2笼位
+				userId: '',
+				ticket: '',
+			}
+		},
+		onLoad(option) {
+			let self = this;
+			this.pageType = option.pageType;
+			console.log(this.pageType)
+		},
+		mounted() {
+			if(this.pageType==1){
+				this.userId=uni.getStorageSync('userId');
+				//this.systemMineLinkGetEquipmentDetail()
+			}else if(this.pageType==2){
+				this.systemMineLinkGetCagePositionDetail()
+			}
+
+
+		},
+
+		methods: {
+			//设备资产管理
+			async systemMineLinkGetEquipmentDetail() {
+				const {
+					data
+				} = await systemMineLinkGetEquipmentDetail();
+				if (data.code == 200) {
+					this.getParams(data.data)
+				}
+
+			},
+			//笼位管理
+			async systemMineLinkGetCagePositionDetail() {
+				const {
+					data
+				} = await systemMineLinkGetCagePositionDetail();
+				if (data.code == 200) {
+					this.getParams(data.data)
+				}
+
+			},
+
+			getParams(item) {
+				let params = JSON.parse(item.params)
+				let obj = {};
+				params.requestArgument.forEach((item) => {
+					if (item.type == 1) {
+						//数据-键值对
+						obj[item.key] = item.value;
+					} else if (item.type == 2) {
+						//读取cookie
+						obj[item.value] = Cookies.get(item.key);
+					} else if (item.type == 3) {
+						//读取localStorage
+						obj[item.value] = uni.getStorageSync('userId');
+					}  else if (item.type == 5) {
+						//生成时间戳-区分13位或者10位
+						if (item.num == '10') {
+							obj[item.key] = Date.parse(new Date()) / 1000;
+				  	formData.append(item.key, );
+						} else if (item.num == '13') {
+							obj[item.key] = Date.parse(new Date());
+						}
+				 }
+				})
+				this.menuLinkPost(item,obj)
+
+			},
+			async menuLinkPost(item,obj){
+				menuLinkPost('http://'+item.reqApi,obj).then(response => {
+					if(response.data.code==200){
+						this.ticket=response.data.data.ticket
+					}
+
+				})
+			},
+
+		},
+	}
+</script>
+
+<style lang="stylus" scoped>
+	#deviceCageSitePage {
+		overflow scroll
+	}
+</style>

+ 31 - 4
pages_basics/views/photoInspection.vue

@@ -29,7 +29,7 @@
 
 			</view>
 		</view>
-		<view class="up-data-button" @click="upButton">提交</view>
+		<view class="up-data-button" @click="upButton">离开</view>
 		<helang-compress ref="helangCompress"></helang-compress>
 	</view>
 
@@ -43,7 +43,8 @@
 	import {
 		laboratoryAppletSignSubList,
 		laboratoryAppletOutCheckList,
-		laboratoryAppletAddPhotoInspect
+		laboratoryAppletAddPhotoInspect,
+		laboratoryAppletSignOutSubmit
 	} from '@/pages_basics/api/index.js'
 	export default {
 		components: {
@@ -55,6 +56,7 @@
 				newData: {},
 				subList: [],
 				subListIndex: "",
+				subId:'',
 				pageType: 2,
 				outCheckData: {
 					list: [],
@@ -78,6 +80,7 @@
 		methods: {
 			buttonChange(e) {
 				this.subListIndex = e.mp.detail.value;
+				this.subId=this.subList[this.subListIndex].subId;
 				this.laboratoryAppletOutCheckList()
 			},
 			//获取实验室
@@ -97,7 +100,12 @@
 					subId: this.subList[this.subListIndex].subId
 				});
 				if (data.code == 200) {
-					this.outCheckData = data.data;
+					if(data.data.list[0]){
+						this.outCheckData = data.data;
+					}else{
+
+						this.laboratoryAppletSignOutSubmit()
+					}
 				}
 			},
 			checkItem(index) {
@@ -156,6 +164,7 @@
 					}
 				});
 			},
+
 			//拍照检查提交
 			async laboratoryAppletAddPhotoInspect() {
 				let self = this;
@@ -185,6 +194,24 @@
 					}, 2000);
 				}
 			},
+			//直接离开
+			async laboratoryAppletSignOutSubmit() {
+				let self = this;
+				const {
+					data
+				} = await laboratoryAppletSignOutSubmit({subId:this.subId});
+				if (data.code == 200) {
+					uni.showToast({
+						title: '签退成功!',
+						icon: "none",
+						mask: true,
+						duration: 2000
+					});
+					setTimeout(function() {
+						uni.navigateBack();
+					}, 2000);
+				}
+			},
 			upImg(index) {
 				let self = this;
 				wx.chooseImage({
@@ -412,4 +439,4 @@
 			bottom: 0;
 		}
 	}
-</style>
+</style>

+ 0 - 1
pages_basics/views/signature/signature.vue

@@ -64,7 +64,6 @@
 			async signatureDele() {
 				let _this = this;
 				this.signatureData = '';
-				this.alreadyImg = '';
 			},
 			//保存按钮
 			async saveFun() {

+ 76 - 54
pages_manage/views/laboratory/iotControl.vue

@@ -14,9 +14,10 @@
 		</view>
 		<view class="sensor">
 			<view v-for="(item,index) in sensorData" :key="index">
-				<img class="sensor-l" :src="baseUrl+item.icon"/>
-				<view class="sensor-r">{{item.deviceName}}:
-					{{item.deviceValue?item.deviceValue:''}}{{item.unit?item.unit:''}}</view>
+				<img class="sensor-l" :src="baseUrl+item.icon" />
+				<view class="sensor-r" :class="item.type?'color-B':'color-A'">{{item.deviceName}}:
+					{{item.deviceValue?item.deviceValue:''}}{{item.unit?item.unit:''}}
+				</view>
 			</view>
 		</view>
 		<!-- 智能控制 -->
@@ -88,10 +89,11 @@
 					name: '智能管控一体机',
 					pcType: 1,
 				}],
+				planSensorList: [],
 			}
 		},
 		created() {
-
+			this.planSensorList = uni.getStorageSync("planSensorList");
 		},
 		mounted() {
 			this.$set(this, 'newData', this.subjectData);
@@ -159,9 +161,9 @@
 						success: function(res) {
 							if (res.confirm) {
 								self.mangerControl(row, status);
-								setTimeout(function(){
+								setTimeout(function() {
 									self.iotAppHardwareFindByType();
-								},200)
+								}, 200)
 
 								console.log('用户点击确定');
 							} else if (res.cancel) {
@@ -192,12 +194,25 @@
 			},
 			//查询传感器状态
 			async iotAppSensorFindBySubId() {
+				let self = this;
 				const {
 					data
 				} = await iotAppSensorFindBySubId({
 					subId: this.subId
 				});
 				if (data.code == 200) {
+					data.data.forEach((item) => {
+						let num = 0;
+						if (self.planSensorList[0]) {
+							self.planSensorList.forEach((minItem) => {
+								if (item.deviceNo == minItem) {
+									num++
+								}
+							})
+						}
+
+						item.type = num != 0;
+					})
 					this.$set(this, 'sensorData', data.data);
 				}
 			},
@@ -211,36 +226,35 @@
 				if (data.code == 200) {
 					data.data.forEach((item) => {
 						if (item.hardwareTypeKey == 'airConditioner') {
-              if(item.reservedThree == 0){
-                item.switchType = 0;
-              }else if(item.reservedThree == 2){
-                item.switchType = 1;
-                item.functionType = 3;
-              }else if(item.reservedThree.indexOf('-') != -1){
-                let list = item.reservedThree.split('-');
-                item.switchType = 1;
-                item.functionType = list[0]==3?1:(list[0]==4?2:'');
-                item.orderType = list[1]?list[1]:'';
-              }else{
-                item.switchType = '';
-                item.functionType = '';
-                item.orderType = '';
-              }
+							if (item.reservedThree == 0) {
+								item.switchType = 0;
+							} else if (item.reservedThree == 2) {
+								item.switchType = 1;
+								item.functionType = 3;
+							} else if (item.reservedThree.indexOf('-') != -1) {
+								let list = item.reservedThree.split('-');
+								item.switchType = 1;
+								item.functionType = list[0] == 3 ? 1 : (list[0] == 4 ? 2 : '');
+								item.orderType = list[1] ? list[1] : '';
+							} else {
+								item.switchType = '';
+								item.functionType = '';
+								item.orderType = '';
+							}
 						}
 					})
 					this.$set(this, 'labHardwareVOList', data.data);
-					let list = [
-							{
-								type: 'video',
-								hardwareName: '视频监控',
-								img: require('@/pages_manage/images/icon_xq_spjk.png'),
-							},
-							{
-								type: 'speech',
-								hardwareName: '语音广播',
-								img: require('@/pages_manage/images/icon_sskz_xz.png'),
-							},
-						];
+					let list = [{
+							type: 'video',
+							hardwareName: '视频监控',
+							img: require('@/pages_manage/images/icon_xq_spjk.png'),
+						},
+						{
+							type: 'speech',
+							hardwareName: '语音广播',
+							img: require('@/pages_manage/images/icon_sskz_xz.png'),
+						},
+					];
 					for (let i = 0; i < data.data.length; i++) {
 						if (data.data[i].hardwareTypeKey == 'airConditioner') {
 							data.data[i].type = 'conditioning';
@@ -248,7 +262,7 @@
 							list.push(data.data[i])
 						}
 					}
-					this.$set(this,'deviceType',list);
+					this.$set(this, 'deviceType', list);
 				}
 			},
 			//查询物联设备
@@ -305,28 +319,28 @@
 							//智能控制
 							let data = JSON.parse(message)
 							let list = JSON.parse(JSON.stringify(this.labHardwareVOList))
-							console.log('智能控制',data)
+							console.log('智能控制', data)
 							list.forEach((item) => {
 								if (item.hardwareNo == data.hardwareNo) {
 									if (item.hardwareTypeKey == 'airConditioner') {
-                  if(data.command == 0){
-                    item.switchType = 0;
-                    item.functionType = '';
-                    item.orderType = '';
-                  }else if(data.command == 2){
-                    item.switchType = 1;
-                    item.functionType = 3;
-                    item.orderType = '';
-                  }else if(data.command.indexOf('-') != -1){
-                    let list = data.command.split('-');
-                    item.switchType = 1;
-                    item.functionType = list[0]==3?1:(list[0]==4?2:'');
-                    item.orderType = list[1]?list[1]:'';
-                  }else{
-                    item.switchType = '';
-                    item.functionType = '';
-                    item.orderType = '';
-                  }
+										if (data.command == 0) {
+											item.switchType = 0;
+											item.functionType = '';
+											item.orderType = '';
+										} else if (data.command == 2) {
+											item.switchType = 1;
+											item.functionType = 3;
+											item.orderType = '';
+										} else if (data.command.indexOf('-') != -1) {
+											let list = data.command.split('-');
+											item.switchType = 1;
+											item.functionType = list[0] == 3 ? 1 : (list[0] == 4 ? 2 : '');
+											item.orderType = list[1] ? list[1] : '';
+										} else {
+											item.switchType = '';
+											item.functionType = '';
+											item.orderType = '';
+										}
 									} else {
 										item.operatingState = data.operatingState;
 										item.online = data.online;
@@ -482,7 +496,7 @@
 					font-family: PingFang SC;
 					font-weight: 500;
 					font-size: 28rpx;
-					color: #222222;
+
 					line-height: 30rpx;
 					overflow: hidden;
 
@@ -490,6 +504,14 @@
 
 					white-space: nowrap;
 				}
+
+				.color-A {
+					color: #222222;
+				}
+
+				.color-B {
+					color: red;
+				}
 			}
 		}
 

+ 7 - 3
pages_manage/views/laboratory/safetyCard.vue

@@ -20,10 +20,14 @@
 		</view>
 		<view class="classify" v-for="(item,index) in newData.labInfoBrandModels" :key="index">
 			<view v-if="item.privateList.length>0 && item.brandType==1" class="small-title">{{item.brandName}}</view>
-			<view v-if="item.privateList.length>0 && item.brandType==1" class="small-items" v-for="(item2,index2) in item.privateList" :key="index2">
+			<view v-if="item.privateList.length>0 && item.brandType==1 && !item.isSpecial" class="small-items" v-for="(item2,index2) in item.privateList" :key="index2">
 				<view>● </view>
 				<view>{{item2.infoName}}</view>
 			</view>
+			<view v-if="item.privateList.length>0 && item.brandType==1 && item.isSpecial" class="small-items" v-for="(item2,index2) in item.privateList" :key="index2">
+				<view></view>
+				<view>{{item2.infoName}}</view>
+			</view>
 			<view  v-if="item.privateList.length>0 && item.brandType==2" class="logotype">{{item.brandName}}</view>
 			<view  v-if="item.privateList.length>0 && item.brandType==2" class="logotype-img">
 				<img v-for="(item3,index3) in item.privateList" :key="index3" :src="baseUrl+item3.infoContent">
@@ -149,7 +153,7 @@
 					line-height: 34rpx;
 					color: #999999;
 				}
-				
+
 			}
 			.logotype{
 				width: 750rpx;
@@ -182,4 +186,4 @@
 			margin: 22rpx 0 50rpx 276rpx;
 		}
 	}
-</style>
+</style>