Browse Source

bug修复

Ming 3 years ago
parent
commit
129cea7be0

+ 3 - 3
pages/eleControl/controlReport/controlReportAdd/controlReportAdd.vue

@@ -8,7 +8,7 @@
 					<text class="necessary">*</text>
 					监察标题:
 				</view>
-				<input type="text" v-model="supervision_title">
+				<input type="text" v-model="supervision_title" required>
 				<!-- <select name="" id="" filterable clearable v-model="supervision_title">
 					<option value="">请选择</option>
 					<option :value=item.supervision_name v-for="item in titleListData">{{ item.supervision_name}}</option>
@@ -127,7 +127,7 @@
 		
 			//新增提交
 			async addSubmit() {
-				if (!this.supervision_title) {
+				if (!this.supervision_title.replace(/^\s*/g,'')) {
 					uni.showToast({
 						title: "请输入监察标题",
 						icon: "none"
@@ -141,7 +141,7 @@
 					});
 					return
 				}
-				if (!this.supervision_content) {
+				if (!this.supervision_content.replace(/^\s*/g,'')) {
 					uni.showToast({
 						title: "请输入监察内容",
 						icon: "none"

+ 1 - 1
pages/siteArchive/archiveDetail/archiveDetail.vue

@@ -295,7 +295,7 @@
 				this.detailInfo = res.data.data[0];
 				if(!this.detailInfo){
 					uni.showToast({
-						title: "暂无数据!",
+						title: "暂无档案信息!",
 						icon: "none"
 					});
 				}

+ 70 - 22
pages/siteManage/siteManage.vue

@@ -4,15 +4,18 @@
 		<view style="height:200rpx"></view>
 		<view class="ding">
 			<view class="cu-bar search bg-gray filter-section" style="padding-top:10rpx">
-				<view class="search-form round bg-white">
-					<select name="" id="" filterable clearable v-model="router_id" style="padding-left:40rpx;background-size: 4.6%;">
+				<view class="search-form round bg-white" style="position:relative;overflow:auto">
+
+					<!-- <select name="" id="" filterable clearable v-model="router_id" style="padding-left:40rpx;background-size: 4.6%;">
 						<option value="0">请选择线路名称</option>
 						<option :value=item.route_name v-for="item in routeListData">{{ item.route_name}}</option>
-					</select>
-				</view>
+					</select> -->
 
+					<input name="siteName" v-model="formMess.siteName" @click="toggleShow" @focus="focusfns"
+						@input="handleInput()" placeholder="请输入或选择"></input>
+				</view>
 			</view>
-			<view class="cu-bar search bg-gray filter-section" >
+			<view class="cu-bar search bg-gray filter-section">
 				<view class="search-form round bg-white">
 					<text class="cuIcon-search"></text>
 					<input class="" type="text" placeholder="请输入站点名称" confirm-type="search" v-model="siteName"></input>
@@ -22,13 +25,22 @@
 				</view>
 			</view>
 		</view>
+
+		<view class="siteItems" v-if="isShow" style="max-height:60vh;overflow:auto;position:absolute;z-index:999; margin: 0 32rpx;
+    width: calc(100% - 64rpx);top:100rpx">
+			<view class=" site-item" v-if="!siteItemData.length">暂无结果</view>
+			<view class="site-item" v-for="(item,index) in siteItemData" @click="changeModel(item,index)" :key="index" style="padding:16rpx 22rpx">
+				{{item.route_name}}
+			</view>
+		</view>
 		<!-- 筛选框end -->
 
 		<!-- 站点列表start -->
 		<view class="site-items" style="margin-top:0;height: calc(100vh - 500rpx);">
 			<view class="cu-list menu-avatar">
-				<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in siteList" :key="index"
-				 @touchstart="ListTouchStart" @touchmove="ListTouchMove" @touchend="ListTouchEnd" :data-target="'move-box-' + index">
+				<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
+					v-for="(item,index) in siteList" :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" @tap="goDeviceManage(item)">
@@ -37,7 +49,8 @@
 
 					<view class="nav-right num">
 						<view class="text-grey text-xs">
-							<image @click="mapLocation(item)" src="../../static/nav-icon.png" style="width:25rpx;height:25rpx;margin-right:26rpx"></image>
+							<image @click="mapLocation(item)" src="../../static/nav-icon.png"
+								style="width:25rpx;height:25rpx;margin-right:26rpx"></image>
 						</view>
 					</view>
 					<view class="move">
@@ -62,8 +75,7 @@
 <script>
 
 </script>
-<script>
-	
+<script>
 	//引入js sdk的封装
 	import * as jwx from '../../util/jssdk.js'
 
@@ -77,9 +89,19 @@
 				siteName: '',
 				siteList: [],
 				siteListRes: 0,
-				
-				router_id:0,
-				routeListData:[]
+
+				router_id: 0,
+				routeListData: [],
+
+
+				route_name: '',
+				isShow: false,
+				formMess: {
+					"siteName": "",
+				},
+
+				siteItemDataOrigin: [],
+				siteItemData: [],
 
 			};
 		},
@@ -93,7 +115,7 @@
 		},
 
 		methods: {
-			
+
 			//线路名称下拉数据请求
 			async getRoutrBox(params = {}) {
 				const res = await this.$myRequest({
@@ -101,15 +123,41 @@
 					showLoading: true,
 					data: params
 				})
-				this.routeListData = res.data.data;
-				console.log(this.routeListData)
+				// this.routeListData = res.data.data;
+				// console.log(this.routeListData)
+
+				this.siteItemData = res.data.data;
+				this.siteItemDataOrigin = res.data.data;
+				this.siteItemData = this.siteItemDataOrigin;
+			},
+			//选中下拉选项,隐藏框,赋值
+			changeModel: function(item, index) {
+				this.isShow = false;
+				this.formMess.siteName = item.route_name;
+			},
+
+			// 输入框点击 显示隐藏下拉框
+			toggleShow: function() {
+				this.isShow = !this.isShow;
+			},
+			//点击下拉筛选
+			handleInput() {
+				//将元素根据搜索内容过滤出来  这里改变了siteItemData
+				this.siteItemData = this.siteItemDataOrigin;
+				this.siteItemData = this.siteItemData.filter(item => item.route_name.indexOf(this.formMess.siteName) > -1);
 			},
-			
+			focusfns: function(e) {
+				//将元素根据搜索内容过滤出来  这里改变了siteItemData
+				this.siteItemData = this.siteItemDataOrigin;
+				this.siteItemData = this.siteItemData.filter(item => item.route_name.indexOf(this.formMess.siteName) >
+					-1);
+			},
+
 			//筛选
 			searchSiteList() {
 				this.getSiteList({
 					"siteName": this.siteName,
-					"route_name":this.router_id
+					"route_name": this.formMess.siteName
 				})
 			},
 
@@ -138,11 +186,11 @@
 			},
 
 			// 打开导航
-			mapLocation(item) {
-				
+			mapLocation(item) {
+
 				//h5 地图导航
 				// window.location.href =  'http://apis.map.qq.com/uri/v1/marker?marker=coord:'+parseFloat(item.latitude)+','+parseFloat(item.longitude)+'' 
-
+
 				//app导航
 				// uni.openLocation({
 				// 	latitude: parseFloat(item.latitude),
@@ -151,7 +199,7 @@
 				// 		// console.log('success');
 				// 	}
 				// });
-
+
 				// 微信公众号导航
 				jwx.configWeiXin(jweixin => {
 					let shareInfo = {

+ 99 - 0
pages/test/test2.vue

@@ -0,0 +1,99 @@
+<template>
+	<view class="appWrapper">
+		<!-- 输入下拉查询 start -->
+		<form action="">
+			<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="toggleShow" @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="changeModel(item,index)" :key="index">{{item.siteName}}</view>
+					</view>
+				</view>
+			</view>
+		</form>
+		<!-- 输入下拉查询 end -->
+
+	</view>
+</template>
+
+<script>
+	export default {
+
+		data() {
+			return {
+				isShow: false,
+				formMess: {
+					"siteName": "",
+				},
+
+				siteItemDataOrigin: [],
+				siteItemData: [],
+
+				
+			}
+		},
+
+		mounted() {
+			
+			// 点击空白隐藏弹框
+			document.addEventListener('click', (e) => {
+				if (e.target.className != 'uni-input-input') {
+					this.isShow = false;
+				}
+			});
+		},
+		onLoad: function(option) {
+			this.getSiteList();
+		
+
+		},
+		methods: {
+			
+	
+			//站点下拉请求数据
+			async getSiteList() {
+				const res = await this.$myRequest({
+					url: 'SiteManagement/getSiteList',
+				})
+				this.siteItemData = res.data.data;
+				this.siteItemDataOrigin = res.data.data;
+				this.siteItemData = this.siteItemDataOrigin;
+			},
+			
+	
+			//选中下拉选项,隐藏框,赋值
+			changeModel: function(item, index) {
+				this.isShow = false;
+				this.formMess.siteName = item.siteName;
+			},
+			
+			
+			// 输入框点击 显示隐藏下拉框
+			toggleShow: function() {
+				this.isShow = !this.isShow;
+			},
+			
+			//点击下拉筛选
+			handleInput() {
+				//将元素根据搜索内容过滤出来  这里改变了siteItemData
+				this.siteItemData = this.siteItemDataOrigin;
+				this.siteItemData = this.siteItemData.filter(item => item.siteName.indexOf(this.formMess.siteName) > -1);
+			},
+
+			focusfns: function(e) {
+				//将元素根据搜索内容过滤出来  这里改变了siteItemData
+				this.siteItemData = this.siteItemDataOrigin;
+				this.siteItemData = this.siteItemData.filter(item => item.siteName.indexOf(this.formMess.siteName) > -1);
+			},
+		}
+	}
+</script>
+