ming 4 роки тому
батько
коміт
2a7253b160

+ 613 - 0
pages/authAdd/authAdd.vue

@@ -0,0 +1,613 @@
+<template>
+	<view class="appWrapper">
+		<!-- 权限新增 start -->
+		<form action=""  v-if="!phone">
+			<view class="form-item margin-top">
+				<view class="title">
+					<text class="necessary">*</text>
+					用户名称
+				</view>
+
+				<select name="" id="" v-model="formMess.mobile" filterable clearable>
+					<option :value=item.mobile v-for="item in maintainStates">{{ item.mobile}}</option>
+				</select>
+
+			</view>
+			
+			<view class="form-item">
+				<view class="title " style="vertical-align:top">
+					<text class="necessary">*</text>
+					站点:
+				</view>
+				<view style="position:relative" class="innerZd">
+					<input name="siteName" v-model="formMess.siteName" @click="test" @focus="focusfns" @input="handleInput()"
+					 placeholder="请输入或选择"></input>
+
+					<view class="siteItems" v-if="isShow" style="max-height:60vh;overflow:auto">
+						<view class=" site-item" v-if="!siteItemData.length">暂无结果</view>
+
+						<view class="site-item" v-for="(item,index) in siteItemData" @click="add(item,index)" :key="index">{{item.siteName}}</view>
+					</view>
+					<view style="width:500rpx;max-height:30vh;overflow:scroll" class="selectedBox">
+						<button class="cu-btn  sm margin-xs" v-for="(item,index) in selectedData" @click="deleteItem(item,index)">
+							{{item.siteName}}
+							<text class="lg text-gray cuIcon-close"></text>
+						</button>
+
+					</view>
+				</view>
+
+
+			</view>
+
+			<view class="form-item margin-top">
+				<view class="title">
+					<text class="necessary">*</text>
+					告警类型
+				</view>
+				<radio-group name="gender" @change="radioChange">
+					<label class="margin-right">
+						<radio value="3" checked /><text>全部告警</text>
+					</label>
+					<label>
+						<radio value="2" /><text>维保告警</text>
+					</label>
+				</radio-group>
+			</view>
+
+			<view class="btn-area submitBottomBtn padding-lr-sm">
+				<button class="bg-blue round  margin-top" @click="addSubmit">提 交 </button>
+			</view>
+		</form>
+		<!-- 权限新增 end -->
+		
+		
+		
+		<!-- 权限修改 start -->
+		<form action=""  v-else>
+			<view class="form-item margin-top">
+				<view class="title">
+					<text class="necessary">*</text>
+					用户名称
+				</view>
+		
+				<select name="" id="" v-model="authorityData.phone" filterable clearable>
+					<option :value=item.mobile v-for="item in maintainStates">{{ item.mobile}}</option>
+				</select>
+		
+			</view>
+			
+			<view class="form-item">
+				<view class="title " style="vertical-align:top">
+					<text class="necessary">*</text>
+					站点:
+				</view>
+				<view style="position:relative" class="innerZd">
+					<input name="siteName" v-model="formMess.siteName" @click="test" @focus="focusfns" @input="handleInput()"
+					 placeholder="请输入或选择"></input>
+		
+					<view class="siteItems" v-if="isShow" style="max-height:60vh;overflow:auto">
+						<view class=" site-item" v-if="!siteItemData.length">暂无结果</view>
+		
+						<view class="site-item" v-for="(item,index) in siteItemData" @click="add(item,index)" :key="index">{{item.siteName}}</view>
+					</view>
+					<view style="width:500rpx;max-height:30vh;overflow:scroll" class="selectedBox">
+						<button class="cu-btn  sm margin-xs" v-for="(item,index) in selectedData" @click="deleteItem(item,index)">
+							{{item.siteName}}
+							<text class="lg text-gray cuIcon-close"></text>
+						</button>
+		
+					</view>
+				</view>
+		
+		
+			</view>
+		
+			<view class="form-item margin-top">
+				<view class="title">
+					<text class="necessary">*</text>
+					告警类型
+				</view>
+				<radio-group name="gender" @change="radioChange">
+					<label class="margin-right">
+						<radio value="3" :checked='authorityData.permissionLabel == 2' /><text>全部告警</text>
+					</label>
+					<label>
+						<radio value="2" :checked='authorityData.permissionLabel == 3' /><text>维保告警</text>
+					</label>
+				</radio-group>
+			</view>
+		
+			<view class="btn-area submitBottomBtn padding-lr-sm">
+				<button class="bg-blue round  margin-top" @click="editSbuimt">提 交 </button>
+			</view>
+		</form>
+		<!-- 权限修改 end -->
+	</view>
+</template>
+
+<script>
+	export default {
+
+		data() {
+			return {
+				index: -1,
+				type: '0',
+				
+				
+				phone:'',
+				authorityData:{},
+
+				isShow: false,
+				formMess: {
+					"userName": "",
+					"siteName": "",
+					"place": "",
+					"longitude": "",
+					"dimension": "",
+					"contactor": "",
+					"mobile": "",
+					
+					
+					
+				},
+
+				// 站点多选下拉
+				siteItemDataOrigin: [],
+				selectedData: [],
+				siteItemData: [],
+				selectedArr: [],
+				selectedString: '',
+				radioOne: 3,
+
+				maintainStates: [{
+						value: 0,
+						mobile: '13262908435'
+					},
+					{
+						value: 1,
+						mobile: '13262908431'
+					},
+					{
+						value: 2,
+						mobile: '13262908432'
+					}
+				]
+			}
+		},
+
+		mounted() {
+			document.addEventListener('click', (e) => {
+				if (e.target.className != 'uni-input-input') {
+					this.isShow = false;
+				}
+			});
+		},
+		onLoad: function(option) {
+			this.phone = option.phone;
+			if (option.phone) {
+				uni.setNavigationBarTitle({
+					title: '权限修改'
+				});
+			} else {
+				uni.setNavigationBarTitle({
+					title: '权限新增'
+				});
+			}
+			this.getSiteList();
+			
+			
+			this.getAuthority({"phone":this.phone})
+
+
+		},
+		methods: {
+			
+			//修改提交
+			editSbuimt(){
+				this.addAuthority({
+					"phone": this.authorityData.phone,
+					"siteId": this.selectedString,
+					"permissionLabel": this.radioOne
+				})
+				
+			},
+			
+			
+			// 修改请求
+			async setEditAuthority(ming={}) {
+				const res = await this.$myRequest({
+					url: 'AuthorityManagement/setEditAuthority',
+					data:ming
+				})
+				this.authorityData=res.data.data[0]
+			
+			},
+			
+			
+			// 回显信息请求
+			async getAuthority(ming={}) {
+				const res = await this.$myRequest({
+					url: 'AuthorityManagement/getAuthority',
+					data:ming
+				})
+				this.authorityData=res.data.data[0]
+			
+			},
+			
+			
+			radioChange(e) {
+				console.log('type:' + e.detail.value);
+				this.radioOne = e.detail.value;
+			},
+			//新增提交
+			async addSubmit() {
+				this.selectedData.forEach(item => {
+					this.selectedArr.push(item.id)
+				})
+				this.selectedString = this.selectedArr.toString();
+				//提交验证
+				if (!this.formMess.mobile) {
+					uni.showToast({
+						title: "请选择用户",
+						icon: "none"
+					});
+					return
+				}
+				if (!this.selectedData.length) {
+					uni.showToast({
+						title: "请选择站点",
+						icon: "none"
+					});
+					return
+				}
+				let res = await this.addAuthority({
+					"phone": this.formMess.mobile,
+					"siteId": this.selectedString,
+					"permissionLabel": this.radioOne
+				})
+
+				if (!res.data.flag) {
+					uni.showToast({
+						title: "添加失败",
+						icon: "none"
+					});
+				} else {
+					uni.showToast({
+						title: "添加成功",
+					});
+				}
+				setTimeout(() => {
+					uni.navigateTo({
+						url: '/pages/authManage/authManage',
+
+					});
+				}, 1000);
+
+			},
+
+			//站点下拉请求数据
+			async getSiteList() {
+				const res = await this.$myRequest({
+					url: 'SiteManagement/getSiteList',
+				})
+				this.siteItemData = res.data.data;
+				this.siteItemDataOrigin = res.data.data;
+				
+			},
+			addAuthority(ming = {}) {
+				return this.$myRequest({
+					url: 'AuthorityManagement/setaddAuthority',
+					data: ming
+				})
+
+
+			},
+
+			add: function(item, index) {
+				this.selectedData.push(item);
+				this.isShow = false;
+				this.formMess.siteName = ''
+				this.siteItemData.splice(index, 1);
+
+			},
+			deleteItem: function(item, index) {
+				// this.selectedData.remove(item);
+
+
+				this.selectedData.splice(index, 1);
+				this.siteItemDataOrigin.push(item);
+
+				//将元素根据搜索内容过滤出来  这里改变了siteItemData
+
+				this.siteItemData = this.getNotSelectItem();
+				this.siteItemData = this.siteItemData.filter(item => item.siteName.indexOf(this.formMess.siteName) > -1);
+				// console.log('这是过滤来的');
+				// console.log(this.siteItemData);
+
+				// this.selectedData = newlist;
+				// console.log(this.selectedData)
+
+
+			},
+
+			// 站点多选下拉
+			test: function() {
+				this.isShow = !this.isShow;
+			},
+			test2: function() {
+				this.isShow = false;
+			},
+			handleInput() {
+				// this.getNotSelectItem();
+
+				//将元素根据搜索内容过滤出来  这里改变了siteItemData
+
+				this.siteItemData = this.getNotSelectItem();
+				this.siteItemData = this.siteItemData.filter(item => item.siteName.indexOf(this.formMess.siteName) > -1);
+
+				// this.selectedData = newlist;
+				// console.log(this.selectedData)
+
+			},
+			// 站点多选下拉 end
+
+
+
+			getNotSelectItem() {
+
+				let ok1 = this.siteItemDataOrigin;
+				let ok2 = this.selectedData;
+				// console.log('选中值',ok2);
+				// console.log('全部值',ok1);
+
+
+				if (ok2.length) {
+					for (let i = 0; i < ok2.length; i++) {
+						for (let j = 0; j < ok1.length; j++) {
+							if (ok1[j] === ok2[i]) { //值已经被选中
+								ok1.splice(j, 1);
+							}
+						}
+					}
+
+				}
+
+
+				return ok1;
+
+
+			},
+
+			formSubmit: function(e) {
+				console.log('form发生了submit事件,携带数据为:' + JSON.stringify(e.detail.value))
+				//定义表单规则
+				var rule = [{
+						name: "userName",
+						checkType: "string",
+						checkRule: "1,3",
+						errorMsg: "姓名应为1-3个字符..."
+					},
+					// {name:"gender", checkType : "in", checkRule:"男,女",  errorMsg:"请选择性别"},
+					// {name:"loves", checkType : "notnull", checkRule:"",  errorMsg:"请选择爱好"}
+				];
+				//进行表单检查
+				var formData = e.detail.value;
+				var checkRes = graceChecker.check(formData, rule);
+				if (checkRes) {
+					uni.showToast({
+						title: "验证通过!",
+						icon: "none"
+					});
+				} else {
+					uni.showToast({
+						title: graceChecker.error,
+						icon: "none"
+					});
+				}
+			},
+			formReset: function(e) {
+				console.log('清空数据')
+			},
+			focusfns: function(e) {
+				// this.getNotSelectItem();
+
+				//将元素根据搜索内容过滤出来  这里改变了siteItemData
+
+				this.siteItemData = this.getNotSelectItem();
+
+
+				this.siteItemData = this.siteItemData.filter(item => item.siteName.indexOf(this.formMess.siteName) > -1);
+			},
+
+
+
+
+
+		}
+	}
+</script>
+
+
+
+
+<style lang="scss">
+	page {
+		height: 100% !important
+	}
+
+
+	.cu-form-group {
+		border-top: 0;
+
+	}
+
+	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;
+
+
+	}
+
+	select:focus,
+	select:active,
+	select:hover {
+		outline: none;
+	}
+
+	select {
+		background: url(../../static/arrow.png) no-repeat scroll 98% center;
+		background-size: 6%;
+	}
+
+	.form-item label text {
+		position: relative;
+		top: 2rpx
+	}
+
+	.form-item {
+		padding: 0 40rpx;
+		display: flex;
+		align-items: top;
+		margin-bottom: 20rpx;
+
+
+		.title {
+			width: 170rpx;
+			position: relative;
+
+			.necessary {
+				color: red;
+				display: inline-block;
+				position: absolute;
+				top: -2rpx;
+				left: -20rpx;
+				font-size: 40rpx;
+
+			}
+		}
+
+		input,
+		select {
+			width: 500rpx;
+			font-size: 28rpx;
+		}
+
+
+	}
+
+
+
+
+
+	/* 站点多选下拉样式 start */
+
+	.layui-btn {
+		background-color: #5fb878;
+	}
+
+	a {
+		text-decoration: none;
+	}
+
+	.label {
+		padding: 2px 0px;
+		background: #aaa;
+		border-radius: 2px;
+		color: #fff;
+		display: block;
+		line-height: 20px;
+		height: 20px;
+		margin: 2px 5px 2px 0;
+		float: left;
+	}
+
+	.label span {
+		padding: 0 5px;
+		color: #fff;
+	}
+
+	.close {
+		padding: 1px 5px !important;
+	}
+
+	.close:hover {
+		/* background-color: #009E94;
+	    border-radius: 2px;
+	    color: tomato; */
+	}
+
+	.selectId input {
+		width: 100% !important;
+	}
+
+	.selectId input {
+		height: 25px;
+		padding: 1px 5px;
+		border-radius: 3px;
+		width: calc(100% - 12px);
+		outline-color: #5fb878;
+		border: 1px solid #5fb878;
+	}
+
+	.selectId {
+		position: relative;
+	}
+
+	.selectId dl {
+		border: 1px solid #eee;
+		border-radius: 3px;
+		margin: 2px 0px;
+		max-height: 300px;
+		overflow-x: hidden;
+		white-space: nowrap;
+		position: absolute;
+		width: 100%;
+		top: 40px;
+		background: #fff;
+		z-index: 1000
+	}
+
+	.selectId dl dd {
+		margin: 0;
+		padding: 5px 10px;
+	}
+
+	.selectId dl dd:hover {
+		background-color: #5FB878;
+		color: white;
+	}
+
+	.AD {
+		/* width: 210px;
+	        margin-left: 40px; */
+		overflow-y: auto;
+		max-height: 200px;
+		/* border: 2px solid #5fb878;
+	        border-radius: 6px;
+	        padding: 1px 2px; */
+	}
+
+	form .AD span {
+		width: auto;
+	}
+
+	.siteSelect {
+		width: 71%;
+		display: inline-block;
+	}
+
+
+	/* 站点多选下拉样式end */
+</style>

