Przeglądaj źródła

详情页 告警

Ming 3 lat temu
rodzic
commit
db175b953a

+ 44 - 1
common/common.scss

@@ -459,7 +459,7 @@ radio,checkbox {
 	
 	// 现场档案新增
 	.form-item.extraDis .title{
-		width:65%
+		width:65%!important
 	}
 	
 	
@@ -467,6 +467,49 @@ radio,checkbox {
 		position:absolute;
 		left:0
 	}
+	
+	//现场档案详情
+	.archiveDetail {
+		.eleTime{
+			color:#999999;
+			margin-left: 12px;
+			line-height:46px;
+			display:flex;
+			align-items: center;
+			span{
+				color:#4074E7;
+				margin:0 20rpx;
+				display:inline-block
+			}
+			image{
+				width:30rpx;
+				height:30rpx;
+				margin-right:20rpx;
+			}
+			
+		}
+		.form-item.remark{
+			border-bottom:0;
+			line-height:100rpx;
+			textarea{
+				height:70rpx;
+				margin-top:15rpx;
+				width:60%
+			}
+		}
+		.form-item{
+			margin-left: 12px;
+			margin-bottom:0;
+			    border-bottom: 1px solid #EDEDED;
+			    line-height: 46px;
+			    color: #666;
+				padding:0;
+				
+				.sub{
+					font-size:28rpx
+				}
+		}
+	}
 	// 单选框&&相机
 	.form-item.radioSec {
 		display: block;

+ 264 - 34
pages/messagePush/messagePush.vue

@@ -1,25 +1,23 @@
 <template>
-	<view class="padding-sm">
+	<view class="padding-sm messagePush" style="padding-bottom:150rpx">
 
 		<form action="">
-			<checkbox-group class="block" @change="CheckboxChange">
-				<view class="  margin-top  ">
-					<view class="flex align-center checkItems">
-						<checkbox class="blue" :class="checkbox[0].checked?'checked':''" :checked="checkbox[0].checked?true:false" value="A"></checkbox>
-						<view class="title">电力监测</view>
-					</view>
-					<view class="flex align-center checkItems">
-						<checkbox class="blue" :class="checkbox[1].checked?'checked':''" :checked="checkbox[1].checked?true:false" value="B"></checkbox>
-						<view class="title">视频报警</view>
-					</view>
-				</view>
 
-			</checkbox-group>
+			<checkbox-group class="block" @change="CheckboxChange" style="height: calc(100vh - 200rpx);
+    overflow: scroll">
+				<view class="margin-top  ">
+					<view class="flex align-left checkItems" v-for="(item,index) in checkbox">
+						<checkbox class="blue" :class="item.checked==1?'checked':''"
+							:checked="item.checked==1?true:false" :value="item.value"></checkbox>
+						<view class="title">{{item.title}}</view>
 
 
+					</view>
+				</view>
+			</checkbox-group>
 
 			<view class="btn-area submitBottomBtn padding-lr-sm">
-				<button class="bg-blue round  margin-top">提 交 </button>
+				<button class="bg-blue round  margin-top" @click="$noMultipleClicks(btnSubmit())">提 交 </button>
 			</view>
 
 		</form>
@@ -31,46 +29,187 @@
 	export default {
 		data() {
 			return {
+				noClick: true,
+				flag: false,
+				getData: {},
+				checkedValue: [],
 				checkbox: [{
-						value: 'A',
-						checked: false
+						value: 'm1',
+						checked: false,
+						title: '开关1'
 					},
 					{
-						value: 'B',
-						checked: false
+						value: 'm2',
+						checked: false,
+						title: '开关2'
 					},
 					{
-						value: 'C',
-						checked: false
+						value: 'm3',
+						checked: false,
+						title: '开关3'
 					},
 					{
-						value: 'D',
-						checked: false
+						value: 'm4',
+						checked: false,
+						title: '火灾预警总'
 					},
 					{
-						value: 'E',
-						checked: false
+						value: 'm5',
+						checked: false,
+						title: '线路电气故障总'
 					},
 					{
-						value: 'F',
-						checked: false
+						value: 'm6',
+						checked: false,
+						title: '缺相'
 					},
 					{
-						value: 'G',
-						checked: false
+						value: 'm7',
+						checked: false,
+						title: '线路带电'
 					},
 					{
-						value: 'H',
-						checked: false
-					}
+						value: 'm8',
+						checked: false,
+						title: '线路开关状态'
+					},
+					{
+						value: 'm9',
+						checked: false,
+						title: '过压'
+					},
+					{
+						value: 'm10',
+						checked: false,
+						title: '低压'
+					},
+					{
+						value: 'm11',
+						checked: false,
+						title: '电流越限'
+					},
+					{
+						value: '12',
+						checked: false,
+						title: '过流跳闸'
+					},
+					{
+						value: 'm13',
+						checked: false,
+						title: '母线停电'
+					},
+					{
+						value: 'm14',
+						checked: false,
+						title: '剩余电流越限'
+					},
+					{
+						value: 'm15',
+						checked: false,
+						title: '测温点1超温'
+					},
+					
+					{
+						value: 'm16',
+						checked: false,
+						title: '测温点2超温'
+					},
+					{
+						value: 'm17',
+						checked: false,
+						title: '测温点3超温'
+					},
+					{
+						value: 'm18',
+						checked: false,
+						title: '测温点4超温'
+					},
+					{
+						value: 'm19',
+						checked: false,
+						title: '环境温度越限'
+					},
+					{
+						value: 'm20',
+						checked: false,
+						title: 'A相燃弧'
+					},
+					
+					{
+						value: 'm21',
+						checked: false,
+						title: 'B相燃弧'
+					},
+					{
+						value: 'm22',
+						checked: false,
+						title: 'C相燃弧'
+					},
+					
+					{
+						value: 'm23',
+						checked: false,
+						title: '电压谐波越限'
+					},
+					{
+						value: 'm24',
+						checked: false,
+						title: '电流谐波越限'
+					},
+					{
+						value: 'm25',
+						checked: false,
+						title: '有功需量超限'
+					},
+					{
+						value: 'm26',
+						checked: false,
+						title: '视在需量超限'
+					},
+					
+					{
+						value: 'm27',
+						checked: false,
+						title: '测量通道故障'
+					},
+					{
+						value: 'm28',
+						checked: false,
+						title: '设备异常	'
+					},
+					{
+						value: 'm29',
+						checked: false,
+						title: '消音'
+					},
+					{
+						value: 'm30',
+						checked: false,
+						title: '开出1'
+					},
+					{
+						value: 'm31',
+						checked: false,
+						title: '开出2'
+					},
+					
 				],
 
 			}
 		},
+		onLoad: function(option) {
+			this.getCheckList();
+		},
 		methods: {
 			CheckboxChange(e) {
+				this.flag = true;
 				var items = this.checkbox,
 					values = e.detail.value;
+				this.checkedValue = values;
+				// console.log(values)
+
+				// console.log('点击复选框时this.checkedValue')
+				// console.log(this.checkedValue)
 				for (var i = 0, lenI = items.length; i < lenI; ++i) {
 					items[i].checked = false;
 					for (var j = 0, lenJ = values.length; j < lenJ; ++j) {
@@ -81,6 +220,94 @@
 					}
 				}
 			},
+
+
+			// 回显数据请求
+			async getCheckList(params = {}) {
+				const res = await this.$myRequest({
+					url: 'PushSettings/setperm',
+					data: params,
+					showLoading: true
+				})
+				this.getData = res.data.data[0];
+
+
+
+				// 遍历checkbox数组对象
+				for (let i = 0; i < this.checkbox.length; i++) {
+					//判断value是否存在于返回对象中.存在的话checked重新赋值
+					if (this.getData.hasOwnProperty(this.checkbox[i].value)) {
+						// console.log(this.checkbox[i].value)
+						this.checkbox[i].checked = true
+					}
+				}
+			},
+
+
+			//提交
+			async btnSubmit() {
+
+				let mingParams = {};
+				if (!this.flag) {
+					//不点击默认传参
+					var obgj = this.getData;
+					console.log('不点击默认传参obgj')
+					console.log(obgj);
+					var arr = [];
+					for (var key in obgj) {
+						console.log(key)
+						console.log(obgj[key])
+						arr.push([key][0])
+					}
+					arr.map((e) => {
+						mingParams[e] = true;
+					});
+				} else {
+					//点击复选框后传参
+					var arr = this.checkedValue;
+					console.log('自由选中复选框后传参arr')
+					console.log(arr)
+
+
+					arr.map((e) => {
+						mingParams[e] = true;
+					});
+					console.log('mingParams')
+					console.log(mingParams)
+
+
+				}
+
+
+
+				let res = await this.PushSettings(mingParams);
+
+				if (!res.data.flag) {
+					uni.showToast({
+						title: "添加失败",
+						icon: "none"
+					});
+				} else {
+					uni.showToast({
+						title: "添加成功",
+					});
+					setTimeout(() => {
+						uni.switchTab({
+							url: '/pages/setting/setting',
+						});
+					}, 1000);
+				}
+				
+
+			},
+			PushSettings(params = {}) {
+				return this.$myRequest({
+					url: 'PushConfig/setperm',
+					data: params
+				})
+			},
+
+
 		}
 	}
 </script>
@@ -89,13 +316,16 @@
 	.checkItems {
 		width: 50%;
 		display: inline-block;
-		text-align: center;
-		margin-bottom: 40rpx;
+		text-align: left;
+		margin-bottom: 30rpx;
 
 		.title {
 			display: inline-block;
 			margin-left: 10rpx;
+			  //   text-align: left;
+				 // width: 80%;
+			
+			   
 		}
 	}
-	
 </style>

+ 15 - 15
pages/setting/setting.vue

@@ -115,22 +115,22 @@
 				});
 			},
 			goMessagePush() {
-				uni.showModal({
-					title: 'Tips',
-					content: '此模块开发中~',
-					showCancel: false,
-					success: function(res) {
-						if (res.confirm) {
-						} else if (res.cancel) {
-						}
-					}
-				});
-				// uni.navigateTo({
-				// 	url: '/pages/messagePush/messagePush',
-				// 	success: res => {},
-				// 	fail: () => {},
-				// 	complete: () => {}
+				// uni.showModal({
+				// 	title: 'Tips',
+				// 	content: '此模块开发中~',
+				// 	showCancel: false,
+				// 	success: function(res) {
+				// 		if (res.confirm) {
+				// 		} else if (res.cancel) {
+				// 		}
+				// 	}
 				// });
+				uni.navigateTo({
+					url: '/pages/messagePush/messagePush',
+					success: res => {},
+					fail: () => {},
+					complete: () => {}
+				});
 			},
 
 		}

