gaoshp
2024-11-03 3e091224ab26252d8624b42b461ba773ee8bee0f
src/views/home/widgets/components/mdcEquipmentRun.vue
@@ -2,14 +2,14 @@
 * @Author: lzhe lzhe@example.com
 * @Date: 2024-04-16 15:22:46
 * @LastEditors: lzhe lzhe@example.com
 * @LastEditTime: 2024-06-21 01:45:18
 * @LastEditTime: 2024-06-24 22:33:49
 * @FilePath: /CPSnew/smart-web/src/views/home/widgets/components/mdcDeviceStatus.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
   <el-card shadow="hover" header="设备稼动率排名" style="height: 100%;" class="running">
      <div class="running-icon">
         <el-icon><RefreshLeft /></el-icon>
         <el-icon @click="refreshBtn"><RefreshLeft /></el-icon>
         <el-icon @click="showSearch"><Filter /></el-icon>
      </div>
      <div class="no-list">{{oeeTitle}}</div>
@@ -37,6 +37,7 @@
                      :data="parentData"
                      :props="{ label: 'title' }"
                      style="width:80%;"
                     :default-checked-keys="selectedIds"
                     :render-after-expand="false" />
               </div>
               <div>
@@ -80,6 +81,7 @@
            parentData: {},
            list: [],
            timeLevelList: [],
            selectedIds: [],
            topList: [],
            search: {
               workStationIdList: [],
@@ -87,8 +89,8 @@
               top: ""
            },
            isSearch: false,
            timeLevel: "",
            top: "",
            timeLevel: "24",
            top: "5",
            apiResource: {
               workStationIdList: []
            },
@@ -145,6 +147,9 @@
         }
      },
      methods: {
         refreshBtn() {
            this.getParentData();
         },
         showSearch() {
            this.search.timeLevel = this.timeLevel;
            this.search.top = this.top;
@@ -152,7 +157,7 @@
         },
         serchSubmit() {
            this.apiResource = this.search;
            this.getRunData();
            this.getRunData('search');
         },
         setCurrentKey(v) {
            if (this.firstWorkKey) return
@@ -186,7 +191,7 @@
            return newData
         },
         getParentData() {
            this.$HTTP.post('/api/blade-cps/group/groupWorkstation/type', {
            this.$HTTP.post('/api/smis/group/groupWorkstation/type', {
               groupCategory: 1,
               groupType: "group_workstation"
            }).then(({ code, data }) => {
@@ -211,8 +216,15 @@
               }
            })
         },
         getRunData() {
            var ids = this.extractLastLevelIds(this.parentData);
         getRunData(type) {
            this.isSearch = false;
            if(type != "search") {
               var ids = this.extractLastLevelIds(this.parentData);
               this.selectedIds = ids;
               this.search.workStationIdList = ids;
            }else {
               var ids = this.search.workStationIdList;
            }
            var obj = {
               timeLevel: 24,
               top: 7,
@@ -220,9 +232,7 @@
            }
            this.$HTTP.post(`/api/blade-visual/status/oee-top`,obj).then(res=> {
               if(res.code == 200) {
                  this.isSearch = false;
                  var recordDom = document.getElementById('equipment');
                  if(res.data.categories.length == 0) return;
                  this.option.yAxis.data = res.data.categories;
                  this.option.series[0].data = res.data.series[0].data;
                  this.oeeTitle = res.data.series[0].name;