|
@@ -10,7 +10,7 @@
|
|
|
</van-nav-bar>
|
|
|
<!-- 搜索框 -->
|
|
|
<div class='equipment-search-container'>
|
|
|
- <van-search class='equipment-search' v-model='keyword' placeholder='请输入设备简称和设备内编码' @search='onSearch'>
|
|
|
+ <van-search class='equipment-search' v-model='keyword' placeholder='请输入设备简称和设备内编码' @search='onSearch' @focus='focus'>
|
|
|
<!-- TODO: 空状态 自定义图标 -->
|
|
|
<!-- <template #action>
|
|
|
<div class='search' @click='onSearch'>搜索</div>
|
|
@@ -58,9 +58,16 @@
|
|
|
<!-- 设备设施 -->
|
|
|
<div class='sbss'>
|
|
|
<h1 class='title'>设备设施</h1>
|
|
|
+ <!-- TODO: 1 -->
|
|
|
<div class='system-btn-container'>
|
|
|
- <div class='system-btn' v-for='(item,index) in sbssList' :key='index'>
|
|
|
- <van-button class='m-btn' :class='item.active' @click='changeSbss(item)'>{{item.text}}</van-button>
|
|
|
+ <div class='system-btn' v-for='(item,index) in sbssList.slice(0,3)' :key='index'>
|
|
|
+ <van-button size='small' class='m-btn' :class='item.active' @click='changeSbss(item)'>{{item.text}}</van-button>
|
|
|
+ </div>
|
|
|
+ <div v-if='!loadMore && sbssList.length>3' class='load-more' @click='loadMore= true'>加载更多</div>
|
|
|
+ <div v-if='loadMore'>
|
|
|
+ <div class='system-btn' v-for='(item,index) in sbssList.slice(3)' :key='index'>
|
|
|
+ <van-button size='small' class='m-btn' :class='item.active' @click='changeSbss(item)'>{{item.text}}</van-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -114,6 +121,7 @@ export default {
|
|
|
system_code: '', //系统code
|
|
|
sbss_code: '', //设备设施code
|
|
|
sbssList: [{ text: '全部', code: '', active: 'active' }], //设备设施筛选条件
|
|
|
+ loadMore: false,
|
|
|
// 弹窗中使用数据
|
|
|
modalData: {
|
|
|
system: '',
|
|
@@ -150,6 +158,8 @@ export default {
|
|
|
this.showPopup = true
|
|
|
// 设置选中的专业系统
|
|
|
this.changeSystem({ smsxt: this.system_code })
|
|
|
+ this.loadMore = false
|
|
|
+ this.sbssList = [{ text: '全部', code: '', active: 'active' }]
|
|
|
// 查询筛选条件的 设备设施
|
|
|
this.getSbss()
|
|
|
},
|
|
@@ -171,6 +181,10 @@ export default {
|
|
|
delete data.category_code
|
|
|
}
|
|
|
let postParams = { system_code: this.system_code }
|
|
|
+ // 筛选后,专业系统选择全部, 删除上传system_code的字段
|
|
|
+ if (!this.system_code) {
|
|
|
+ delete postParams.system_code
|
|
|
+ }
|
|
|
// TODO: keyword
|
|
|
if (this.keyword) {
|
|
|
data.keyword = `${this.keyword}:sbjc,assetnum;`
|
|
@@ -197,7 +211,9 @@ export default {
|
|
|
},
|
|
|
async onLoad() {
|
|
|
console.log('onload')
|
|
|
- // await sleep(1000)
|
|
|
+ if (this.page > 1) {
|
|
|
+ await sleep(1000)
|
|
|
+ }
|
|
|
await this.getList()
|
|
|
this.page++
|
|
|
this.loading = false
|
|
@@ -213,6 +229,9 @@ export default {
|
|
|
this.initData()
|
|
|
this.onLoad()
|
|
|
},
|
|
|
+ focus() {
|
|
|
+ console.log(1123123123123)
|
|
|
+ },
|
|
|
/**
|
|
|
* 初始化数据,查询列表
|
|
|
*/
|
|
@@ -437,10 +456,12 @@ export default {
|
|
|
width: 50% !important;
|
|
|
min-width: 50% !important;
|
|
|
max-width: 50% !important;
|
|
|
+ height: 50px;
|
|
|
+ box-sizing: border-box;
|
|
|
padding: 10px 10px 10px 0;
|
|
|
.m-btn {
|
|
|
width: 100%;
|
|
|
- // height: 100%;
|
|
|
+ height: 40px !important;
|
|
|
text-align: center;
|
|
|
background: #eff0f1;
|
|
|
border-radius: 2px;
|
|
@@ -464,6 +485,7 @@ export default {
|
|
|
}
|
|
|
.system-btn-container {
|
|
|
width: 100%;
|
|
|
+ height: 40px;
|
|
|
flex: 1;
|
|
|
overflow: auto;
|
|
|
.system-btn {
|
|
@@ -474,7 +496,7 @@ export default {
|
|
|
.m-btn {
|
|
|
display: block !important;
|
|
|
width: 100% !important;
|
|
|
- // height: 100%;
|
|
|
+ height: 40px !important;
|
|
|
text-align: center;
|
|
|
background: #eff0f1;
|
|
|
border-radius: 2px;
|
|
@@ -485,6 +507,15 @@ export default {
|
|
|
background-color: #025baa !important;
|
|
|
color: #fff;
|
|
|
}
|
|
|
+ .load-more {
|
|
|
+ width: 80px;
|
|
|
+ height: 25px;
|
|
|
+ line-height: 25px;
|
|
|
+ text-align: center;
|
|
|
+ margin: 0 auto;
|
|
|
+ color: #025baa;
|
|
|
+ background: #e5eef6;
|
|
|
+ }
|
|
|
}
|
|
|
.divider {
|
|
|
border-bottom: 1px solid #e6e6e6;
|