|
@@ -15,6 +15,7 @@
|
|
|
class='equipment-container'
|
|
|
:class='{"one-list":list.length === 1}'
|
|
|
v-model='loading'
|
|
|
+ :immediate-check='false'
|
|
|
:finished='finished'
|
|
|
@load='onLoad'
|
|
|
finished-text
|
|
@@ -26,7 +27,7 @@
|
|
|
<span>{{item.count}}</span>
|
|
|
</div>
|
|
|
<!-- 第1页 -->
|
|
|
- <van-cell is-link v-for='detail in item.data.slice(0,innerSize) || []' @click='goToDetail(detail)' :key='detail.classstructureid'>
|
|
|
+ <van-cell is-link v-for='detail in item.data.slice(0,4) || []' @click='goToDetail(detail)' :key='detail.classstructureid'>
|
|
|
<!-- 使用 title 插槽来自定义标题 -->
|
|
|
<template #title>
|
|
|
<span class='number'>{{detail.classstructureid}}</span>
|
|
@@ -39,33 +40,9 @@
|
|
|
</template>
|
|
|
</van-cell>
|
|
|
<!-- 加载更多 -->
|
|
|
- <div class='load-more' v-show='item.loadMore && item.data && item.data.length>=5' @click='locationLoadMore(item,index)'>加载更多</div>
|
|
|
+ <div class='load-more' v-show='item.loadMore && item.count>=5' @click='locationLoadMore(item,index)'>加载更多</div>
|
|
|
</div>
|
|
|
</van-list>
|
|
|
- <div class='equipment-container' v-if='1'>
|
|
|
- <div class='switch-room' v-for='ii in 0' :key='ii'>
|
|
|
- <div class='title'>
|
|
|
- <span>螺旋式冷水机组</span>
|
|
|
- <span>10</span>
|
|
|
- </div>
|
|
|
- <!-- 单元格 -->
|
|
|
- <van-cell is-link v-for='item in mockList' :key='item.classstructureid'>
|
|
|
- <!-- 使用 title 插槽来自定义标题 -->
|
|
|
- <template #title>
|
|
|
- <span class='number'>{{item.classstructureid}}</span>
|
|
|
- <span class='name'>{{item.sbjc}}</span>
|
|
|
- </template>
|
|
|
- <template #right-icon>
|
|
|
- <span class='wx' v-if='item._type === "维修"'>维修</span>
|
|
|
- <span class='wb'>维保</span>
|
|
|
- <van-icon name='arrow' class='arrow-icon' />
|
|
|
- </template>
|
|
|
- </van-cell>
|
|
|
- <!-- 加载更多 -->
|
|
|
- <div class='load-more' @click>加载更多</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- 点击头部筛选,出现的右侧弹窗 -->
|
|
|
<!-- 点击头部筛选,出现的右侧弹窗 -->
|
|
|
<van-popup class='m-popup-container' v-model='showPopup' position='right'>
|
|
|
<div class='m-popup'>
|
|
@@ -199,6 +176,8 @@ export default {
|
|
|
let data = {
|
|
|
page: this.page,
|
|
|
size: this.size,
|
|
|
+ subPage: 1,
|
|
|
+ subSize: 10 || this.innerSize,
|
|
|
plazaId: this.plazaId,
|
|
|
onlyMainAsset: true,
|
|
|
}
|
|
@@ -265,9 +244,65 @@ export default {
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
+ * 点击加载更多
|
|
|
+ */
|
|
|
+ locationLoadMore(item, index) {
|
|
|
+ console.log(item, index)
|
|
|
+ item.loadMore = false
|
|
|
+ this.$set(this.list, index, item)
|
|
|
+ this.locationOnLoad(item, index)
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 查询一个设备类下的onLoad事件
|
|
|
*/
|
|
|
- locationLoadMore() {},
|
|
|
+ async locationOnLoad(data, index) {
|
|
|
+ let item = cloneDeep(this.list[index])
|
|
|
+ console.log(item)
|
|
|
+ if (item.page > 2) {
|
|
|
+ await sleep(1000)
|
|
|
+ }
|
|
|
+ await this.getLocationList({ ...data, index })
|
|
|
+ // 调用接口后的item
|
|
|
+ let currentItem = cloneDeep(this.list[index])
|
|
|
+ // list无数据,不执行后续分页查询
|
|
|
+ if (!currentItem.list.length) {
|
|
|
+ currentItem.finished = true
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ currentItem.page++
|
|
|
+ currentItem.finished = false
|
|
|
+ currentItem.loading = false
|
|
|
+ if (currentItem.list.length + currentItem.data.length >= currentItem.count) {
|
|
|
+ currentItem.finished = true
|
|
|
+ }
|
|
|
+ this.$set(this.list, index, currentItem)
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 查询一个设备类下的设备
|
|
|
+ */
|
|
|
+ async getLocationList(item) {
|
|
|
+ // queryEquipmentList
|
|
|
+ const { location, index } = item
|
|
|
+ let currentList = cloneDeep(this.list[index])
|
|
|
+ let queryData = {
|
|
|
+ data: {
|
|
|
+ page: currentList.page,
|
|
|
+ size: currentList.size,
|
|
|
+ plazaId: this.plazaId,
|
|
|
+ onlyMainAsset: true,
|
|
|
+ },
|
|
|
+ postParams: {
|
|
|
+ system_code: this.system_code, //TODO: 专业系统
|
|
|
+ classstructureid: currentList.classstructureid,
|
|
|
+ },
|
|
|
+ }
|
|
|
+ if (this.keyword) {
|
|
|
+ queryData.data.keyword = `${this.keyword}:drawernum,outspec,control;`
|
|
|
+ }
|
|
|
+ console.log(item)
|
|
|
+ console.log(currentList)
|
|
|
+ console.log(queryData)
|
|
|
+ },
|
|
|
/**
|
|
|
* 跳转设备详情页
|
|
|
*/
|