+ 25 - 18
pages/siteArchive/archiveDetail/archiveDetail.vue

@@ -1,40 +1,45 @@
 <template>
-	<view class="appWrapper">
+	<view class="appWrapper archiveDetail">
 		<form action="">
-			<view style="height:30rpx"></view>
 			<view class="form-item">
-				
-				
 				<view class="title">
-					<!-- <text class="necessary">*</text> -->
 					户号:
 				</view>
-				<input name="input" disabled ="true" v-model="detailInfo.account_number" ></input>
+				<view class="sub">{{detailInfo.account_number}}</view>
 			</view>
 			<view class="form-item">
 				<view class="title">流变变比:</view>
-				<input name="input" disabled ="true" v-model="detailInfo.rheological_change"></input>
+				<view class="sub">{{detailInfo.rheological_change}}</view>
 			</view>
 			<view class="form-item">
 				<view class="title" style="width:240rpx">单路电源容量:</view>
-				<input name="input" disabled ="true" v-model="detailInfo.power_capacity"></input>
+				<view class="sub">{{detailInfo.power_capacity}}</view>
 			</view>
 			<view class="form-item">
 				<view class="title">线路:</view>
-				<input name="input" disabled ="true" v-model="detailInfo.route_name"></input>
+				<view class="sub">{{detailInfo.route_name}}</view>
 			</view>
 			<view class="form-item">
 				<view class="title">站点名称:</view>
