|
@@ -85,8 +85,6 @@
|
|
|
>
|
|
>
|
|
|
</el-input>
|
|
</el-input>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
<DeptSelect
|
|
<DeptSelect
|
|
|
v-model="postId"
|
|
v-model="postId"
|
|
|
placeholder="使用单位"
|
|
placeholder="使用单位"
|
|
@@ -116,12 +114,17 @@
|
|
|
|
|
|
|
|
<!-- 卡片视图 -->
|
|
<!-- 卡片视图 -->
|
|
|
<div
|
|
<div
|
|
|
|
|
+ ref="cardView"
|
|
|
class="card-view"
|
|
class="card-view"
|
|
|
:style="{
|
|
:style="{
|
|
|
height: isFullscreen
|
|
height: isFullscreen
|
|
|
? 'calc(100vh - 155px)'
|
|
? 'calc(100vh - 155px)'
|
|
|
: 'calc(100vh - 240px)'
|
|
: 'calc(100vh - 240px)'
|
|
|
}"
|
|
}"
|
|
|
|
|
+ v-infinite-scroll="loadMore"
|
|
|
|
|
+ :infinite-scroll-distance="50"
|
|
|
|
|
+ :infinite-scroll-disabled="loadingMore || deviceData.length >= total"
|
|
|
|
|
+ :infinite-scroll-immediate="false"
|
|
|
>
|
|
>
|
|
|
<el-row :gutter="10">
|
|
<el-row :gutter="10">
|
|
|
<el-col
|
|
<el-col
|
|
@@ -190,6 +193,13 @@
|
|
|
</div>
|
|
</div>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
+ <!-- 占位块:确保总数超过20条时能出现滚动条 -->
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-if="deviceData.length > 0 && deviceData.length < total"
|
|
|
|
|
+ class="scroll-placeholder"
|
|
|
|
|
+ >
|
|
|
|
|
+ <i v-if="loadingMore" class="el-icon-loading"></i>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 分页 -->
|
|
<!-- 分页 -->
|
|
@@ -222,7 +232,7 @@
|
|
|
import { businessStatus } from '@/utils/dict/warehouse';
|
|
import { businessStatus } from '@/utils/dict/warehouse';
|
|
|
import DeptSelect from '@/components/CommomSelect/dept-selectNew.vue';
|
|
import DeptSelect from '@/components/CommomSelect/dept-selectNew.vue';
|
|
|
import { component } from 'vue-fullscreen';
|
|
import { component } from 'vue-fullscreen';
|
|
|
-
|
|
|
|
|
|
|
+ import { getAssetList } from '@/api/ledgerAssets';
|
|
|
export default {
|
|
export default {
|
|
|
mixins: [dictMixins, tableColumnsMixin],
|
|
mixins: [dictMixins, tableColumnsMixin],
|
|
|
components: { DeptSelect, VueFullscreen: component },
|
|
components: { DeptSelect, VueFullscreen: component },
|
|
@@ -258,7 +268,8 @@
|
|
|
cacheKeyUrl: 'ems-energy-monitoring-list',
|
|
cacheKeyUrl: 'ems-energy-monitoring-list',
|
|
|
deviceData: [],
|
|
deviceData: [],
|
|
|
categoryLevelId: '',
|
|
categoryLevelId: '',
|
|
|
- rootCategoryLevelId: ''
|
|
|
|
|
|
|
+ rootCategoryLevelId: '',
|
|
|
|
|
+ loadingMore: false
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {},
|
|
computed: {},
|
|
@@ -323,19 +334,28 @@
|
|
|
this.deviceData = [];
|
|
this.deviceData = [];
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- // 加载设备数据(模拟)
|
|
|
|
|
- loadDeviceData() {
|
|
|
|
|
- querySubstanceRunningMonitor({
|
|
|
|
|
- pageNum: 1,
|
|
|
|
|
- size: 9999,
|
|
|
|
|
|
|
+ // 加载设备数据
|
|
|
|
|
+ loadDeviceData(isLoadMore = false) {
|
|
|
|
|
+ if (this.loadingMore) return;
|
|
|
|
|
+ this.loadingMore = true;
|
|
|
|
|
+ if (!isLoadMore) {
|
|
|
|
|
+ this.pageNum = 1;
|
|
|
|
|
+ if (this.$refs.cardView) {
|
|
|
|
|
+ this.$refs.cardView.scrollTop = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ getAssetList({
|
|
|
|
|
+ pageNum: this.pageNum,
|
|
|
|
|
+ size: 20,
|
|
|
categoryLevelId: this.categoryLevelId,
|
|
categoryLevelId: this.categoryLevelId,
|
|
|
rootCategoryLevelId: this.rootCategoryLevelId,
|
|
rootCategoryLevelId: this.rootCategoryLevelId,
|
|
|
areaId: this.areaId,
|
|
areaId: this.areaId,
|
|
|
keyWord: this.keyWord,
|
|
keyWord: this.keyWord,
|
|
|
postId: this.postId
|
|
postId: this.postId
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
|
|
+ this.loadingMore = false;
|
|
|
this.updateTime = dayjs().format('YYYY-M-D HH:mm:ss');
|
|
this.updateTime = dayjs().format('YYYY-M-D HH:mm:ss');
|
|
|
- this.deviceData = res.list.map((item) => {
|
|
|
|
|
|
|
+ const list = res.list.map((item) => {
|
|
|
let iotList = [];
|
|
let iotList = [];
|
|
|
if (item.iotPointDataList) {
|
|
if (item.iotPointDataList) {
|
|
|
item.iotPointDataList.forEach((element) => {
|
|
item.iotPointDataList.forEach((element) => {
|
|
@@ -362,10 +382,23 @@
|
|
|
: iotList.filter((iotListItem, index) => index < 4);
|
|
: iotList.filter((iotListItem, index) => index < 4);
|
|
|
return item;
|
|
return item;
|
|
|
});
|
|
});
|
|
|
|
|
+ if (isLoadMore) {
|
|
|
|
|
+ this.deviceData = this.deviceData.concat(list);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.deviceData = list;
|
|
|
|
|
+ }
|
|
|
this.total = res.count;
|
|
this.total = res.count;
|
|
|
console.log(res);
|
|
console.log(res);
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.loadingMore = false;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ // 加载更多
|
|
|
|
|
+ loadMore() {
|
|
|
|
|
+ if (this.deviceData.length >= this.total) return;
|
|
|
|
|
+ this.pageNum++;
|
|
|
|
|
+ this.loadDeviceData(true);
|
|
|
|
|
+ },
|
|
|
// // 获取设备图标
|
|
// // 获取设备图标
|
|
|
// getDeviceIcon(type) {
|
|
// getDeviceIcon(type) {
|
|
|
// const iconMap = {
|
|
// const iconMap = {
|
|
@@ -418,7 +451,7 @@
|
|
|
},
|
|
},
|
|
|
// 重置
|
|
// 重置
|
|
|
handleReset() {
|
|
handleReset() {
|
|
|
- this.name = '';
|
|
|
|
|
|
|
+ this.keyWord = '';
|
|
|
this.postId = '';
|
|
this.postId = '';
|
|
|
this.pageNum = 1;
|
|
this.pageNum = 1;
|
|
|
this.loadDeviceData();
|
|
this.loadDeviceData();
|
|
@@ -731,6 +764,14 @@
|
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|
|
|
padding-right: 10px;
|
|
padding-right: 10px;
|
|
|
|
|
|
|
|
|
|
+ .scroll-placeholder {
|
|
|
|
|
+ height: 80px;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ color: rgba(255, 255, 255, 0.3);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.device-card {
|
|
.device-card {
|
|
|
height: 170px;
|
|
height: 170px;
|
|
|
background: linear-gradient(
|
|
background: linear-gradient(
|