|
@@ -0,0 +1,269 @@
|
|
|
+<template>
|
|
|
+ <van-nav-bar title="发酵机" left-arrow @click-left="onClickLeft" />
|
|
|
+ <van-pull-refresh v-model="loading" @refresh="onRefresh">
|
|
|
+ <div class="fermentator">
|
|
|
+ <div class="fermentator-header">
|
|
|
+ <div class="status">
|
|
|
+ <div class="img">
|
|
|
+ <img src="../../assets/images/icon_sbzt1.png" alt="">
|
|
|
+ </div>
|
|
|
+ <div class="text">
|
|
|
+ <div class="label">设备状态</div>
|
|
|
+ <div class="value" style="color:#3FBF31">正常</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="mode">
|
|
|
+ <div class="img">
|
|
|
+ <img src="../../assets/images/icon_gzms1.png" alt="">
|
|
|
+ </div>
|
|
|
+ <div class="text">
|
|
|
+ <div class="label">工作模式</div>
|
|
|
+ <div class="value">自动</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="commons-title">设备参数</div>
|
|
|
+
|
|
|
+
|
|
|
+ <ul class="songjin">
|
|
|
+ <li>
|
|
|
+ <div style="display: flex">
|
|
|
+ <div class="icon">
|
|
|
+ <img src="../../assets/images/fermentator/icon_guany@2x.png" alt="">
|
|
|
+ </div>
|
|
|
+ <div class="text" style="margin-left: 8px">
|
|
|
+ 罐压(Mpa)
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="num">
|
|
|
+ <p>{{ obj.gy }}</p>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <div style="display: flex">
|
|
|
+ <div class="icon">
|
|
|
+ <img src="../../assets/images/fermentator/icon_tongql@2x.png" alt="">
|
|
|
+ </div>
|
|
|
+ <div class="text" style="margin-left: 8px">
|
|
|
+ 通气量(M³/H)
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="num">
|
|
|
+ <p>{{ obj.tql }}</p>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <div style="display: flex">
|
|
|
+ <div class="icon">
|
|
|
+ <img src="../../assets/images/fermentator/icon_wend@2x.png" alt="">
|
|
|
+ </div>
|
|
|
+ <div class="text" style="margin-left: 8px">
|
|
|
+ 温度( ℃)
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="num">
|
|
|
+ <p>{{ obj.wd }}</p>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <div style="display: flex">
|
|
|
+ <div class="icon">
|
|
|
+ <img src="../../assets/images/fermentator/icon_lsjwd@2x.png" alt="">
|
|
|
+ </div>
|
|
|
+ <div class="text" style="margin-left: 8px">
|
|
|
+ 冷水机温度( ℃)
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="num">
|
|
|
+ <p>{{ obj.lsjwd }}</p>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <div style="display: flex">
|
|
|
+ <div class="icon">
|
|
|
+ <img src="../../assets/images/fermentator/icon_sjd@2x.png" alt="">
|
|
|
+ </div>
|
|
|
+ <div class="text" style="margin-left: 8px">
|
|
|
+ 酸碱度(PH)
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="num">
|
|
|
+ <p>{{ obj.sjd }}</p>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <div style="display: flex">
|
|
|
+ <div class="icon">
|
|
|
+ <img src="../../assets/images/fermentator/icon_rjlhy@2x.png" alt="">
|
|
|
+ </div>
|
|
|
+ <div class="text" style="margin-left: 8px">
|
|
|
+ 溶解含氧(DO%)
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="num">
|
|
|
+ <p>{{ obj.rjhy }}</p>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <div style="display: flex">
|
|
|
+ <div class="icon">
|
|
|
+ <img src="../../assets/images/fermentator/icon_zhuans@2x.png" alt="">
|
|
|
+ </div>
|
|
|
+ <div class="text" style="margin-left: 8px">
|
|
|
+ 转速(Rpm)
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="num">
|
|
|
+ <p>{{ obj.zs }}</p>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </van-pull-refresh>
|
|
|
+</template>
|
|
|
+<script setup>
|
|
|
+import * as echarts from 'echarts'
|
|
|
+import { ref, onMounted,getCurrentInstance } from 'vue'
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
+const proxy = getCurrentInstance().proxy
|
|
|
+const loading = ref(false)
|
|
|
+const obj2 = ref({
|
|
|
+ gy:0.05,
|
|
|
+ tql:22,
|
|
|
+ wd:27.9,
|
|
|
+ lsjwd:8.5,
|
|
|
+ sjd:5.96,
|
|
|
+ rjhy:19.1,
|
|
|
+ zs:475,
|
|
|
+})
|
|
|
+const obj = ref({
|
|
|
+ gy:0.05,
|
|
|
+ tql:22,
|
|
|
+ wd:27.9,
|
|
|
+ lsjwd:8.5,
|
|
|
+ sjd:5.96,
|
|
|
+ rjhy:19.1,
|
|
|
+ zs:475,
|
|
|
+})
|
|
|
+const onRefresh = () => {
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.value = false
|
|
|
+ }, 500)
|
|
|
+}
|
|
|
+
|
|
|
+const changeData = () => {
|
|
|
+ obj.value.gy = calculationDeviation( obj2.value.gy,2)
|
|
|
+ obj.value.tql = calculationDeviation( obj2.value.tql)
|
|
|
+ obj.value.wd = calculationDeviation( obj2.value.wd)
|
|
|
+ obj.value.lsjwd = calculationDeviation( obj2.value.lsjwd)
|
|
|
+ obj.value.sjd = calculationDeviation( obj2.value.sjd)
|
|
|
+ obj.value.rjhy = calculationDeviation( obj2.value.rjhy)
|
|
|
+ obj.value.zs = calculationDeviation( obj2.value.zs)
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+const calculationDeviation = (value,num) => {
|
|
|
+ return ((((Math.floor(Math.random()*200) - 100) / 10000)) * value + value).toFixed(num || 1)
|
|
|
+}
|
|
|
+
|
|
|
+const onClickLeft = () => history.back();
|
|
|
+
|
|
|
+const router = useRouter()
|
|
|
+
|
|
|
+const getDtl = () => {
|
|
|
+ proxy.post('/tdaDevice/data', { deviceId: router.currentRoute.value.params.id }).then(
|
|
|
+ (res) => {
|
|
|
+ console.log(res)
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
+}
|
|
|
+getDtl()
|
|
|
+onMounted(() => {
|
|
|
+ setInterval(() => {
|
|
|
+ changeData()
|
|
|
+ }, 5000)
|
|
|
+})
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.fermentator {
|
|
|
+ padding: 0 12px 80px;
|
|
|
+ .chart-warp{
|
|
|
+ background: #fff;
|
|
|
+ .chart-box {
|
|
|
+ height: 250px;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .fermentator-header {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-top: 12px;
|
|
|
+
|
|
|
+ .status,.mode{
|
|
|
+ width: 49%;
|
|
|
+ background: #fff;
|
|
|
+ padding: 12px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: flex;
|
|
|
+ .label{
|
|
|
+ font-size: 14px;
|
|
|
+ color: #666;
|
|
|
+ }
|
|
|
+ .value{
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #FF8800;
|
|
|
+ margin-top: 6px;
|
|
|
+ }
|
|
|
+ .img{
|
|
|
+ width: 50px;
|
|
|
+ height: 50px;
|
|
|
+ margin-right: 12px;
|
|
|
+ img{
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .songjin {
|
|
|
+ li {
|
|
|
+ height: 70px;
|
|
|
+ background: #ffffff;
|
|
|
+ border-radius: 5px 5px 5px 5px;
|
|
|
+ line-height: 40px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-bottom: 12px;
|
|
|
+ padding: 15px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ font-size: 14px;
|
|
|
+ .icon {
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ border-radius: 50%;
|
|
|
+ background: #eeeeee;
|
|
|
+ text-align: center;
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .num {
|
|
|
+ color: #333;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 40px;
|
|
|
+ p{
|
|
|
+ margin: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+</style>
|