+ 180 - 0
pages/authManage/authManage.vue

@@ -0,0 +1,180 @@
+<template>
+	<view class="site-wrapper">
+
+
+		<!-- 筛选框start -->
+		<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" @blur="InputBlur" :adjust-position="false" type="text" confirm-type="search"
+					 v-model="phoneNumber"></input>
+				</view>
+				<view class="action">
+					<button class="cu-btn bg-blue round" @click="searchAuthList">查询</button>
+				</view>
+			</view>
+		</view>
+		<!-- 筛选框end -->
+
+		<!-- 权限管理start -->
+		<view class="site-items">
+			<view class="cu-list menu-avatar">
+
+				<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in authList" :key="index"
+				 @touchstart="ListTouchStart" @touchmove="ListTouchMove" @touchend="ListTouchEnd" :data-target="'move-box-' + index">
+					<view class="cu-avatar round lg" style="background-image: url(../../static/site-icon.png);"></view>
+					<view class="content">
+						<view class="text-grey site-tit">{{item.phone}}</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 v-if="!authList.length&&authListRes==1" class="text-center margin-top"> 暂无数据</view>
+		</view>
+
+		<!-- 权限管理end-->
+
+
+		<!-- 新增按钮start -->
+		<view class="plus">
+			<image src="../../static/plus.png" style="width:125rpx;height:125rpx" @tap="goAddPage(type)"></image>
+		</view>
+		<!-- 新增按钮end -->
+	</view>
+
+</template>
+
+<script>
+	import json from '../../data/json.js';
+
+	export default {
+		data() {
+			return {
+				phoneNumber: '',
+				authListRes: 0,
+				authList: [],
+				type: '0',
+				siteListData: json.siteListData,
+				modalName: null,
+				listTouchStart: 0,
+				listTouchDirection: null,
+				CustomBar: this.CustomBar,
+				csListArrl: [],
+				//左滑默认宽度
+				delBtnWidth: 160,
+				flag: false
+
+
+			};
+		},
+
+		onLoad: function(option) {
+			this.getAuthData()
+			
+		},
+		methods: {
+			
+			EditItem(item){
+				uni.navigateTo({
+					url: '/pages/authAdd/authAdd?phone='+item.phone+'',
+				
+				});
+			},
+			  deleteItem(item) {
+				 let deleteT=0;
+				 uni.showModal({	
+				     title: '确认删除吗?',
+				     content: '',
+				     success: function (result) {
+				         if (result.confirm) {
+							  this.deleteAuth({
+							 	"phone": item.phone
+							 });
+				         } else if (result.cancel) {
+				             console.log('用户点击取消');
+				         }
+				     }.bind(this)
+				 }); 
+			},
+
+
+			// 删除请求接口
+			async deleteAuth(ming = {}) {
+				let res = await  this.$myRequest({
+					url: 'AuthorityManagement/setDelAuthority',
+					data: ming
+				})
+				if (!res.data.flag) {
+					alert('删除失败');
+					return;
+				}
+				this.getAuthData()
+				
+				return res;
+			},
+
+
+			async getAuthData(ming = {}) {
+				const res = await this.$myRequest({
+					url: 'AuthorityManagement/getAuthorityList',
+					showLoading: true,
+					data: ming
+				})
+				this.authListRes = 1;
+				this.authList = res.data.data
+				console.log(res.data.data);
+			},
+
+			searchAuthList() {
+				this.getAuthData({
+					"phone": this.phoneNumber
+				})
+			},
+
+
+
+			// 页面跳转
+			goAddPage(type) {
+				uni.navigateTo({
+					url: '/pages/authAdd/authAdd',
+					success: res => {},
+					fail: () => {},
+					complete: () => {}
+				});
+			},
+
+
+			InputFocus(e) {
+				this.InputBottom = e.detail.height
+			},
+			InputBlur(e) {
+				this.InputBottom = 0
+			},
+
+			// 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>

+ 83 - 0
pages/device-Manage/device-Manage.vue

@@ -0,0 +1,83 @@
+<template>
+
+	<view class="">
+		<view class="cu-list menu-avatar">
+			
+			
+			<view class="cu-item deviceTypeItem" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in deviceData"
+			 :key="index" :data-target="'move-box-' + index" @tap="goDeviceDetail(item)">
+				<view class="cu-avatar round lg" style="background-image:url(../../static/jx.png)"></view>
+				<view class="content" >
+					<view class="">{{item.deviceName}}</view>
+				</view>
+				<view class="nav-right num">
+					<view class="text-grey">
+						{{item.trueStatus?'离线':'在线'}}
+						<text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				deviceData:[],
+				
+				modalName: null,
+			};
+		},
+		
+		onLoad:function(option){
+			console.log(111)
+			console.log(option.companyCode)
+			this.companyCode=option.companyCode
+			this.deviceType=option.deviceType
+			this.getDeviceManage({"companyCode":option.companyCode,"deviceType":option.deviceType})
+		},
+		methods: {
+			
+			async getDeviceManage(ming={}) {
+				const res= await this.$myRequest({
+					url:'OperationMonitoring/getDeviceList',
+					data:ming,
+					showLoading:true
+				})
+				console.log(res.data.data)
+				this.deviceData=res.data.data
+				// this.powerDeviceCount= res.data.data[0].powerDeviceCount
+				// this.videoDeviceCount= res.data.data[0].videoDeviceCount
+				
+			},
+			
+			// 页面跳转
+			goDeviceDetail(item) {
+				uni.navigateTo({
+					url: '/pages/device-Manage/deviceDetail/deviceDetail?deviceType=1&companyCode='+this.companyCode+'&deviceCode='+item.deviceCode+'',
+					success: res => {},
+					fail: () => {},
+					complete: () => {}
+				});
+			},
+			
+
+
+
+		}
+
+	}
+</script>
+
+<style lang="scss">
+	.cu-list.menu-avatar>.cu-item .content>uni-view:first-child {
+		font-size: 32rpx;
+	}
+
+	.num {
+		font-size: 30rpx;
+		color: #666;
+	}
+</style>

