dedsudiyu 10 ay önce
ebeveyn
işleme
b11d8d29ce

+ 4 - 0
pages/views/login/login.vue

@@ -117,6 +117,10 @@
 							uni.redirectTo({
 								url: '/pages/views/saoCode/saoCode',
 							});
+						}else if(uni.getStorageSync('warningId')){
+							uni.redirectTo({
+								url: '/pages_basics/views/earlyWarningManage/earlyWarningDetail',
+							});
 						} else {
 							uni.redirectTo({
 								url: '/pages/views/home/home',

+ 24 - 0
pages_basics/api/index.js

@@ -7,4 +7,28 @@ export const systemMineUserEdit = (data) => {
 		method: 'POST',
 		data: { ...data }
 	})
+};
+//预警记录-列表
+export const systemMineWarningNoticeList = (data) => {
+	return apiResquest({
+		url: `/system/mine/warningNoticeList`,
+		method: 'POST',
+		data: { ...data }
+	})
+};
+//预警记录-非预案详情
+export const systemMineWarningNoticeDetail = (data) => {
+	return apiResquest({
+		url: `/system/mine/warningNoticeDetail`,
+		method: 'get',
+		data: { ...data }
+	})
+};
+//预警记录-预案详情
+export const laboratoryEventFindByEventId = (data) => {
+	return apiResquest({
+		url: `/laboratory/event/findByEventId`,
+		method: 'get',
+		data: { ...data }
+	})
 };

Dosya farkı çok büyük olduğundan ihmal edildi
+ 771 - 596
pages_basics/views/earlyWarningManage/earlyWarningDetail.vue


+ 274 - 224
pages_basics/views/earlyWarningManage/earlyWarningList.vue

@@ -1,268 +1,318 @@
-<!-- 安全检查-校院巡查管理 -->
+<!-- 预警记录 -->
 <template>
-  <view class="earlyWarning">
-	<scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
-		<viw class="list" v-for="(item,index) in dataList" :key="index">
-			<view class="list_t">{{item[0].createDate}}</view>
-			<view class="list_li" v-for="(item2,index2) in item" :key="index2" @click="handleClick(item2,'detail')">
-				<view class="list_li_t">
-					<view class="list_li_t_l"></view>
-					<view class="list_li_t_c orange_color" v-if="item2.warningType==1">算法识别</view>
-					<view class="list_li_t_c yellow_color" v-if="item2.warningType==2">化学品</view>
-					<view class="list_li_t_c yellow_color" v-if="item2.warningType==3">气瓶</view>
-					<view class="list_li_t_c red_color" v-if="item2.warningType==4">预案</view>
-					<view class="list_li_t_c2">{{item2.warningContent}}</view>
-					<view class="list_li_t_r"></view>
-				</view>
-				<view class="list_li_b">
-					<view class="list_li_b_t">
-						<text>{{item2.subName}}</text>
-						<text>{{item2.warningTime.split(' ')[1]}}</text>
+	<view class="earlyWarning">
+		<scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
+			<viw class="list" v-for="(item,index) in dataList" :key="index">
+				<view class="list_t">{{item.appCreateTime}}</view>
+				<view class="list_li" v-for="(item2,index2) in item.list" :key="index2" @click="handleClick(item2)">
+					<view class="list_li_t">
+						<view class="list_li_t_l"></view>
+						<view class="list_li_t_c orange_color" v-if="item2.warnType==1">化学品</view>
+						<view class="list_li_t_c yellow_color_one" v-if="item2.warnType==2">气瓶</view>
+						<view class="list_li_t_c yellow_color" v-if="item2.warnType==3">算法识别</view>
+						<view class="list_li_t_c red_color" v-if="item2.warnType==4">预案</view>
+						<view class="list_li_t_c2" v-if="item2.warnType == 1">
+							{{item2.chemicalWarnType == 1?'化学品违规带离':
+						(item2.chemicalWarnType == 2?'化学品超时未归还':
+						(item2.chemicalWarnType == 3?'化学品过期':
+						(item2.chemicalWarnType == 4?'化学品即将过期':
+						(item2.chemicalWarnType == 5?'化学品超期未入库':
+						(item2.chemicalWarnType == 6?'化学品业务操作超时':
+						'')))))}}
+						</view>
+						<view class="list_li_t_c2" v-else>{{item2.warnContent}}</view>
+						<view class="list_li_t_r"></view>
 					</view>
-					<view class="list_li_b_b">
-						<img src="@/pages_basics/images/icon_wtzg_xx.png"/>
-						<text>{{item2.buildName}}-{{item2.floorName}}{{item2.roomNum}}</text>
+					<view class="list_li_b">
+						<view class="list_li_b_t">
+							<text>{{item2.subName}}</text>
+							<text>{{item2.appTimeDivision}}</text>
+						</view>
+						<view class="list_li_b_b">
+							<img src="@/pages_basics/images/icon_wtzg_xx.png" />
+							<text>{{item2.buildName}}-{{item2.floorName}}{{item2.roomNum}}</text>
+						</view>
 					</view>
 				</view>
-			</view>
-		</viw>
-		<img class="null-img" v-if="!dataList[0]" src="@/pages_basics/images/null-data-1.png">
-	</scroll-view>
-  </view>
+			</viw>
+			<view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
+		</scroll-view>
+	</view>
 
 </template>
 
 <script>
-import { config } from '@/api/request/config.js'
-import {warningNoticeLogList} from '@/api/apiDemo/index.js'
-export default {
-  name: "rectifyList",
-  components: {
+	import {
+		systemMineWarningNoticeList
+	} from '@/pages_basics/api/index.js'
+	export default {
+		name: "rectifyList",
+		components: {
 
-  },
-  data() {
-    return {
-		//列表请求参数
-		getData:{
-			pageNum:1,
-			pageSize:10,
 		},
-		dataList:[],
-		dataArr:[],//临时存储
-		total:0,
-		timeStatus:false,//判断是否超过当前时间30分钟
-
-	}
-  },
-  onLoad(option) {
-
-  },
-  onShow() {
-
-  },
-  mounted(){
-	 this.getList();
-  },
-  methods: {
-
-		//滚动事件
-		scrollGet(){
-			let self=this;
-			if(self.total/self.getData.pageSize<=self.getData.pageNum){
-			    console.log('没有更多数据!')
-			}else{
-					setTimeout(function(){
-						self.getData.pageNum += 1;
-						self.getList();
-					},1000)
+		data() {
+			return {
+				// 查询参数
+				queryParams: {
+					page: 1,
+					pageSize: 4,
+				},
+				dataList: [],
+				dataArr: [], //临时存储
+				total: 0,
+				timeStatus: false, //判断是否超过当前时间30分钟
+				getDataType: false,
 
 			}
-
 		},
-
-		handleClick(row,doType){
-		  let self=this;
-		  if( doType=='detail'){//详情
-			  uni.navigateTo({
-			    url: '/pages_basics/views/earlyWarningManage/earlyWarningDetail?warningId='+row.id,//安全警报
-			  });
-		  }
+		onLoad(option) {
 
 		},
-		//排序
-		sortClass(sortData){
-		  const groupBy = (array, f) => {
-		    let groups = {};
-		    array.forEach((o) => {
-		      let group = JSON.stringify(f(o));
+		onShow() {
 
-		      groups[group] = groups[group] || [];
-		      groups[group].push(o);
-		    });
-		    return Object.keys(groups).map((group) => {
-		      return groups[group];
-		    });
-		  };
-		  const sorted = groupBy(sortData, (item) => {
-		    return item.createDate; // 返回需要分组的对象
-		  });
-		  return sorted;
 		},
-		async getList(){
-			let self = this;
-			const {data} = await warningNoticeLogList(this.getData);
-			if(data.code==200){
-				this.dataArr=[...this.dataArr,...data.data.records]
-				this.dataList=this.sortClass(this.dataArr)
-				console.log(this.dataList)
-				this.total=data.data.total;
-			}
+		mounted() {
+			this.getList();
 		},
+		methods: {
+			//滚动加载事件
+			scrollGet() {
+				if (this.total / this.queryParams.pageSize <= this.queryParams.page) {
+					this.$set(this, 'getDataType', true);
+				} else {
+					this.queryParams.page += 1;
+					this.$nextTick(() => {
+						this.getList();
+					})
+				}
+			},
+
+			handleClick(item) {
+				if(item.warnType != 4){
+					uni.navigateTo({
+						url: '/pages_basics/views/earlyWarningManage/earlyWarningDetail?noticeId='+item.noticeId, //安全警报
+					});
+				}else{
+					uni.navigateTo({
+						url: '/pages_basics/views/earlyWarningManage/earlyWarningDetail?eventId='+item.chemicalWarnInfo, //安全警报
+					});
+				}
+			},
+			//排序
+			sortClass(sortData) {
+				const groupBy = (array, f) => {
+					let groups = {};
+					array.forEach((o) => {
+						let group = JSON.stringify(f(o));
 
-  }
-}
+						groups[group] = groups[group] || [];
+						groups[group].push(o);
+					});
+					return Object.keys(groups).map((group) => {
+						return groups[group];
+					});
+				};
+				const sorted = groupBy(sortData, (item) => {
+					return item.createDate; // 返回需要分组的对象
+				});
+				return sorted;
+			},
+			async getList() {
+				const {
+					data
+				} = await systemMineWarningNoticeList(this.queryParams);
+				if (data.code == 200) {
+					let list = JSON.parse(JSON.stringify(this.dataList));
+					data.data.records.forEach((item) => {
+						let num = 0;
+						list.forEach((minItem) => {
+							if (item.appCreateTime == minItem.appCreateTime) {
+								num++
+								minItem.list.push(item)
+							}
+						})
+						if (num == 0) {
+							list.push({
+								appCreateTime: item.appCreateTime,
+								list: [item]
+							})
+						}
+					})
+					this.$set(this, 'dataList', list);
+					this.$set(this, 'total', data.data.total);
+					if (data.data.total / this.queryParams.pageSize <= this.queryParams.page) {
+						this.$set(this, 'getDataType', true);
+					}
+				}
+			},
+
+		}
+	}
 </script>
 
 <style lang="stylus" scoped>
-.earlyWarning{
-	height:100%;
-	display flex;
-	padding: 0 30rpx;
-	box-sizing: border-box;
-	.red_color{
-		color: #D40000;
-		border: 1rpx solid #D40000;
-	}
-	.orange_color{
-		color: #FF4800;
-		border: 1rpx solid #FF4800;
-	}
-	.yellow_color{
-		color: #FFA34E;
-		border: 1rpx solid #FFA34E;
-	}
-	.null-img{
-		display block
-		width:276rpx;
-		height:321rpx;
-		margin:100rpx 0 0 274rpx;
-	}
-	.list{
-		.list_t{
-			height: 80rpx;
-			font-size: 30rpx;
-			font-family: PingFang SC-Medium, PingFang SC;
-			font-weight: 400;
-			color: #666666;
-			line-height: 80rpx;
+	.earlyWarning {
+		height: 100%;
+		display flex;
+		flex-direction column;
+		padding: 0 30rpx 30rpx;
+		box-sizing: border-box;
+
+		.red_color {
+			color: #D40000;
+			border: 1rpx solid #D40000;
 		}
-		.list_li{
-			width: 690rpx;
-			height:auto;
-			background: #FFFFFF;
-			border-radius: 10rpx;
-			padding-bottom: 52rpx;
-			box-sizing: border-box;
-			margin-bottom: 20rpx;
-			.list_li_t{
-				position: relative;
-				height: 110rpx;
-				display: flex;
-				justify-content: flex-start;
-				align-items: center;
-				.list_li_t_l{
-					position: absolute;
-					left:-15rpx;
-					top: 76rpx;
-					width: 30rpx;
-					height: 30rpx;
-					background:#F5F5F5;
-					border-radius: 15rpx;
-				}
-				.list_li_t_c{
-					height: 40rpx;
-					font-size: 30rpx;
-					font-family: PingFang SC-Medium, PingFang SC;
-					font-weight: 400;
-					line-height: 36rpx;
-					margin-left: 30rpx;
-					margin-right: 20rpx;
-					border-radius: 20rpx;
-					padding: 0 20rpx;
-					box-sizing: border-box;
 
-				}
-				.list_li_t_c2{
-					font-size: 30rpx;
-					font-family: PingFang SC-Medium, PingFang SC;
-					font-weight: 400;
-					color: #333333;
-					line-height: 30rpx;
-					white-space: nowrap;
-					overflow: hidden;
-				    text-overflow: ellipsis;
-					flex: 1;
-				}
-				.list_li_t_r{
-					position: absolute;
-					right:-15rpx;
-					top: 76rpx;
-					width: 30rpx;
-					height: 30rpx;
-					background:#F5F5F5;
-					border-radius: 15rpx;
-				}
+		.orange_color {
+			color: #FF4800;
+			border: 1rpx solid #FF4800;
+		}
+
+		.yellow_color {
+			color: #FFA34E;
+			border: 1rpx solid #FFA34E;
+		}
+		.yellow_color_one {
+			color: #bc8f8f;
+			border: 1rpx solid #bc8f8f;
+		}
+
+		.get-data-null-p {
+			text-align: center;
+			line-height: 40rpx;
+			padding-bottom: 40px;
+			color: #999;
+		}
+
+		.list {
+			.list_t {
+				height: 80rpx;
+				font-size: 30rpx;
+				font-family: PingFang SC-Medium, PingFang SC;
+				font-weight: 400;
+				color: #666666;
+				line-height: 80rpx;
 			}
-			.list_li_b{
-				margin: 0 30rpx;
-				border-top: 1rpx dotted #D8D8D8;
 
-				.list_li_b_t{
+			.list_li {
+				width: 690rpx;
+				height: auto;
+				background: #FFFFFF;
+				border-radius: 10rpx;
+				padding-bottom: 52rpx;
+				box-sizing: border-box;
+				margin-bottom: 20rpx;
+
+				.list_li_t {
+					position: relative;
+					height: 110rpx;
 					display: flex;
-					justify-content: space-between;
-					margin-top:28rpx;
-					>text:nth-of-type(1){
+					justify-content: flex-start;
+					align-items: center;
+
+					.list_li_t_l {
+						position: absolute;
+						left: -15rpx;
+						top: 76rpx;
+						width: 30rpx;
+						height: 30rpx;
+						background: #F5F5F5;
+						border-radius: 15rpx;
+					}
+
+					.list_li_t_c {
+						height: 40rpx;
 						font-size: 30rpx;
 						font-family: PingFang SC-Medium, PingFang SC;
 						font-weight: 400;
-						color: #333333;
-						line-height: 30rpx;
+						line-height: 36rpx;
+						margin-left: 30rpx;
+						margin-right: 20rpx;
+						border-radius: 20rpx;
+						padding: 0 20rpx;
+						box-sizing: border-box;
+
 					}
-					>text:nth-of-type(2){
+
+					.list_li_t_c2 {
 						font-size: 30rpx;
 						font-family: PingFang SC-Medium, PingFang SC;
 						font-weight: 400;
-						color: #666666;
+						color: #333333;
 						line-height: 30rpx;
-					}
-				}
-				.list_li_b_b{
-					display: flex;
-					justify-content: flex-start;
-					margin-top:30rpx;
-					>img{
-						width: 30rpx;
-						height: 30rpx;
-						margin-right: 22rpx;
-					}
-					>text{
-						font-size: 28rpx;
-						font-family: PingFang SC-Medium, PingFang SC;
-						font-weight: 400;
-						color: #666666;
-						line-height: 28rpx;
 						white-space: nowrap;
 						overflow: hidden;
 						text-overflow: ellipsis;
 						flex: 1;
 					}
+
+					.list_li_t_r {
+						position: absolute;
+						right: -15rpx;
+						top: 76rpx;
+						width: 30rpx;
+						height: 30rpx;
+						background: #F5F5F5;
+						border-radius: 15rpx;
+					}
+				}
+
+				.list_li_b {
+					margin: 0 30rpx;
+					border-top: 1rpx dotted #D8D8D8;
+
+					.list_li_b_t {
+						display: flex;
+						justify-content: space-between;
+						margin-top: 28rpx;
+
+						>text:nth-of-type(1) {
+							font-size: 30rpx;
+							font-family: PingFang SC-Medium, PingFang SC;
+							font-weight: 400;
+							color: #333333;
+							line-height: 30rpx;
+						}
+
+						>text:nth-of-type(2) {
+							font-size: 30rpx;
+							font-family: PingFang SC-Medium, PingFang SC;
+							font-weight: 400;
+							color: #666666;
+							line-height: 30rpx;
+						}
+					}
+
+					.list_li_b_b {
+						display: flex;
+						justify-content: flex-start;
+						margin-top: 30rpx;
+
+						>img {
+							width: 30rpx;
+							height: 30rpx;
+							margin-right: 22rpx;
+						}
+
+						>text {
+							font-size: 28rpx;
+							font-family: PingFang SC-Medium, PingFang SC;
+							font-weight: 400;
+							color: #666666;
+							line-height: 28rpx;
+							white-space: nowrap;
+							overflow: hidden;
+							text-overflow: ellipsis;
+							flex: 1;
+						}
+					}
 				}
 			}
 		}
+
+		.info-max-box {
+			flex: 1;
+			overflow-y scroll;
+		}
 	}
-	.info-max-box{
-		flex: 1;
-		overflow: scroll;
-	}
-}
-</style>
+</style>