IPC-610
2024-10-15 79ad6097cbe4b4d6cee66dd8ad9c3c1c8f2b5243
Web/src/views/device/deviceInfo/index.vue
@@ -20,6 +20,18 @@
                     <el-switch v-model="state.boDemo" active-text="" inactive-text="演示模式"
                        @change="handleSwitchChange('boDemo', $event)"></el-switch>
                  </el-card>
                  <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
                     <el-switch v-model="state.boDrumReversal" active-text="" inactive-text="滚动反转"
                        @change="handleSwitchChange('boDrumReversal', $event)"></el-switch>
                  </el-card>
                  <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
                     <el-switch v-model="state.boOutLock" active-text="" inactive-text="出库锁定"
                        @change="handleSwitchChange('boOutLock', $event)"></el-switch>
                  </el-card>
                  <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
                     <el-switch v-model="state.boEnterLock" active-text="" inactive-text="入库锁定"
                        @change="handleSwitchChange('boEnterLock', $event)"></el-switch>
                  </el-card>
               </el-collapse-item>
               <el-collapse-item title="堆垛机" name="2">
@@ -81,6 +93,7 @@
import { listStatus, listPosition } from '/@/api/wcs/wcsPlc';
import { signalR } from './signalR';
import { cellsDataLine, cellsDataOne, cellsDataTwo, cellsDataThree } from './data';
import { ElMessage } from "element-plus";
const state = ref<any>({});
const stackers = ref<any>({});
@@ -100,13 +113,14 @@
         if (foundCell) {
            //修改高度
            foundCell.BoxHeight = s.boxHeight;
            foundCell.EndLocat = s.endLocat;
         }
      }
      else if (s.type == 1) {
         // 更新输送线数据
         updateCellData(cellsDataOne, s);
         updateCellData(cellsDataTwo, s);
         updateCellData(cellsDataThree, s);
         updateCellData(cellsDataOne.value, s);
         updateCellData(cellsDataTwo.value, s);
         updateCellData(cellsDataThree.value, s);
      }
   });
};
@@ -135,15 +149,20 @@
   signalR.off('UpdateService');
   signalR.on('UpdateService', (data: any) => {
      state.value = data;
      if (data.error) {
         ElMessage({
            message: data.error,
            type: "error",
         });
      }
   });
   signalR.off('PublicPosition');
   signalR.on('PublicPosition', (data: any) => {
      if (data.type == 1) {
         // 更新输送线数据
         updateCellData(cellsDataOne, data);
         updateCellData(cellsDataTwo, data);
         updateCellData(cellsDataThree, data);
         updateCellData(cellsDataOne.value, data);
         updateCellData(cellsDataTwo.value, data);
         updateCellData(cellsDataThree.value, data);
      }
      else if (data.type == 0) {
         // 更新堆垛机数据
@@ -166,6 +185,7 @@
   debugger;
   const foundCell = cellsDataLine.value.find(cell => cell.Code === data.stationNum);
   if (foundCell) {
      foundCell.EndLocat = data.endLocat;
      const startHeight = foundCell.BoxHeight;
      const targetHeight = data.boxHeight;
      const duration = 1000; // 动画持续时间(毫秒)
@@ -204,7 +224,7 @@
const activeName = ['1', '2', '3'];
//输送线数据
let cellsData = ref(cellsDataOne);
let cellsData = cellsDataOne.value;
// 层平面状态
@@ -216,8 +236,8 @@
//切换层平面
function floorTogglePlain(buttonNumber) {
   const floorData = [cellsDataOne, cellsDataTwo, cellsDataThree];
   const floorData = [cellsDataOne.value, cellsDataTwo.value, cellsDataThree.value];
   debugger;
   if (buttonNumber >= 1 && buttonNumber <= 3) {
      const index = buttonNumber - 1;
      floorStates.value = {
@@ -225,7 +245,7 @@
         isPlain2: index !== 1,
         isPlain3: index !== 2
      };
      cellsData.value = floorData[index];
      cellsData = floorData[index];
   }
}
</script>