提交代码

This commit is contained in:
guanj
2026-06-01 11:32:25 +08:00
parent 276ef60389
commit 43c6249530
15 changed files with 384 additions and 157 deletions

View File

@@ -3,15 +3,11 @@
<!-- 暂态 -->
<view class="transientBox">
<view class="statistics pd20">
<view
class="box boxClick"
:class="{ boxClick1: filterValue == index }"
v-for="(item, index) in dataList"
@click="
<view class="box boxClick" :class="{ boxClick1: filterValue == index }"
v-for="(item, index) in dataList" @click="
filterValue = index
init()
"
>
init()
">
<!-- <text class="num">{{ item.value }}</text> -->
<text class="num">{{ item.value }}</text>
<text class="label">{{ item.label }}</text>
@@ -20,23 +16,13 @@
<!-- <view class="smallLabel"> </view> -->
</view>
<!-- 卡片 -->
<scroll-view
scroll-y="true"
@refresherrefresh="refresherrefresh"
@scrolltolower="scrolltolower"
:refresher-triggered="triggered"
refresher-enabled="true"
class="event-list"
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }"
>
<scroll-view scroll-y="true" @scroll="onScroll" :scroll-top="scrollTop" scroll-with-animation
@refresherrefresh="refresherrefresh" @scrolltolower="scrolltolower"
:refresher-triggered="triggered" refresher-enabled="true" class="event-list"
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }">
<!-- 循环渲染事件项 -->
<uni-card
class="event-item boxClick"
:class="judgment(item.showName).type"
v-for="(item, index) in store.data || []"
:key="index"
@click="jump(item)"
>
<uni-card class="event-item boxClick" :class="judgment(item.showName).type"
v-for="(item, index) in store.data || []" :key="index" @click="jump(item)">
<!-- 头部图标 + 信息 + 操作 -->
<view class="event-header">
<view class="event-icon">
@@ -56,7 +42,7 @@
<text class="event-id">{{ item.lineName }}</text>
<text class="event-tag" :class="`${judgment(item.showName).type}-tag`">{{
item.showName
}}</text>
}}</text>
</view>
<view class="event-desc">
<text>工程{{ item.engineeringName }}</text>
@@ -65,7 +51,7 @@
</view>
</view>
<view class="event-action">
<uni-icons type="search" size="25" color="#376cf3"></uni-icons>
<uni-icons type="search" size="25" color="#376cf3"></uni-icons>
</view>
</view>
<!-- 详情区域 -->
@@ -89,17 +75,18 @@
}} {{
item.landPoint != null && item.landPoint !== ''
? ',落点区域:' + item.landPoint
: ''
: ',落点区域:未知'
}}
</text>
</view>
</uni-card>
<uni-load-more
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
:status="store.status"
></uni-load-more>
<uni-load-more v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
:status="store.status"></uni-load-more>
<Cn-empty v-else style="top: 20%"></Cn-empty>
</scroll-view>
<view class="back-top boxClick" v-show="showBackTop" @click="backToTop">
<uni-icons type="arrow-up" size="22" color="#fff"></uni-icons>
</view>
</view>
</template>
<script>
@@ -117,7 +104,7 @@ export default {
// default: () => {},
},
sortIndex: {
type: [Number,String],
type: [Number, String],
// default: () => {},
},
},
@@ -135,6 +122,9 @@ export default {
status: 'noMore', //more加载前 loading加载中 noMore加载后
sort: 0,
triggered: true,
scrollTop: 0,
oldScrollTop: 0,
showBackTop: false,
}
},
@@ -167,20 +157,20 @@ export default {
this.filterValue == 0
? []
: this.filterValue == 1
? ['Evt_Sys_DipStr']
: this.filterValue == 2
? ['Evt_Sys_IntrStr']
: ['Evt_Sys_SwlStr']
? ['Evt_Sys_DipStr']
: this.filterValue == 2
? ['Evt_Sys_IntrStr']
: ['Evt_Sys_SwlStr']
this.store.params.startTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).firstDay
this.store.params.endTime = this.$util.getMonthFirstAndLastDay(this.selectValue.date).lastDay
this.store.loadedCallback = () => {
this.getHeight()
this.loading = false
queryAppEventCounts(this.store.params).then((res) => {
this.dataList[0].value = res.data.allNum
this.dataList[1].value = res.data.eventDown
this.dataList[2].value = res.data.eventOff
this.dataList[3].value = res.data.eventUp
this.dataList[0].value = res.data?.allNum || 0
this.dataList[1].value = res.data?.eventDown || 0
this.dataList[2].value = res.data?.eventOff || 0
this.dataList[3].value = res.data?.eventUp || 0
})
}
this.store.reload()
@@ -232,8 +222,8 @@ export default {
uni.navigateTo({ url: '/pages/message1/comp/transientDetails?detail=' + encodeURIComponent(str) })
},
setSort(index) {
console.log(123,this.sortIndex);
console.log(123, this.sortIndex);
// this.sort = index
this.init()
},
@@ -251,6 +241,17 @@ export default {
this.store.next && this.store.next()
}
},
onScroll(e) {
this.oldScrollTop = e.detail.scrollTop
this.showBackTop = e.detail.scrollTop > 200
},
backToTop() {
this.scrollTop = this.oldScrollTop
this.$nextTick(() => {
this.scrollTop = 0
})
this.showBackTop = false
},
},
computed: {},
@@ -273,4 +274,19 @@ export default {
/deep/ .uni-scroll-view-refresher {
display: none;
}
.back-top {
position: fixed;
right: 30rpx;
bottom: 60rpx;
width: 80rpx;
height: 80rpx;
border-radius: 50%;
background: #376cf3;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4rpx 16rpx rgba(55, 108, 243, 0.35);
z-index: 99;
}
</style>