|
@@ -1,32 +1,43 @@
|
|
<template>
|
|
<template>
|
|
- <scroll-view class="scroll-height" :scroll-y="true" :data-theme="'theme-' + proxy.$settingStore.themeColor.name" @scrolltolower="scrolltolower">
|
|
|
|
- <u-sticky class="example-body" style="top: 0px">
|
|
|
|
- <view class="padding-sm padding-tb-10" :class="'bg-' + proxy.$settingStore.themeColor.name">
|
|
|
|
- <u--input
|
|
|
|
- v-model="facilityName"
|
|
|
|
- placeholder="搜索"
|
|
|
|
- prefixIcon="search"
|
|
|
|
- prefixIconStyle="font-size: 22px;color: #909399"
|
|
|
|
- customStyle="height:35px;background-color:#f5f6fa;"
|
|
|
|
- @confirm="init()"
|
|
|
|
- clearable
|
|
|
|
- ></u--input>
|
|
|
|
- </view>
|
|
|
|
- </u-sticky>
|
|
|
|
-
|
|
|
|
- <u-empty v-show="dataList.length <= 0" text="暂无数据" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"> </u-empty>
|
|
|
|
- <view v-if="dataList.length > 0" class="facilitiesDetailsList-container">
|
|
|
|
- <view class="menu-list margin-0">
|
|
|
|
- <view class="list-cell list-cell-arrow" v-for="(base, index) in dataList" :key="index" @click="handleToDevice(base.id)">
|
|
|
|
- <view class="menu-item-box">
|
|
|
|
- <view class="title">{{ base.facilityName }}</view>
|
|
|
|
|
|
+ <u-sticky class="example-body" style="top: 0px">
|
|
|
|
+ <view class="padding-sm padding-tb-10" :class="'bg-' + proxy.$settingStore.themeColor.name">
|
|
|
|
+ <u--input
|
|
|
|
+ v-model="facilityName"
|
|
|
|
+ placeholder="搜索"
|
|
|
|
+ prefixIcon="search"
|
|
|
|
+ prefixIconStyle="font-size: 22px;color: #909399"
|
|
|
|
+ customStyle="height:35px;background-color:#f5f6fa;"
|
|
|
|
+ @confirm="init()"
|
|
|
|
+ clearable
|
|
|
|
+ ></u--input>
|
|
|
|
+ </view>
|
|
|
|
+ </u-sticky>
|
|
|
|
+
|
|
|
|
+ <oa-scroll
|
|
|
|
+ class="scroll-height"
|
|
|
|
+ :pageSize="pageSize"
|
|
|
|
+ :total="total"
|
|
|
|
+ :refresherLoad="true"
|
|
|
|
+ :refresherEnabled="true"
|
|
|
|
+ :refresherDefaultStyle="'none'"
|
|
|
|
+ :refresherThreshold="44"
|
|
|
|
+ :refresherBackground="'#f5f6f7'"
|
|
|
|
+ @load="load"
|
|
|
|
+ @refresh="refresh"
|
|
|
|
+ :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
|
|
|
|
+ >
|
|
|
|
+ <template #default>
|
|
|
|
+ <view class="facilitiesDetailsList-container">
|
|
|
|
+ <view class="menu-list margin-0">
|
|
|
|
+ <view class="list-cell list-cell-arrow" v-for="(base, index) in dataList" :key="index" @click="handleToDevice(base.id)">
|
|
|
|
+ <view class="menu-item-box">
|
|
|
|
+ <view class="title">{{ base.facilityName }}</view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
- <u-loadmore :status="status" @click="scrolltolower" />
|
|
|
|
- </view>
|
|
|
|
- </scroll-view>
|
|
|
|
|
|
+ </template>
|
|
|
|
+ </oa-scroll>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
@@ -39,7 +50,6 @@ import { baseGgpFacility } from "@/api/business/fireIot/facilitiesView/index";
|
|
const { proxy } = getCurrentInstance();
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
|
const dataList = ref([]);
|
|
const dataList = ref([]);
|
|
-const status = ref("loadmore");
|
|
|
|
const facilityType = ref(undefined);
|
|
const facilityType = ref(undefined);
|
|
const facilityName = ref("");
|
|
const facilityName = ref("");
|
|
const facilityTypeName = ref("");
|
|
const facilityTypeName = ref("");
|
|
@@ -69,10 +79,6 @@ function selectListApi() {
|
|
|
|
|
|
dataList.value = requset.data.records;
|
|
dataList.value = requset.data.records;
|
|
total.value = requset.data.total;
|
|
total.value = requset.data.total;
|
|
-
|
|
|
|
- if (total.value == dataList.value.length) {
|
|
|
|
- status.value = "nomore";
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -85,19 +91,21 @@ function handleToDevice(id) {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @scrollView触底事件
|
|
|
|
|
|
+ * @scrollView加载数据
|
|
*/
|
|
*/
|
|
-function scrolltolower(e) {
|
|
|
|
- if (total.value == dataList.value.length) {
|
|
|
|
- status.value = "nomore";
|
|
|
|
- return;
|
|
|
|
- } else {
|
|
|
|
- status.value = "loading";
|
|
|
|
- pageSize.value += 10;
|
|
|
|
- setTimeout(() => {
|
|
|
|
- selectListApi();
|
|
|
|
- }, 1000);
|
|
|
|
- }
|
|
|
|
|
|
+function load() {
|
|
|
|
+ pageSize.value += 10;
|
|
|
|
+ init();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @scrollView刷新数据
|
|
|
|
+ */
|
|
|
|
+function refresh() {
|
|
|
|
+ facilityName.value = "";
|
|
|
|
+ pageSize.value = 20;
|
|
|
|
+ total.value = 0;
|
|
|
|
+ init();
|
|
}
|
|
}
|
|
|
|
|
|
onReady(() => {});
|
|
onReady(() => {});
|