jsy-app/pages/fourmonitor/spore.vue

471 lines
12 KiB
Vue
Raw Normal View History

2024-12-19 12:41:30 +08:00
<template>
<view class="page">
<uni-row style="height: 40px;margin-left: 10px;">
2024-12-19 18:12:16 +08:00
<uni-col :span="12">
2024-12-19 12:41:30 +08:00
<uni-row style="height: 40px;">
2024-12-19 18:12:16 +08:00
<uni-col :span="10">
<view style="font-size: 14px;line-height: 35px;color: white;">运行模式</view>
</uni-col>
<uni-col :span="12"><u-button :text="`${itemProperty.m == '1'? '自动':'手动'}`"
:type="`${itemProperty.m == '1'? 'success':'warning'}`"
style="height: 25px;width: 60px;margin-bottom: 2px;margin-top: 5px;float: right;margin-right: 5px;float: left;"
@click="controlHeadSwitch(item,itemProperty.m,'m')"></u-button></uni-col>
2024-12-19 12:41:30 +08:00
</uni-row>
</uni-col>
2024-12-19 18:12:16 +08:00
<uni-col :span="12">
2024-12-19 12:41:30 +08:00
<u-button text="历史" type="info"
2024-12-19 18:12:16 +08:00
style="height: 25px;width: 60px;margin-bottom: 2px;margin-top: 5px;float: right;margin-right: 5px;"
@click="openH(item)"></u-button>
2024-12-19 12:41:30 +08:00
</uni-col>
</uni-row>
<uni-row class="rowheadstyle">
<view class="rowview">
<uni-col :span="6">
<u-icon label="设备门:" labelPos="right" label-color="white" size="28" labelSize="12"
2024-12-19 19:35:43 +08:00
name="../../static/images/head/spore_tem1.png"></u-icon>
2024-12-19 12:41:30 +08:00
</uni-col>
2024-12-19 18:12:16 +08:00
<uni-col :span="6">
2024-12-19 12:41:30 +08:00
<view class="valuecol">
{{itemProperty.ss===null?"--":(itemProperty.ss==='1'?"打开":"关闭") }}
</view>
</uni-col>
2024-12-19 18:12:16 +08:00
<uni-col :span="6">
2024-12-19 12:41:30 +08:00
<u-icon label="海拔:" labelPos="right" label-color="white" size="28" labelSize="12"
2024-12-19 19:35:43 +08:00
name="../../static/images/head/bzhb.png"></u-icon>
2024-12-19 12:41:30 +08:00
</uni-col>
2024-12-19 18:12:16 +08:00
<uni-col :span="6">
2024-12-19 12:41:30 +08:00
<view class="valuecol">
{{itemProperty.att===null?"--":itemProperty.att}}m
</view>
</uni-col>
</view>
</uni-row>
<uni-row class="rowheadstyle">
<view class="rowview">
2024-12-19 18:12:16 +08:00
<uni-col :span="6">
2024-12-19 12:41:30 +08:00
<u-icon label="单次采样:" labelPos="right" label-color="white" size="28" labelSize="12"
2024-12-19 19:35:43 +08:00
name="../../static/images/head/spore_tem2.png"></u-icon>
2024-12-19 12:41:30 +08:00
</uni-col>
2024-12-19 18:12:16 +08:00
<uni-col :span="6">
2024-12-19 12:41:30 +08:00
<view class="valuecol">
{{itemProperty.pl===null?"--":itemProperty.pl}}
</view>
</uni-col>
<uni-col :span="6">
<u-icon label="累计采样:" labelPos="right" label-color="white" size="28" labelSize="12"
2024-12-19 19:35:43 +08:00
name="../../static/images/head/spore_tem3.png"></u-icon>
2024-12-19 12:41:30 +08:00
</uni-col>
2024-12-19 18:12:16 +08:00
<uni-col :span="6">
2024-12-19 12:41:30 +08:00
<view class="valuecol">
{{itemProperty.pt===null?"--":itemProperty.pt}}
</view>
</uni-col>
</view>
</uni-row>
<uni-row class="rowstyle">
2024-12-19 18:12:16 +08:00
<uni-col :span="12">
<uni-row class="col1"><uni-col :span="24">
<view class="text1">光源</view>
</uni-col></uni-row>
<uni-row class="col2"><uni-col :span="24"><u-button :text="`${itemProperty.ias == '1'? '打开':'关闭'}`"
type="info" @click="controlHeadSwitch(item,itemProperty.ias,'ias')"
class="but1"></u-button></uni-col></uni-row>
2024-12-19 12:41:30 +08:00
</uni-col>
2024-12-19 18:12:16 +08:00
<uni-col :span="12">
<uni-row class="col1"><uni-col :span="24">
<view class="text1">采样口</view>
</uni-col></uni-row>
<uni-row class="col2"><uni-col :span="24"><u-button :text="`${itemProperty.sls == '1'? '打开':'关闭'}`"
type="info" @click="controlHeadSwitch(item,itemProperty.sls,'sls')"
class="but1"></u-button></uni-col></uni-row>
2024-12-19 12:41:30 +08:00
</uni-col>
</uni-row>
<uni-row class="rowstyle">
2024-12-19 18:12:16 +08:00
<uni-col :span="12">
<uni-row class="col1"><uni-col :span="24">
<view class="text1">吸气口</view>
</uni-col></uni-row>
<uni-row class="col2"><uni-col :span="24"><u-button :text="`${itemProperty.ais == '1'? '打开':'关闭'}`"
type="info" @click="controlHeadSwitch(item,itemProperty.ais,'ais')"
2024-12-19 19:35:43 +08:00
style="width: 200px;"></u-button></uni-col></uni-row>
2024-12-19 12:41:30 +08:00
</uni-col>
2024-12-19 18:12:16 +08:00
<uni-col :span="12">
<uni-row class="col1"><uni-col :span="24">
<view class="text1">载波电机</view>
</uni-col></uni-row>
<uni-row class="col2"><uni-col :span="24"><u-button :text="`${itemProperty.zbs == '1'? '运行':'停止'}`"
type="info" @click="controlHeadSwitch(item,itemProperty.zbs,'zbs')"
class="but1"></u-button></uni-col></uni-row>
2024-12-19 12:41:30 +08:00
</uni-col>
</uni-row>
<uni-row class="rowstyle">
2024-12-19 18:12:16 +08:00
<uni-col :span="12">
<uni-row class="col1"><uni-col :span="24">
<view class="text1">排气口</view>
</uni-col></uni-row>
<uni-row class="col2"><uni-col :span="24"><u-button :text="`${itemProperty.bwa == '1'? '打开':'关闭'}`"
type="info" @click="controlHeadSwitch(item,itemProperty.bwa,'bwa')"
class="but1"></u-button></uni-col></uni-row>
2024-12-19 12:41:30 +08:00
</uni-col>
2024-12-19 18:12:16 +08:00
<uni-col :span="12">
<uni-row class="col1"><uni-col :span="24">
<view class="text1">摄像头</view>
</uni-col></uni-row>
<uni-row class="col2"><uni-col :span="24"><u-button text="拍照" type="info"
@click="controlHeadSwitch(item,0,'pg')" class="but1"></u-button></uni-col></uni-row>
2024-12-19 12:41:30 +08:00
</uni-col>
</uni-row>
<uni-row class="rowheadstyle"> <uni-col :span="24" v-if="itemProperty.aat!=null">
2024-12-19 18:12:16 +08:00
<u-button text="分析" type="info" @click="analysis(item,itemProperty.aat)"
style="height: 25px;width: 200px;margin-bottom: 2px;margin-top: 10px;text-align: center;"></u-button>
</uni-col></uni-row>
2024-12-19 12:41:30 +08:00
<u-popup :show="showDeviceLog" mode="center">
<view class="dialog-container">
<view class="dialog-title">
<text>孢子历史记录</text>
<u-icon name="reload" size="20" class="reload-btn" @click="reload"></u-icon>
<u-icon name="close" size="20" class="close-btn" @click="closeLog"></u-icon>
</view>
<view class="dialog-body">
2024-12-19 18:12:16 +08:00
<view class="logs-data-box" style="width:90vw">
<view class="logs-container">
<view class="logs-item" v-for="itemHistory in listData" :key="item.id">
<view class="row">
<view class="full-line">
<text class="label">设备编号</text>
<text class="text">{{ itemHistory.deviceCode }}</text>
</view>
</view>
<view class="row">
<view class="full-line">
<text class="label">记录时间</text>
<text class="text">{{ itemHistory.createTime }}</text>
</view>
</view>
<view class="charge">
<view class="flex item charge-item">
<view>{{ itemHistory.historyContent || "-" }}</view>
</view>
</view>
</view>
</view>
<uni-pagination :pageCount="query.pageSize" :curPageNum="query.pageNum" :totalNum="total"
@pageClick="pageTurning"></uni-pagination>
</view>
2024-12-19 12:41:30 +08:00
</view>
</view>
</u-popup>
<u-popup :show="showAnalysis" mode="center">
<view class="dialog-container">
<view class="dialog-title">
<text>孢子分析</text>
<u-icon name="close" size="20" class="close-btn" @click="closeLogAnalysis"></u-icon>
</view>
<view class="dialog-body" v-if="itemProperty.aat!=null">
<uni-row class="rowstyle">
<uni-col :span="24">
<uni-row class="col1"><uni-col :span="24">
<view class="text2">分析图片</view>
</uni-col></uni-row>
<uni-row class="col2"><uni-col :span="24" style="text-align: center;"><u-image
:src="itemProperty.img" :lazy-load="true" width="240px" height="240px"
shape="square"></u-image></uni-col></uni-row>
</uni-col>
</uni-row>
<uni-row class="rowstyle">
<uni-col :span="24">
<uni-row class="col1"><uni-col :span="24">
<view class="text2">分析时间</view>
</uni-col></uni-row>
<uni-row class="col2"><uni-col :span="24" style="text-align: center;">
<view class="text2">{{itemProperty.aat===null?"--":itemProperty.aat}}</view>
</uni-col></uni-row>
</uni-col>
</uni-row>
</view>
</view>
</u-popup>
</view>
</template>
2024-12-19 18:12:16 +08:00
<script>
import plugin from "@/plugins"
2024-12-19 12:41:30 +08:00
import {
2024-12-19 18:12:16 +08:00
controlHeadSwitch
} from "@/api/controlHeadInterface"
2024-12-19 12:41:30 +08:00
import {
2024-12-19 18:12:16 +08:00
getOutDeviceHistoryList
} from "@/api/system/device_agricultural"
export default {
data() {
return {
item: {},
itemProperty: {},
showDeviceLog: false,
passParams: {},
showAnalysis: false,
total: 0,
listData: [],
query: {
pageNum: 1,
pageSize: 10,
deviceCode: null
}
}
},
onLoad(option) {
if (option.item != null) {
this.item = JSON.parse(decodeURIComponent(option.item));
if (this.item) {
this.itemProperty = this.item.deviceData;
this.query.deviceCode = this.item.deviceCode;
}
}
},
methods: {
queryList(str) {
if (str == "into") {
this.query.pageNum = 1;
}
if (str == "pre") {
this.query.pageNum = this.query.pageNum - 1
}
if (str == "next") {
this.query.pageNum = this.query.query.pageNum + 1
}
getOutDeviceHistoryList(this.query).then(res => {
this.listData = res.rows;
this.total = res.total;
})
},
//打开历史界面
openH(item) {
this.showDeviceLog = true
this.queryList("into");
},
reload() {
uni.$emit("reloadlogs")
},
//关闭历史记录
closeLog() {
this.showDeviceLog = false;
},
//控制按钮
controlHeadSwitch(item, e, k) {
if (this.itemProperty.s === "offline") {
plugin.modal.msgError("设备离线,不能操作!");
return;
}
if (k === "pg" && this.itemProperty.m === "1") {
plugin.modal.msgError("自动模式不能拍照!");
return;
}
if (k === "pg" && this.itemProperty.ias === "0") {
plugin.modal.msgError("请先打开光源!");
return;
}
let par = {
controlKey: k,
deviceTypeId: 8,
operationType: 11,
deviceCode: item.deviceCode,
controlValve: e == 1 ? 0 : 1
};
controlHeadSwitch(par).then(res => {})
},
//打开分析弹出页
analysis(item, e) {
if (!e) {
plugin.modal.msgError("没有可以分析的数据!");
return;
}
this.showAnalysis = true;
},
//关闭分析弹出页
closeLogAnalysis() {
this.showAnalysis = false;
},
pageTurning(flag) {
if (flag === 0) {
if (this.query.pageNum - 1 === 0) return
this.queryList("pre")
}
if (flag === 1) {
if (this.query.pageNum + 1 > Math.ceil(this.total / this.query.pageSize)) return
this.queryList("next")
2024-12-19 12:41:30 +08:00
}
2024-12-19 18:12:16 +08:00
}
2024-12-19 12:41:30 +08:00
}
}
</script>
<style lang="scss">
2024-12-19 18:12:16 +08:00
.page {
2024-12-19 12:41:30 +08:00
height: 1200px;
width: 100%;
2024-12-19 18:12:16 +08:00
background-color: cadetblue;
2024-12-19 12:41:30 +08:00
}
2024-12-19 18:12:16 +08:00
2024-12-19 12:41:30 +08:00
.uni-page-head {
display: none
}
2024-12-19 18:12:16 +08:00
.col1 {
width: 130px;
height: 20px;
2024-12-19 12:41:30 +08:00
}
2024-12-19 18:12:16 +08:00
.col2 {
width: 130px;
height: 30px;
2024-12-19 12:41:30 +08:00
}
2024-12-19 18:12:16 +08:00
.text1 {
text-align: center;
background-color: #13bff3;
height: 20px;
line-height: 20px;
color: white;
2024-12-19 12:41:30 +08:00
}
2024-12-19 18:12:16 +08:00
2024-12-19 12:41:30 +08:00
.text2 {
text-align: center;
background-color: #13bff3;
height: 20px;
width: 240px;
line-height: 20px;
color: white;
}
2024-12-19 18:12:16 +08:00
.but1 {
2024-12-19 19:35:43 +08:00
width: 200;
2024-12-19 12:41:30 +08:00
}
.demo-uni-col {
height: 32px;
border-radius: 2px;
}
.dark {
background-color: cadetblue;
}
.light {
background-color: cadetblue;
}
2024-12-19 18:12:16 +08:00
.rowheadstyle {
2024-12-19 12:41:30 +08:00
height: 40px;
left: 10px;
2024-12-19 18:12:16 +08:00
2024-12-19 12:41:30 +08:00
}
2024-12-19 18:12:16 +08:00
.rowstyle {
2024-12-19 12:41:30 +08:00
height: 70px;
left: 10px;
padding-top: 10px;
2024-12-19 18:12:16 +08:00
2024-12-19 12:41:30 +08:00
}
.rowview {
margin-top: 5px;
height: 100%;
width: 100%;
line-height: 40px;
}
.valuecol {
height: 80%;
text-align: left;
line-height: 28px;
font-size: 12px;
// border: 1px solid black;
width: 95%;
// background-color: white;
color: white;
}
2024-12-19 18:12:16 +08:00
2024-12-19 12:41:30 +08:00
// 弹窗
.dialog-container {
width: 90vw;
height: 90vh;
overflow: hidden;
2024-12-19 18:12:16 +08:00
2024-12-19 12:41:30 +08:00
.dialog-title {
width: 100%;
height: 34px;
font-size: 16px;
line-height: 34px;
text-align: center;
font-weight: bold;
border-bottom: 1px solid #999;
position: relative;
2024-12-19 18:12:16 +08:00
2024-12-19 12:41:30 +08:00
.reload-btn {
position: absolute;
top: 50%;
right: 56px;
transform: translateY(-50%);
}
2024-12-19 18:12:16 +08:00
2024-12-19 12:41:30 +08:00
.close-btn {
position: absolute;
top: 50%;
right: 10px;
transform: translateY(-50%);
}
}
2024-12-19 18:12:16 +08:00
2024-12-19 12:41:30 +08:00
.dialog-body {
height: calc(100% - 35px);
overflow: hidden;
position: relative;
background-color: #f7f7f7;
2024-12-19 18:12:16 +08:00
2024-12-19 12:41:30 +08:00
//扫码的弹窗
.scancode-device-info {
height: 100%;
padding: 0 20px;
overflow-x: hidden;
overflow-y: auto;
display: flex;
flex-direction: column;
justify-content: space-evenly;
2024-12-19 18:12:16 +08:00
&>view {
2024-12-19 12:41:30 +08:00
width: 100%;
line-height: 40px;
font-size: 18px;
color: gray;
2024-12-19 18:12:16 +08:00
2024-12-19 12:41:30 +08:00
.label {
display: inline-block;
width: 30%;
color: black;
margin-right: 2px;
white-space: nowrap;
}
}
}
}
2024-12-19 18:12:16 +08:00
2024-12-19 12:41:30 +08:00
.control-panel {
height: 100px;
display: flex;
align-items: center;
flex-wrap: nowrap;
justify-content: space-evenly;
2024-12-19 18:12:16 +08:00
&>view {
2024-12-19 12:41:30 +08:00
padding: 6px 10px;
color: #007acc;
font-size: 14px;
border: 1px solid #ccc;
border-radius: 4px;
}
}
}
</style>