瀏覽代碼

干燥机,发酵机

asd26269546 2 年之前
父節點
當前提交
a970dc5747

+ 8 - 0
src/assets/css/index.scss

@@ -160,4 +160,12 @@ li {
         font-size: 12px;
         color: #999;
     }
+}
+
+.van-field--label-top .van-icon-arrow{
+    position: absolute;
+    right: 10px;
+    top: 0;
+    height: 70px;
+    line-height: 70px;
 }

二進制
src/assets/images/fermentator/icon_cfwd@2x.png


二進制
src/assets/images/fermentator/icon_guany@2x.png


二進制
src/assets/images/fermentator/icon_gzms@2x.png


二進制
src/assets/images/fermentator/icon_jfwd@2x.png


二進制
src/assets/images/fermentator/icon_jlsd@2x.png


二進制
src/assets/images/fermentator/icon_lsjwd@2x.png


二進制
src/assets/images/fermentator/icon_rjlhy@2x.png


二進制
src/assets/images/fermentator/icon_sbzt@2x.png


二進制
src/assets/images/fermentator/icon_sjd@2x.png


二進制
src/assets/images/fermentator/icon_tongql@2x.png


二進制
src/assets/images/fermentator/icon_wend@2x.png


二進制
src/assets/images/fermentator/icon_zhuans@2x.png


二進制
src/assets/images/fermentator/icon_ztfy@2x.png


+ 15 - 0
src/router/index.js

