干燥机配套车间生产管理系统/云平台前端
baoshiwei
2 天以前 220db80e605945ced1b33443020933206b0915db
src/views/dry/bigScreen/BigWorkShop.vue
@@ -285,12 +285,18 @@
   import { router } from '/@/router'
   import { defHttp } from '/@/utils/http/axios'
   import { useUserStore } from '/@/store/modules/user'
  import {setAuthCache} from "/@/utils/auth";
  import {TENANT_ID} from "/@/enums/cacheEnum";
   const eqpNum = ref(4)
   const eqpMap = ref(new Map())
   const eqpCodes = ref(['GM001', 'GM002', 'GM003', 'GM004', 'GM005', 'GM006', 'GM007', 'GM008'])
   const eqps = ref([] as dryEquipment[])
   const title = ref('智能干燥车间')
   const userStore = useUserStore()
  const tenantId = ref(router.currentRoute.value.query.tenantId | userStore.getTenant)
  setAuthCache(TENANT_ID, tenantId.value)
  console.log('tenantId1', router.currentRoute.value.query.tenantId)
  console.log('tenantId2', userStore.getTenant)
   const envHum = ref(0)
   const envTemp = ref(0)
   const originWeight = ref(0)
@@ -301,7 +307,7 @@
   const steamAvg = ref(0)
   const wattAvg = ref(0)
   // console.log(userStore.dictItems.title)
   console.log(userStore.dictItems.title)
   userStore.dictItems.title?.forEach((element) => {
      if (element.value === 'bigscreentitle') {
         title.value = element.text
@@ -314,7 +320,7 @@
   const nowDate = ref()
   function listAllEqp() {
      listAll({ enable: 'Y' })
    defHttp.get({ url: '/dry/real/queryAllEqps', params: { tenantId: tenantId.value,enable: 'Y'  } })
         .then((result) => {
            // (`output->result`, result)
            eqps.value = result
@@ -340,9 +346,9 @@
   }
   function queryWorkShopStatistics() {
      let tenantId = userStore.getTenant
      defHttp.get({ url: '/dry/real/workshopStatistics', params: { tenantid: tenantId } }).then((res) => {
         // console.log(`output->res`, res)
      defHttp.get({ url: '/dry/real/workshopStatistics', params: { tenantid: tenantId.value } }).then((res) => {
         console.log(`output->res`, res)
         steam.value = res.steam
         watt.value = res.watt
         envHum.value = res.envHum
@@ -358,17 +364,19 @@
   }
   function queryRealTime(eqp: dryEquipment) {
      let tenantId = userStore.getTenant
      let eqpCode = eqp.code
      let queryRealTimeUrl = '/dry/real/getRealTimeData'
      defHttp.get({ url: queryRealTimeUrl, params: { tenantid: tenantId, machineid: eqpCode } }).then((res) => {
      defHttp.get({ url: queryRealTimeUrl, params: { tenantid: tenantId.value, machineid: eqpCode } }).then((res) => {
         if (res && res.trendVo) {
            res.tempValue = [res.windTemp, 100]
            res.totalRemain = res.remain
            if (res.detailList) {
            if (res.detailList && res.detailList.length > 0) {
               // 干燥剩余时间=工单预计剩余-(当前干燥时间-最后一次记录干燥时间)
               res.totalRemain = res.remain - (res.dryTime - res.detailList[res.detailList.length - 1].totalTime)
            }
            } else {
          res.totalRemain = res.remain - res.dryTime
        }
            if (res.totalRemain < 0) {
               res.totalRemain = 0
            }
@@ -408,7 +416,7 @@
   }
   function showInfo(data) {
      return data ? (data.fault ? data.fault : data.warning ? data.warning : data.orderStatus ? covertStatus(data.orderStatus+'') : '空闲') : '空闲'
      return data ? (data.fault ? data.fault : data.warning ? data.warning : data.level ? data.level : '空闲') : '空闲'
   }
  function covertStatus(status){