From b00c4b56c0698fa35e579b94697516fef53e28bd Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期二, 16 一月 2024 21:07:41 +0800
Subject: [PATCH] 修复设备保养的删除功能

---
 src/container/workshop/device.vue |   56 +++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 49 insertions(+), 7 deletions(-)

diff --git a/src/container/workshop/device.vue b/src/container/workshop/device.vue
index f383439..2d7adad 100644
--- a/src/container/workshop/device.vue
+++ b/src/container/workshop/device.vue
@@ -1,13 +1,13 @@
 <!--
  * @Date: 2024-01-13 20:46:33
  * @LastEditors: Sneed
- * @LastEditTime: 2024-01-13 23:35:27
+ * @LastEditTime: 2024-01-16 01:08:39
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/workshop/device.vue
 -->
 <template>
     <div class="device-item">
         <el-checkbox class="care" v-model="care" @change="change"></el-checkbox>
-        <p>YKX123123213</p>
+        <p>{{ machineName }}</p>
         <div class="device-item-box">
             <div class="img">
                 <span class="img-status" v-if="item.status === 'STOP'">鍋滄満</span>
@@ -20,21 +20,21 @@
                 <li>
                     <img src="./img/sd.png" alt="">
                     <div>
-                        <p>{{ item.cycleCount || 0 }}</p>
+                        <p>{{ efficiency}}</p>
                         <p>鑳藉姏鍒╃敤鐜�</p>
                     </div>
                 </li>
                 <li>
                     <img src="./img/sd.png" alt="">
                     <div>
-                        <p>{{ item.cycleCount || 0 }}</p>
+                        <p>{{ utilizationDaily}}</p>
                         <p>鏃ュ埄鐢ㄧ巼</p>
                     </div>
                 </li>
                 <li>
                     <img src="./img/sd.png" alt="">
                     <div>
-                        <p>{{ item.cycleCount || 0 }}</p>
+                        <p>{{ info.cycleCount}}</p>
                         <p>瀹屽伐浠舵暟</p>
                     </div>
                 </li>
@@ -45,17 +45,59 @@
 <script>
 import { getRequest,getUrl } from '@/api/Api'
 export default {
-    props: ['id'],
+    props: {
+        id: {
+            type: [String,Number]
+        },
+        info: {
+            type: Object,
+            default: function () {
+                return {}
+            }
+        },
+        deviceList: {
+            type: Array,
+            default: function() {
+                return []
+            }
+        },
+        plantDeviceList: {
+            type: Array,
+            default: function() {
+                return []
+            }
+        }
+    },
     data () {
         return {
             care: false,
             item: {}
         }
     },
+    computed: {
+        efficiency () {
+            return this.info.efficiency || 0
+        },
+        utilizationDaily () {
+            return this.info.utilizationDaily || 0
+        },
+        cycleCount () {
+            return this.info.cycleCount || 0
+        },
+        machineName () {
+            try {
+                let arr = [...this.deviceList,...this.plantDeviceList]
+                return arr.find(item => item.machineId=== this.id).machineName
+            } catch (error) {
+                return this.id
+            }
+             
+        }
+    },
     methods: {
         change (val) {
             console.log(val)
-            getRequest('machineConcern',{concern: val ? 1 : 0,id: this.item.id}).then(res => {
+            getRequest('machineConcern',{concern: val ? 1 : 0,id: this.id}).then(res => {
                 console.log(res)
             })
         },

--
Gitblit v1.9.3