<template>
    <div @click.stop="closeModal" class="n_container">
        <div class="n_header">
            <div class="n_header_h1">
                <h1>晟华生产数</h1>
            </div>
        </div>
        <div class="n_body_container">
            <div class="n_body_container_wraper">
                <div class="status_wrap">
                    <div class="status_item">
                        <div class="status_tip green"></div>
                        <div class="status_name">运行中</div>
                    </div>
                    <div class="status_item">
                        <div class="status_tip yellow"></div>
                        <div class="status_name">待机</div>
                    </div>
                    <div class="status_item">
                        <div class="status_tip gray"></div>
                        <div class="status_name">关机</div>
                    </div>
                    <div class="status_item">
                        <div class="status_tip red"></div>
                        <div class="status_name">故障</div>
                    </div>
                </div>
                <div class="center_content">
                    <div class="machine_wrap diepanji_wrap">
                        <!-- <div class="machine_wrap mtp_wrap_1">
                            <img src="../../../images/workshop/mtp.png"  v-for="(e,i) in [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]" :key="i">
                        </div> -->
                        <div class="machine_wrap gtssj_wrap_1" ref="BZJ01" @click.stop="yjInfo('device', 'BZJ01')">
                            <img src="../../../images/workshop/gtssj.png" alt="" v-for="(e,i) in [1,2,3,4,5]" :key="i">
                        </div>
                        <div class="machine_wrap cpj_wrap_1">
                            <div class="sh_machine cpj">
                            <img src="../../../images/workshop/cpj.png" alt="">
                            </div>
                        </div>
                    </div>
                    <div class="cmd_block">
                      <div class="machine_wrap ktp_wrap_1" ref="DT01" @click.stop="yjInfo('device', 'DT01')">
                        <div class="ktp">
                          <img src="../../../images/workshop/ktp_gray.png" alt="">
                        </div>
                      </div>
                      <div class="machine_wrap cmd_wrap_1">
                        <div class="sh_machine weilan1">
                          <img src="../../../images/workshop/weilan_5.png" alt="">
                        </div>
                        <div class="sh_machine fjfztb">
                          <img src="../../../images/workshop/fjfztb.png" alt="">
                        </div>
                        <div v-if="SortAndPalletizingList.length > 0" class="sh_machine kongtuopan_1" ref="cmgw01" @click.stop="yjInfo('cmgw', 1)">
                          <img v-show="SortAndPalletizingList[0].color_status === 0" src="../../../images/workshop/ktp_gray.png" alt="">
                          <img v-show="SortAndPalletizingList[0].color_status === 1" src="../../../images/workshop/ktp_green.png" alt="">
                          <img v-show="SortAndPalletizingList[0].color_status === 2" src="../../../images/workshop/ktp_red.png" alt="">
                          <img v-show="SortAndPalletizingList[0].color_status === 3" src="../../../images/workshop/ktp_yellow.png" alt="">
                          <div v-show="SortAndPalletizingList[0].color_status === 1" class="zhuan_qty">
                            <p>{{ SortAndPalletizingList[0].encoder_qty }}</p>
                            <div class="zhuan_bg_arrow"></div>
                          </div>
                        </div>
                        <div v-if="SortAndPalletizingList.length > 0" class="sh_machine kongtuopan_1 kongtuopan_2" ref="cmgw02" @click.stop="yjInfo('cmgw', 2)">
                          <img v-show="SortAndPalletizingList[1].color_status === 0" src="../../../images/workshop/ktp_gray.png" alt="">
                          <img v-show="SortAndPalletizingList[1].color_status === 1" src="../../../images/workshop/ktp_green.png" alt="">
                          <img v-show="SortAndPalletizingList[1].color_status === 2" src="../../../images/workshop/ktp_red.png" alt="">
                          <img v-show="SortAndPalletizingList[1].color_status === 3" src="../../../images/workshop/ktp_yellow.png" alt="">
                          <div v-show="SortAndPalletizingList[1].color_status === 1" class="zhuan_qty">
                            <p>{{ SortAndPalletizingList[1].encoder_qty }}</p>
                            <div class="zhuan_bg_arrow"></div>
                          </div>
                        </div>
                        <div v-if="ManipulatorInfoList.length > 0" class="sh_machine robot_1" :class="{'rotate_1': String(ManipulatorInfoList[4].color_status) === '1'}" ref="FJCDJXS01" @click.stop="yjInfo('device', 'FJCDJXS01')">
                          <img v-show="String(ManipulatorInfoList[4].color_status) === '0'" src="../../../images/workshop/robot_cmd_gray.png" alt="">
                          <img v-show="String(ManipulatorInfoList[4].color_status) === '1'" src="../../../images/workshop/robot_cmd_green.png" alt="">
                          <img v-show="String(ManipulatorInfoList[4].color_status) === '2'" src="../../../images/workshop/robot_cmd_red.png" alt="">
                          <img v-show="String(ManipulatorInfoList[4].color_status) === '3'" src="../../../images/workshop/robot_cmd_yellow.png" alt="">
                        </div>
                        <div class="sh_machine weilan2">
                          <img src="../../../images/workshop/weilan_5.png" alt="">
                        </div>
                        <div v-if="SortAndPalletizingList.length > 0" class="sh_machine cmdssj_1" ref="cmgw03" @click.stop="yjInfo('cmgw', 3)">
                          <img v-show="SortAndPalletizingList[2].color_status === 0" src="../../../images/workshop/cmdssj_gray.png" alt="">
                          <img v-show="SortAndPalletizingList[2].color_status === 1" src="../../../images/workshop/cmdssj_green.png" alt="">
                          <img v-show="SortAndPalletizingList[2].color_status === 2" src="../../../images/workshop/cmdssj_red.png" alt="">
                          <img v-show="SortAndPalletizingList[2].color_status === 3" src="../../../images/workshop/cmdssj_yellow.png" alt="">
                          <div v-show="SortAndPalletizingList[2].color_status === 1" class="zhuan_qty">
                            <p>{{ SortAndPalletizingList[2].encoder_qty }}</p>
                            <div class="zhuan_bg_arrow"></div>
                          </div>
                        </div>
                        <div v-if="SortAndPalletizingList.length > 0" class="sh_machine cmdssj_1 cmdssj_2" ref="cmgw04" @click.stop="yjInfo('cmgw', 4)">
                          <img v-show="SortAndPalletizingList[3].color_status === 0" src="../../../images/workshop/cmdssj_gray.png" alt="">
                          <img v-show="SortAndPalletizingList[3].color_status === 1" src="../../../images/workshop/cmdssj_green.png" alt="">
                          <img v-show="SortAndPalletizingList[3].color_status === 2" src="../../../images/workshop/cmdssj_red.png" alt="">
                          <img v-show="SortAndPalletizingList[3].color_status === 3" src="../../../images/workshop/cmdssj_yellow.png" alt="">
                          <div v-show="SortAndPalletizingList[3].color_status === 1" class="zhuan_qty">
                            <p>{{ SortAndPalletizingList[3].encoder_qty }}</p>
                            <div class="zhuan_bg_arrow"></div>
                          </div>
                        </div>
                        <div class="sh_machine robot_2 rotate_2" ref="FJMDJXS01" @click.stop="yjInfo('device', 'FJMDJXS01')">
                          <img src="../../../images/workshop/robot_cmd_green.png" alt="">
                        </div>
                      </div>
                      <div class="machine_wrap cmd_wrap_1 cmd_wrap_2">
                        <div class="sh_machine weilan1">
                          <img src="../../../images/workshop/weilan_5.png" alt="">
                        </div>
                        <div class="sh_machine fjfztb">
                          <img src="../../../images/workshop/fjfztb.png" alt="">
                        </div>
                        <div class="sh_machine kongtuopan_1">
                          <img src="../../../images/workshop/mtp.png" alt="">
                        </div>
                        <div class="sh_machine kongtuopan_1 kongtuopan_2">
                          <img src="../../../images/workshop/mtp.png" alt="">
                        </div>
                        <div class="sh_machine robot_1">
                          <img src="../../../images/workshop/robot_cmd_gray.png" alt="">
                        </div>
                        <div class="sh_machine weilan2">
                          <img src="../../../images/workshop/weilan_5.png" alt="">
                        </div>
                        <div class="sh_machine cmdssj_1">
                          <img src="../../../images/workshop/cmdssj_gray.png" alt="">
                        </div>
                        <div class="sh_machine cmdssj_1 cmdssj_2">
                          <img src="../../../images/workshop/cmdssj_gray.png" alt="">
                        </div>
                        <div class="sh_machine robot_2">
                          <img src="../../../images/workshop/robot_cmd_gray.png" alt="">
                        </div>
                      </div>
                      <div class="machine_wrap liu_wrap">
                        <div class="sh_machine cmdssj_1">
                          <img src="../../../images/workshop/cmdssj_gray.png" alt="">
                        </div>
                        <div class="sh_machine cmdssj_1 cmdssj_2">
                          <img src="../../../images/workshop/cmdssj_gray.png" alt="">
                        </div>
                        <div class="rgv_line_wrap">
                          <div class="rgv_line_1">
                            <div class="rgv_line_begine"></div>
                            <div class="rgv_line_begine rgv_line_end"></div>
                            <div class="rgv_line_node"  v-for="(e,i) in [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]" :key="i"></div>
                          </div>
                          <div class="rgv_line_1 rgv_line_2">
                            <div class="rgv_line_begine"></div>
                            <div class="rgv_line_begine rgv_line_end"></div>
                            <div class="rgv_line_node"  v-for="(e,i) in [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]" :key="i"></div>
                          </div>
                          <div class="rgv_line_3"></div>
                        </div>
                        <div class="sh_machine rgvct" ref="RGV01" @click.stop="yjInfo('device', 'RGV01')">
                          <img src="../../../images/workshop/rgv_ct.png" alt="">
                        </div>
                        <div class="machine_wrap ggtj_wrap_1">
                          <div class="machine_wrap ggtj">
                            <img src="../../../images/workshop/ggtssj_y.png" alt="" v-for="(e,i) in [1,2,3]" :key="i">
                          </div>
                          <div class="sh_machine fmj">
                            <img src="../../../images/workshop/fmj.png" alt="">
                          </div>
                        </div>
                        <div class="machine_wrap ggtj_wrap_1 ggtj_wrap_2">
                          <div class="machine_wrap ggtj pointer" ref="bthc01" @click.stop="yjInfo('bthc', 1)">
                            <img src="../../../images/workshop/ggtssj_y.png" alt="">
                          </div>
                        </div>
                        <div class="machine_wrap ggtj_wrap_1 ggtj_wrap_3">
                          <div class="machine_wrap ggtj pointer" ref="bthc02" @click.stop="yjInfo('bthc', 2)">
                            <img src="../../../images/workshop/ggtssj_y.png" alt="">
                          </div>
                        </div>
                        <div class="machine_wrap ggtj_wrap_1 ggtj_wrap_4">
                          <div class="machine_wrap ggtj">
                            <img src="../../../images/workshop/ggtssj_y.png" alt="" v-for="(e,i) in [1,2,3]" :key="i">
                          </div>
                          <div class="sh_machine fmj">
                            <img src="../../../images/workshop/fmj.png" alt="">
                          </div>
                        </div>
                        <div class="machine_wrap ggtj_wrap_1 ggtj_wrap_5">
                          <div class="machine_wrap ggtj pointer" ref="bthc03" @click.stop="yjInfo('bthc', 3)">
                            <img src="../../../images/workshop/ggtssj_y.png" alt="">
                          </div>
                        </div>
                        <div class="machine_wrap ggtj_wrap_1 ggtj_wrap_7">
                          <div class="machine_wrap ggtj pointer" ref="bthc04" @click.stop="yjInfo('bthc', 4)">
                            <img src="../../../images/workshop/ggtssj_y.png" alt="">
                          </div>
                        </div>
                        <div class="machine_wrap ggtj_wrap_1 ggtj_wrap_8">
                          <div class="machine_wrap ggtj pointer" ref="bthc05" @click.stop="yjInfo('bthc', 5)">
                            <img src="../../../images/workshop/ggtssj_y.png" alt="">
                          </div>
                        </div>
                        <div class="machine_wrap ggtj_wrap_1 ggtj_wrap_9">
                          <div class="machine_wrap ggtj pointer" ref="bthc06" @click.stop="yjInfo('bthc', 6)">
                            <img src="../../../images/workshop/ggtssj_y.png" alt="">
                          </div>
                        </div>
                        <div class="machine_wrap ggtj_wrap_1 ggtj_wrap_10">
                          <div class="machine_wrap ggtj pointer" ref="bthc07" @click.stop="yjInfo('bthc', 7)">
                            <img src="../../../images/workshop/ggtssj_y.png" alt="">
                          </div>
                        </div>
                        <div class="machine_wrap ggtj_wrap_1 ggtj_wrap_11">
                          <div class="machine_wrap ggtj pointer" ref="bthc08" @click.stop="yjInfo('bthc', 8)">
                            <img src="../../../images/workshop/ggtssj_y.png" alt="">
                          </div>
                        </div>
                        <div class="machine_wrap ggtj_wrap_1 ggtj_wrap_6">
                          <div v-if="PackagingLineList.length > 0" class="machine_wrap ggtj">
                            <div v-for="(e,i) in PackagingLineList.slice(0,8)" :key="i" class="ggtj_list_wrap" @click.stop="bzxInfo(e)">
                              <div v-show="i === 5" class="sh_machine rgpt">
                                <img src="../../../images/workshop/rgpt.png" alt="">
                              </div>
                              <img class="sh_machine" src="../../../images/workshop/ggtssj.png" alt="">
                              <img v-show="String(e.move) === '1'" class="mtp" src="../../../images/workshop/mtp.png" alt="">
                              <div v-show="i === 5" class="sh_machine ltssj">
                                <img src="../../../images/workshop/ltssj_g.png" alt="">
                              </div>
                              <div v-show="i === 6" class="sh_machine fmj_bzd">
                                <img src="../../../images/workshop/fmj_bzd.png" alt="">
                              </div>
                              <div v-if="e.device_code === pkId" class="popup_block_wraper popup_block_wraper_1">
                                <div class="foldline foldline_right"></div>
                                <div class="popup_bg">
                                  <div class="popup_block">
                                    <div class="pop_header">
                                      <div class="pop_name">{{pkObj.device_code}}</div>
                                    </div>
                                    <div class="pop_content">
                                      <div class="pop_item">
                                        <div class="pop_label">状态</div>
                                        <div class="pop_val">{{ ['无货', '有货'][Number(pkObj.move)] }}</div>
                                      </div>
                                      <div class="pop_item">
                                        <div class="pop_label">载具类型</div>
                                        <div class="pop_val">{{ pkObj.vehicle_type }}</div>
                                      </div>
                                      <div class="pop_item">
                                        <div class="pop_label">载具编码</div>
                                        <div class="pop_val">{{ pkObj.vehicle_code }}</div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                                <div class="iconfont icon-guanbi close_btn" @click.stop="closeModal1"></div>
                              </div>
                            </div>
                          </div>
                          <div v-if="PackagingLineList.length > 0" class="sh_machine crj" @click.stop="bzxInfo(PackagingLineList[8])">
                            <img src="../../../images/workshop/crj.png" alt="">
                            <img v-show="String(PackagingLineList[8].move) === '1'" class="mtp" src="../../../images/workshop/mtp.png" alt="">
                            <div v-if="PackagingLineList[8].device_code === pkId" class="popup_block_wraper popup_block_wraper_2">
                              <div class="foldline foldline_right"></div>
                              <div class="popup_bg">
                                <div class="popup_block">
                                  <div class="pop_header">
                                    <div class="pop_name">{{pkObj.device_code}}</div>
                                  </div>
                                  <div class="pop_content">
                                    <div class="pop_item">
                                      <div class="pop_label">状态</div>
                                      <div class="pop_val">{{ ['无货', '有货'][Number(pkObj.move)] }}</div>
                                    </div>
                                    <div class="pop_item">
                                      <div class="pop_label">载具类型</div>
                                      <div class="pop_val">{{ pkObj.vehicle_type }}</div>
                                    </div>
                                    <div class="pop_item">
                                      <div class="pop_label">载具编码</div>
                                      <div class="pop_val">{{ pkObj.vehicle_code }}</div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                              <div class="iconfont icon-guanbi close_btn" @click.stop="closeModal1"></div>
                            </div>
                          </div>
                        </div>
                        <div class="machine_wrap ggtj_wrap_1 ggtj_wrap_6 ggtj_wrap_12">
                          <div v-if="PackagingLineList.length > 0" class="machine_wrap ggtj">
                            <div v-for="(e,i) in PackagingLineList.slice(9)" :key="i" class="ggtj_list_wrap" @click.stop="bzxInfo(e)">
                              <img class="sh_machine" src="../../../images/workshop/ggtssj.png">
                              <img v-show="String(e.move) === '1'" class="mtp" src="../../../images/workshop/mtp.png" alt="">
                              <div v-if="e.device_code === pkId" class="popup_block_wraper popup_block_wraper_3">
                                <div class="foldline foldline_right"></div>
                                <div class="popup_bg">
                                  <div class="popup_block">
                                    <div class="pop_header">
                                      <div class="pop_name">{{pkObj.device_code}}</div>
                                    </div>
                                    <div class="pop_content">
                                      <div class="pop_item">
                                        <div class="pop_label">状态</div>
                                        <div class="pop_val">{{ ['无货', '有货'][Number(pkObj.move)] }}</div>
                                      </div>
                                      <div class="pop_item">
                                        <div class="pop_label">载具类型</div>
                                        <div class="pop_val">{{ pkObj.vehicle_type }}</div>
                                      </div>
                                      <div class="pop_item">
                                        <div class="pop_label">载具编码</div>
                                        <div class="pop_val">{{ pkObj.vehicle_code }}</div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                                <div class="iconfont icon-guanbi close_btn" @click.stop="closeModal1"></div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                      <div class="sh_machine elect_1">
                        <img src="../../../images/workshop/elect.png" alt="">
                      </div>
                      <div class="sh_machine elect_1 elect_2">
                        <img src="../../../images/workshop/elect.png" alt="">
                      </div>
                      <div class="sh_machine elect_1 elect_3">
                        <img src="../../../images/workshop/elect.png" alt="">
                      </div>
                      <div class="sh_machine elect_1 elect_4">
                        <img src="../../../images/workshop/elect.png" alt="">
                      </div>
                    </div>
                </div>
            </div>
        </div>
        <div v-if="showModal" class="popup_block_wraper" :style="{'top': top, 'left': left}">
          <div class="foldline" :class="foldlineStyle"></div>
          <div class="popup_bg">
            <div class="popup_block">
              <div class="pop_header">
                <div v-show="machine === 'device'" class="pop_name">{{pkObj.device_name}}</div>
                <div v-show="machine === 'device'" class="pop_status">
                  <div class="pop_status_dot" :class="['gray', 'yellow', 'green', 'red'][Number(pkObj.device_status)]"></div>
                  <div class="pop_status_text fgray">{{pkObj.device_status_name}}</div>
                </div>
              </div>
              <div v-show="machine === 'device'" class="pop_content">
                <div class="pop_item">
                  <div class="pop_label">开机时间</div>
                  <div class="pop_val">{{ pkObj.open_time }}</div>
                </div>
                <div class="pop_item">
                  <div class="pop_label">待机时间</div>
                  <div class="pop_val pop_val_s">{{ pkObj.stand_time }}</div>
                  <div class="pop_unit">时</div>
                </div>
                <div class="pop_item">
                  <div class="pop_label">生产时间</div>
                  <div class="pop_val pop_val_s">{{ pkObj.work_time }}</div>
                  <div class="pop_unit">时</div>
                </div>
                <div class="pop_item">
                  <div class="pop_label">故障时间</div>
                  <div class="pop_val pop_val_s">{{ pkObj.error_time }}</div>
                  <div class="pop_unit">时</div>
                </div>
              </div>
              <div v-show="machine === 'cmgw' || machine === 'bthc'" class="pop_content">
                <div class="pop_item">
                  <div class="pop_label">状态</div>
                  <div class="pop_val">{{ ['无货', '有货'][Number(pkObj.point_status) - 1] }}</div>
                </div>
                <div class="pop_item">
                  <div class="pop_label">载具</div>
                  <div class="pop_val">{{ pkObj.vehicle_code }}</div>
                </div>
                <div class="pop_item">
                  <div class="pop_label">bom号</div>
                  <div class="pop_val">{{ pkObj.bom }}</div>
                </div>
                <div class="pop_item">
                  <div class="pop_label">物料编码</div>
                  <div class="pop_val">{{ pkObj.material_code }}</div>
                </div>
                <div class="pop_item">
                  <div class="pop_label">数量</div>
                  <div class="pop_val pop_val_s">{{ pkObj.qty }}</div>
                  <div class="pop_unit">块</div>
                </div>
                <div v-show="machine === 'cmgw'" class="pop_item">
                  <div class="pop_label">机台</div>
                  <div class="pop_val">{{ pkObj.device_name }}</div>
                </div>
                <div class="pop_item">
                  <div class="pop_label">碾次</div>
                  <div class="pop_val">{{ pkObj.mix_num }}</div>
                </div>
                <div v-show="machine === 'cmgw'" class="pop_item">
                  <div class="pop_label">是否满托</div>
                  <div class="pop_val">{{ pkObj.is_full }}</div>
                </div>
                <div v-show="machine === 'bthc'" class="pop_item">
                  <div class="pop_label">入库时间</div>
                  <div class="pop_val">{{ pkObj.instorage_time }}</div>
                </div>
              </div>
            </div>
          </div>
          <div class="iconfont icon-guanbi close_btn" @click.stop="closeModal"></div>
        </div>
        <div class="tooltip_wrap left_tooltip_wrap" :style="expand ? 'opacity: 1' : 'opacity: 0.1'">
          <div class="tooltip_arrow pointer" @click="expandTooltip" v-text="expand ? '&gt;&gt;' : '&lt;&lt;'"></div>
          <div class="tooltip_pages" :style="expand ? 'width: 300px' : 'width: 0'">
            <router-link to="/setup" class="tooltip_page">配置</router-link>
            <router-link to="/homepageone" class="tooltip_page">1</router-link>
            <router-link to="/hnlkone" class="tooltip_page">2</router-link>
            <router-link to="/takeshapeone" class="tooltip_page">3</router-link>
            <router-link to="/firedryone" class="tooltip_page">4</router-link>
            <div class="tooltip_page current_page pointer">5</div>
            <router-link to="/pdone" class="tooltip_page">6</router-link>
          </div>
        </div>
    </div>