-				<input name="input" disabled ="true" v-model="detailInfo.site_name"></input>
+				<view class="sub">{{detailInfo.site_name}}</view>
 			</view>
 			<view class="form-item">
 				<view class="title">监察:</view>
-				<input name="input" disabled ="true" v-model="detailInfo.supervision_name"></input>
+				<view class="sub">{{detailInfo.supervision_name}}</view>
+			</view>
+			<view class="form-item">
+				<view class="title">电试报告时间:</view>
+				<view class="sub">{{detailInfo.supervision_name}}</view>
 			</view>
+			<view class="eleTime">
+				<image src="/static/noteIcon.png"></image>
+				<view>距离电试超期还有  <span>730</span>  天</view>
+				
+				</view>
 			
 			<view class="info-tit margin-left-xs">
 				<text class="cuIcon-titles margin-right-xs"></text>
-				四防一通
+				现场问题 
 			</view>
 			<view class="form-item extraDis">
 				<view class="title">电缆孔洞:</view>
@@ -94,7 +99,7 @@
 			
 			<view class="info-tit margin-left-xs">
 				<text class="cuIcon-titles margin-right-xs"></text>
-				室内环境
+				其他
 			</view>
 			<view class="form-item extraDis">
 				<view class="title">堆放杂物:</view>