@@ -30,11 +30,26 @@ const routes = [{
 				component: () => import('../views/working/index.vue')
 			},
 			{
+				path: 'xiamenList',
+				name: '发酵机列表',
+				component: () => import('../views/equipment/xiamenList.vue')
+			},
+			{
 				path: 'warpKnitting/:id',
 				name: '经编机',
 				component: () => import('../views/equipment/warpKnitting.vue')
 			},
 			{
+				path: 'warpKnitting/:id',
+				name: '经编机',
+				component: () => import('../views/equipment/warpKnitting.vue')
+			},
+			{
+				path: 'fermentator/:id',
+				name: '发酵机',
+				component: () => import('../views/equipment/fermentator.vue')
+			},
+			{
 				path: 'process',
 				name: '采购单',
 				component: () => import('../views/process/index.vue')

+ 0 - 3
src/utils/axios.js

@@ -58,7 +58,6 @@ service.interceptors.request.use(config => {
   }
   return config
 }, error => {
-  console.log(error)
   Promise.reject(error)
 })
 
@@ -142,7 +141,6 @@ export function get(url, params = {}) {
 
 export function post(url, data = {}, method = 'post',headers = {}) {
   return new Promise((resolve, reject) => {
-    console.log(!data.closeLoading)
     if(!data.closeLoading) {
       showLoadingToast({
         message: '加载中...',
@@ -157,7 +155,6 @@ export function post(url, data = {}, method = 'post',headers = {}) {
       data: data,
       headers: {...headers}
     }).then(res => {
-      console.log(res)
       closeToast()
       resolve(res);
     }).catch(err => {

+ 217 - 0
src/views/equipment/dryer.vue

@@ -0,0 +1,217 @@
+<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_jfwd@2x.png" alt="">
+						</div>
+						<div class="text" style="margin-left: 8px">
+							进风温度( ℃)
+						</div>
+					</div>
+					<div class="num">
+						<p>{{ obj.jfwd }}</p>
+					</div>
+				</li>
+                <li>
+					<div style="display: flex">
+						<div class="icon">
+							<img src="../../assets/images/fermentator/icon_cfwd@2x.png" alt="">
+						</div>
+						<div class="text" style="margin-left: 8px">
+							出风温度( ℃)
+						</div>
+					</div>
+					<div class="num">
+						<p>{{ obj.cfwd }}</p>
+					</div>
+				</li>
+                <li>
+					<div style="display: flex">
+						<div class="icon">
+							<img src="../../assets/images/fermentator/icon_ztfy@2x.png" alt="">
+						</div>
+						<div class="text" style="margin-left: 8px">
+							主塔负压(Kpa)
+						</div>
+					</div>
+					<div class="num">
+						<p>{{ obj.ztfy }}</p>
+					</div>
+				</li>
+                <li>
+					<div style="display: flex">
+						<div class="icon">
+							<img src="../../assets/images/fermentator/icon_jlsd@2x.png" alt="">
+						</div>
+						<div class="text" style="margin-left: 8px">
+							进料速度(Ml/min)
+						</div>
+					</div>
+					<div class="num"> 
+						<p>{{ obj.jlsd }}</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({
+    jfwd: 150,
+    cfwd: 97,
+    ztfy: -0.24,
+    jlsd: 110,
+})
+const obj = ref({
+    jfwd: 150,
+    cfwd: 97,
+    ztfy: -0.24,
+    jlsd: 110,
+})
+const onRefresh = () => {
+	setTimeout(() => {
+		loading.value = false
+	}, 500)
+}
+
+const changeData = () => {
+    obj.value.jfwd = calculationDeviation(obj2.value.jfwd,1)
+    obj.value.cfwd = calculationDeviation(obj2.value.cfwd,1)
+    obj.value.ztfy = calculationDeviation(obj2.value.ztfy,2)
+    obj.value.jlsd = calculationDeviation(obj2.value.jlsd,1)
+}
+
+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>

+ 269 - 0
src/views/equipment/fermentator.vue

@@ -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>

+ 174 - 0
src/views/equipment/xiamenList.vue

@@ -0,0 +1,174 @@
+<template>
+	<van-pull-refresh v-model="loading" @refresh="onRefresh">
+		<div class="xiamenList">
+			<van-list
+				v-model:loading="loading"
+				:finished="finished"
+				finished-text="没有更多了"
+				@load="onLoad"
+			>
+				<ul>
+					<li @click="toDtl(1)">
+						<div class="title">发酵机1</div>
+						<div class="content">
+							<div class="item">
+								<div class="label">型号:</div>
+								<div class="value">SMT-202201</div>
+							</div>
+							
+						</div>
+						
+						<div class="type success">运行</div>
+					</li>
+                    <li @click="toDtl(2)">
+						<div class="title">干燥机2</div>
+						<div class="content">
+							<div class="item">
+								<div class="label">型号:</div>
+								<div class="value">SMT-202202</div>
+							</div>
+							
+						</div>
+						
+						<div class="type success">运行</div>
+					</li>
+				</ul>
+			</van-list>
+		</div>
+	</van-pull-refresh>
+</template>
+<script setup>
+import { ref, getCurrentInstance, onMounted } from 'vue'
+const loading = ref(false)
+const finished = ref(false);
+const proxy = getCurrentInstance().proxy
+const listData = ref([])
+const onRefresh = () => {
+	setTimeout(() => {
+		loading.value = false
+	}, 500)
+}
+const onLoad = () => {
+    setTimeout(() => {
+        loading.value = false
+        finished.value = true
+    }, 500)
+}
+
+const toDtl = (id) => {
+	if(id === 1) {
+		proxy.$router.push('/main/fermentator/' + id)
+	}else{
+		proxy.$router.push('/main/dryer/' + id)
+	}
+	
+}
+const getList = () => {
+	proxy.post('/tdaDevice/page').then(res => {
+		listData.value = res.data.rows
+		console.log(res)
+	})
+}
+getList()
+</script>
+
+<style lang="scss" scoped>
+.xiamenList {
+	background-color: #f1f1f1;
+	padding: 12px;
+	color: #333;
+	min-height: 80vh;
+	font-weight: 400;
+	ul {
+		li {
+			background: #fff;
+			border-radius: 8px;
+			margin-top: 12px;
+			padding: 0 12px;
+			position: relative;
+			.type {
+				position: absolute;
+				top: 0;
+				right: 0;
+				background: #ff8c33;
+				color: #fff;
+				font-size: 12px;
+				height: 24px;
+				line-height: 24px;
+				border-radius: 0 8px 0 8px;
+				width: 60px;
+				text-align: center;
+			}
+			//成功
+			.success {
+				background: #3fbf31;
+				color: #fff;
+			}
+			.error {
+				background: #f6514f;
+				color: #fff;
+			}
+			.stop {
+				background: #dddddd;
+				color: #999999;
+			}
+			.title {
+				font-size: 16px;
+				font-weight: bold;
+				height: 48px;
+				line-height: 48px;
+			}
+			.content {
+				display: flex;
+                height: 30px;
+				.item {
+					flex: 1;
+                    display: flex;
+					.label {
+						font-size: 12px;
+						color: #999;
+						margin-bottom: 8px;
+					}
+					.value {
+						font-size: 14px;
+						color: #333;
+                        margin-left:5px;
+					}
+				}
+			}
+			.foot-tag {
+				display: flex;
+				margin-top: 12px;
+				color: #333;
+				font-size: 12px;
+				font-weight: 400;
+				height: 44px;
+				border-top: 1px solid #ddd;
+				padding-top: 12px;
+				box-sizing: border-box;
+				.tag {
+					margin-right: 24px;
+					display: flex;
+					align-items: left;
+					.icon {
+						margin-right: 8px;
+						height: 20px;
+						width: 20px;
+						line-height: 20px;
+						text-align: center;
+						font-size: 12px;
+						border-radius: 4px;
+						background: #ff8c33;
+						color: #fff;
+					}
+					.text {
+						font-size: 12px;
+						line-height: 20px;
+						color: #999;
+					}
+				}
+			}
+		}
+	}
+}
+</style>

+ 2 - 1
src/views/main.vue

@@ -6,7 +6,7 @@
 				<van-tabbar-item icon="search" to="/main/working">工作台</van-tabbar-item>
 				<van-tabbar-item
 					icon="friends-o"
-					to="/main/equipment"
+					:to="getUserInfo().tenantId != 'hmhjc' ? '/main/xiamenList' : '/main/equipment'"
 				>物联网</van-tabbar-item>
 				<van-tabbar-item
 					icon="setting-o"
@@ -19,6 +19,7 @@
 </template>
 <script setup>
 import { ref, getCurrentInstance } from 'vue'
+import { getUserInfo } from '@/utils/auth';
 import '../assets/icon/iconfont.css'
 import 'vant/lib/index.css';
 import axios from 'axios'

+ 17 - 26
src/views/working/index.vue

@@ -3,7 +3,7 @@
     <div class="card" v-for="i in routerData" :key="i.path">
       <div class="title">{{ i.meta.title }}</div>
       <ul>
-        <li v-for="j in i.children" :key="j.path">
+        <li v-for="j in i.children" :key="j.path" @click="toRouter(j)">
           <div class="icon">
             <van-icon class-prefix="icon" name="icon_gd" />
           </div>
@@ -11,30 +11,7 @@
         </li>
       </ul>
     </div>
-    <div class="card">
-      <div class="title">出入库</div>
-      <ul>
-        
-        <li @click="handleGo(1)">
-          <div class="icon">
-            <van-icon class-prefix="icon" name="icon_gd" />
-          </div>
-          <div class="text">手动出库</div>
-        </li>
-        <li @click="handleGo(2)">
-          <div class="icon">
-            <van-icon class-prefix="icon" name="icon_gd" />
-          </div>
-          <div class="text">手动入库</div>
-        </li>
-        <li @click="handleGo(4)">
-          <div class="icon">
-            <van-icon class-prefix="icon" name="icon_gd" />
-          </div>
-          <div class="text">仓库维护</div>
-        </li>
-      </ul>
-    </div>
+    
   </div>
 </template>
 <script setup>
@@ -44,10 +21,24 @@ console.log(toRaw(proxy), "asss");
 const routerData = ref([]);
 const getRouter = () => {
   proxy.get("getRouters", {}).then((res) => {
-    routerData.value = res.data;
+    for (let i = 0; i < res.data.length; i++) {
+      const element = res.data[i];
+      console.log(element.type)
+      if(element.type == 2){
+        
+        routerData.value = element.children;
+        console.log(routerData.value)
+      }
+    }
+    
   });
 };
 getRouter();
+const toRouter = (item) => {
+  proxy.$router.push({
+    path: item.path,
+  });
+};
 const handleGo = (type) => {
   if (type === 1) {
     proxy.$router.push({