Compare commits

...

2 Commits

Author SHA1 Message Date
lld 4c3df3dd90 设备日志提交 2026-03-30 02:47:55 +08:00
lld 682338094e 自动模式设备日志 2026-03-30 01:53:34 +08:00
2 changed files with 146 additions and 103 deletions

View File

@ -340,7 +340,6 @@ export default {
dicts: ['sys_data_map'], dicts: ['sys_data_map'],
name: "manual", name: "manual",
props: { props: {
//
value: { value: {
type: String, type: String,
default: "1" default: "1"
@ -1163,7 +1162,13 @@ export default {
}) })
} else if (e.index===1) { } else if (e.index===1) {
// this.$refs.logDialog.open(); // this.$refs.logDialog.open();
this.$tab.navigateTo('/pages/news/subpages/deviceLog/log'); var logInfo = JSON.stringify(
{
imei: this.value,
agriName: this.selectedText
}
);
this.$tab.navigateTo('/pages/news/subpages/deviceLog/log?logInfo='+encodeURIComponent(logInfo));
} }
}, },
closeLogDialog() { closeLogDialog() {

View File

@ -16,7 +16,7 @@
<!-- 日期标题 + 分类筛选靠右 --> <!-- 日期标题 + 分类筛选靠右 -->
<view class="filter-bar"> <view class="filter-bar">
<uni-dateformat :date="date" format="MM-dd" /> <uni-dateformat style="font-size: 40rpx;line-height: 60rpx;font-weight: bolder" :date="date" format="MM-dd" />
<view class="category-tabs" v-if="isShowSelect"> <view class="category-tabs" v-if="isShowSelect">
请选择大棚<uni-data-select align="left" :clear="false" v-model="imei" :localdata="range" @change="getLogInfo" /> 请选择大棚<uni-data-select align="left" :clear="false" v-model="imei" :localdata="range" @change="getLogInfo" />
</view> </view>
@ -27,6 +27,7 @@
:current="current" :current="current"
:bold="true" :bold="true"
@change="switchTab" @change="switchTab"
class="subsection"
v-if="logList.length>0" v-if="logList.length>0"
:height="80"></tn-subsection> :height="80"></tn-subsection>
<swiper :current="current" :acceleration="true" <swiper :current="current" :acceleration="true"
@ -37,20 +38,27 @@
:key="key"> :key="key">
<!-- 视频列表带时间轴 --> <!-- 视频列表带时间轴 -->
<scroll-view scroll-y class="log-list" v-if="tabList.length>0"> <scroll-view scroll-y class="log-list" v-if="tabList.length>0">
<uni-collapse :accordion="true" v-model="activeIndex"> <uni-collapse :accordion="true">
<!-- 循环 tabList当前卷膜的数据 --> <!-- 循环 tabList当前卷膜的数据 -->
<uni-collapse-item <uni-collapse-item
v-for="(item, index) in tabList" v-for="(item, index) in tabList"
:key="index" :key="index"
:title="item.create_time" :title="`【${agriName}】于${formatDate(item.createTime,'hh:mm:ss')}触发自动化条件执行卷膜${current+1}${item.execCmd}!`"
title-border="show"
:border="true" :border="true"
> >
<view class="content"> <view class="content">
<view>监测时段{{ item.monitor_period }}</view> <view>大棚{{ agriName }}</view>
<view>当前温度{{ item.current_temp }} </view> <view>卷膜卷膜{{ current+1 }}</view>
<view>参考温度{{ item.ref_temp }} </view> <view>监测时段{{ item.monitorPeriod }}</view>
<view>温度适宜{{ item.suitable_temp === 1 ? '是' : '否' }}</view> <view>执行时间{{ item.createTime }}</view>
<view>执行指令{{ item.exec_cmd }}</view> <view>当时温度{{ item.currentTemp }}</view>
<view>参考温度计{{ item.refTemp.replace('20','温度') }} </view>
<view>适宜温度{{ item.suitableTemp }}</view>
<view>运行风口{{ item.fanStatus }}cm</view>
<view>是否最后一个条件{{ item.isLast? '是' : '否' }}</view>
<view>执行指令{{ item.execCmd }}</view>
</view> </view>
</uni-collapse-item> </uni-collapse-item>
</uni-collapse> </uni-collapse>
@ -90,7 +98,7 @@ export default {
}, },
status: 'more', status: 'more',
loading: false, loading: false,
activeIndex: '', // agriName: null
} }
}, },
mounted() { mounted() {
@ -98,11 +106,25 @@ export default {
// this.videoList = this.getDateList1(); // this.videoList = this.getDateList1();
}, },
onShow() { onShow() {
},
onLoad(option) {
if (option.logInfo) {
const decodedStr = decodeURIComponent(option.logInfo);
const logInfo = JSON.parse(decodedStr); //
this.imei=logInfo.imei;
console.info(this.imei)
this.agriName = logInfo.agriName;
this.getLogInfo();
this.isShowSelect = false;
}
if (!this.imei) { if (!this.imei) {
this.getImeiList() this.getImeiList()
} }
}, },
methods: { methods: {
formatDate,
handleDateClick(item) { handleDateClick(item) {
this.dateList = this.dateList.map(d => ({...d, active: d === item})) this.dateList = this.dateList.map(d => ({...d, active: d === item}))
var number = new Date(); var number = new Date();
@ -153,6 +175,9 @@ export default {
}, },
getLogInfo() { getLogInfo() {
if (!this.agriName) {
this.agriName = this.range.find(item => item.value === this.imei).text || null
}
if (!this.imei || !this.date) { if (!this.imei || !this.date) {
return; return;
} }
@ -178,134 +203,134 @@ export default {
{ {
id: 1, id: 1,
imei: "868402051234567", imei: "868402051234567",
roll_film: "jm1", rollFilm: "jm1",
monitor_period: "08:00-12:00", monitorPeriod: "08:00-12:00",
current_temp: 25.3, currentTemp: 25.3,
ref_temp: "26.0", refTemp: "202",
suitable_temp: 1, suitableTemp: 25.9,
fan_status: 1.0, fanStatus: 1.0,
is_last: 0, isLast: 0,
exec_cmd: "rollerjm1: 开棚", execCmd: "开",
log_id: 1001, logId: 1001,
create_time: "2026-03-30 09:15:22" createTime: "2026-03-30 09:15:22"
}, },
{ {
id: 2, id: 2,
imei: "868402051234567", imei: "868402051234567",
roll_film: "jm1", rollFilm: "jm1",
monitor_period: "12:00-16:00", monitorPeriod: "12:00-16:00",
current_temp: 28.7, currentTemp: 28.7,
ref_temp: "26.0", refTemp: "201",
suitable_temp: 0, suitableTemp: 28.7,
fan_status: 1.0, fanStatus: 1.0,
is_last: 0, isLast: 0,
exec_cmd: "jm1: 关棚", execCmd: "关",
log_id: 1002, logId: 1002,
create_time: "2026-03-30 13:20:45" createTime: "2026-03-30 13:20:45"
}, },
{ {
id: 3, id: 3,
imei: "868402051234567", imei: "868402051234567",
roll_film: "jm1", rollFilm: "jm1",
monitor_period: "16:00-20:00", monitorPeriod: "16:00-20:00",
current_temp: 26.2, currentTemp: 26.2,
ref_temp: "26.0", refTemp: "202",
suitable_temp: 1, suitableTemp: 28.2,
fan_status: 0.5, fanStatus: 0.5,
is_last: 1, isLast: 1,
exec_cmd: "rollerjm1: 开棚", execCmd: "开",
log_id: 1003, logId: 1003,
create_time: "2026-03-30 17:40:18" createTime: "2026-03-30 17:40:18"
}, },
// jm2 // jm2
{ {
id: 4, id: 4,
imei: "868402057654321", imei: "868402057654321",
roll_film: "jm2", rollFilm: "jm2",
monitor_period: "08:00-12:00", monitorPeriod: "08:00-12:00",
current_temp: 24.1, currentTemp: 24.1,
ref_temp: "24.0", refTemp: "202",
suitable_temp: 1, suitableTemp: 34.2,
fan_status: 0.0, fanStatus: 0.0,
is_last: 0, isLast: 0,
exec_cmd: "rollerjm2: 开棚", execCmd: "开",
log_id: 1004, logId: 1004,
create_time: "2026-03-30 10:05:11" createTime: "2026-03-30 10:05:11"
}, },
{ {
id: 5, id: 5,
imei: "868402057654321", imei: "868402057654321",
roll_film: "jm2", rollFilm: "jm2",
monitor_period: "12:00-16:00", monitorPeriod: "12:00-16:00",
current_temp: 25.8, currentTemp: 25.8,
ref_temp: "24.0", refTemp: "203",
suitable_temp: 1, suitableTemp: 24.1,
fan_status: 0.5, fanStatus: 0.5,
is_last: 0, isLast: 0,
exec_cmd: "rollerjm2: 关棚", execCmd: "关",
log_id: 1005, logId: 1005,
create_time: "2026-03-30 14:35:33" createTime: "2026-03-30 14:35:33"
}, },
{ {
id: 6, id: 6,
imei: "868402057654321", imei: "868402057654321",
roll_film: "jm2", rollFilm: "jm2",
monitor_period: "16:00-20:00", monitorPeriod: "16:00-20:00",
current_temp: 23.9, currentTemp: 23.9,
ref_temp: "24.0", refTemp: "204",
suitable_temp: 1, suitableTemp: 35.2,
fan_status: 0.0, fanStatus: 0.0,
is_last: 1, isLast: 1,
exec_cmd: "rollerjm2: 开棚", execCmd: "开",
log_id: 1006, logId: 1006,
create_time: "2026-03-30 18:22:09" createTime: "2026-03-30 18:22:09"
}, },
// jm3 // jm3
{ {
id: 7, id: 7,
imei: "868402059876543", imei: "868402059876543",
roll_film: "jm3", rollFilm: "jm3",
monitor_period: "08:00-12:00", monitorPeriod: "08:00-12:00",
current_temp: 23.5, currentTemp: 23.5,
ref_temp: "25.0", refTemp: "203",
suitable_temp: 1, suitableTemp: 27,
fan_status: 0.0, fanStatus: 0.0,
is_last: 0, isLast: 0,
exec_cmd: "rollerjm3: 开棚", execCmd: "开",
log_id: 1007, logId: 1007,
create_time: "2026-03-30 08:45:33" createTime: "2026-03-30 08:45:33"
}, },
{ {
id: 8, id: 8,
imei: "868402059876543", imei: "868402059876543",
roll_film: "jm3", rollFilm: "jm3",
monitor_period: "12:00-16:00", monitorPeriod: "12:00-16:00",
current_temp: 27.4, currentTemp: 27.4,
ref_temp: "25.0", refTemp: "202",
suitable_temp: 0, suitableTemp: 23.3,
fan_status: 1.0, fanStatus: 1.0,
is_last: 0, isLast: 0,
exec_cmd: "rollerjm3: 关棚", execCmd: "关",
log_id: 1008, logId: 1008,
create_time: "2026-03-30 12:50:27" createTime: "2026-03-30 12:50:27"
}, },
{ {
id: 9, id: 9,
imei: "868402059876543", imei: "868402059876543",
roll_film: "jm3", rollFilm: "jm3",
monitor_period: "16:00-20:00", monitorPeriod: "16:00-20:00",
current_temp: 25.1, currentTemp: 25.1,
ref_temp: "25.0", refTemp: "202",
suitable_temp: 1, suitableTemp: 26.5,
fan_status: 0.5, fanStatus: 0.5,
is_last: 1, isLast: 1,
exec_cmd: "rollerjm3: 开棚", execCmd: "开",
log_id: 1009, logId: 1009,
create_time: "2026-03-30 16:10:55" createTime: "2026-03-30 16:10:55"
} }
]; ];
if (this.logList && this.logList.length>0) { if (this.logList && this.logList.length>0) {
this.tabList = this.logList.filter(item => item.roll_film === `jm${this.current+1}`); this.tabList = this.logList.filter(item => item.rollFilm === `jm${this.current+1}`);
} }
this.loading = false; this.loading = false;
}, 1000); }, 1000);
@ -315,7 +340,7 @@ export default {
}, },
change(e) { change(e) {
this.current=e.detail.current this.current=e.detail.current
this.tabList = this.logList.filter(item => item.roll_film === `jm${this.current+1}`); this.tabList = this.logList.filter(item => item.rollFilm === `jm${this.current+1}`);
} }
} }
@ -391,4 +416,17 @@ export default {
/deep/.uni-select__input-placeholder { /deep/.uni-select__input-placeholder {
font-size: 24rpx !important; font-size: 24rpx !important;
} }
/deep/ .uni-swiper-wrapper {
height: calc(100vh - 300rpx);
}
.subsection {
margin: 0 30rpx;
}
/deep/ .uni-collapse-item__title-box {
padding: 0;
}
/deep/.uni-collapse-item__title-text {
font-size: 25rpx!important;
}
</style> </style>