@@ -199,14 +204,14 @@
 			</view>
 			
 			<!-- 设备 -->
-			<view class="info-tit margin-left-xs">
+		<!-- 	<view class="info-tit margin-left-xs">
 				<text class="cuIcon-titles margin-right-xs"></text>
 				设备
 			</view>
 			<view class="form-item extraDis">
 				<view class="title">设备老旧(标明出厂或投运日期):</view>
 				<input type="text" disabled ="true" v-model="detailInfo.old_equipment" style="width:35%">
-			</view>
+			</view> -->
 			
 			<!-- 安全工器具 -->
 			<view class="info-tit margin-left-xs">
@@ -252,7 +257,7 @@
 					</label>
 				</radio-group>
 			</view>
-			<view class="form-item">
+			<view class="form-item remark" >
 				<view class="title">备注:</view>
 				<!-- <input type="text" disabled="true" v-model="detailInfo.remarks"> -->
 				<textarea name="" id="" disabled="true" v-model="detailInfo.remarks"></textarea>
@@ -312,6 +317,8 @@
 
 
 
-<style lang="scss">
-	
+<style lang="scss" >
+	.form-item .title{
+		width:242rpx
+	}
 </style>

+ 71 - 32
pages/siteArchive/siteArchive.vue

@@ -1,12 +1,35 @@
 <template>
 	<view class="site-wrapper">
-		
-		<view style="height: calc(100vh - 190rpx);overflow:scroll">
+
+		<!-- 筛选框start -->
+		<view style="height:100rpx"></view>
+		<view class="ding">
+
+			<view class="cu-bar search bg-gray filter-section">
+				<view class="search-form round bg-white">
+					<text class="cuIcon-search"></text>
+					<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>
+
+		<!-- 筛选框end -->
+
+		<view style="height: calc(100vh - 290rpx);overflow:scroll">
 			<view class="cu-list menu-avatar">
