|
@@ -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>
|
|
@@ -101,7 +108,7 @@ export default {
|
|
|
category_code: '',
|
|
|
showPopup: false,
|
|
|
systemList: [
|
|
|
- { text: '全部', smsxt: '', active: 'active' },
|
|
|
+ { text: '全部', smsxt: '全部', active: 'active' },
|
|
|
{ text: '供电系统', smsxt: '1001', active: '' },
|
|
|
{ text: '暖通系统', smsxt: '1002', active: '' },
|
|
|
{ text: '消防系统', smsxt: '1003', active: '' },
|
|
@@ -113,16 +120,17 @@ export default {
|
|
|
],
|
|
|
system_code: '', //系统code
|
|
|
sbss_code: '', //设备设施code
|
|
|
- sbssList: [{ text: '全部', code: '', active: 'active' }], //设备设施筛选条件
|
|
|
+ sbssList: [{ text: '全部', code: '全部', active: 'active' }], //设备设施筛选条件
|
|
|
+ loadMore: false,
|
|
|
// 弹窗中使用数据
|
|
|
modalData: {
|
|
|
system: '',
|
|
|
- sbss: '',
|
|
|
+ sbss: '全部',
|
|
|
},
|
|
|
// 弹窗中使用备份数据
|
|
|
modalDataBak: {
|
|
|
system: '',
|
|
|
- sbss: '',
|
|
|
+ sbss: '全部',
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -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()
|
|
|
},
|
|
@@ -162,15 +172,22 @@ export default {
|
|
|
page: this.page,
|
|
|
size: this.size,
|
|
|
plazaId: this.plazaId,
|
|
|
- category_code: this.category_code,
|
|
|
onlyMainAsset: true,
|
|
|
}
|
|
|
+
|
|
|
+ let postParams = {
|
|
|
+ system_code: this.system_code,
|
|
|
+ category_code: this.category_code,
|
|
|
+ }
|
|
|
+ // 筛选后,专业系统选择全部, 删除上传system_code的字段
|
|
|
+ if (!this.system_code || this.system_code === '全部') {
|
|
|
+ delete postParams.system_code
|
|
|
+ }
|
|
|
// TODO: 筛选后, 使用classstructureid字段,删除category_code字段
|
|
|
if (this.sbss_code) {
|
|
|
- data.classstructureid = this.sbss_code
|
|
|
- delete data.category_code
|
|
|
+ this.sbss_code !== '全部' && (data.classstructureid = this.sbss_code)
|
|
|
+ delete postParams.category_code
|
|
|
}
|
|
|
- let postParams = { system_code: this.system_code }
|
|
|
// TODO: keyword
|
|
|
if (this.keyword) {
|
|
|
data.keyword = `${this.keyword}:sbjc,assetnum;`
|
|
@@ -197,7 +214,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 +232,9 @@ export default {
|
|
|
this.initData()
|
|
|
this.onLoad()
|
|
|
},
|
|
|
+ focus() {
|
|
|
+ console.log(1123123123123)
|
|
|
+ },
|
|
|
/**
|
|
|
* 初始化数据,查询列表
|
|
|
*/
|
|
@@ -236,6 +258,7 @@ export default {
|
|
|
})
|
|
|
// 弹窗选中的系统
|
|
|
this.$set(this.modalDataBak, 'system', data.smsxt)
|
|
|
+ this.getSbss(data.smsxt)
|
|
|
},
|
|
|
/**
|
|
|
* popup 更改设备设施
|
|
@@ -255,16 +278,20 @@ export default {
|
|
|
},
|
|
|
/**
|
|
|
* 获取设备设施筛选条件
|
|
|
+ * @param smsxt 右弹窗 更改专业系统传递参数
|
|
|
*/
|
|
|
- async getSbss() {
|
|
|
+ async getSbss(smsxt) {
|
|
|
console.log(this.smsxt, this.system_code)
|
|
|
let getParams = {
|
|
|
- smsxt: this.smsxt,
|
|
|
+ smsxt: smsxt || this.smsxt,
|
|
|
+ }
|
|
|
+ if (smsxt === '全部') {
|
|
|
+ delete getParams.smsxt
|
|
|
}
|
|
|
let resData = await queryClassStructure({ getParams })
|
|
|
console.log(resData)
|
|
|
if (!resData && !resData?.data) {
|
|
|
- this.sbssList = [{ text: '全部', code: '', active: 'active' }]
|
|
|
+ this.sbssList = [{ text: '全部', code: '全部', active: 'active' }]
|
|
|
return false
|
|
|
}
|
|
|
let res_data = resData.data || []
|
|
@@ -279,7 +306,7 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
- this.sbssList = [{ text: '全部', code: '', active: 'active' }, ...sbssList]
|
|
|
+ this.sbssList = [{ text: '全部', code: '全部', active: 'active' }, ...sbssList]
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -288,14 +315,18 @@ export default {
|
|
|
reset() {
|
|
|
this.modalDataBak = {
|
|
|
system: '',
|
|
|
- sbss: '',
|
|
|
+ sbss: '全部',
|
|
|
}
|
|
|
this.modalData = {
|
|
|
system: '',
|
|
|
- sbss: '',
|
|
|
+ sbss: '全部',
|
|
|
}
|
|
|
this.system_code = this.smsxt
|
|
|
+ this.sbss_code = ''
|
|
|
this.showPopup = false
|
|
|
+ // 初始化数据,查询列表
|
|
|
+ this.initData()
|
|
|
+ this.onLoad()
|
|
|
},
|
|
|
/**
|
|
|
* 弹窗确认
|
|
@@ -437,10 +468,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 +497,7 @@ export default {
|
|
|
}
|
|
|
.system-btn-container {
|
|
|
width: 100%;
|
|
|
+ height: 40px;
|
|
|
flex: 1;
|
|
|
overflow: auto;
|
|
|
.system-btn {
|
|
@@ -474,7 +508,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 +519,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;
|