</template>

<script>
import { workshopCondition, sortingAndPackagingPopover } from '@js/getData2'

export default {
  data () {
    return {
      interTime: this.$store.getters.setTime,
      timer: null,
      expand: false,
      SplitOrPalletizingList: [], // 拆码工位弹窗
      HalfSupportCacheList: [], // 点位/货位弹出框
      DevicesInfoList: {}, // 设备弹窗
      SortAndPalletizingList: [], // 分拣拆码垛对接位
      ManipulatorInfoList: [], // 机械手数据
      PackagingLineList: [], // 包装线数据
      showModal: false,
      machine: '',
      top: '',
      left: '',
      foldlineStyle: '',
      pkObj: {},
      pkId: ''
    }
  },
  mounted () {
    this._sortingAndPackagingPopover()
    this._workshopCondition()
    this.refresh()
  },
  beforeDestroy () {
    clearInterval(this.timer)
  },
  methods: {
    refresh () {
      this.timer = setInterval(() => {
        this._sortingAndPackagingPopover()
        this._workshopCondition()
      }, this.interTime)
    },
    async _workshopCondition () {
      let res = await workshopCondition()
      if (res.code === 200) {
        if (res.result.hasOwnProperty('SortAndPalletizingList')) {
          this.SortAndPalletizingList = [...res.result.SortAndPalletizingList]
        }
        if (res.result.hasOwnProperty('ManipulatorInfoList')) {
          this.ManipulatorInfoList = [...res.result.ManipulatorInfoList]
        }
      }
    },
    async _sortingAndPackagingPopover () {
      let res = await sortingAndPackagingPopover()
      if (res.code === 200) {
        if (res.result.hasOwnProperty('SplitOrPalletizingList')) {
          this.SplitOrPalletizingList = [...res.result.SplitOrPalletizingList]
        }
        if (res.result.hasOwnProperty('HalfSupportCacheList')) {
          this.HalfSupportCacheList = [...res.result.HalfSupportCacheList]
        }
        if (res.result.hasOwnProperty('DevicesInfoList')) {
          this.DevicesInfoList = res.result.DevicesInfoList
        }
        if (res.result.hasOwnProperty('PackagingLineList')) {
          this.PackagingLineList = [...res.result.PackagingLineList]
        }
      }
    },
    expandTooltip () {
      this.expand = !this.expand
    },
    closeModal () {
      this.showModal = false
      this.machine = ''
      this.pkObj = {}
      this.pkId = ''
    },
    yjInfo (m, type) {
      this.machine = m
      if (m === 'cmgw') {
        if (!this.SplitOrPalletizingList.length) {
          return
        }
        switch (type) {
          case 1:
            this.pkObj = this.SplitOrPalletizingList[0]
            this.top = this.$refs.cmgw01.getBoundingClientRect().top - 13
            this.left = this.$refs.cmgw01.getBoundingClientRect().left - 627
            this.foldlineStyle = 'foldline_right'
            break
          case 2:
            this.pkObj = this.SplitOrPalletizingList[1]
            this.top = this.$refs.cmgw02.getBoundingClientRect().top - 13
            this.left = this.$refs.cmgw02.getBoundingClientRect().left - 627
            this.foldlineStyle = 'foldline_right'
            break
          case 3:
            this.pkObj = this.SplitOrPalletizingList[2]
            this.top = this.$refs.cmgw03.getBoundingClientRect().top - 13
            this.left = this.$refs.cmgw03.getBoundingClientRect().left - 627
            this.foldlineStyle = 'foldline_right'
            break
          case 4:
            this.pkObj = this.SplitOrPalletizingList[3]
            this.top = this.$refs.cmgw04.getBoundingClientRect().top - 13
            this.left = this.$refs.cmgw04.getBoundingClientRect().left - 627
            this.foldlineStyle = 'foldline_right'
            break
        }
        this.showModal = true
      }
      if (m === 'bthc') {
        if (!this.HalfSupportCacheList.length) {
          return
        }
        switch (type) {
          case 1:
            this.pkObj = this.HalfSupportCacheList[0]
            this.top = this.$refs.bthc01.getBoundingClientRect().top - 13
            this.left = this.$refs.bthc01.getBoundingClientRect().left - 627
            this.foldlineStyle = 'foldline_right'
            this.showModal = true
            break
          case 2:
            if (this.HalfSupportCacheList.length >= 2) {
              this.pkObj = this.HalfSupportCacheList[1]
              this.top = this.$refs.bthc02.getBoundingClientRect().top - 13
              this.left = this.$refs.bthc02.getBoundingClientRect().left - 627
              this.foldlineStyle = 'foldline_right'
              this.showModal = true
            }
            break
          case 3:
            if (this.HalfSupportCacheList.length >= 3) {
              this.pkObj = this.HalfSupportCacheList[2]
              this.top = this.$refs.bthc03.getBoundingClientRect().top - 13
              this.left = this.$refs.bthc03.getBoundingClientRect().left - 627
              this.foldlineStyle = 'foldline_right'
              this.showModal = true
            }
            break
          case 4:
            if (this.HalfSupportCacheList.length >= 4) {
              this.pkObj = this.HalfSupportCacheList[3]
              this.top = this.$refs.bthc04.getBoundingClientRect().top - 13
              this.left = this.$refs.bthc04.getBoundingClientRect().left - 627
              this.foldlineStyle = 'foldline_right'
              this.showModal = true
            }
            break
          case 5:
            if (this.HalfSupportCacheList.length >= 5) {
              this.pkObj = this.HalfSupportCacheList[4]
              this.top = this.$refs.bthc05.getBoundingClientRect().top - 13
              this.left = this.$refs.bthc05.getBoundingClientRect().left - 627
              this.foldlineStyle = 'foldline_right'
              this.showModal = true
            }
            break
          case 6:
            if (this.HalfSupportCacheList.length >= 6) {
              this.pkObj = this.HalfSupportCacheList[5]
              this.top = this.$refs.bthc06.getBoundingClientRect().top - 13
              this.left = this.$refs.bthc06.getBoundingClientRect().left - 627
              this.foldlineStyle = 'foldline_right'
              this.showModal = true
            }
            break
          case 7:
            if (this.HalfSupportCacheList.length >= 7) {
              this.pkObj = this.HalfSupportCacheList[6]
              this.top = this.$refs.bthc07.getBoundingClientRect().top - 13
              this.left = this.$refs.bthc07.getBoundingClientRect().left - 627
              this.foldlineStyle = 'foldline_right'
              this.showModal = true
            }
            break
          case 8:
            if (this.HalfSupportCacheList.length >= 8) {
              this.pkObj = this.HalfSupportCacheList[7]
              this.top = this.$refs.bthc08.getBoundingClientRect().top - 13
              this.left = this.$refs.bthc08.getBoundingClientRect().left - 627
              this.foldlineStyle = 'foldline_right'
              this.showModal = true
            }
            break
        }
      }
      if (m === 'device') {
        if (JSON.stringify(this.DevicesInfoList.length) === '{}') {
          return
        }
        switch (type) {
          case 'DT01':
            this.pkObj = this.DevicesInfoList.DT01
            this.top = this.$refs.DT01.getBoundingClientRect().top - 13
            this.left = this.$refs.DT01.getBoundingClientRect().left - 627
            this.foldlineStyle = 'foldline_right'
            break
          case 'RGV01':
            this.pkObj = this.DevicesInfoList.RGV01
            this.top = this.$refs.RGV01.getBoundingClientRect().top - 13
            this.left = this.$refs.RGV01.getBoundingClientRect().left - 627
            this.foldlineStyle = 'foldline_right'
            break
          case 'FJCDJXS01':
            this.pkObj = this.DevicesInfoList.FJCDJXS01
            this.top = this.$refs.FJCDJXS01.getBoundingClientRect().top - 31
            this.left = this.$refs.FJCDJXS01.getBoundingClientRect().left - 650
            this.foldlineStyle = 'foldline_right'
            break
          case 'FJMDJXS01':
            this.pkObj = this.DevicesInfoList.FJMDJXS01
            this.top = this.$refs.FJMDJXS01.getBoundingClientRect().top - 31
            this.left = this.$refs.FJMDJXS01.getBoundingClientRect().left - 650
            this.foldlineStyle = 'foldline_right'
            break
          case 'BZJ01':
            this.pkObj = this.DevicesInfoList.BZJ01
            this.top = this.$refs.BZJ01.getBoundingClientRect().top
            this.left = this.$refs.BZJ01.getBoundingClientRect().left + 119
            this.foldlineStyle = 'foldline_left'
            break
        }
        this.showModal = true
      }
    },
    bzxInfo (e) {
      this.pkId = this.pkId === e.device_code ? '' : e.device_code
      this.pkObj = this.pkId === e.device_code ? e : {}
    },
    closeModal1 () {
      this.pkId = ''
      this.pkObj = {}
    }
  }
}
</script>

