暂时提交

feasure-livedata
lld 2026-03-30 01:15:34 +08:00
parent d121a240e6
commit 35b9480a29
7 changed files with 103 additions and 178 deletions

View File

@ -42,3 +42,10 @@ export function delAutolog(id) {
method: 'delete'
})
}
export function getAutoLogList(query) {
return request({
url: '/warn/autolog/getAutoLogList',
method: 'get',
params: query
})
}

View File

@ -42,7 +42,7 @@
</view>
</view>
</scroll-view>
<view class="empty__item tn-margin-top" v-else>
<view class="empty__item tn-margin-top empty__view" v-else>
<tn-empty icon="https://resource.tuniaokj.com/images/empty/alien/2.png"
text="近7天暂无消息" :imgWidth="200"
:imgHeight="200"></tn-empty>

View File

@ -16,96 +16,81 @@
<!-- 日期标题 + 分类筛选靠右 -->
<view class="filter-bar">
<text class="date-title">
<uni-dateformat :date="date" format="MM-dd" />
</text>
<uni-dateformat :date="date" format="MM-dd" />
<view class="category-tabs" v-if="isShowSelect">
请选择大棚<uni-data-select align="left" :clear="false" v-model="imei" :localdata="range" />
请选择大棚<uni-data-select align="left" :clear="false" v-model="imei" :localdata="range" @change="getLogInfo" />
</view>
</view>
<uni-load-more iconType="auto" v-if="loading" :status="status" :content-text="contentText" />
<!-- 视频列表带时间轴 -->
<scroll-view scroll-y class="video-list" v-if="videoList.length>0">
<view
v-for="(item, index) in videoList"
:key="index"
class="video-item"
>
<!-- 时间轴uni-icons实现 -->
<view class="time-axis">
<uni-icons type="circle" size="14" color="#1677ff"></uni-icons>
<view class="axis-line" v-if="index !== videoList.length"></view>
</view>
<tn-subsection :list="filmRollerList"
:current="current"
:bold="true"
@change="switchTab"
v-if="logList.length>0"
:height="80"></tn-subsection>
<swiper class="swiper" :current="current" :acceleration="true"
v-if="logList.length>0"
@change="change">
<swiper-item v-for="(roller, key) in filmRollerList"
@touchmove.stop
:key="key">
<!-- 视频列表带时间轴 -->
<scroll-view scroll-y class="video-list" v-if="logList.length>0">
<!-- 一个 uni-collapse 容器 + accordion="true" 实现互斥展开 -->
<uni-collapse :accordion="true">
<!-- v-for 写在 uni-collapse-item -->
<uni-collapse-item
v-for="(item, index) in logList"
:key="index"
:title="item.title || '视频标题'"
:border="true"
title-border="show">
<view class="content">
<view>{{}}</view>
<view>{{}}</view>
<view>{{}}</view>
<view>{{}}</view>
<view>{{}}</view>
</view>
</uni-collapse-item>
</uni-collapse>
</scroll-view>
</swiper-item>
</swiper>
<!-- 时间 + 卡片 垂直排列 -->
<view class="time-card-wrap">
<!-- 时间 + 未读红点在卡片正上方 -->
<view class="time-info">
<text class="time-text">{{ item.time }}</text>
<view class="unread-dot" v-if="item.unread"></view>
</view>
<!-- 视频卡片 -->
<view class="video-card" @click="gotoDetail(item)">
<view class="video-info">
<text class="device-name">{{ item.device }}</text>
<text class="event-type">{{ item.event }}</text>
</view>
<image class="video-cover" :src="item.cover" mode="aspectFill"></image>
</view>
</view>
</view>
</scroll-view>
<view class="empty__item tn-margin-top" v-else>
<view class="empty__item tn-margin-top empty__view" v-else>
<tn-empty icon="https://resource.tuniaokj.com/images/empty/alien/2.png"
text="暂无视频" :imgWidth="200"
text="暂无日志" :imgWidth="200"
:imgHeight="200"></tn-empty>
</view>
</view>
</template>
<script>
import {parseTime} from "@/utils/agri";
import {listAgri} from "@/api/system/assets/agri";
import {getAutoLogList} from "@/api/warn/autolog";
import {formatDate} from "@/uni_modules/uni-dateformat/components/uni-dateformat/date-format";
export default {
data() {
return {
dateList: this.getDateList(),
videoList: [
{
time: '13:22:04',
device: 'DS-2DE4423DW-D/GLT/...',
event: '画面变化',
cover: 'https://picsum.photos/id/1015/400/200',
unread: true
},
{
time: '13:20:20',
device: 'DS-2DE4423DW-D/G我饿全额钱31313122LT/...',
event: '画面变化',
cover: 'https://picsum.photos/id/1015/400/200',
unread: true
},
{
time: '13:19:12',
device: 'DS-2DE4423DW-D/GLT/...',
event: '画面变化',
cover: 'https://picsum.photos/id/1015/400/200',
unread: true
},
{
time: '13:18:11',
device: 'DS-2DE4423DW-D/GLT/...',
event: '画面变化',
cover: 'https://picsum.photos/id/1015/400/200',
unread: true
}
],
logList: [],
range: [],
imei: '',
isShowSelect: true,
date: Date.now()
date: Date.now(),
filmRollerList:["卷膜1", "卷膜2", "卷膜3"],
current: 0,
tabList: [],
contentText: {
contentdown: '查看更多',
contentrefresh: '正在加载中....',
contentnomore: '没有更多数据了'
},
status: 'more',
loading: false
}
},
mounted() {
@ -118,24 +103,16 @@ export default {
}
},
methods: {
parseTime,
handleDateClick(item) {
this.dateList = this.dateList.map(d => ({...d, active: d === item}))
uni.showToast({title: `切换到${item.day} ${item.week}`})
var number = new Date();
if (item.day !== '今') {
number.setDate(item.day)
}
this.date = +number;
// todo
// this.videoList = this.getDateList1();
this.getLogInfo()
},
handleFilterClick() {
// todo
uni.showToast({title: '打开筛选面板'})
},
getDateList() {
const weekMap = ['日', '一', '二', '三', '四', '五', '六'];
const today = new Date();
@ -162,11 +139,7 @@ export default {
return {week: w[d.getDay()], day: i === 6 ? '今' : d.getDate() + '', active: i === 6}
})
},
gotoDetail(item) {
//
this.$modal.msg("暂未开放!");
return;
},
getImeiList() {
listAgri().then(response => {
if (response.code === 200) {
@ -178,6 +151,35 @@ export default {
}
})
},
getLogInfo() {
this.loading = true;
this.status = 'loading';
if (!this.imei || !this.date) {
return;
}
var loginfo = {
imei: this.imei,
monitorDate: formatDate(this.date, "yyyy-MM-dd")
}
getAutoLogList(loginfo).then(response => {
if (response.code === 200) {
this.logList = response.data;
}
}).finally(() => {
if (this.logList && this.logList.length>0) {
this.tabList = this.logList.filter(item => item.roller === `jm${this.current+1}`);
}
this.loading = false;
})
},
switchTab(e) {
this.current=e.index
},
change(e) {
this.current=e.detail.current
}
}
}
</script>
@ -232,11 +234,7 @@ export default {
justify-content: space-between;
padding: 20rpx 30rpx;
}
.date-title {
font-size: 36rpx;
font-weight: 400;
color: #333;
}
.category-tabs {
display: flex;
align-items: center;
@ -249,86 +247,10 @@ export default {
padding: 0 30rpx;
height: calc(100vh - var(--status-bar-height) - 180rpx);
}
.video-item {
display: flex;
align-items: flex-start;
margin-bottom: 30rpx;
.content {
padding: 15px;
}
/* 时间轴 */
.time-axis {
display: flex;
flex-direction: column;
align-items: center;
margin-right: 14rpx;
padding-top: 20rpx;
}
.axis-line {
width: 1rpx;
height: 170rpx; /* 适配时间+卡片高度 */
background-color: #e0e0e0;
margin-top: 8rpx;
}
/* 时间+卡片 垂直包裹 */
.time-card-wrap {
flex: 1;
display: flex;
flex-direction: column;
}
/* 时间信息(在卡片正上方) */
.time-info {
display: flex;
align-items: center;
margin-bottom: 15rpx;
}
.time-text {
font-size: 30rpx;
color: #333;
margin-top: 20rpx;
}
.unread-dot {
width: 12rpx;
height: 12rpx;
background-color: #ff3b30;
border-radius: 50%;
margin-left: 10rpx;
}
/* 视频卡片 */
.video-card {
display: flex;
background-color: #f7f8fd;
border-radius: 12rpx;
padding: 20rpx;
}
.video-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
width: 0;
}
.device-name {
font-size: 28rpx;
color: #8f8f8f;
margin-bottom: 10rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding-right: 10rpx;
}
.event-type {
font-size: 28rpx;
color: #333;
font-weight: 500;
}
.video-cover {
width: 320rpx;
height: 180rpx;
border-radius: 8rpx;
}
/deep/.uni-select__input-placeholder {
font-size: 24rpx !important;
}

View File

@ -37,7 +37,7 @@
</view>
<uni-load-more v-if="messageList.length>4" iconType="auto" :status="status" :content-text="contentText" />
</scroll-view>
<view class="empty__item tn-margin-top" v-else>
<view class="empty__item tn-margin-top empty__view" v-else>
<tn-empty icon="https://resource.tuniaokj.com/images/empty/alien/2.png"
text="近7天暂无消息可下拉查看历史消息" :imgWidth="200"
:imgHeight="200"></tn-empty>

View File

@ -51,7 +51,7 @@
</view>
<uni-load-more v-if="noticeList.length>8" iconType="auto" :status="status" :content-text="contentText" />
</scroll-view>
<view class="empty__item tn-margin-top" v-else>
<view class="empty__item tn-margin-top empty__view" v-else>
<tn-empty icon="https://resource.tuniaokj.com/images/empty/alien/2.png"
text="暂无公告" :imgWidth="200"
:imgHeight="200"></tn-empty>

View File

@ -16,9 +16,7 @@
<!-- 日期标题 + 分类筛选靠右 -->
<view class="filter-bar">
<text class="date-title">
<uni-dateformat :date="date" format="MM-dd" />
</text>
<uni-dateformat :date="date" format="MM-dd" />
<view class="category-tabs">
<view
v-for="(item, index) in categoryList"
@ -66,7 +64,7 @@
</view>
</view>
</scroll-view>
<view class="empty__item tn-margin-top" v-else>
<view class="empty__item tn-margin-top empty__view" v-else>
<tn-empty icon="https://resource.tuniaokj.com/images/empty/alien/2.png"
text="暂无视频" :imgWidth="200"
:imgHeight="200"></tn-empty>
@ -237,11 +235,6 @@ export default {
justify-content: space-between;
padding: 20rpx 30rpx;
}
.date-title {
font-size: 36rpx;
font-weight: 400;
color: #333;
}
.category-tabs {
display: flex;
align-items: center;

View File

@ -90,3 +90,6 @@
background: #007aff;
color: #fff;
}
.empty__view {
margin-top: 100rpx;
}