+ 147 - 0
pages/device-Manage/deviceDetail/deviceDetail.vue

@@ -0,0 +1,147 @@
+<template>
+	<view class="wrapper flex justify-between padding-lr-lg">
+		<view class="device-items">
+			<view class="device-item">
+				<text class="text-yellow">Uab</text>
+				<text>{{deviceDetail.Uab>1000?deviceDetail.Uab/1000:deviceDetail.Uab}}</text>
+				<text v-if="deviceDetail.Uab>1000">KV</text>
+				<text v-else>V</text>
+			</view>
+			<view class="device-item">
+				<text class="text-green">Ubc</text>
+				<text>{{deviceDetail.Ubc>1000?deviceDetail.Ubc/1000:deviceDetail.Ubc}}</text>
+				<text v-if="deviceDetail.Ubc>1000">KV</text>
+				<text v-else>V</text>
+			</view>
+			<view class="device-item">
+				<text class="text-red">Uca</text>
+				<text>{{deviceDetail.Uca}}</text>
+				<text>V</text>
+			</view>
+			<view class="device-item">
+				<text class="text-red">F</text>
+				<text>{{deviceDetail.F}}</text>
+				<text>V</text>
+			</view>
+		</view>
+
+		<view class="device-items">
+			<view class="device-item">
+				<text class="text-yellow">La</text>
+				<text>{{deviceDetail.Ia}}</text>
+				<text>A</text>
+			</view>
+			<view class="device-item">
+				<text class="text-green">Lb</text>
+				<text>{{deviceDetail.Ib}}</text>
+				<text>A</text>
+			</view>
+			<view class="device-item">
+				<text class="text-red">Lc</text>
+				<text>{{deviceDetail.Ic}}</text>
+				<text>A</text>
+			</view>
+			<view class="device-item">
+				<text class="text-yellow">P</text>
+				<text>{{deviceDetail.P}}</text>
+				<text>kW</text>
+			</view>
+			<view class="device-item">
+				<text class="text-green">Q</text>
+				<text>{{deviceDetail.Q}}</text>
+				<text>kvar</text>
+			</view>
+			<view class="device-item">
+				<text class="text-red">cos</text>
+				<text>{{deviceDetail.COS}}</text>
+				<text>V</text>
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+	export default {
+		data() {
+			return {
+				deviceDetail:''
+			}
+		},
+	
+		
+		onLoad:function(option){
+			
+			uni.setNavigationBarColor({
+				frontColor: "#ffffff", //文字颜色
+				backgroundColor: "#000033", //底部背景色
+			})
+			console.log(111)
+			console.log(option.companyCode)
+			this.companyCode=option.companyCode
+			this.deviceType=option.deviceType
+			this.getDeviceDetail({"companyCode":option.companyCode,"deviceType":option.deviceType,"deviceCode":option.deviceCode})
+		},
+		
+		
+		methods: {
+			
+			async getDeviceDetail(ming={}) {
+				const res= await this.$myRequest({
+					url:'OperationMonitoring/getMonitoringScreen',
+					data:ming,
+					showLoading:true
+				})
+				console.log(res.data.data[0])
+				this.deviceDetail=res.data.data[0]
+				// this.powerDeviceCount= res.data.data[0].powerDeviceCount
+				// this.videoDeviceCount= res.data.data[0].videoDeviceCount
+				
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		height: 100% !important
+	}
+
+	.wrapper {
+		width: 100%;
+		height: 100%;
+		background-color: #000033;
+		background-image: url(../../../static/device-bg.png);
+		background-position: center center;
+		background-size: cover;
+		position: relative;
+
+		.device-items {
+			font-family: FANDOLFANG-REGULAR;
+			margin-top: 150rpx;
+			color: #fff;
+			.device-item text{
+				vertical-align:top
+			}
+
+			.device-item text:first-child {
+				width: 50rpx;
+				display: inline-block;
+				font-size: 28rpx;
+			}
+			.device-item text:nth-child(2) {
+				display: inline-block;
+				width: 100rpx;
+				margin: 0 15rpx 30rpx 15rpx;
+				height: 42rpx;
+				background: #FFFFCC;
+				font-size: 28rpx;
+				text-align: left;
+				padding-left: 10rpx;
+				line-height: 42rpx;
+				color: #333;
+			}
+		}
+		.device-item:nth-child(3) {
+			margin-bottom: 94rpx;
+		}
+	}
+</style>

+ 429 - 0
pages/deviceAdd/deviceAdd.vue

@@ -0,0 +1,429 @@
+<template>
+	<view class="appWrapper">
+		
+		<!-- 站点新增start -->
+		<form action="" @submit="formSubmit" v-if="!id">
+			<view class="form-item margin-top">
+				<view class="title">
+					<text class="necessary">*</text>
+					设备编号:
+				</view>
+				<input name="deviceCode" v-model="formMess.deviceCode"></input>
+			</view>
+			<view class="form-item">
+				<view class="title">设备名称:</view>
+				<input name="input" v-model="formMess.deviceName"></input>
+			</view>
+			<view class="form-item">
+				<view class="title">安装位置:</view>
+				<input name="input" v-model="formMess.deviceInstallationPosition"></input>
+			</view>
+			<view class="form-item">
+				<view class="title">所属楼层:</view>
+				<select name="" id="" v-model="formMess.floor" filterable clearable>
+					<option value="1" >楼层1</option>
+					<option value="2" >楼层2</option>
+				</select>
+			</view>
+			<view class="form-item">
+				<view class="title">站点:</view>
+				<select name="" id="" v-model="formMess.siteId" filterable clearable>
+					<option :value=item.id v-for="item in siteList">{{ item.siteName}}</option>
+				</select>
+			</view>
+			<view class="form-item">
+				<view class="title">设备类型:</view>
+				<select name="" id="" v-model="formMess.deviceType" filterable clearable>
+					<option value="1" >智慧用电</option>
+					<option value="2" >视频监测</option>
+				</select>
+			</view>
+
+
+			<view class="btn-area submitBottomBtn padding-lr-sm">
+				<button class="bg-blue round  margin-top" @click="addSubmit">提 交 </button>
+			</view>
+		</form>
+		<!-- 站点新增end -->
+		
+		<!-- 站点修改start -->
+		<form action="" @submit="formSubmit" v-else>
+			<view class="form-item margin-top">
+				<view class="title">
+					<text class="necessary">*</text>
+					设备编号:
+				</view>
+				<input name="deviceCode" v-model="deviceMessage.deviceCode"></input>
+			</view>
+			<view class="form-item">
+				<view class="title">设备名称:</view>
+				<input name="input" v-model="deviceMessage.deviceName"></input>
+			</view>
+			<view class="form-item">
+				<view class="title">安装位置:</view>
+				<input name="input" v-model="deviceMessage.deviceInstallationPosition"></input>
+			</view>
+			<view class="form-item">
+				<view class="title">所属楼层:</view>
+				<select name="" id="" v-model="deviceMessage.floor" filterable clearable>
+					<option value="1" >楼层1</option>
+					<option value="2" >楼层2</option>
+				</select>
+			</view>
+			<view class="form-item">
+				<view class="title">站点:</view>
+				<select name="" id="" v-model="deviceMessage.siteId" filterable clearable>
+					<option :value=item.id v-for="item in siteList">{{ item.siteName}}</option>
+				</select>
+			</view>
+			<view class="form-item">
+				<view class="title">设备类型:</view>
+				<select name="" id="" v-model="deviceMessage.deviceType" filterable clearable>
+					<option value="1" >智慧用电</option>
+					<option value="2" >视频监测</option>
+				</select>
+			</view>
+		
+		
+			<view class="btn-area submitBottomBtn padding-lr-sm">
+				<button class="bg-blue round  margin-top" @click="editSubmit">提 交 </button>
+			</view>
+		</form>
+		<!-- 站点修改end -->
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				siteList:[],
+				
+				id: 0,
+				formMess: {
+					
+					"deviceCode": "",
+					"siteId": "",
+					"deviceType": "",
+					"deviceName": "",
+					"deviceInstallationPosition": "",
+					"floor": "",
+				},
+				deviceMessage:{}
+			}
+		},
+		
+		onLoad: function(option) {
+			this.id=option.id
+				this.getSiteList()
+			if (option.id) {
+				uni.setNavigationBarTitle({
+					title: '设备修改'
+				});
+				this.getDeviceList({"siteId":option.id})
+			} else {
+				uni.setNavigationBarTitle({
+					title: '设备新增'
+				});
+			
+			}
+			
+
+		},
+
+		methods: {
+
+			//新增验证并提交
+			addSubmit() {
+				if (!this.formMess.deviceCode) {
+					uni.showToast({
+						title: "请填写设备名称",
+						icon: "none"
+					});
+					return
+				}
+				this.setAddDevice({
+					"deviceCode": this.formMess.deviceCode,
+					"siteId": this.formMess.siteId,
+					"deviceType": this.formMess.deviceType,
+					"deviceName": this.formMess.deviceName,
+					"deviceInstallationPosition": this.formMess.deviceInstallationPosition,
+					"floor": this.formMess.floor
+				})
+			},
+			
+			//编辑验证并提交
+			editSubmit() {
+				if (!this.deviceMessage.deviceCode) {
+					uni.showToast({
+						title: "请填写设备名称",
+						icon: "none"
+					});
+					return
+				}
+				this.setEditDevice({
+					"deviceCode": this.deviceMessage.deviceCode,
+					"siteId": this.deviceMessage.siteId,
+					"deviceType": this.deviceMessage.deviceType,
+					"deviceName": this.deviceMessage.deviceName,
+					"deviceInstallationPosition": this.deviceMessage.deviceInstallationPosition,
+					"floor": this.deviceMessage.floor
+				})
+			},
+			
+			// 新增请求
+			async setAddDevice(ming = {}) {
+				const res = await this.$myRequest({
+					url: 'DeviceManagement/setAddDevice',
+					data: ming
+				})
+				if (!res.data.flag) {
+					uni.showToast({
+						title: "添加失败",
+						icon: "none"
+					});
+				} else {
+					uni.showToast({
+						title: "添加成功",
+					});
+				}
+				setTimeout(() => {
+					uni.navigateTo({
+						url: '/pages/deviceManage/deviceManage',
+					});
+				}, 1000);
+
+			},
+			
+			
+		
+			
+			// 站点下拉
+			async getSiteList(ming = {}) {
+				const res = await this.$myRequest({
+					url: 'SiteManagement/getSiteList',
+					data: ming
+				})
+				// this.deviceMessage=res.data.data[0];
+				 this.siteList=res.data.data
+				// console.log(res.data.data)
+			},
+			
+			
+			// 修改回显请求
+			async getDeviceList(ming = {}) {
+				const res = await this.$myRequest({
+					url: 'DeviceManagement/getDeviceList',
+					data: ming
+				})
+				console.log('res.data.data')
+				console.log(res.data.data[0])
+				this.deviceMessage=res.data.data[0];
+			},
+			
+			
+			// 编辑请求
+			async setEditDevice(ming = {}) {
+				const res = await this.$myRequest({
+					url: 'DeviceManagement/setEditDevice',
+					data: ming
+				})
+				if (!res.data.flag) {
+					uni.showToast({
+						title: "编辑失败",
+						icon: "none"
+					});
+				} else {
+					uni.showToast({
+						title: "编辑成功",
+					});
+				}
+				setTimeout(() => {
+					uni.navigateTo({
+						url: '/pages/siteManage/siteManage',
+					});
+				}, 1000);
+			},
+
+		}
+	}
+</script>
+
+
+
+
+<style lang="scss">
+	.cu-form-group {
+		border-top: 0;
+
+	}
+
+	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;
+
+
+	}
+
+	select:focus,
+	select:active,
+	select:hover {
+		outline: none;
+	}
+
+	select {
+		background: url(../../static/arrow.png) no-repeat scroll 98% center;
+		background-size: 6%;
+	}
+
+	.form-item label text {
+		position: relative;
+		top: 2rpx
+	}
+
+	.form-item {
+		padding: 0 40rpx;
+		display: flex;
+		align-items: top;
+		margin-bottom: 20rpx;
+
+
+		.title {
+			width: 170rpx;
+			position: relative;
+
+			.necessary {
+				color: red;
+				display: inline-block;
+				position: absolute;
+				top: -2rpx;
+				left: -20rpx;
+				font-size: 40rpx;
+
+			}
+		}
+
+		input,
+		select {
+			width: 500rpx;
+			font-size: 28rpx;
+		}
+
+
+	}
+
+
+
+
+
+	/* 站点多选下拉样式 start */
+
+	.layui-btn {
+		background-color: #5fb878;
+	}
+
+	a {
+		text-decoration: none;
+	}
+
+	.label {
+		padding: 2px 0px;
+		background: #aaa;
+		border-radius: 2px;
+		color: #fff;
+		display: block;
+		line-height: 20px;
+		height: 20px;
+		margin: 2px 5px 2px 0;
+		float: left;
+	}
+
+	.label span {
+		padding: 0 5px;
+		color: #fff;
+	}
+
+	.close {
+		padding: 1px 5px !important;
+	}
+
+	.close:hover {
+		/* background-color: #009E94;
+	    border-radius: 2px;
+	    color: tomato; */
+	}
+
+	.selectId input {
+		width: 100% !important;
+	}
+
+	.selectId input {
+		height: 25px;
+		padding: 1px 5px;
+		border-radius: 3px;
+		width: calc(100% - 12px);
+		outline-color: #5fb878;
+		border: 1px solid #5fb878;
+	}
+
+	.selectId {
+		position: relative;
+	}
+
+	.selectId dl {
+		border: 1px solid #eee;
+		border-radius: 3px;
+		margin: 2px 0px;
+		max-height: 300px;
+		overflow-x: hidden;
+		white-space: nowrap;
+		position: absolute;
+		width: 100%;
+		top: 40px;
+		background: #fff;
+		z-index: 1000
+	}
+
+	.selectId dl dd {
+		margin: 0;
+		padding: 5px 10px;
+	}
+
+	.selectId dl dd:hover {
+		background-color: #5FB878;
+		color: white;
+	}
+
+	.AD {
+		/* width: 210px;
+	        margin-left: 40px; */
+		overflow-y: auto;
+		max-height: 200px;
+		/* border: 2px solid #5fb878;
+	        border-radius: 6px;
+	        padding: 1px 2px; */
+	}
+
+	form .AD span {
+		width: auto;
+	}
+
+	.siteSelect {
+		width: 71%;
+		display: inline-block;
+	}
+
+
+	/* 站点多选下拉样式end */
+</style>

