From f466ae4fdc645c66c9f25e2e4598b9809e2b41af Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期六, 13 一月 2024 22:56:49 +0800
Subject: [PATCH] Merge branch 'master' of http://www.beijingsoft.cn:9090/r/mdc-front

---
 src/container/Map/index.vue |  155 ++++++++++++++++++---------------------------------
 1 files changed, 55 insertions(+), 100 deletions(-)

diff --git a/src/container/Map/index.vue b/src/container/Map/index.vue
index e11e4fb..f1a6efe 100644
--- a/src/container/Map/index.vue
+++ b/src/container/Map/index.vue
@@ -1,48 +1,30 @@
 <!--
  * @Date: 2024-01-05 22:26:22
  * @LastEditors: Sneed
- * @LastEditTime: 2024-01-12 22:37:43
+ * @LastEditTime: 2024-01-13 22:19:48
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/Map/index.vue
 -->
 <template>
     <div class="workshop">
         <Map v-if="status===0 || status === 1 && id" :status="status" :currentMap="currentMap" :name="plantName" :id="id" @out="out" />
         <div v-else class="preview">
-            <div class="left">
-                <div @click="editMap" class="edit-btn">
-                    {{id ? '杩涘叆缂栬緫鐘舵��' : '鏂板'}}
-                </div>
-                <el-select clearable class="left-select" v-model="id" placeholder="璇烽�夋嫨">
-                    <el-option
-                    v-for="item in mapList"
-                    :key="item.id"
-                    :label="item.name"
-                    :value="item.id">
-                    </el-option>
-                </el-select>
-                <div class="left-item left-1">
-                    <div>44%</div>
-                    <div>寮�鏈虹巼</div>
-                </div>
-                <div class="left-item left-2">
-                    <div>44%</div>
-                    <div>鏁呴殰鐜�</div>
-                </div>
-                <div class="left-item left-3">
-                    <div>44%</div>
-                    <div>鍒囧墛鐜�</div>
-                </div>
-                <div class="left-item left-4">
-                    <div>44%</div>
-                    <div>浜岀彮寮�宸ョ巼</div>
-                </div>
-                <div class="left-item left-5">
-                    <div>44%</div>
-                    <div>涓夌彮寮�宸ョ巼</div>
-                </div>
-            </div>
+            <LeftStatus class="left" :info="info">
+                <template>
+                    <div @click="editMap" class="edit-btn">
+                        {{id ? '杩涘叆缂栬緫鐘舵��' : '鏂板'}}
+                    </div>
+                    <el-select clearable class="left-select" v-model="id" placeholder="璇烽�夋嫨">
+                        <el-option
+                        v-for="item in mapList"
+                        :key="item.id"
+                        :label="item.name"
+                        :value="item.id">
+                        </el-option>
+                    </el-select>
+                </template>
+            </LeftStatus>
             <div class="right">
-                <Status v-show="false"/>
+                <Status v-show="id" :info="info"/>
                 <div class="preview-map">
                     <Map v-if="id" :status="2" :currentMap="currentMap"  @out="out" />
                 </div>
@@ -51,12 +33,15 @@
     </div>
 </template>
 <script>
-    import Map from './Map.vue'
+    import Map from './Map.vue';
     import Status from '@/components/newComp/Status'
+    import LeftStatus from './LeftStatus.vue'
+    import { getRequest, getUrl } from '@/api/Api'
     export default {
         components: {
             Map,
-            Status
+            Status,
+            LeftStatus
         },
         watch: {
             id (val) {
@@ -65,8 +50,28 @@
                     this.plantName = ''
                     return
                 }
-                this.currentMap = JSON.parse(this.mapList.find(item => item.id ===this.id).gridSetting)
-                this.plantName = this.mapList.find(item => item.id ===this.id).name
+                try {
+                    this.currentMap = JSON.parse(this.mapList.find(item => item.id ===this.id).gridSetting)
+                    this.plantName = this.mapList.find(item => item.id ===this.id).name
+                } catch (error) {
+                    
+                }
+                getRequest('machineList', {
+                    plantId: this.id,
+                }).then(res => {
+                    // this.list = res.data.list
+                    this.info = {
+                        runRate: res.data.runRate,
+                        cutRate: res.data.cutRate,
+                        alarmRate: res.data.alarmRate,
+                        threeShiftRate: res.data.threeShiftRate,
+                        twoShiftRate: res.data.twoShiftRate,
+                        run: res.data.run,
+                        alarm: res.data.alarm,
+                        stop: res.data.stop,
+                        idle: res.data.idle
+                    }
+                })
             }
         },
         data () {
@@ -76,6 +81,17 @@
                 plantName: '',
                 mapList: [],
                 status: 2, // 0 鏂板 1缂栬緫 2鏌ョ湅
+                info: {
+                    runRate: '',
+                    cutRate: '',
+                    alarmRate: '',
+                    threeShiftRate: '',
+                    twoShiftRate: '',
+                    run: '',
+                    alarm: '',
+                    stop: '',
+                    idle: '',
+                }
             }
         },
         methods: {
@@ -124,67 +140,6 @@
             width: 100%;
             height: 100%;
             display: flex;
-            .left {
-                flex: 0 0 auto;
-                width: 194px;
-                height: 100%;
-                margin-left: 20px;
-                background: url('./img//left_icon.png') 100% center no-repeat;
-                .edit-btn {
-                    margin-top: 20px;
-                    color: #C6DCE0;
-                    text-align: center;
-                    line-height: 38px;
-                    width: 150px;
-                    height: 38px;
-                    background: url('./img//btn.png') 100% center no-repeat;
-                    background-size: contain;
-                    font-size: 16px;
-                    cursor: pointer;
-                }
-                .left-select {
-                    margin-top: 20px;
-                    width: 150px;
-                }
-                .left-item:first-child {
-                    margin-top: 138px;
-                }
-                .left-item {
-                    margin-top: 20px;
-                    width: 138px;
-                    height: 138px;
-                    background: url('./img/left_1.png') 0 0 no-repeat;
-                    background-size: contain;
-                    color: #D6EEEF;
-                    position: relative;
-                    & > div:first-child {
-                        font-size: 23px;
-                        position: absolute;
-                        left: 50%;
-                        top: 50%;
-                        transform: translate(-50%,-50%);
-                    }
-                    & > div:last-child {
-                        font-size: 12px;
-                        position: absolute;
-                        left: 50%;
-                        bottom: 25px;
-                        transform: translate(-50%,-50%);
-                    }
-                }
-                .left-2 {
-                    background-image: url('./img/left_2.png');
-                }
-                .left-3 {
-                    background-image: url('./img/left_3.png');
-                }
-                .left-4 {
-                    background-image: url('./img/left_4.png');
-                }
-                .left-5 {
-                    background-image: url('./img/left_5.png');
-                }
-            }
             .right {
                 width: calc(100% -  194px);
                 padding-top: 30px; 

--
Gitblit v1.9.3