Bladeren bron

现场档案增加线路下拉筛选可输入

ming 3 jaren geleden
bovenliggende
commit
c36ac7d403
3 gewijzigde bestanden met toevoegingen van 86 en 13 verwijderingen
  1. 6 6
      pages/index/index.vue
  2. 75 2
      pages/siteArchive/siteArchive.vue
  3. 5 5
      util/api.js

+ 6 - 6
pages/index/index.vue

@@ -193,15 +193,15 @@
 		onLoad: function(option) {
 
 		
-			// if (option.op) {
-			// 	this.getData();
+			if (option.op) {
+				this.getData();
 			
-			// } else {
-			// 	this.init()
-			// }
+			} else {
+				this.init()
+			}
 			
 			
-			this.getData();
+			// this.getData();
 
 			this.hackReset = false;
 			this.$nextTick(() => {

+ 75 - 2
pages/siteArchive/siteArchive.vue

@@ -2,8 +2,19 @@
 	<view class="site-wrapper">
 
 		<!-- 筛选框start -->
-		<view style="height:100rpx"></view>
+		<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" style="position:relative;overflow:auto">
+					<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="search-form round bg-white">
@@ -16,7 +27,18 @@
 				</view>
 
 			</view>
+			
+			
 
+		</view>
+		
+		<view class="siteItems" v-if="isShow2" 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 -->
@@ -82,6 +104,14 @@
 				size: 10,
 				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
 				isLoadMore: false, //是否加载中
+				
+				isShow2: false,
+				formMess: {
+					"siteName": "",
+				},
+				siteItemDataOrigin: [],
+				siteItemData: [],
+				
 			};
 		},
 
@@ -95,10 +125,48 @@
 		onLoad: function(option) {
 
 			this.loadData()
-
+			this.getRoutrBox()
 		},
 
 		methods: {
+			//线路名称下拉数据请求
+			async getRoutrBox(params = {}) {
+				const res = await this.$myRequest({
+					url: 'Archives/getRoutrBox',
+					showLoading: true,
+					data: params
+				})
+				this.siteItemData = res.data.data;
+				this.siteItemDataOrigin = res.data.data;
+				this.siteItemData = this.siteItemDataOrigin;
+			},
+			//选中下拉选项,隐藏框,赋值
+			changeModel: function(item, index) {
+				this.isShow2 = false;
+				this.formMess.siteName = item.route_name;
+			},
+			
+			// 输入框点击 显示隐藏下拉框
+			toggleShow: function() {
+				this.isShow2 = !this.isShow2;
+			},
+			//点击下拉筛选
+			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);
+			},
+			
+			
+			
+			
 
 			searchData() {
 				this.currentPage=1,
@@ -110,6 +178,7 @@
 			loadData(){
 				this.getDataList({
 					"site_name": this.siteName,
+					"route_name": this.formMess.siteName,
 					currentPage: this.currentPage,
 					size: this.size,
 				})
@@ -190,6 +259,10 @@
 				}
 				this.listTouchDirection = null
 			}
+			
+			
+			
+			
 		}
 	}
 </script>

+ 5 - 5
util/api.js

@@ -1,9 +1,9 @@
 // const BASE_URL = 'https://iot.usky.cn/USKYOF/USKYOF.php/Home/' //(测试域名)  
-const BASE_URL = 'https://qhome.usky.cn/USKYOF/USKYOF.php/Home/' //(正式域名新)  
-const websiteUrl = 'https://qhome.usky.cn'
+const BASE_URL = 'https://wx.ewoogi.com/USKYOF/USKYOF.php/Home/' //(正式域名新)  
+const websiteUrl = 'https://wx.ewoogi.com'
 
-// const websiteUrl = 'https://qhome.usky.cn'
-// const BASE_URL='http://https://qhome.usky.cn/USKYOF/USKYOF.php/Home/'
+// const websiteUrl = 'https://wx.ewoogi.com'
+// const BASE_URL='http://https://wx.ewoogi.com/USKYOF/USKYOF.php/Home/'
 // 同时发送异步代码的次数,防止一次点击中有多次请求,用于处理
 let ajaxTimes = 0;
 
@@ -62,7 +62,7 @@ function myRequest(options){
 				let notIndexFail = ['Index/getDataStatistics', 'Com/getAuthorizationUrl'];
 				if (notIndexFail.includes(options.url)) {
 					window.location.href =
-						'https://qhome.usky.cn/wx/index.html#/pages/index/index';
+						'https://wx.ewoogi.com/wx/index.html#/pages/index/index';
 				} else {
 					uni.showModal({
 						showCancel: false,