123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <template>
- <view class="uni-container">
- <my-search :queryParams="queryParams" :getData="getData" @date-change="onDateChange"></my-search>
- <view class="main-street" v-if="list.length>0 && isLoaded">
- <view v-for="(item, index) in list" :key="index">
- <uni-card>
- <view>
- <view class="main-item">
- <view>填报时间:</view>
- <view class="conts">{{ item.reporttime }}</view>
- </view>
- </view>
- <view class="">
- <view class="an-niu-street" @click.native="delClick(item.id)" link style="margin-left:3px">
- <text class="deletes">删除</text>
- </view>
- <view class="an-niu-street" @click.native="viewClick(item.id)" link>
- <text class="detail">查看</text>
- </view>
- <view class="an-niu-street" @click.native="editClick(item.id)" link>
- <text class="bianji">编辑</text>
- </view>
- </view>
- </uni-card>
- </view>
- </view>
- <view v-else-if="list.length==0 && isLoaded" style="text-align: center;">
- <view class="text-gray" style="padding-top: 20px;">
- <img :src="tan90" alt="暂无数据" />
- </view>
- </view>
- <image :src="Group" @click="addClick" class="tiantupian-street"></image>
- <!-- 加载中 -->
- <isLodingModel></isLodingModel>
- </view>
- </template>
- <script>
- import {
- getXfxcjypxyl,
- delXfxcjypxyl
- }
- from '@/api/fire_inspetItem/index';
- import {
- delSure
- } from '@/utils/common.js'
- import config from '@/config'
- const baseUrlImg = config.baseUrlImg
- import mySearch from '@/pagesA/components/my-search/index'
- export default {
- components: {
- mySearch
- },
- data() {
- return {
- isLoaded: false,
- Group: `${baseUrlImg}/checkActive/Group.png`,
- list: [],
- tan90: `${baseUrlImg}/tan90.png`,
- queryParams: {
- pageNo: 1,
- pageSize: 10,
- reporttime: []
- },
- // 总条数
- total: 0,
- loading: false
- }
- },
- onShow() {
- this.list = []
- this.getData()
- },
- watch: {
- loading: {
- handler(newLength, oldLength) {
- this.$modal.isLoadingModel(this.loading)
- },
- immediate: true
- }
- },
- methods: {
- onDateChange(params) {
- this.queryParams = params
- this.loading = true
- this.isLoaded = false
- this.list = []
- this.getData()
- },
- getData() {
- this.loading = true
- getXfxcjypxyl(this.queryParams).then(response => {
- this.isLoaded = true
- this.list = [...this.list, ...response.data.list]
- this.loading = false
- })
- },
- viewClick(item) {
- this.isLoaded = false
- uni.navigateTo({
- url: `/pagesA/fire/fire_inspetItem/add-street/streetXfxcjypxyl?viewData=${item}`,
- })
- },
- editClick(item) {
- this.isLoaded = false
- uni.navigateTo({
- url: `/pagesA/fire/fire_inspetItem/add-street/streetXfxcjypxyl?editData=${item}`,
- })
- },
- delClick(val) {
- delSure(delXfxcjypxyl, val, this)
- },
- addClick() {
- this.isLoaded = false
- uni.navigateTo({
- url: '/pagesA/fire/fire_inspetItem/add-street/streetXfxcjypxyl',
- })
- },
- },
- // 触底的事件
- onReachBottom() {
- // 判断是否还有下一页数据
- if (this.queryParams.pageNo * this.queryParams.pageSize >= this.total)
- return uni.showToast({
- title: `数据加载完毕`
- });
- // 判断是否正在请求其它数据,如果是,则不发起额外的请求
- if (this.loading) return;
- this.queryParams.pageNo += 1;
- this.getData(this.queryParams.pageNo);
- },
- }
- </script>
- <style lang="scss" scoped>
- body {
- background-color: #f5f7f9;
- }
- page {
- background-color: #f5f7f9 !important;
- }
- .uni-container {
- height: 100%
- }
- /deep/.uni-card {
- box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
- border-radius: 30rpx;
- }
- </style>
|