+ 392 - 0
pages/siteAdd/siteAdd.vue

@@ -0,0 +1,392 @@
+<template>
+	<view class="appWrapper">
+		
+		<!-- 站点新增start -->
+		<form action="" @submit="formSubmit" v-if="!id">
+			<view class="form-item margin-top">
+				<view class="title">
+					<text class="necessary">*</text>
+					站点名称:
+				</view>
+				<input name="userName" v-model="formMess.siteName"></input>
+			</view>
+			<view class="form-item">
+				<view class="title">地址:</view>
+				<input name="input" v-model="formMess.address"></input>
+			</view>
+			<view class="form-item">
+				<view class="title">经度:</view>
+				<input name="input" v-model="formMess.longitude"></input>
+			</view>
+			<view class="form-item">
+				<view class="title">维度:</view>
+				<input name="input" v-model="formMess.latitude"></input>
+			</view>
+			<view class="form-item">
+				<view class="title">联系人:</view>
+				<input name="input" v-model="formMess.userName"></input>
+			</view>
+			<view class="form-item">
+				<view class="title">手机号码:</view>
+				<input name="input" v-model="formMess.phone"></input>
+			</view>
+
+
+			<view class="btn-area submitBottomBtn padding-lr-sm">
+				<button class="bg-blue round  margin-top" @click="addSubmit">提 交 </button>
+			</view>
+		</form>
+		<!-- 站点新增end -->
+		
+		<!-- 站点修改start -->
+		<form action="" @submit="formSubmit" v-else>
+			<view class="form-item margin-top">
+				<view class="title">
+					<text class="necessary">*</text>
+					站点名称:
+				</view>
+				<input name="userName" v-model="siteMessage.siteName"></input>
+			</view>
+			<view class="form-item">
+				<view class="title">地址:</view>
+				<input name="input" v-model="siteMessage.address"></input>
+			</view>
+			<view class="form-item">
+				<view class="title">经度:</view>
+				<input name="input" v-model="siteMessage.longitude"></input>
+			</view>
+			<view class="form-item">
+				<view class="title">维度:</view>
+				<input name="input" v-model="siteMessage.latitude"></input>
+			</view>
+			<view class="form-item">
+				<view class="title">联系人:</view>
+				<input name="input" v-model="siteMessage.userName"></input>
+			</view>
+			<view class="form-item">
+				<view class="title">手机号码:</view>
+				<input name="input" v-model="siteMessage.phone"></input>
+			</view>
+		
+		
+			<view class="btn-area submitBottomBtn padding-lr-sm">
+				<button class="bg-blue round  margin-top" @click="editSubmit">提 交 </button>
+			</view>
+		</form>
+		<!-- 站点修改end -->
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+				id: 0,
+				formMess: {
+					"siteName": "",
+					"userName": "",
+					"phone": "",
+					"address": "",
+					"longitude": "",
+					"latitude": "",
+				},
+				siteMessage:{}
+			}
+		},
+		
+		onLoad: function(option) {
+			this.id=option.id
+			if (option.id) {
+				uni.setNavigationBarTitle({
+					title: '站点修改'
+				});
+				this.getSiteList({"id":option.id})
+			} else {
+				uni.setNavigationBarTitle({
+					title: '站点新增'
+				});
+			}
+		},
+
+		methods: {
+
+			//新增验证并提交
+			addSubmit() {
+				if (!this.formMess.siteName) {
+					uni.showToast({
+						title: "请填写站点名称",
+						icon: "none"
+					});
+					return
+				}
+				this.getAddSite({
+					"siteName": this.formMess.siteName,
+					"userName": this.formMess.userName,
+					"phone": this.formMess.phone,
+					"address": this.formMess.address,
+					"longitude": this.formMess.longitude,
+					"latitude": this.formMess.latitude
+				})
+			},
+			
+			//编辑验证并提交
+			editSubmit() {
+				if (!this.siteMessage.siteName) {
+					uni.showToast({
+						title: "请填写站点名称",
+						icon: "none"
+					});
+					return
+				}
+				this.setEditSite({
+					"id":this.id,
+					"siteName": this.siteMessage.siteName,
+					"userName": this.siteMessage.userName,
+					"phone": this.siteMessage.phone,
+					"address": this.siteMessage.address,
+					"longitude": this.siteMessage.longitude,
+					"latitude": this.siteMessage.latitude
+				})
+			},
+			
+			// 新增请求
+			async getAddSite(ming = {}) {
+				const res = await this.$myRequest({
+					url: 'SiteManagement/setAddSite',
+					data: ming
+				})
+				if (!res.data.flag) {
+					uni.showToast({
+						title: "添加失败",
+						icon: "none"
+					});
+				} else {
+					uni.showToast({
+						title: "添加成功",
+					});
+				}
+				setTimeout(() => {
+					uni.navigateTo({
+						url: '/pages/siteManage/siteManage',
+					});
+				}, 1000);
+
+			},
+			
+			// 修改回显请求
+			async getSiteList(ming = {}) {
+				const res = await this.$myRequest({
+					url: 'SiteManagement/getSiteList',
+					showLoading: true,
+					data: ming
+				})
+				this.siteMessage=res.data.data[0];
+			},
+			
+			
+			// 编辑请求
+			async setEditSite(ming = {}) {
+				const res = await this.$myRequest({
+					url: 'SiteManagement/setEditSite',
+					data: ming
+				})
+				if (!res.data.flag) {
+					uni.showToast({
+						title: "编辑失败",
+						icon: "none"
+					});
+				} else {
+					uni.showToast({
+						title: "编辑成功",
+					});
+				}
+				setTimeout(() => {
+					uni.navigateTo({
+						url: '/pages/siteManage/siteManage',
+					});
+				}, 1000);
+			},
+
+		}
+	}
+</script>
+
+
+
+
+<style lang="scss">
+	.cu-form-group {
+		border-top: 0;
+
+	}
+
+	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;
+
+
+	}
+
+	select:focus,
+	select:active,
+	select:hover {
+		outline: none;
+	}
+
+	select {
+		background: url(../../static/arrow.png) no-repeat scroll 98% center;
+		background-size: 6%;
+	}
+
+	.form-item label text {
+		position: relative;
+		top: 2rpx
+	}
+
+	.form-item {
+		padding: 0 40rpx;
+		display: flex;
+		align-items: top;
+		margin-bottom: 20rpx;
+
+
+		.title {
+			width: 170rpx;
+			position: relative;
+
+			.necessary {
+				color: red;
+				display: inline-block;
+				position: absolute;
+				top: -2rpx;
+				left: -20rpx;
+				font-size: 40rpx;
+
+			}
+		}
+
+		input,
+		select {
+			width: 500rpx;
+			font-size: 28rpx;
+		}
+
+
+	}
+
+
+
+
+
+	/* 站点多选下拉样式 start */
+
+	.layui-btn {
+		background-color: #5fb878;
+	}
+
+	a {
+		text-decoration: none;
+	}
+
+	.label {
+		padding: 2px 0px;
+		background: #aaa;
+		border-radius: 2px;
+		color: #fff;
+		display: block;
+		line-height: 20px;
+		height: 20px;
+		margin: 2px 5px 2px 0;
+		float: left;
+	}
+
+	.label span {
+		padding: 0 5px;
+		color: #fff;
+	}
+
+	.close {
+		padding: 1px 5px !important;
+	}
+
+	.close:hover {
+		/* background-color: #009E94;
+	    border-radius: 2px;
+	    color: tomato; */
+	}
+
+	.selectId input {
+		width: 100% !important;
+	}
+
+	.selectId input {
+		height: 25px;
+		padding: 1px 5px;
+		border-radius: 3px;
+		width: calc(100% - 12px);
+		outline-color: #5fb878;
+		border: 1px solid #5fb878;
+	}
+
+	.selectId {
+		position: relative;
+	}
+
+	.selectId dl {
+		border: 1px solid #eee;
+		border-radius: 3px;
+		margin: 2px 0px;
+		max-height: 300px;
+		overflow-x: hidden;
+		white-space: nowrap;
+		position: absolute;
+		width: 100%;
+		top: 40px;
+		background: #fff;
+		z-index: 1000
+	}
+
+	.selectId dl dd {
+		margin: 0;
+		padding: 5px 10px;
+	}
+
+	.selectId dl dd:hover {
+		background-color: #5FB878;
+		color: white;
+	}
+
+	.AD {
+		/* width: 210px;
+	        margin-left: 40px; */
+		overflow-y: auto;
+		max-height: 200px;
+		/* border: 2px solid #5fb878;
+	        border-radius: 6px;
+	        padding: 1px 2px; */
+	}
+
+	form .AD span {
+		width: auto;
+	}
+
+	.siteSelect {
+		width: 71%;
+		display: inline-block;
+	}
+
+
+	/* 站点多选下拉样式end */
+</style>