-				<view class="cu-item"  :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in siteArchiveData"
-				 :key="index" :data-target="'move-box-' + index" @tap="goArchiveDetail(item.id)"  @touchstart="ListTouchStart" @touchmove="ListTouchMove" @touchend="ListTouchEnd">
-					<view class="cu-avatar round lg" style="background-image:url(../../../static/archiveIcon.png)"></view>
-					<view class="content" >
+				<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
+					v-for="(item,index) in siteArchiveData" :key="index" :data-target="'move-box-' + index"
+					@tap="goArchiveDetail(item.id)" @touchstart="ListTouchStart" @touchmove="ListTouchMove"
+					@touchend="ListTouchEnd">
+					<view class="cu-avatar round lg" style="background-image:url(../../../static/archiveIcon.png)">
+					</view>
+					<view class="content">
 						<view class="pro-title">
 							<view class="cut">{{item.site_name}} (现场档案)</view>
 						</view>
@@ -16,21 +39,21 @@
 							<text class="icon iconfont margin-right-sm margin-left-lg">&#xe629;</text>
 						</view>
 					</view>
-					
+
 					<view class="move" style="    width: 66px;">
 						<view class="bg-grey" @click.stop="editItem(item)">编辑</view>
 					</view>
 				</view>
 			</view>
 		</view>
-		
+
 		<!-- 新增按钮start -->
 		<view class="plus">
 			<image src="../../static/plus.png" style="width:100rpx;height:100rpx" @tap="goAddPage()"></image>
 		</view>
 		<!-- 新增按钮end -->
 	</view>
-	
+
 </template>
 
 <script>
@@ -38,20 +61,35 @@
 		data() {
 			return {
 				modalName: null,
-				siteArchiveData:[],
-				
-				
-				
+				siteArchiveData: [],
+
+				siteName: ''
+
+
+
 			};
 		},
-		onLoad:function(option){
-			
+		onLoad: function(option) {
+
 			this.getDataList();
-			
+
 		},
-	
+
 		methods: {
-			
+
+			searchData() {
+				this.getDataList({
+					"siteName": this.siteName,
+				})
+			},
+
+			InputFocus(e) {
+				this.InputBottom = e.detail.height
+			},
+			InputBlur(e) {
+				this.InputBottom = 0
+			},
+
 			//编辑
 			editItem(item) {
 				uni.navigateTo({
@@ -69,11 +107,11 @@
 				console.log(res.data.data)
 				this.siteArchiveData = res.data.data
 			},
-			
+
 			// 页面跳转
-			goArchiveDetail(id){
+			goArchiveDetail(id) {
 				uni.navigateTo({
-					url: '/pages/siteArchive/archiveDetail/archiveDetail?id='+id,
+					url: '/pages/siteArchive/archiveDetail/archiveDetail?id=' + id,
 				});
 			},
 			goAddPage(item) {
@@ -81,18 +119,18 @@
 					url: '/pages/siteArchive/siteArchiveAdd/siteArchiveAdd',
 				});
 			},
-			
-			
+
+
 			// ListTouch触摸开始
 			ListTouchStart(e) {
 				this.listTouchStart = e.touches[0].pageX
 			},
-			
+
 			// ListTouch计算方向
 			ListTouchMove(e) {
 				this.listTouchDirection = e.touches[0].pageX - this.listTouchStart < -80 ? 'left' : 'right'
 			},
-			
+
 			// ListTouch计算滚动
 			ListTouchEnd(e) {
 				if (this.listTouchDirection == 'left') {
@@ -107,14 +145,15 @@
 </script>
 
 <style lang="scss">
-	.cu-item{
-		height:160rpx!important
+	.cu-item {
+		height: 160rpx !important
 	}
-	.cu-list.menu-avatar > .cu-item .content {
-	    left: 110rpx;
+
+	.cu-list.menu-avatar>.cu-item .content {
+		left: 110rpx;
 	}
+
 	.cu-list>.cu-item.move-cur {
-	    -webkit-transform: translateX(-66px);
-		}
-	   
+		-webkit-transform: translateX(-66px);
+	}
 </style>

BIN
static/noteIcon.png