Bladeren bron

告警推送排版

ming 3 jaren geleden
bovenliggende
commit
78a4b3bb77

+ 1 - 1
common/common.scss

@@ -249,7 +249,7 @@ radio,checkbox {
 	margin-top:100rpx;
 	width: 100%;
 	height: calc(100% - 100rpx);
-	overflow: scroll
+	// overflow: scroll
 }
 
 .site-items .site-tit {

+ 102 - 1
data/json.js

@@ -614,6 +614,106 @@ let weiBaoPlan = [{
 		"status": 1
 	}
 
+];
+//功能报备
+let funcReport = [{
+		"id": "1",
+		"title": "报备内容:测试用传装置1",
+		"des": "备注:三楼茶水间",
+		"time": "2021-01-20 15:23:43",
+		"status": 0
+	},
+	{
+		"id": "2",
+		"title": "报备内容:测试用传装置2",
+		"des": "备注:三楼茶水间",
+		"time": "2021-01-20 15:23:43",
+		"status": 0
+	},
+	{
+		"id": "3",
+		"title": "报备内容:测试用传装置3",
+		"des": "备注:三楼茶水间",
+		"time": "2021-01-20 15:23:43",
+		"status": 0
+	},
+	{
+		"id": "4",
+		"title": "报备内容:测试用传装置4",
+		"des": "备注:三楼茶水间",
+		"time": "2021-01-20 15:23:43",
+		"status": 0
+	},
+	{
+		"id": "5",
+		"title": "报备内容:测试用传装置5",
+		"des": "备注:三楼茶水间",
+		"time": "2021-01-20 15:23:43",
+		"status": 0
+	},
+	{
+		"id": "6",
+		"title": "报备内容:测试用传装置6",
+		"des": "备注:三楼茶水间",
+		"time": "2021-01-20 15:23:43",
+		"status": 0
+	},
+	{
+		"id": "7",
+		"title": "报备内容:测试用传装置7",
+		"des": "备注:三楼茶水间",
+		"time": "2021-01-20 15:23:43",
+		"status": 1
+	},
+	{
+		"id": "8",
+		"title": "报备内容:测试用传装置8",
+		"des": "备注:三楼茶水间",
+		"time": "2021-01-20 15:23:43",
+		"status": 2
+	},
+	{
+		"id": "3",
+		"title": "报备内容:测试用传装置3",
+		"des": "备注:三楼茶水间",
+		"time": "2021-01-20 15:23:43",
+		"status": 0
+	},
+	{
+		"id": "4",
+		"title": "报备内容:测试用传装置4",
+		"des": "备注:三楼茶水间",
+		"time": "2021-01-20 15:23:43",
+		"status": 0
+	},
+	{
+		"id": "5",
+		"title": "报备内容:测试用传装置5",
+		"des": "备注:三楼茶水间",
+		"time": "2021-01-20 15:23:43",
+		"status": 0
+	},
+	{
+		"id": "6",
+		"title": "报备内容:测试用传装置6",
+		"des": "备注:三楼茶水间",
+		"time": "2021-01-20 15:23:43",
+		"status": 0
+	},
+	{
+		"id": "7",
+		"title": "报备内容:测试用传装置7",
+		"des": "备注:三楼茶水间",
+		"time": "2021-01-20 15:23:43",
+		"status": 1
+	},
+	{
+		"id": "8",
+		"title": "报备内容:测试用传装置8",
+		"des": "备注:三楼茶水间",
+		"time": "2021-01-20 15:23:43",
+		"status": 2
+	}
 ];
 
 
@@ -643,7 +743,8 @@ module.exports = {
 
 	weiBaoList: weiBaoList,
 	weiBaoRecord: weiBaoRecord,
-	weiBaoPlan: weiBaoPlan,
+	weiBaoPlan: weiBaoPlan,
+	funcReport:funcReport
 
 
 

+ 5 - 8
package-lock.json

@@ -3,15 +3,12 @@
   "version": "1.0.0",
   "lockfileVersion": 1,
   "requires": true,
-  
-  "sockjs":{
-  "dev": false
-  },
-  "sockjs-client" :{
-  "dev": false
-  },
-  
   "dependencies": {
+    "@dcloudio/uni-i18n": {
+      "version": "2.0.1-33920220314002",
+      "resolved": "https://registry.npmmirror.com/@dcloudio/uni-i18n/-/uni-i18n-2.0.1-33920220314002.tgz",
+      "integrity": "sha512-yPxJMsSO7pduzvCcYlqyPT0V5yQc2tDK3GMxcVdRkd7339S63yK9jqWh/b99PAY4Cq/yzwiT9rx40fne5/8d4w=="
+    },
     "downloadjs": {
       "version": "1.4.7",
       "resolved": "https://registry.nlark.com/downloadjs/download/downloadjs-1.4.7.tgz",

+ 1 - 0
package.json

@@ -9,6 +9,7 @@
   "author": "",
   "license": "ISC",
   "dependencies": {
+    "@dcloudio/uni-i18n": "^2.0.1-33920220314002",
     "echarts": "^5.0.2",
     "jweixin-module": "^1.4.0",
     "mpvue-echarts": "^0.3.2",

+ 18 - 0
pages.json

@@ -705,6 +705,24 @@
             }
             
         }
+        ,{
+            "path" : "pages/setting/funReport/funReport",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "功能报备",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/setting/funReport/funcAdd/funcAdd",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "功能报备新增",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	
 	

+ 45 - 7
pages/index/index.vue

@@ -133,10 +133,11 @@
 		},
 
 		onLoad(option) {
-
-			if (option.op) {
-				// alert('op')
-				// 首页数据渲染
+			
+			// start
+			
+			if(window.location.host.indexOf('localhost') != -1 ){
+			
 				this.getSearchList();
 				this.getHomeData({
 					'company_code': uni.getStorageSync('selectedCode') ? uni.getStorageSync('selectedCode') : this
@@ -146,10 +147,44 @@
 					'company_code': uni.getStorageSync('selectedCode') ? uni.getStorageSync('selectedCode') : this
 						.defaultSite
 				});
-
-			} else {
-				this.init()
+			}else{
+			
+				if (option.op) {
+					// alert('op')
+					// 首页数据渲染
+					this.getSearchList();
+					this.getHomeData({
+						'company_code': uni.getStorageSync('selectedCode') ? uni.getStorageSync('selectedCode') : this
+							.defaultSite
+					});
+					this.getHandleData({
+						'company_code': uni.getStorageSync('selectedCode') ? uni.getStorageSync('selectedCode') : this
+							.defaultSite
+					});
+				
+				} else {
+					this.init()
+				}
+				
 			}
+			// end
+
+			// if (option.op) {
+			// 	// alert('op')
+			// 	// 首页数据渲染
+			// 	this.getSearchList();
+			// 	this.getHomeData({
+			// 		'company_code': uni.getStorageSync('selectedCode') ? uni.getStorageSync('selectedCode') : this
+			// 			.defaultSite
+			// 	});
+			// 	this.getHandleData({
+			// 		'company_code': uni.getStorageSync('selectedCode') ? uni.getStorageSync('selectedCode') : this
+			// 			.defaultSite
+			// 	});
+
+			// } else {
+			// 	this.init()
+			// }
 
 			// 首页数据渲染
 			// this.getSearchList();
@@ -162,6 +197,9 @@
 			// 		.defaultSite
 			// });
 			
+			
+			
+			
 			var res = uni.getStorageSync('selectedCode');
 			var res2 = uni.getStorageSync('selectedName');
 			if (res) {

+ 190 - 0
pages/setting/funReport/funReport.vue

@@ -0,0 +1,190 @@
+<template>
+
+	<view class="">
+		
+		<!-- 筛选框start -->
+		<view style="height:98rpx"></view>
+		<view class="ding">
+			<!-- <calendar></calendar> -->
+			<view class="example-body">
+				<uni-datetime-picker v-model="datetimerange" type="daterange" start-placeholder="请选择开始时间"
+					end-placeholder="请选择结束时间" start="2000-3-20 12:00:00" end="2025-10-20 20:00:00" rangeSeparator="至" />
+			</view>
+		</view>
+		<!-- 筛选框end -->
+		<view  class="site-items" style="margin-top:0;height: calc(100vh - 286rpx)">
+			<view class="cu-list menu-avatar" >
+				<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
+					v-for="(item,index) in funcReport" :key="index" 
+					@touchstart="ListTouchStart"
+					@touchmove="ListTouchMove" @touchend="ListTouchEnd" :data-target="'move-box-' + index"
+					>
+					<view class="cu-avatar round lg">
+						<image class="image-bg" src="/static/device-icon.png"/>
+					</view>
+					<view class="content">
+						<view class="pro-title">
+							<view class="cut">{{item.title}}</view>
+						</view>
+						<view class="pro-des  ">
+							<view class="text-cut">
+								{{item.des}}
+							</view>
+						</view>
+						<view class="pro-date ">{{item.time}}</view>
+					</view>
+					<view class="nav-right num">
+						<view class="text-grey">
+							<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
+						</view>
+					</view>
+					<view class="move">
+						<view class="bg-grey" @click.stop="editItem(item)">编辑</view>
+						<view class="bg-red" @click.stop="deleteItem(item)">删除</view>
+					</view>
+				</view>
+			</view>
+			
+			<view  style="padding-bottom:60px"></view>
+			
+			<!-- <view v-if="!authList.length&&authListRes==1" class="text-center margin-top"> 暂无数据</view>
+			<view v-show="isLoadMore&&this.currentPage>1" style="padding-bottom:60px">
+				<uni-load-more :status="loadStatus"></uni-load-more>
+			</view> -->
+		</view>
+		
+		
+		
+		<!-- 新增按钮start -->
+			<view style="width: 100%;
+		position: fixed;
+		bottom: 0px;
+		right: 0px;
+		height: 64px;
+		background: #fff;">
+				<view class="plus">
+					<image src="../../../static/plus.png" style="width:100rpx;height:100rpx" @tap="goAddPage()"></image>
+				</view>
+			</view>
+			
+			<!-- 新增按钮end -->
+	</view>
+</template>
+
+<script>
+	import json from '../../../data/json.js';
+	export default {
+		data() {
+			return {
+				funcReport: json.funcReport,
+				modalName: null,
+				getData:[],
+				dwtype:0,
+				datetimerange: ['', ''],
+				
+				listTouchStart: 0,
+				listTouchDirection: null,
+			};
+		},
+
+		onLoad: function(option) {
+			this.dwtype=option.dwtype
+			// this.getDeviceList({'company_code':uni.getStorageSync('selectedCode'),"dwtype":option.dwtype})
+
+		},
+		onNavigationBarButtonTap(e) {
+			console.log(e)
+			uni.navigateTo({
+				url: './export/export?dwtype='+this.dwtype,
+
+			});
+		},
+		methods: {
+
+		
+			
+			// 设备类型数据请求
+			// async getDeviceList(params = {}) {
+			// 	const res = await this.$myRequest({
+			// 		url: 'DeviceManagement/getDeviceList',
+			// 		data:params,
+			// 		showLoading: true
+			// 	})
+			// 	this.getData=res.data.data;
+			// 	console.log(this.getData);
+			// },
+			
+			//编辑
+			editItem(item) {
+				// uni.redirectTo({
+				// 	url: '/pages/siteAdd/siteAdd?id=' + item.id + '',
+				// });
+				alert('编辑')
+			},
+			
+			//删除
+			deleteItem(item) {
+				alert('删除')
+				// this.deleteStatus=true
+				// uni.showModal({
+				// 	title: '确认删除吗?',
+				// 	content: '',
+				// 	success: function(result) {
+				// 		if (result.confirm) {
+				// 			this.setDelSite({
+				// 				"id": item.id
+				// 			})
+				// 		} else if (result.cancel) {
+				// 			// console.log('用户点击取消');
+				// 		}
+				// 	}.bind(this)
+				// });
+			},
+			
+			// 新增
+			goAddPage(type) {
+				uni.redirectTo({
+					url: '/pages/setting/funReport/funcAdd/funcAdd',
+					success: res => {},
+					fail: () => {},
+					complete: () => {}
+				});
+			},
+			
+			
+			
+			// 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') {
+					this.modalName = e.currentTarget.dataset.target
+				} else {
+					this.modalName = null
+				}
+				this.listTouchDirection = null
+			}
+			
+		}
+
+	}
+</script>
+
+<style lang="scss">
+	.cu-item {
+		height: 180rpx !important
+	}
+	.plus {
+	    position: fixed;
+	    bottom: 3px;
+	    right: 3px;
+	}
+</style>

+ 398 - 0
pages/setting/funReport/funcAdd/funcAdd.vue

@@ -0,0 +1,398 @@
+<template>
+	<view class="appWrapper padding-top" style="height:calc(100vh - 250rpx);overflow:scroll">
+
+		<form action="">
+			<!-- <view class="form-item ">
+				<view class="title">
+					<text class="necessary">*</text>
+					设备编号:
+				</view>
+				<input name="input" v-model="device_code"></input>
+			</view> -->
+			
+			
+			
+			<!-- <view class="form-item ">
+				<view class="title"><text class="necessary">*</text>物联网卡号:</view>
+				<input name="input" v-model="sim"></input>
+			</view>
+			<view class="form-item selectBox">
+				<view class="title"><text class="necessary">*</text>所属单位:</view>
+				<select name="" id="" filterable clearable v-model="company_code">
+					<option value="">请选择</option>
+					<option :value="item.owner_code" v-for="(item,index) in companyListData" 
+						style="width:80%">{{item.owner_name}}</option>
+				</select>
+				<text class="icon iconfont margin-right-sm margin-left">&#xe63d;</text>
+			</view> -->
+			<view class="form-item selectBox">
+				<view class="title"><text class="necessary">*</text>报备类型:</view>
+				<select name="" id="" placeholder=""clearable  v-model="type">
+					<option value="">请选择</option>
+					<option value="1">单位</option>
+					<option value="2">类型</option>
+					<option value="3">设备</option>
+					
+				</select>
+				<text class="icon iconfont margin-right-sm margin-left">&#xe63d;</text>
+			</view>
+			
+
+
+		
+			
+			
+			
+
+			<view class="btn-area submitBottomBtn padding-lr-sm">
+				<button class="bg-blue round  margin-top" @tap="submit()">提 交 </button>
+			</view>
+		</form>
+
+
+	</view>
+</template>
+
+<script>
+	// var graceChecker = require("../../common/graceChecker.js");
+	// import add from '../../common/select.js';
+	export default {
+
+		data() {
+			return {
+
+				companyListData: [],
+				index: -1,
+	
+
+				
+				
+				
+				"device_code":"",
+				"device_name":"",
+				"unitinfo":"",
+				"louyu": "",
+				"sim":"",
+				company_code: '',
+				
+				"type":'',
+				transfer_type: '',
+				
+				"owner_bl":"",//倍率
+				"is_top":"0", //是否顶楼
+				
+				"deviceType":"",
+				"manufacturerName":"",
+				"model":"",
+				"location":"",
+				"protocolType":"",
+				"manufacturerId":"",
+				
+				"min_level":"",
+				"max_level":"",
+				
+				"radioOne":0,
+				
+				"owner_xh_a":'z',
+				"owner_xh_b":'z',
+				"owner_xh_c":'z'
+
+				
+
+
+			}
+		},
+		onLoad: function(option) {
+			this.getSiteList();
+
+
+
+		},
+		watch: {
+			
+		},
+		methods: {
+
+			async submit() {
+				//提交验证
+				
+				if (!this.device_code) {
+					uni.showToast({
+						title: "请输入设备编号",
+						icon: "none"
+					});
+					return
+				}else{
+					var reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{2,10}$/;
+					if(!reg.test(this.device_code)){
+						uni.showToast({
+							title: "请输入字母和数字结合的设备编号",
+							icon: "none"
+						});
+						return
+					}
+				}
+				
+				
+				
+				
+		
+					
+					
+				if (!this.device_name.replace(/^\s*/g,'')) {
+					uni.showToast({
+						title: "请输入设备名称",
+						icon: "none"
+					});
+					return
+				}
+				if (!this.unitinfo.replace(/^\s*/g,'')) {
+					uni.showToast({
+						title: "请输入单元地址",
+						icon: "none"
+					});
+					return
+				}
+				if (!this.louyu) {
+					uni.showToast({
+						title: "请选择所属楼层",
+						icon: "none"
+					});
+					return
+				}
+				if (!this.sim.replace(/^\s*/g,'')) {
+					uni.showToast({
+						title: "请输入物联网卡号",
+						icon: "none"
+					});
+					return
+				}
+				if (!this.company_code) {
+					uni.showToast({
+						title: "请选择所在单位",
+						icon: "none"
+					});
+					return
+				}
+				if (!this.type) {
+					uni.showToast({
+						title: "请选择设备类型",
+						icon: "none"
+					});
+					return
+				}
+				if (!this.transfer_type) {
+					uni.showToast({
+						title: "请选择传输方式",
+						icon: "none"
+					});
+					return
+				}
+				
+				if(this.type==1&&this.transfer_type=="4G"){
+					if (this.owner_xh_a=='z') {
+						uni.showToast({
+							title: "请选择第一个解析方法",
+							icon: "none"
+						});
+						return
+					}
+					if (this.owner_xh_b=='z') {
+						uni.showToast({
+							title: "请选择第二个解析方法",
+							icon: "none"
+						});
+						return
+					}
+					if (this.owner_xh_c=='z') {
+						uni.showToast({
+							title: "请选择第三个解析方法",
+							icon: "none"
+						});
+						return
+					}
+				}
+				
+				if(this.transfer_type=='NB'&&(this.type==2||this.type==5)){
+					if (!this.deviceType) {
+						uni.showToast({
+							title: "请选择水表NB设备类型",
+							icon: "none"
+						});
+						return
+					}
+					if (!this.manufacturerName) {
+						uni.showToast({
+							title: "请选择水表NB厂商名称",
+							icon: "none"
+						});
+						return
+					}
+					if (!this.model) {
+						uni.showToast({
+							title: "请选择水表NB设备型号",
+							icon: "none"
+						});
+						return
+					}
+					if (!this.manufacturerId) {
+						uni.showToast({
+							title: "请选择水表NB厂商ID",
+							icon: "none"
+						});
+						return
+					}
+					if (!this.location.replace(/^\s*/g,'')) {
+						uni.showToast({
+							title: "请输入水表NB地址",
+							icon: "none"
+						});
+						return
+					}
+					if (!this.protocolType.replace(/^\s*/g,'')) {
+						uni.showToast({
+							title: "请输入水表NB协议",
+							icon: "none"
+						});
+						return
+					}
+				}
+				
+				
+				if(this.type==7&&this.transfer_type=='4G'){
+					if (!this.max_level) {
+						uni.showToast({
+							title: "请选择最高层",
+							icon: "none"
+						});
+						return
+					}
+					if (!this.min_level) {
+						uni.showToast({
+							title: "请选择最低层",
+							icon: "none"
+						});
+						return
+					}
+					
+				
+					if (!this.owner_bl.replace(/^\s*/g,'')) {
+						uni.showToast({
+							title: "请输入倍率",
+							icon: "none"
+						});
+						return
+					}
+				}
+	
+				let queryParam = {};
+				queryParam.device_code = this.device_code;
+				queryParam.device_name = this.device_name;
+				queryParam.unitinfo = this.unitinfo;
+				queryParam.louyu = this.louyu;
+				queryParam.sim = this.sim;
+				
+				queryParam.company_code = this.company_code;
+				queryParam.type = this.type;
+				queryParam.transfer_type = this.transfer_type;
+				queryParam.is_top = this.radioOne;
+				
+				if (this.type==1&&this.transfer_type=="4G") {
+					queryParam.owner_xh_a = this.owner_xh_a;
+					queryParam.owner_xh_b = this.owner_xh_b;
+					queryParam.owner_xh_c = this.owner_xh_c;
+					this.addDevice(queryParam)
+					return;
+				}
+				if (this.transfer_type=='NB'&&(this.type==2||this.type==5)) {
+					queryParam.deviceType = this.deviceType;
+					queryParam.manufacturerName = this.manufacturerName;
+					queryParam.model = this.model;
+					queryParam.location = this.location;
+					queryParam.protocolType = this.protocolType;
+					queryParam.manufacturerId = this.manufacturerId;
+					this.addDevice(queryParam)
+					return;
+				}
+				if (this.type==7&&this.transfer_type=='4G') {
+					queryParam.max_level = this.max_level;
+					queryParam.min_level = this.min_level;
+					queryParam.owner_bl = this.owner_bl;
+					this.addDevice(queryParam)
+					return;
+				}
+				this.addDevice(queryParam)
+			
+			},
+			
+			async addDevice(params = {}) {
+				const res = await this.$myRequest({
+					url: 'DeviceConfig/setDevice',
+					data: params
+				})
+				if (res.data.flag) {
+					// uni.showToast({
+					// 	title: "提交成功",
+					// });
+					// setTimeout(() => {
+					// 	uni.navigateTo({
+					// 		url: '/pages/deviceManage/deviceManage',
+					// 	});
+					// }, 1000);
+					setTimeout(() => {
+						uni.navigateTo({
+							url: '/pages/accountManage/success/success',
+						});
+					}, 1000);
+				}
+			},
+			
+			
+
+			radioChange(e) {
+				console.log('type:' + e.detail.value);
+				this.radioOne = e.detail.value;
+			},
+
+			//单位下拉请求数据
+			async getSiteList() {
+				const res = await this.$myRequest({
+					url: 'Index/getCompanyList',
+				})
+				this.companyListData = res.data.data;
+			},
+
+
+
+
+
+
+		}
+	}
+</script>
+
+
+
+
+<style lang="scss">
+	input,
+	select,
+	option {
+		line-height: 70rpx;
+		padding: 0 20rpx;
+		height: 70rpx;
+		border: 1px solid #EDEDED;
+		// width:500rpx!important;
+		background-color: #fff;
+		box-sizing: border-box;
+		appearance: none;
+		-moz-appearance: none;
+		-webkit-appearance: none;
+		color: #999;
+	}
+
+
+
+
+	/* 站点多选下拉样式end */
+</style>

+ 23 - 0
pages/setting/setting.vue

@@ -35,6 +35,21 @@
 					</view>
 				</view>
 			</view>
+			
+			<view class="cu-item shadow" @tap="goFunReport()">
+				<view class="cu-avatar ">
+					<image class="image-bg" src="/static/building-icon.png"/>
+				</view>
+				<view class="content">
+					<view class="">功能报备</view>
+				</view>
+				<view class="nav-right">
+					<view class="text-grey">
+						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
+					</view>
+				</view>
+			</view>
+			
 			<!-- <view class="cu-item" @tap="goSiteManage" v-if="permissionLabel==1">
 				<view class="cu-avatar " style="background-image:url(../../static/setting-icon2.png)"></view>
 				<view class="content">
@@ -125,6 +140,14 @@
 					fail: () => {},
 					complete: () => {}
 				});
+			},
+			goFunReport() {
+				uni.navigateTo({
+					url: '/pages/setting/funReport/funReport',
+					success: res => {},
+					fail: () => {},
+					complete: () => {}
+				});
 			},
 
 		}