提交代码

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,13 +3,8 @@
<!-- {{ height }} -->
<view class="pd20">
<uni-segmented-control
:current="curSub"
class="subsection"
active-color="#376cf3"
:values="subsectionList"
@clickItem="sectionChange"
/>
<uni-segmented-control :current="curSub" class="subsection" active-color="#376cf3" :values="subsectionList"
@clickItem="sectionChange" />
</view>
<view class="filterCriteria">
<!-- 筛选条件 -->
@@ -17,14 +12,10 @@
</view>
<!-- 卡片 -->
<scroll-view
scroll-y="true"
@refresherrefresh="refresherrefresh"
:refresher-triggered="triggered"
refresher-enabled="true"
<scroll-view scroll-y="true" @scroll="onScroll" :scroll-top="scrollTop" scroll-with-animation
@refresherrefresh="refresherrefresh" :refresher-triggered="triggered" refresher-enabled="true"
class="event-list mt20"
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }"
>
:style="{ height: 'calc(100vh - ' + (navHeight + height) + 'px)', overflow: 'auto' }">
<!-- 循环渲染事件项 -->
<uni-card class="event-item" :class="item.type" v-for="(item, index) in store.data" :key="index">
<!-- 头部图标 + 信息 + 操作 -->
@@ -37,7 +28,7 @@
size="40"
color="#E6A23C"
></uni-icons> -->
<Cn-icon-transient :name="`报告`" />
<Cn-icon-transient :name="`报告`" />
<view class="badge1" v-if="item.isRead == 0"> </view>
</view>
<view class="event-info">
@@ -48,36 +39,35 @@
</view> -->
</view>
<view class="event-desc">
<text
>统计时间{{
curSub == 0 ? item.startTime : item.startTime + ' 至 ' + item.endTime
}}</text
>
<text>统计时间{{
curSub == 0 ? item.startTime : item.startTime + ' 至 ' + item.endTime
}}</text>
</view>
</view>
<view class="event-action" v-if="curSub == 0 ? monthFlag : item.endTime != thisMonth01">
<view class="iconText boxClick" @click="download(item)"
><uni-icons type="arrow-down" color="#fff" size="16"></uni-icons>
<view class="event-action" v-if="!showNotGenerated(item)">
<view class="iconText boxClick" @click="download(item)"><uni-icons type="arrow-down"
color="#fff" size="16"></uni-icons>
</view>
</view>
</view>
<!-- 详情区域 -->
<view class="event-detail textBox" @touchmove.stop>
<text v-if="curSub == 0 ? monthFlag : item.endTime != thisMonth01">{{
<text v-if="!showNotGenerated(item)">{{
item.overLimitDesc == '' ? '该监测点暂无指标越限' : item.overLimitDesc
}}</text>
}}</text>
<text v-else>数据未生成暂不支持下载</text>
</view>
<!-- <view class="downloadReport" @click="download">
<uni-icons type="download" size="16" color="#376cf3"></uni-icons>下载报告
</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>
@@ -105,18 +95,19 @@ export default {
return {
status: 'noMore',
curSub: 0,
subsectionList: ['报', '月报'],
subsectionList: ['报', '月报'],
thisSelectValue: {},
triggered: true,
height: 0,
thisMonth01: '',
monthFlag: true,
scrollTop: 0,
oldScrollTop: 0,
showBackTop: false,
}
},
created() {},
created() { },
mounted() {
this.thisMonth01 = this.$util.getToday().slice(0, -3) + '-01'
this.monthFlag = this.$util.getToday() != this.$util.getToday().slice(0, -3) + '-01'
// this.setHeight()
},
@@ -137,6 +128,8 @@ export default {
},
sectionChange(index) {
this.curSub = index.currentIndex
this.showBackTop = false
this.scrollTop = 0
this.init()
},
init() {
@@ -156,7 +149,9 @@ export default {
}
// this.store.params.startTime = this.selectValue.range[0]
// this.store.params.endTime = this.selectValue.range[1]
this.store.loadedCallback = () => {}
this.store.loadedCallback = () => {
this.store.status = 'noMore'
}
this.store.reload()
},
@@ -233,7 +228,7 @@ export default {
})
}
},
fail: function (res) {},
fail: function (res) { },
})
})
.catch((err) => {
@@ -253,6 +248,24 @@ export default {
this.triggered = false
}, 500)
},
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
},
/** 日报统计时间与今天相同月报开始、结束时间均为当月1号 */
showNotGenerated(item) {
if (this.curSub === 0) {
return item.startTime === this.$util.getToday()
}
return item.startTime === this.thisMonth01 && item.endTime === this.thisMonth01
},
},
computed: {},
@@ -262,12 +275,14 @@ export default {
</script>
<style lang="scss" scoped>
@import '@/pages/message1/index.scss';
.event-title {
justify-content: space-between;
}
.event-tags {
display: flex;
font-size: 27rpx !important ;
font-size: 27rpx !important;
line-height: 50rpx;
}
@@ -276,6 +291,7 @@ export default {
// display: grid;
// grid-template-columns: 1fr 1fr;
}
.downloadReport {
width: 100%;
background: #376cf320;
@@ -288,25 +304,31 @@ export default {
display: flex;
justify-content: center;
}
.filterCriteria {
.nav {
background-color: #fff;
}
.choose1 {
background-color: #fff;
padding: 0 20rpx;
display: flex;
justify-content: space-between;
/deep/ .uni-checkbox-input {
width: 30rpx;
height: 30rpx;
}
font-size: 26rpx;
}
}
/deep/ .uni-scroll-view-refresher {
display: none;
}
.iconText {
width: 45rpx;
height: 45rpx;
@@ -315,13 +337,16 @@ export default {
text-align: center;
line-height: 40rpx;
}
.segmented-control {
flex: 1;
margin-right: 24rpx;
height: 60rpx;
}
/* 列表容器 */
.event-list {
/* 头部:图标 + 信息 + 操作 */
.event-header {
display: flex;
@@ -340,9 +365,25 @@ export default {
font-size: 24rpx;
}
}
.textBox {
// @touchmove.stop
max-height: 110rpx;
overflow-y: auto;
}
.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>