|
@@ -2,7 +2,15 @@
|
|
|
<view class="site-wrapper" ref="contentWrapper">
|
|
|
|
|
|
<!-- 筛选框start -->
|
|
|
+ <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">
|
|
|
<text class="cuIcon-search"></text>
|
|
@@ -12,13 +20,22 @@
|
|
|
<view class="action">
|
|
|
<button class="cu-btn bg-blue round" @click="searchData()">查询</button>
|
|
|
</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 -->
|
|
|
|
|
|
|
|
|
<!-- 站点列表start -->
|
|
|
- <view class="site-items">
|
|
|
+ <view class="site-items" style="margin-top: 0px">
|
|
|
<view class="cu-list menu-avatar longPressUl">
|
|
|
<view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in newSiteListData"
|
|
|
:key="index" :data-target="'move-box-' + index">
|
|
@@ -63,6 +80,13 @@
|
|
|
listTouchStart: 0,
|
|
|
listTouchDirection: null,
|
|
|
CustomBar: this.CustomBar,
|
|
|
+
|
|
|
+ isShow2: false,
|
|
|
+ formMess: {
|
|
|
+ "siteName": "",
|
|
|
+ },
|
|
|
+ siteItemDataOrigin: [],
|
|
|
+ siteItemData: [],
|
|
|
};
|
|
|
},
|
|
|
|
|
@@ -94,13 +118,58 @@
|
|
|
})
|
|
|
},
|
|
|
onLoad() {
|
|
|
- this.getSiteList()
|
|
|
+ this.getSiteList();
|
|
|
+ this.getRoutrBox()
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //线路名称下拉数据请求
|
|
|
+ async getRoutrBox(params = {}) {
|
|
|
+ const res = await this.$myRequest({
|
|
|
+ url: 'Archives/getRoutrBox',
|
|
|
+ showLoading: true,
|
|
|
+ data: params
|
|
|
+ })
|
|
|
+ // 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.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.getSiteList({
|
|
|
- "siteName": this.siteName
|
|
|
+ "siteName": this.siteName,
|
|
|
+ "route_name": this.formMess.siteName
|
|
|
})
|
|
|
},
|
|
|
|