123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <template>
- <view class="site-wrapper">
- <view style="height: calc(100vh - 200rpx)">
- <!-- 筛选框start -->
- <view class="cu-bar search bg-gray filter-section">
- <view class="search-form round bg-white">
- <text class="cuIcon-search"></text>
- <input class="" type="text" placeholder="请输入标题" v-model="supervision_title" />
- </view>
- <view class="action">
- <button class="cu-btn bg-blue round" @click="loadData">查询</button>
- </view>
- </view>
- <!-- 筛选框end -->
- <view class="cu-list menu-avatar">
- <view
- class="cu-item"
- :class="modalName == 'move-box-' + index ? 'move-cur' : ''"
- v-for="(item, index) in controlReport"
- :key="index"
- :data-target="'move-box-' + index"
- @tap="goDetail(item.id)"
- >
- <view class="cu-avatar round lg" style="background-image: url(../../../static/controlReportIcon.png)"></view>
- <view class="content">
- <view class="pro-title">
- <view class="cut inOneLine">{{ item.supervision_title }}</view>
- </view>
- <view class="pro-date inOneLine">{{ item.site_name }}</view>
- <view class="pro-date inOneLine">{{ item.create_time }}</view>
- </view>
- <view class="nav-right num">
- <view class="text-grey">
- <text class="icon iconfont margin-right-sm margin-left-lg"></text>
- </view>
- </view>
- </view>
- </view>
- <view v-if="!controlReport.length && siteListRes == 1" class="text-center margin-top"> 暂无数据</view>
- <view v-show="isLoadMore && this.currentPage > 1" style="padding-bottom: 60px">
- <uni-load-more :status="loadStatus"></uni-load-more>
- </view>
- </view>
- <!-- 新增按钮start -->
- <view style="width: 100%; position: fixed; bottom: 0px; right: 0px; height: 64px; background: #fff">
- <view class="plus">
- <image src="../../../static/plus.png" style="width: 100rpx; height: 100rpx" @tap="goAddPage()"></image>
- </view>
- </view>
- <!-- 新增按钮end -->
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- controlReport: [],
- modalName: null,
- siteListRes: 0,
- currentPage: 1,
- size: 11,
- loadStatus: "loading", //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
- isLoadMore: false, //是否加载中
- supervision_title: "",
- };
- },
- onReachBottom() {
- //上拉触底函数
- if (!this.isLoadMore) {
- //此处判断,上锁,防止重复请求
- this.isLoadMore = true;
- this.currentPage += 1;
- this.loadData();
- }
- },
- onLoad: function (option) {
- this.loadData();
- },
- methods: {
- // 页面跳转
- goAddPage(item) {
- uni.redirectTo({
- url: "/pages/eleControl/controlReport/controlReportAdd/controlReportAdd",
- });
- },
- goDetail(id) {
- uni.navigateTo({
- url: "/pages/eleControl/controlReport/controlReportDetail/controlReportDetail?id=" + id,
- });
- },
- loadData() {
- this.getDataList({
- currentPage: this.currentPage,
- size: this.size,
- supervision_title: this.supervision_title,
- });
- },
- //数据请求
- async getDataList(params = {}) {
- const res = await this.$myRequest({
- url: "MonitoringReporting/getMonitoringReportingList",
- showLoading: true,
- data: params,
- });
- this.siteListRes = 1;
- if (res.data.total) {
- // this.controlReport = res.data.data
- this.controlReport = res.data.data;
- if (res.data.data.length < this.size) {
- //判断接口返回数据量小于请求数据量,则表示此为最后一页
- this.isLoadMore = true;
- this.loadStatus = "nomore";
- } else {
- this.isLoadMore = false;
- }
- } else {
- this.isLoadMore = true;
- this.loadStatus = "nomore";
- }
- },
- },
- };
- </script>
- <style lang="scss">
- .cu-item {
- height: 160rpx !important;
- }
- </style>
|