<style lang="stylus" scoped>
@import '~@css/mixin'
.n_container
    position relative
    _wh(100%, 100%)
    overflow hidden
.n_header
    _wh(100%, 8%)
    _bis('../../../images/bg_header.jpg')
.n_header_h1
    _wh(100%, 100%)
    _fj(row, flex-end)
    _bis('../../../images/top_left.png',auto,,right)
    h1
        _font(32px, 1, #fff,,right)
        padding-bottom 2%
        letter-spacing 6px
        font-family "阿里妈妈数黑体" !important
        margin-right -3px
.n_body_container
    _wh(100%, 92%)
    padding 40px 0 20px 20px
    _bis('../../../images/bg_content_l.jpg')
.n_body_container_wraper
    _wh(100%, 100%)
    position relative
    z-index 0
.center_content
    _wh(100%, 100%)
    position relative
    z-index 0
.status_wrap
    position absolute
    top -26px
    right 40px
    z-index 1
    _fj(row)
.status_item
    _fj(row)
    +.status_item
        margin-left 20px
.status_tip
    _wh(15px, 15px)
    border-radius 50%
    margin-right 10px
    box-shadow 0px 0px 4px 0px rgba(33,121,195,0.88)
.status_name
    _font(16px, 1, #fff)
.green
  background-color $green2
.yellow
  background-color $yellow
.gray
  background-color $gray1
.red
  background-color $orange
.machine_wrap
    position absolute
    z-index 2
.sh_machine
  position absolute
  top 0
  left 0
  z-index 3
  width 100%
  img
    position absolute
    top 0
    left 0
    z-index 4
    _wh(100%, auto)
.diepanji_wrap
    _wh(30%,50%)
    left 17%
    top 2%
.mtp_wrap_1
    width 7%
    img
        _wh(100%, auto)
.gtssj_wrap_1
    width: 7%;
    // left: 11%
    img
        _wh(100%, auto)
.cpj_wrap_1
    width: 11%;
    top: 8%;
    // left: 8%;
    left: -3%;
    .cpj
        width 100%
.cmd_block
  width 41%
  height 77%
  position absolute
  top: 2%;
  left: 44%;
.ktp_wrap_1
  width: 6.3%;
  top: 0;
  left: -12.5%;
  .ktp
    width 100%
    img
      _wh(100%, auto)
.cmd_wrap_1
  width: 24%;
  height: 36%;
  top: 0
  left: 0
  .robot_1
    left: 48%;
    top: 12%;
    width 1%
    height 1%
    transform: rotate(-90deg)
    img
      width: 2000%;
      top: -2000%;
      left: -1000%;
  .kongtuopan_1
    width 26%
    top 3%
    left 3%
    cursor pointer
  .zhuan_qty
    position absolute
    top -28px
    right: 0;
    z-index 8
    _wh(50px, 20px)
    background-color: #0ff;
    border: 1px solid #0ff;
    border-radius: 5px
    p
      display block
      _fj(row,center)
      _wh(100%, 100%)
      _font(13px, 13px, #fff,,center)
      white-space nowrap
    .zhuan_bg_arrow
      position: absolute;
      bottom -5px
      right 10%
      display: block;
      width: 0;
      height: 0;
      border-color: transparent;
      border-style: solid;
      border-width: 5px
      border-bottom-width: 0;
      border-top-color: #0ff;
      &:after
        content: " ";
        border-width: 5px;
  .kongtuopan_2
    left auto
    right 3%
    .zhuan_qty
      right auto
      left 0
      .zhuan_bg_arrow
        right auto
        left 10%
  .fjfztb
    width: 59%;
    top: 9%;
    left: 17%;
  .weilan1
    width: 100%;
    height: 53%;
    left: 0;
    transform rotate(180deg)
    img
      _wh(100%, 100%)
  .weilan2
    width: 100%;
    height: 53%;
    top: auto;
    bottom: -19%;
    left: 0;
    img
      _wh(100%, 100%)
  .cmdssj_1
    width: 26%
    top: 95%;
    left: 4%;
    img
      transform rotateY(180deg)
  .cmdssj_2
    left auto
    right 4%
    img
      transform rotate(0deg)
    .zhuan_qty
      right auto
      left 0
      .zhuan_bg_arrow
        right auto
        left 10%
.robot_2
    top: auto;
    bottom: -8%
    left: 48%;
    width 1%
    height 1%
    transform: rotate(-90deg)
    img
      width: 2000%;
      top: -2000%;
      left: -1000%;
.cmd_wrap_2
  left 30%
.liu_wrap
  _wh(130%, 78%)
  top 43%
  left -15%
  .cmdssj_1
    width: 4.8%;
    top: -11%;
    left: 74%;
    img
      transform rotateY(180deg)
  .cmdssj_2
    left: 84%;
    img
      transform rotate(0deg)
.rgv_line_wrap
  position absolute
  top 0
  left 0
  _wh(100%, 9%)
.rgv_line_1
  position absolute
  top 0
  left 2%
  z-index 4
  width 96%
  height 10%
  background-color #b2b2b2
  margin 0 auto
  box-shadow 0px 3px 10px #333333
  _fj(row)
.rgv_line_begine
  position absolute
  top -100%
  left 0
  z-index 5
  _wh(0.5%, 300%)
  height 300%
  background-color #b2b2b2
  border-radius 50%
  box-shadow 0px 3px 10px #333333
.rgv_line_end
  left auto
  right 0
.rgv_line_node
  _wh(0.2%, 150%)
  background-color #b2b2b2
  border-radius 50%
  box-shadow 0px 1px 4px #333333
.rgv_line_2
  top auto
  bottom 0
.rgv_line_3
  position absolute
  top 47.5%
  left 0
  z-index 4
  width 100%
  height 5%
  background-color #b2b2b2
  margin 0 auto
  box-shadow 0px 3px 10px #333333
.rgvct
  width: 10%;
  top: 0.6%;
  left: 75%;
.ggtj_wrap_1
  width 5%
  top: 9%;
  left: 7%;
  .ggtj
    width 100%
    img
      _wh(100%, auto)
  .fmj
    width: 120%;
    left: -10%;
    top 5%
.ggtj_wrap_2
  left 14%
.ggtj_wrap_3
  left 24%
.ggtj_wrap_4
  left 31%
.ggtj_wrap_5
  left 40%
.ggtj_wrap_6
  height 90%
  left 48%
  z-index 4
  .rgpt
    top 9%
    width: 200%;
    left: -50%
  .ltssj
    _wh(120%, 100%)
    left: -10%
    z-index 4
    img
      height 100%
  .fmj_bzd
    top 39%
    width: 120%;
    left: -10%;
    z-index 4
  .crj
    top: 88%;
    _wh(180%, 12.01%)
    left: -74%;
    .mtp
      width 55.56%
      left 43%
      top 21%
  .ggtj
    _wh(100%, 87.69%)
  .ggtj_list_wrap
    position relative
    _wh(100%, 12.5%)
    _fj(row,center)
    .mtp
      position relative
      z-index 4
.ggtj_wrap_7
  left 56%
.ggtj_wrap_8
  left 62%
.ggtj_wrap_9
  left 68%
.ggtj_wrap_10
  left 74%
.ggtj_wrap_11
  left 80%
.ggtj_wrap_12
  left: 76%;
  top: 49%;
  transform: rotate(-90deg);
  z-index 5
  .ggtj_list_wrap
    position relative
    _wh(100%, 12.5%)
    _fj(row,center)
    .mtp
      position relative
      z-index 4
.elect_1
  width: 4%;
  height: 2.96%;
  left: 55%;
  top: 1%;
  background-color #fff
  z-index 1
  _fj(row,center)
  img
    position static
    _wh(50%, 100%)
.elect_2
  width: 2.7%;
  height: 4.4%;
  left: 55%;
  top: 38%;
  img
    _wh(80%, 80%)
.elect_3
  width: 3.5%;
  height: 4.4%;
  left: 12%;
  top: 50%;
  img
    _wh(60%, 100%)
.elect_4
  width: 7%;
  height: 4.4%;
  left: 36%;
  top: 108%;
  img
    _wh(40%, 100%)
.elect_5
  width: 2%;
  height: 28%;
  left: 100.2%
  top: 56%;
  img
    _wh(80%, 50%)
.rotate_1
  animation rotate_1 1.5s linear 1.5s infinite alternate-reverse
@keyframes rotate_1 {
    0% {
      transform: rotateZ(-90deg)
    }
    10% {
        transform: rotateZ(-90deg)
    }
    90% {
        transform: rotateZ(-180deg)
    }
    100% {
        transform: rotateZ(-180deg)
    }
}
.rotate_2
  animation rotate_2 1.5s linear 1.5s infinite alternate-reverse
@keyframes rotate_2 {
    0% {
      transform: rotateZ(0deg)
    }
    10% {
        transform: rotateZ(0deg)
    }
    90% {
        transform: rotateZ(-90deg)
    }
    100% {
        transform: rotateZ(-90deg)
    }
}
.popup_block_wraper_1
  position absolute
  top: -4%;
  left: auto;
  right: 249%;
  z-index 10
.popup_block_wraper_2
  position absolute
  top: -137%
  left: auto;
  right: 140%;
  z-index 10
  .foldline_right
    transform: rotateY(180deg)
.popup_block_wraper_3
  position absolute
  top: -773%;
  left: auto;
  right: -550%;
  z-index: 10;
  transform: rotate(90deg);
  .foldline_right
    transform: rotateY(180deg)
</style>
