hwh
2024-09-05 7bb43fd6a2d62060c2f622e8d9396329ebaf4794
Web/src/views/device/sortPallet/index.vue
@@ -14,7 +14,7 @@
                    </el-button>
                </div>  
            </el-row>
            <el-row :span="2">
            <el-row :span="1">
                <div class="card-container">
                    <el-card class="other-box-card" v-for="deviceInfo in devicePointData" :key="deviceInfo.id">
                        <div slot="header" class="linefix">
@@ -75,27 +75,15 @@
  
  <script lang="ts" setup>
    import { ref } from 'vue';
import { GetWcsPackPlcList } from '/@/api/wcs/wcsDevice';
    const deviceList=[
        {
            id: 1,
            name: '1号机器人'
        },
        {
            id: 2,
            name: '2号机器人'
        },
        {
            id: 3,
            name: '3号机器人'
        },
    ];
const deviceList=ref<any>([]);
    const devicePointList=[
        {
          id: 1,
          deviceId:1,
          name: '1号机器人 1工位',
        deviceId:586494087331909,
        name: '1号码垛机器人 1工位',
          taskNumber: 'T000001',
          taskType: '',
          plc: '',
@@ -104,8 +92,8 @@
        },
        {
          id: 2,
          deviceId:1,
          name: '1号机器人 2工位',
        deviceId:586494087331909,
        name: '1号码垛机器人 2工位',
          taskNumber: '',
          taskType: '',
          plc: '',
@@ -114,8 +102,8 @@
        },
        {
          id: 3,
          deviceId:1,
          name: '1号机器人 3工位',
        deviceId:586494087331909,
        name: '1号码垛机器人 3工位',
          taskNumber: '',
          taskType: '',
          plc: '',
@@ -124,8 +112,8 @@
        },
        {
          id: 4,
          deviceId:2,
          name: '2号机器人 1工位',
        deviceId:586494241939525,
        name: '2号码垛机器人 1工位',
          taskNumber: 'T000001',
          taskType: '',
          plc: '',
@@ -134,8 +122,8 @@
        },
        {
          id: 5,
          deviceId:2,
          name: '2号机器人 2工位',
        deviceId:586494241939525,
        name: '2号码垛机器人 2工位',
          taskNumber: '',
          taskType: '',
          plc: '',
@@ -154,12 +142,20 @@
        }
    ];
    //输送线数据
    let devicePointFirst= devicePointList.filter(device => device.deviceId === deviceList[0].id)
    let devicePointData = ref(devicePointFirst);
    let selectedDeviceId = ref(deviceList[0].id);
let devicePointData = ref<any>([]);
const selectedDeviceId=ref<any>();
// 查询操作
const handleQuery = async () => {
    var res = await GetWcsPackPlcList();
    deviceList.value = res.data.result;
    //切换层平面
    //输送线数据
    selectedDeviceId.value = deviceList.value[0].id;
    devicePointData.value= devicePointList.filter(device => device.deviceId === selectedDeviceId.value);
};
handleQuery();
//切换
    function chooseDevice(id) {
        selectedDeviceId.value = id;
        devicePointData.value = devicePointList.filter(device => device.deviceId === id);