From 11645f5f19cad36d938d0579941500a7d7d3a360 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期三, 04 九月 2024 11:28:38 +0800
Subject: [PATCH] 绑定分拣码垛设备数据;增加分拣任务实体
---
Web/src/views/device/sortPallet/index.vue | 190 +++++++++++++++++++++++------------------------
1 files changed, 93 insertions(+), 97 deletions(-)
diff --git a/Web/src/views/device/sortPallet/index.vue b/Web/src/views/device/sortPallet/index.vue
index 0ce1640..950d163 100644
--- a/Web/src/views/device/sortPallet/index.vue
+++ b/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">
@@ -73,100 +73,96 @@
</el-container>
</template>
- <script lang="ts" setup>
- import { ref } from 'vue';
+<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宸ヤ綅',
- taskNumber: 'T000001',
- taskType: '',
- plc: '',
- wcs: '',
- status: 0
- },
- {
- id: 2,
- deviceId:1,
- name: '1鍙锋満鍣ㄤ汉 2宸ヤ綅',
- taskNumber: '',
- taskType: '',
- plc: '',
- wcs: '',
- status: 1
- },
- {
- id: 3,
- deviceId:1,
- name: '1鍙锋満鍣ㄤ汉 3宸ヤ綅',
- taskNumber: '',
- taskType: '',
- plc: '',
- wcs: '',
- status: 1
- },
- {
- id: 4,
- deviceId:2,
- name: '2鍙锋満鍣ㄤ汉 1宸ヤ綅',
- taskNumber: 'T000001',
- taskType: '',
- plc: '',
- wcs: '',
- status: 0
- },
- {
- id: 5,
- deviceId:2,
- name: '2鍙锋満鍣ㄤ汉 2宸ヤ綅',
- taskNumber: '',
- taskType: '',
- plc: '',
- wcs: '',
- status: 1
- },
- {
- id: 6,
- deviceId:3,
- name: '3鍙锋満鍣ㄤ汉 1宸ヤ綅',
- taskNumber: 'T000001',
- taskType: '',
- plc: '',
- wcs: '',
- status: 0
- }
- ];
+const devicePointList=[
+ {
+ id: 1,
+ deviceId:586494087331909,
+ name: '1鍙风爜鍨涙満鍣ㄤ汉 1宸ヤ綅',
+ taskNumber: 'T000001',
+ taskType: '',
+ plc: '',
+ wcs: '',
+ status: 0
+ },
+ {
+ id: 2,
+ deviceId:586494087331909,
+ name: '1鍙风爜鍨涙満鍣ㄤ汉 2宸ヤ綅',
+ taskNumber: '',
+ taskType: '',
+ plc: '',
+ wcs: '',
+ status: 1
+ },
+ {
+ id: 3,
+ deviceId:586494087331909,
+ name: '1鍙风爜鍨涙満鍣ㄤ汉 3宸ヤ綅',
+ taskNumber: '',
+ taskType: '',
+ plc: '',
+ wcs: '',
+ status: 1
+ },
+ {
+ id: 4,
+ deviceId:586494241939525,
+ name: '2鍙风爜鍨涙満鍣ㄤ汉 1宸ヤ綅',
+ taskNumber: 'T000001',
+ taskType: '',
+ plc: '',
+ wcs: '',
+ status: 0
+ },
+ {
+ id: 5,
+ deviceId:586494241939525,
+ name: '2鍙风爜鍨涙満鍣ㄤ汉 2宸ヤ綅',
+ taskNumber: '',
+ taskType: '',
+ plc: '',
+ wcs: '',
+ status: 1
+ },
+ {
+ id: 6,
+ deviceId:3,
+ name: '3鍙锋満鍣ㄤ汉 1宸ヤ綅',
+ taskNumber: 'T000001',
+ taskType: '',
+ plc: '',
+ wcs: '',
+ status: 0
+ }
+];
+
+let devicePointData = ref<any>([]);
+const selectedDeviceId=ref<any>();
+// 鏌ヨ鎿嶄綔
+const handleQuery = async () => {
+ var res = await GetWcsPackPlcList();
+ deviceList.value = res.data.result;
//杈撻�佺嚎鏁版嵁
- let devicePointFirst= devicePointList.filter(device => device.deviceId === deviceList[0].id)
- let devicePointData = ref(devicePointFirst);
- let selectedDeviceId = ref(deviceList[0].id);
+ 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);
- }
- </script>
-
- <style scoped>
+//鍒囨崲
+function chooseDevice(id) {
+ selectedDeviceId.value = id;
+ devicePointData.value = devicePointList.filter(device => device.deviceId === id);
+}
+</script>
+
+<style scoped>
.card-page {
width: 100%;
height: 50px;
@@ -181,13 +177,13 @@
height: 30px;
}
.card-container {
- display: grid;
- grid-template-columns: repeat(6, 1fr);
- gap: 10px;
+ display: grid;
+ grid-template-columns: repeat(6, 1fr);
+ gap: 10px;
}
- .other-box-card {
- box-sizing: border-box;
- background: linear-gradient(135deg, #66ccff, #3399ff);
+ .other-box-card {
+ box-sizing: border-box;
+ background: linear-gradient(135deg, #66ccff, #3399ff);
}
.lineStatus{
position: absolute;
@@ -226,5 +222,5 @@
.device-status-1{
background-color: red;
}
- </style>
+</style>
\ No newline at end of file
--
Gitblit v1.8.0