8个文件已修改
3 文件已重命名
10个文件已添加
| | |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.29:8848 |
| | | server-addr: 10.153.19.44:8848 |
| | | gateway: |
| | | discovery: |
| | | locator: |
| | |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.29:8848 |
| | | server-addr: 10.153.19.44:8848 |
| | | gateway: |
| | | discovery: |
| | | locator: |
File was renamed from JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCRinse.java |
| | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.mes.common.S7object; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.md.entity.Machine; |
| | | import com.mes.md.entity.Tasking; |
| | | import com.mes.md.mapper.MachineMapper; |
| | | import com.mes.md.service.TaskingService; |
| | | import com.mes.tools.WebSocketServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class PLCRinse { |
| | | public class PLCCleaning { |
| | | |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | @Autowired |
| | | TaskingService taskingService; |
| | | @Autowired |
| | | MachineMapper machineMapper; |
| | | //@Scheduled(fixedDelay = 500) |
| | | public void plcRinse() { |
| | | //磨边线é度 |
| | |
| | | } |
| | | |
| | | } |
| | | //@Scheduled(fixedDelay = 1000) |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void edgingWeb() { |
| | | //è·åæ¥è¦ç¶æ |
| | | String warning = plcParameterObject.getPlcParameter("rinseWarning").getValue(); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | if (!Objects.equals(warning, "0")) { |
| | | //log.info("æ¥è¦ä¿¡æ¯ï¼"+warning); |
| | | jsonObject.append("rinseWarning", warning); |
| | | } |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("rinse"); |
| | | // String warning = plcParameterObject.getPlcParameter("rinseWarning").getValue(); |
| | | // if (!Objects.equals(warning, "0")) { |
| | | // //log.info("æ¥è¦ä¿¡æ¯ï¼"+warning); |
| | | // jsonObject.append("rinseWarning", warning); |
| | | // } |
| | | Machine machine=machineMapper.selectById(7L); |
| | | List<Tasking> taskingList=taskingService.findMachineTask(machine); |
| | | jsonObject.append("taskingList", taskingList); |
| | | jsonObject.append("machine", machine); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cleaning"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.mes.common.S7object; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.md.entity.Machine; |
| | | import com.mes.md.entity.Tasking; |
| | | import com.mes.md.mapper.MachineMapper; |
| | | import com.mes.md.service.TaskingService; |
| | | import com.mes.tools.WebSocketServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | @Autowired |
| | | TaskingService taskingService; |
| | | @Autowired |
| | | MachineMapper machineMapper; |
| | | //@Scheduled(fixedDelay = 500) |
| | | public void PLCEdging() { |
| | | //磨边è¿ç请æ±ä¿¡å· |
| | |
| | | } |
| | | |
| | | } |
| | | //@Scheduled(fixedDelay = 1000) |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void edgingWeb() { |
| | | //è·åå½åä»»å¡è¡¨ææ°çä¸åä»»å¡ç¶æ |
| | | //è·åæ¥è¦ç¶æ |
| | | String warning = plcParameterObject.getPlcParameter("warning").getValue(); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | if (!Objects.equals(warning, "0")) { |
| | | //log.info("æ¥è¦ä¿¡æ¯ï¼"+warning); |
| | | jsonObject.append("warning", warning); |
| | | } |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("scanQrCode"); |
| | | // String warning = plcParameterObject.getPlcParameter("warning").getValue(); |
| | | // if (!Objects.equals(warning, "0")) { |
| | | // //log.info("æ¥è¦ä¿¡æ¯ï¼"+warning); |
| | | // jsonObject.append("warning", warning); |
| | | // } |
| | | Machine machine=machineMapper.selectById(5L); |
| | | List<Tasking> taskingList=taskingService.findMachineTask(machine); |
| | | jsonObject.append("taskingList", taskingList); |
| | | jsonObject.append("machine", machine); |
| | | Machine machineQr=machineMapper.selectById(3L); |
| | | List<Tasking> taskingListQr=taskingService.findMachineTask(machineQr); |
| | | jsonObject.append("taskingListQr",taskingListQr ); |
| | | jsonObject.append("machineQR",machineQr ); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("edging"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
File was renamed from JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCTurn.java |
| | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.mes.common.S7object; |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.md.entity.Machine; |
| | | import com.mes.md.entity.Tasking; |
| | | import com.mes.md.mapper.MachineMapper; |
| | | import com.mes.md.service.TaskingService; |
| | | import com.mes.tools.WebSocketServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class PLCTurn { |
| | | public class PLCFlipSlice { |
| | | |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | @Autowired |
| | | TaskingService taskingService; |
| | | @Autowired |
| | | MachineMapper machineMapper; |
| | | //@Scheduled(fixedDelay = 500) |
| | | public void plcTurn() { |
| | | //æ¸
æ´æºé度 |
| | |
| | | } |
| | | |
| | | } |
| | | //@Scheduled(fixedDelay = 1000) |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void turnWeb() { |
| | | //è·åæ¥è¦ç¶æ |
| | | String warning = plcParameterObject.getPlcParameter("turnWarning").getValue(); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | if (!Objects.equals(warning, "0")) { |
| | | //log.info("æ¥è¦ä¿¡æ¯ï¼"+warning); |
| | | jsonObject.append("turnWarning", warning); |
| | | } |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("turn"); |
| | | // String warning = plcParameterObject.getPlcParameter("turnWarning").getValue(); |
| | | // |
| | | // if (!Objects.equals(warning, "0")) { |
| | | // //log.info("æ¥è¦ä¿¡æ¯ï¼"+warning); |
| | | // jsonObject.append("turnWarning", warning); |
| | | // } |
| | | Machine machine=machineMapper.selectById(25L); |
| | | List<Tasking> taskingList=taskingService.findMachineTask(machine); |
| | | jsonObject.append("taskingList", taskingList); |
| | | jsonObject.append("machine", machine); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("flipSlice"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
File was renamed from JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCScanQR.java |
| | |
| | | package com.mes.job; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.mes.common.S7object; |
| | | import com.mes.md.entity.Machine; |
| | | import com.mes.md.entity.Tasking; |
| | | import com.mes.md.mapper.MachineMapper; |
| | | import com.mes.md.service.TaskingService; |
| | | import com.mes.tools.WebSocketServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import com.mes.device.PlcParameterObject; |
| | | |
| | |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class PLCScanQR { |
| | | public class PLCScanQrCodesReport { |
| | | |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | @Autowired |
| | | TaskingService taskingService; |
| | | @Autowired |
| | | MachineMapper machineMapper; |
| | | //@Scheduled(fixedDelay = 500) |
| | | public void pLCScanQR() { |
| | | //è·åå½åä»»å¡è¡¨ææ°çä¸åä»»å¡ç¶æ |
| | |
| | | } |
| | | |
| | | } |
| | | //@Scheduled(fixedDelay = 1000) |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void scanQrCode() { |
| | | //è·åå½åä»»å¡è¡¨ææ°çä¸åä»»å¡ç¶æ |
| | | //è·åæ¥è¦ç¶æ |
| | | String warning = plcParameterObject.getPlcParameter("warning").getValue(); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | if (!Objects.equals(warning, "0")) { |
| | | //log.info("æ¥è¦ä¿¡æ¯ï¼"+warning); |
| | | jsonObject.append("warning", warning); |
| | | } |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("scanQrCode"); |
| | | //è·åæ¥è¦ç¶æ |
| | | // String warning = plcParameterObject.getPlcParameter("warning").getValue(); |
| | | |
| | | // if (!Objects.equals(warning, "0")) { |
| | | // //log.info("æ¥è¦ä¿¡æ¯ï¼"+warning); |
| | | // jsonObject.append("warning", warning); |
| | | // } |
| | | Machine machine=machineMapper.selectById(25L); |
| | | List<Tasking> taskingList=taskingService.findMachineTask(machine); |
| | | jsonObject.append("taskingList", taskingList); |
| | | jsonObject.append("machine", machine); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("scanQrCodesReport"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.29:8848 |
| | | server-addr: 10.153.19.44:8848 |
| | | application: |
| | | name: deviceInteraction |
| | | redis: |
| | | database: 0 |
| | | host: 10.153.19.29 |
| | | host: 10.153.19.44 |
| | | port: 6379 |
| | | password: 123456 |
| | |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | server-addr: 10.153.19.29:8848 |
| | | server-addr: 10.153.19.44:8848 |
| | | application: |
| | | name: deviceInteraction |
| | | redis: |
| | | database: 0 |
| | | host: 10.153.19.29 |
| | | host: 10.153.19.44 |
| | | port: 6379 |
| | | password: 123456 |
| | |
| | | machine: { |
| | | upperSlice:'èªå¨ä¸çæº', |
| | | scanQrCodesIdentify:'æ«ç è¯å«', |
| | | scanQredging:'æ«ç 磨边', |
| | | edging:'磨边æº', |
| | | cleaning:'æ¸
æ´æº', |
| | | flipSlice:'ç¿»çå°', |
| | |
| | | children: [ |
| | | { |
| | | /*----------- èªå¨ä¸ç ----------------*/ |
| | | path: 'UpperSlice', |
| | | name: 'upperSlice', |
| | | component: () => import('../views/UpperSlice/upperSlice.vue'), |
| | | path: 'MechanicalArm', |
| | | name: 'mechanicalArm', |
| | | component: () => import('../views/MechanicalArm/mechanicalArm.vue'), |
| | | children: [ |
| | | { |
| | | path: '/UpperSlice/upperSlice', |
| | | name: 'upperSlice', |
| | | component: () => import('../views/UpperSlice/upperSlice.vue'), |
| | | path: '/mechanicalArm/mechanicalArm', |
| | | name: 'mechanicalArm', |
| | | component: () => import('../views/MechanicalArm/mechanicalArm.vue'), |
| | | } |
| | | ] |
| | | }, |
| | |
| | | component: () => import('../views/Cleaning/cleaning.vue'), |
| | | } |
| | | ] |
| | | },flipSlice |
| | | }, |
| | | { |
| | | /*----------- ç¿»çå° ----------------*/ |
| | | path: 'FlipSlice', |
| | | path: 'FlipSlice', |
| | | name: 'flipSlice', |
| | | component: () => import('../views/FlipSlice/flipSlice.vue'), |
| | | children: [ |
| | |
| | | ] |
| | | }, |
| | | { |
| | | /*----------- æ«ç 2 ----------------*/ |
| | | path: 'ScanQrCodesVerify', |
| | | name: 'scanQrCodesVerify', |
| | | component: () => import('../views/ScanQrCodesVerify/scanQrCodesVerify.vue'), |
| | | /*----------- ç¿»çå° ----------------*/ |
| | | path: 'ScanQrCodesReport', |
| | | name: 'scanQrCodesReport', |
| | | component: () => import('../views/ScanQrCodesReport/scanQrCodesReport.vue'), |
| | | children: [ |
| | | { |
| | | path: '/ScanQrCodesVerify/scanQrCodesVerify', |
| | | name: 'scanQrCodesVerify', |
| | | component: () => import('../views/ScanQrCodesVerify/scanQrCodesVerify.vue'), |
| | | path: '/ScanQrCodesReport/scanQrCodesReport', |
| | | name: 'scanQrCodesReport', |
| | | component: () => import('../views/ScanQrCodesReport/scanQrCodesReport.vue'), |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | /*----------- èªå¨ææ æº ----------------*/ |
| | | path: 'Marking', |
| | | name: 'marking', |
| | | component: () => import('../views/Marking/marking.vue'), |
| | | children: [ |
| | | { |
| | | path: '/Marking/marking', |
| | | name: 'marking', |
| | | component: () => import('../views/Marking/marking.vue'), |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | /*----------- èªå¨ä¸å°æº ----------------*/ |
| | | path: 'SilkScreen', |
| | | name: 'silkScreen', |
| | | component: () => import('../views/SilkScreen/silkScreen.vue'), |
| | | children: [ |
| | | { |
| | | path: '/SilkScreen/silkScreen', |
| | | name: 'silkScreen', |
| | | component: () => import('../views/SilkScreen/silkScreen.vue'), |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | /*----------- èªå¨ç¹è¶æº ----------------*/ |
| | | path: 'GlueDispenser', |
| | | name: 'glueDispenser', |
| | | component: () => import('../views/GlueDispenser/glueDispenser.vue'), |
| | | children: [ |
| | | { |
| | | path: '/GlueDispenser/glueDispenser', |
| | | name: 'glueDispenser', |
| | | component: () => import('../views/GlueDispenser/glueDispenser.vue'), |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | /*----------- ç干线 ----------------*/ |
| | | path: 'Drying', |
| | | name: 'drying', |
| | | component: () => import('../views/Drying/drying.vue'), |
| | | children: [ |
| | | { |
| | | path: '/Drying/drying', |
| | | name: 'drying', |
| | | component: () => import('../views/Drying/drying.vue'), |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | /*----------- æè½¬å° ----------------*/ |
| | | path: 'Rotate', |
| | | name: 'rotate', |
| | | component: () => import('../views/Rotate/rotate.vue'), |
| | | children: [ |
| | | { |
| | | path: '/Rotate/rotate', |
| | | name: 'rotate', |
| | | component: () => import('../views/Rotate/rotate.vue'), |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | /*----------- èªå¨è´´èæº ----------------*/ |
| | | path: 'Lamination', |
| | | name: 'lamination', |
| | | component: () => import('../views/Lamination/lamination.vue'), |
| | | children: [ |
| | | { |
| | | path: '/Lamination/lamination', |
| | | name: 'lamination', |
| | | component: () => import('../views/Lamination/lamination.vue'), |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | /*----------- æ¥å·¥ç®¡ç ----------------*/ |
| | | path: 'ZiDongShangpian', |
| | | name: 'zidongshangpian', |
| | | component: () => import('../views/Marking/marking.vue'), |
| | | children: [ |
| | | { |
| | | path: '/Marking/marking', |
| | | name: 'marking', |
| | | component: () => import('../views/Marking/marking.vue'), |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | /*----------- æ¥è¡¨ç®¡ç ----------------*/ |
| | | path: 'ZiDongShangpian', |
| | | name: 'zidongshangpian', |
| | | component: () => import('../views/Marking/marking.vue'), |
| | | children: [ |
| | | { |
| | | path: '/Marking/marking', |
| | | name: 'marking', |
| | | component: () => import('../views/Marking/marking.vue'), |
| | | } |
| | | ] |
| | | }, |
| | | // { |
| | | // /*----------- æ«ç 2 ----------------*/ |
| | | // path: 'ScanQrCodesVerify', |
| | | // name: 'scanQrCodesVerify', |
| | | // component: () => import('../views/ScanQrCodesVerify/scanQrCodesVerify.vue'), |
| | | // children: [ |
| | | // { |
| | | // path: '/ScanQrCodesVerify/scanQrCodesVerify', |
| | | // name: 'scanQrCodesVerify', |
| | | // component: () => import('../views/ScanQrCodesVerify/scanQrCodesVerify.vue'), |
| | | // } |
| | | // ] |
| | | // }, |
| | | // { |
| | | // /*----------- èªå¨ææ æº ----------------*/ |
| | | // path: 'Marking', |
| | | // name: 'marking', |
| | | // component: () => import('../views/Marking/marking.vue'), |
| | | // children: [ |
| | | // { |
| | | // path: '/Marking/marking', |
| | | // name: 'marking', |
| | | // component: () => import('../views/Marking/marking.vue'), |
| | | // } |
| | | // ] |
| | | // }, |
| | | // { |
| | | // /*----------- èªå¨ä¸å°æº ----------------*/ |
| | | // path: 'SilkScreen', |
| | | // name: 'silkScreen', |
| | | // component: () => import('../views/SilkScreen/silkScreen.vue'), |
| | | // children: [ |
| | | // { |
| | | // path: '/SilkScreen/silkScreen', |
| | | // name: 'silkScreen', |
| | | // component: () => import('../views/SilkScreen/silkScreen.vue'), |
| | | // } |
| | | // ] |
| | | // }, |
| | | // { |
| | | // /*----------- èªå¨ç¹è¶æº ----------------*/ |
| | | // path: 'GlueDispenser', |
| | | // name: 'glueDispenser', |
| | | // component: () => import('../views/GlueDispenser/glueDispenser.vue'), |
| | | // children: [ |
| | | // { |
| | | // path: '/GlueDispenser/glueDispenser', |
| | | // name: 'glueDispenser', |
| | | // component: () => import('../views/GlueDispenser/glueDispenser.vue'), |
| | | // } |
| | | // ] |
| | | // }, |
| | | // { |
| | | // /*----------- ç干线 ----------------*/ |
| | | // path: 'Drying', |
| | | // name: 'drying', |
| | | // component: () => import('../views/Drying/drying.vue'), |
| | | // children: [ |
| | | // { |
| | | // path: '/Drying/drying', |
| | | // name: 'drying', |
| | | // component: () => import('../views/Drying/drying.vue'), |
| | | // } |
| | | // ] |
| | | // }, |
| | | // { |
| | | // /*----------- æè½¬å° ----------------*/ |
| | | // path: 'Rotate', |
| | | // name: 'rotate', |
| | | // component: () => import('../views/Rotate/rotate.vue'), |
| | | // children: [ |
| | | // { |
| | | // path: '/Rotate/rotate', |
| | | // name: 'rotate', |
| | | // component: () => import('../views/Rotate/rotate.vue'), |
| | | // } |
| | | // ] |
| | | // }, |
| | | // { |
| | | // /*----------- èªå¨è´´èæº ----------------*/ |
| | | // path: 'Lamination', |
| | | // name: 'lamination', |
| | | // component: () => import('../views/Lamination/lamination.vue'), |
| | | // children: [ |
| | | // { |
| | | // path: '/Lamination/lamination', |
| | | // name: 'lamination', |
| | | // component: () => import('../views/Lamination/lamination.vue'), |
| | | // } |
| | | // ] |
| | | // }, |
| | | // { |
| | | // /*----------- æ¥å·¥ç®¡ç ----------------*/ |
| | | // path: 'ZiDongShangpian', |
| | | // name: 'zidongshangpian', |
| | | // component: () => import('../views/Marking/marking.vue'), |
| | | // children: [ |
| | | // { |
| | | // path: '/Marking/marking', |
| | | // name: 'marking', |
| | | // component: () => import('../views/Marking/marking.vue'), |
| | | // } |
| | | // ] |
| | | // }, |
| | | // { |
| | | // /*----------- æ¥è¡¨ç®¡ç ----------------*/ |
| | | // path: 'ZiDongShangpian', |
| | | // name: 'zidongshangpian', |
| | | // component: () => import('../views/Marking/marking.vue'), |
| | | // children: [ |
| | | // { |
| | | // path: '/Marking/marking', |
| | | // name: 'marking', |
| | | // component: () => import('../views/Marking/marking.vue'), |
| | | // } |
| | | // ] |
| | | // }, |
| | | /*----------- ç³»ç»ç®¡ç ----------------*/ |
| | | { |
| | | path: 'User', |
New file |
| | |
| | | <!-- ææ æº --> |
| | | <script setup> |
| | | import request from "@/utils/request"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import { reactive, ref, onMounted, onBeforeUnmount,onUnmounted } from 'vue' |
| | | import { useI18n } from 'vue-i18n' |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const { t } = useI18n() |
| | | const requestData = reactive({ |
| | | account: '', |
| | | password: '', |
| | | }); |
| | | const loadData = ref([]); |
| | | const findMachine = ref([]); |
| | | const machineId=7;//å½å页é¢ç设å¤ID |
| | | //使ç¨WebSocketæ¹å¼å±ç¤ºæ°æ® |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/cleaning`; |
| | | // å®ä¹æ¶æ¯å¤ç彿°ï¼æ´æ° receivedData åé |
| | | const handleMessage = (data) => { |
| | | // æ´æ° tableData çæ°æ® |
| | | loadData.value = data.taskingList[0]; |
| | | findMachine.value = data.machine[0]; |
| | | // console.log(data); |
| | | }; |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("å
³éäº") |
| | | closeWebSocket(); |
| | | }); |
| | | |
| | | onMounted(async () => { |
| | | //使ç¨WebSocketæ¹å¼å±ç¤ºæ°æ® |
| | | socket = initializeWebSocket(socketUrl, handleMessage);// åå§å WebSocketï¼å¹¶ä¼ éæ¶æ¯å¤ç彿° |
| | | |
| | | |
| | | //ä½¿ç¨æ¥å£æ¹å¼å±ç¤ºæ°æ® |
| | | //load(); |
| | | }); |
| | | |
| | | // //è·åæ°æ® |
| | | // const load = async() => { |
| | | // //è·å设å¤ä»»å¡æ°æ® |
| | | // try { |
| | | // const response = await request.post('/deviceInteraction/tasking/findMachineTask', |
| | | // { |
| | | // "id": 11 |
| | | // }); // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | // if (response.code === 200) { |
| | | // loadData.value.findTaskingData= response.data; |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // } |
| | | // } catch (error) { |
| | | // // console.error('Error fetching rects :', error); |
| | | // } |
| | | // //è·å设å¤ç¶æ |
| | | // try { |
| | | // const response = await request.post('/deviceInteraction/machine/findMachine', |
| | | // { |
| | | // "id": 11 |
| | | // }); // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | // if (response.code === 200) { |
| | | // findMachine.value= response.data; |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // } |
| | | // } catch (error) { |
| | | // // console.error('Error fetching rects :', error); |
| | | // } |
| | | // } |
| | | //ä¿®æ¹å·¥ä½ç¶æ ã失败/æ£å¨å·¥ä½/å®å·¥ã |
| | | const workStatus = async(row,state) => { |
| | | let url; |
| | | if(state=="éå"){ |
| | | url="/deviceInteraction/tasking/loseMachineTask"; |
| | | }else if(state=="æ£å¨å·¥ä½"){ |
| | | url="/deviceInteraction/tasking/startMachineTask"; |
| | | }else if(state=="å®å·¥"){ |
| | | url="/deviceInteraction/tasking/finishMachineTask"; |
| | | }else{ |
| | | return; |
| | | } |
| | | ElMessageBox.confirm( |
| | | t('functionState.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('functionState.sure'), |
| | | cancelButtonText: t('functionState.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //å¼å§ä¿®æ¹ |
| | | request.post(url, |
| | | { |
| | | "id": machineId |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('functionState.cancel'), |
| | | }) |
| | | }) |
| | | |
| | | } |
| | | |
| | | //å¼å·¥/æå |
| | | const machineStatus = async(state) => { |
| | | ElMessageBox.confirm( |
| | | t('functionState.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('functionState.sure'), |
| | | cancelButtonText: t('functionState.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //ä¸çº¿æ¥å£ |
| | | request.post("/deviceInteraction/machine/updateMachineState", |
| | | { |
| | | "id": machineId, |
| | | "state": state |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('functionState.cancel'), |
| | | }) |
| | | }) |
| | | } |
| | | //ç ´æ |
| | | const damagedTask = async(row) => { |
| | | ElMessageBox.confirm( |
| | | t('functionState.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('functionState.sure'), |
| | | cancelButtonText: t('functionState.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //ä¸çº¿æ¥å£ |
| | | request.post("/deviceInteraction/tasking/damagedTask", |
| | | { |
| | | "glassId": row.glassId |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('functionState.cancel'), |
| | | }) |
| | | }) |
| | | } |
| | | //ä¸çº¿(æ¿èµ°) |
| | | const glassDownLine = async(row) => { |
| | | ElMessageBox.confirm( |
| | | t('functionState.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('functionState.sure'), |
| | | cancelButtonText: t('functionState.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //ä¸çº¿æ¥å£ |
| | | request.post("/deviceInteraction/tasking/glassDownLine", |
| | | { |
| | | "glassId": row.glassId, |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('functionState.cancel'), |
| | | }) |
| | | }) |
| | | } |
| | | //ä¸çº¿ |
| | | const topLine = async() => { |
| | | |
| | | } |
| | | |
| | | </script> |
| | | <template> |
| | | <div ref="content" style="padding:0 20px;"> |
| | | <div id="div-title" style="font-size: 20px; font-weight: bold; margin:10px 0 10px 0;padding-left: 20px;"> |
| | | {{$t('machine.cleaning')}} |
| | | </div> |
| | | <hr /> |
| | | <br> |
| | | <div id="search" > |
| | | <!-- åè½ --> |
| | | <el-button :type="(findMachine['state']=='æå'?'danger':'success')" id="ButtonMachineStatus" @click="machineStatus((findMachine['state']=='æå'?'å¼å·¥':'æå'))">{{findMachine['state']=='å¼å·¥'?$t('functionState.start'):$t('functionState.stop')}}</el-button> |
| | | <el-button type="primary" id="ButtonTopLine" @click="topLine">{{$t('functionState.topLine')}}</el-button> |
| | | <!-- <el-button type="primary" id="searchButton" @click="downLine('ä¸çº¿')">ä¸çº¿</el-button> |
| | | <el-button type="primary" id="searchButton" @click="workStatus('ç ´æ')">ç ´æ</el-button> |
| | | <el-button type="primary" id="searchButton" @click="workStatus('å®å·¥')">å®å·¥</el-button> --> |
| | | </div> |
| | | <div id="main-body" style="min-height:240px;"> |
| | | <!-- è¡¨æ ¼å
容 --> |
| | | <el-table :data="loadData" stripe |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }" |
| | | :cell-style="{ textAlign: 'center' }"> |
| | | <!-- <el-table-column type="selection" min-width="30" /> --> |
| | | <el-table-column type="index" :label="$t('glassInfo.number')" min-width="30" /> |
| | | <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')"/> |
| | | <el-table-column prop="taskType" :label="$t('glassInfo.taskType')"/> |
| | | <el-table-column prop="glassId" :label="$t('glassInfo.glassId')"/> |
| | | <el-table-column prop="length" :label="$t('glassInfo.length')"/> |
| | | <el-table-column prop="width" :label="$t('glassInfo.width')"/> |
| | | <el-table-column prop="thickness" :label="$t('glassInfo.thickness')"/> |
| | | <el-table-column prop="workState" :label="$t('glassInfo.workState')"/> |
| | | <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, 'éå')" >{{$t('functionState.anew')}}</el-button> |
| | | <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, 'å®å·¥')">{{$t('functionState.finish')}}</el-button> |
| | | <el-button size="mini" link type="primary" plain @click="damagedTask(scope.row)">{{$t('functionState.lose')}}</el-button> |
| | | <el-button size="mini" link type="primary" plain @click="glassDownLine(scope.row)">{{$t('functionState.downLine')}}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <div id="main-body" |
| | | style="width: 70%; height: 400px;margin:20px auto;background-image: url(../../src/assets/æ¸
æ´æº.png) ;background-size: 100% 100%;"> |
| | | <!-- ç»å¾å
容 --> |
| | | <div style="width: 200px; height: 100px; background-color: red; position: relative; top: 170px; left: 28px"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | table { |
| | | text-align: center; |
| | | width: 100%; |
| | | height: 100%; |
| | | border-collapse: collapse; |
| | | border-spacing: 0; |
| | | } |
| | | |
| | | table td { |
| | | text-align: center; |
| | | } |
| | | |
| | | #main-body { |
| | | width: 100%; |
| | | height: 100%; |
| | | border: 1px solid #ccc; |
| | | margin-top: 25px; |
| | | } |
| | | |
| | | #searchButton { |
| | | width: 100px; |
| | | height: 40px; |
| | | font-size: 16px; |
| | | border-radius: 5px; |
| | | background-color: #409EFF; |
| | | color: #fff; |
| | | border: none; |
| | | cursor: pointer; |
| | | } |
| | | </style> |
New file |
| | |
| | | <!-- ææ æº --> |
| | | <script setup> |
| | | import request from "@/utils/request"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import { reactive, ref, onMounted, onBeforeUnmount,onUnmounted } from 'vue' |
| | | import { useI18n } from 'vue-i18n' |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const { t } = useI18n() |
| | | const requestData = reactive({ |
| | | account: '', |
| | | password: '', |
| | | }); |
| | | const loadData = ref([]); |
| | | const findMachine = ref([]); |
| | | const machineId=5;//å½å页é¢ç设å¤ID |
| | | //使ç¨WebSocketæ¹å¼å±ç¤ºæ°æ® |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/edging`; |
| | | // å®ä¹æ¶æ¯å¤ç彿°ï¼æ´æ° receivedData åé |
| | | const handleMessage = (data) => { |
| | | // æ´æ° tableData çæ°æ® |
| | | loadData.value = data.taskingList[0]; |
| | | findMachine.value = data.machine[0]; |
| | | }; |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("å
³éäº") |
| | | closeWebSocket(); |
| | | }); |
| | | |
| | | onMounted(async () => { |
| | | //使ç¨WebSocketæ¹å¼å±ç¤ºæ°æ® |
| | | socket = initializeWebSocket(socketUrl, handleMessage);// åå§å WebSocketï¼å¹¶ä¼ éæ¶æ¯å¤ç彿° |
| | | |
| | | //ä½¿ç¨æ¥å£æ¹å¼å±ç¤ºæ°æ® |
| | | //load(); |
| | | }); |
| | | |
| | | // //è·åæ°æ® |
| | | // const load = async() => { |
| | | // //è·å设å¤ä»»å¡æ°æ® |
| | | // try { |
| | | // const response = await request.post('/deviceInteraction/tasking/findMachineTask', |
| | | // { |
| | | // "id": 11 |
| | | // }); // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | // if (response.code === 200) { |
| | | // loadData.value.findTaskingData= response.data; |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // } |
| | | // } catch (error) { |
| | | // // console.error('Error fetching rects :', error); |
| | | // } |
| | | // //è·å设å¤ç¶æ |
| | | // try { |
| | | // const response = await request.post('/deviceInteraction/machine/findMachine', |
| | | // { |
| | | // "id": 11 |
| | | // }); // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | // if (response.code === 200) { |
| | | // findMachine.value= response.data; |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // } |
| | | // } catch (error) { |
| | | // // console.error('Error fetching rects :', error); |
| | | // } |
| | | // } |
| | | //ä¿®æ¹å·¥ä½ç¶æ ã失败/æ£å¨å·¥ä½/å®å·¥ã |
| | | const workStatus = async(row,state) => { |
| | | let url; |
| | | if(state=="éå"){ |
| | | url="/deviceInteraction/tasking/loseMachineTask"; |
| | | }else if(state=="æ£å¨å·¥ä½"){ |
| | | url="/deviceInteraction/tasking/startMachineTask"; |
| | | }else if(state=="å®å·¥"){ |
| | | url="/deviceInteraction/tasking/finishMachineTask"; |
| | | }else{ |
| | | return; |
| | | } |
| | | ElMessageBox.confirm( |
| | | t('marking.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('marking.sure'), |
| | | cancelButtonText: t('marking.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //å¼å§ä¿®æ¹ |
| | | request.post(url, |
| | | { |
| | | "id": machineId |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('marking.cancel'), |
| | | }) |
| | | }) |
| | | |
| | | } |
| | | |
| | | //å¼å·¥/æå |
| | | const machineStatus = async(state) => { |
| | | ElMessageBox.confirm( |
| | | t('marking.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('marking.sure'), |
| | | cancelButtonText: t('marking.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //ä¸çº¿æ¥å£ |
| | | request.post("/deviceInteraction/machine/updateMachineState", |
| | | { |
| | | "id": machineId, |
| | | "state": state |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('marking.cancel'), |
| | | }) |
| | | }) |
| | | } |
| | | //ç ´æ |
| | | const damagedTask = async(row) => { |
| | | ElMessageBox.confirm( |
| | | t('marking.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('marking.sure'), |
| | | cancelButtonText: t('marking.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //ä¸çº¿æ¥å£ |
| | | request.post("/deviceInteraction/tasking/damagedTask", |
| | | { |
| | | "glassId": row.glassId |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('marking.cancel'), |
| | | }) |
| | | }) |
| | | } |
| | | //ä¸çº¿(æ¿èµ°) |
| | | const glassDownLine = async(row) => { |
| | | ElMessageBox.confirm( |
| | | t('marking.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('marking.sure'), |
| | | cancelButtonText: t('marking.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //ä¸çº¿æ¥å£ |
| | | request.post("/deviceInteraction/tasking/glassDownLine", |
| | | { |
| | | "glassId": row.glassId, |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('marking.cancel'), |
| | | }) |
| | | }) |
| | | } |
| | | //ä¸çº¿ |
| | | const topLine = async() => { |
| | | |
| | | } |
| | | |
| | | </script> |
| | | <template> |
| | | <div ref="content" style="padding:0 20px;"> |
| | | <div id="div-title" style="font-size: 20px; font-weight: bold; margin:10px 0 10px 0;padding-left: 20px;"> |
| | | {{$t('machine.edging')}} |
| | | </div> |
| | | <hr /> |
| | | <br> |
| | | <div id="search" > |
| | | <!-- åè½ --> |
| | | <el-button type="primary" id="ButtonMachineStatus" @click="machineStatus((findMachine['state']=='æå'?'å¼å·¥':'æå'))">{{findMachine['state']=='å¼å·¥'?$t('functionState.start'):$t('functionState.stop')}}</el-button> |
| | | <el-button type="primary" id="ButtonTopLine" @click="topLine">{{$t('functionState.topLine')}}</el-button> |
| | | <!-- <el-button type="primary" id="searchButton" @click="downLine('ä¸çº¿')">ä¸çº¿</el-button> |
| | | <el-button type="primary" id="searchButton" @click="workStatus('ç ´æ')">ç ´æ</el-button> |
| | | <el-button type="primary" id="searchButton" @click="workStatus('å®å·¥')">å®å·¥</el-button> --> |
| | | </div> |
| | | <div id="main-body" style="min-height:240px;"> |
| | | <!-- è¡¨æ ¼å
容 --> |
| | | <el-table :data="loadData" stripe |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }" |
| | | :cell-style="{ textAlign: 'center' }"> |
| | | <!-- <el-table-column type="selection" min-width="30" /> --> |
| | | <el-table-column type="index" :label="$t('glassInfo.number')" min-width="30" /> |
| | | <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')"/> |
| | | <el-table-column prop="taskType" :label="$t('glassInfo.taskType')"/> |
| | | <el-table-column prop="glassId" :label="$t('glassInfo.glassId')"/> |
| | | <el-table-column prop="length" :label="$t('glassInfo.length')"/> |
| | | <el-table-column prop="width" :label="$t('glassInfo.width')"/> |
| | | <el-table-column prop="thickness" :label="$t('glassInfo.thickness')"/> |
| | | <el-table-column prop="workState" :label="$t('glassInfo.workState')"/> |
| | | <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, 'éå')" >{{$t('functionState.anew')}}</el-button> |
| | | <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, 'å®å·¥')">{{$t('functionState.finish')}}</el-button> |
| | | <el-button size="mini" link type="primary" plain @click="damagedTask(scope.row)">{{$t('functionState.lose')}}</el-button> |
| | | <el-button size="mini" link type="primary" plain @click="glassDownLine(scope.row)">{{$t('functionState.downLine')}}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <div id="main-body" |
| | | style="width: 50%; height: 460px; margin: auto;background-image: url(../../src/assets/æ«ç è¯å«.png) ;background-size: 100% 100%;"> |
| | | <!-- ç»å¾å
容 --> |
| | | <div style="width: 150px; height: 100px; background-color: red; position: relative; top: 171px; left: 328px"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | table { |
| | | text-align: center; |
| | | width: 100%; |
| | | height: 100%; |
| | | border-collapse: collapse; |
| | | border-spacing: 0; |
| | | } |
| | | |
| | | table td { |
| | | text-align: center; |
| | | } |
| | | |
| | | #main-body { |
| | | width: 100%; |
| | | height: 100%; |
| | | border: 1px solid #ccc; |
| | | margin-top: 25px; |
| | | } |
| | | |
| | | #searchButton { |
| | | width: 100px; |
| | | height: 40px; |
| | | font-size: 16px; |
| | | border-radius: 5px; |
| | | background-color: #409EFF; |
| | | color: #fff; |
| | | border: none; |
| | | cursor: pointer; |
| | | } |
| | | </style> |
New file |
| | |
| | | <!-- ææ æº --> |
| | | <script setup> |
| | | import request from "@/utils/request"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import { reactive, ref, onMounted, onBeforeUnmount, onUnmounted } from 'vue' |
| | | import { useI18n } from 'vue-i18n' |
| | | import { WebSocketHost, host } from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const { t } = useI18n() |
| | | const requestData = reactive({ |
| | | account: '', |
| | | password: '', |
| | | }); |
| | | const loadData = ref([]); |
| | | const findMachine = ref([]); |
| | | const machineId = 25;//å½å页é¢ç设å¤ID |
| | | //使ç¨WebSocketæ¹å¼å±ç¤ºæ°æ® |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/flipSlice`; |
| | | // å®ä¹æ¶æ¯å¤ç彿°ï¼æ´æ° receivedData åé |
| | | const handleMessage = (data) => { |
| | | // æ´æ° tableData çæ°æ® |
| | | loadData.value = data.taskingList[0]; |
| | | findMachine.value = data.machine[0]; |
| | | // console.log(data); |
| | | }; |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("å
³éäº") |
| | | closeWebSocket(); |
| | | }); |
| | | |
| | | onMounted(async () => { |
| | | //使ç¨WebSocketæ¹å¼å±ç¤ºæ°æ® |
| | | socket = initializeWebSocket(socketUrl, handleMessage);// åå§å WebSocketï¼å¹¶ä¼ éæ¶æ¯å¤ç彿° |
| | | |
| | | |
| | | //ä½¿ç¨æ¥å£æ¹å¼å±ç¤ºæ°æ® |
| | | //load(); |
| | | }); |
| | | |
| | | // //è·åæ°æ® |
| | | // const load = async() => { |
| | | // //è·å设å¤ä»»å¡æ°æ® |
| | | // try { |
| | | // const response = await request.post('/deviceInteraction/tasking/findMachineTask', |
| | | // { |
| | | // "id": 11 |
| | | // }); // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | // if (response.code === 200) { |
| | | // loadData.value.findTaskingData= response.data; |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // } |
| | | // } catch (error) { |
| | | // // console.error('Error fetching rects :', error); |
| | | // } |
| | | // //è·å设å¤ç¶æ |
| | | // try { |
| | | // const response = await request.post('/deviceInteraction/machine/findMachine', |
| | | // { |
| | | // "id": 11 |
| | | // }); // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | // if (response.code === 200) { |
| | | // findMachine.value= response.data; |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // } |
| | | // } catch (error) { |
| | | // // console.error('Error fetching rects :', error); |
| | | // } |
| | | // } |
| | | //ä¿®æ¹å·¥ä½ç¶æ ã失败/æ£å¨å·¥ä½/å®å·¥ã |
| | | const workStatus = async (row, state) => { |
| | | let url; |
| | | if (state == "éå") { |
| | | url = "/deviceInteraction/tasking/loseMachineTask"; |
| | | } else if (state == "æ£å¨å·¥ä½") { |
| | | url = "/deviceInteraction/tasking/startMachineTask"; |
| | | } else if (state == "å®å·¥") { |
| | | url = "/deviceInteraction/tasking/finishMachineTask"; |
| | | } else { |
| | | return; |
| | | } |
| | | ElMessageBox.confirm( |
| | | t('functionState.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('functionState.sure'), |
| | | cancelButtonText: t('functionState.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //å¼å§ä¿®æ¹ |
| | | request.post(url, |
| | | { |
| | | "id": machineId |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('functionState.cancel'), |
| | | }) |
| | | }) |
| | | |
| | | } |
| | | |
| | | //å¼å·¥/æå |
| | | const machineStatus = async (state) => { |
| | | ElMessageBox.confirm( |
| | | t('functionState.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('functionState.sure'), |
| | | cancelButtonText: t('functionState.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //ä¸çº¿æ¥å£ |
| | | request.post("/deviceInteraction/machine/updateMachineState", |
| | | { |
| | | "id": machineId, |
| | | "state": state |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('functionState.cancel'), |
| | | }) |
| | | }) |
| | | } |
| | | //ç ´æ |
| | | const damagedTask = async (row) => { |
| | | ElMessageBox.confirm( |
| | | t('functionState.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('functionState.sure'), |
| | | cancelButtonText: t('functionState.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //ä¸çº¿æ¥å£ |
| | | request.post("/deviceInteraction/tasking/damagedTask", |
| | | { |
| | | "glassId": row.glassId |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('functionState.cancel'), |
| | | }) |
| | | }) |
| | | } |
| | | //ä¸çº¿(æ¿èµ°) |
| | | const glassDownLine = async (row) => { |
| | | ElMessageBox.confirm( |
| | | t('functionState.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('functionState.sure'), |
| | | cancelButtonText: t('functionState.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //ä¸çº¿æ¥å£ |
| | | request.post("/deviceInteraction/tasking/glassDownLine", |
| | | { |
| | | "glassId": row.glassId, |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('functionState.cancel'), |
| | | }) |
| | | }) |
| | | } |
| | | //ä¸çº¿ |
| | | const topLine = async () => { |
| | | |
| | | } |
| | | |
| | | </script> |
| | | <template> |
| | | <div ref="content" style="padding:0 20px;"> |
| | | <div id="div-title" style="font-size: 20px; font-weight: bold; margin:10px 0 10px 0;padding-left: 20px;"> |
| | | {{ $t('machine.flipSlice') }} |
| | | </div> |
| | | <hr /> |
| | | <br> |
| | | <div id="search"> |
| | | <!-- åè½ --> |
| | | <el-button :type="(findMachine['state'] == 'æå' ? 'danger' : 'success')" id="ButtonMachineStatus" |
| | | @click="machineStatus((findMachine['state'] == 'æå' ? 'å¼å·¥' : 'æå'))">{{ findMachine['state'] == 'å¼å·¥' ? $t('functionState.start') : $t('functionState.stop') }}</el-button> |
| | | <el-button type="primary" id="ButtonTopLine" @click="topLine">{{ $t('functionState.topLine') }}</el-button> |
| | | <!-- <el-button type="primary" id="searchButton" @click="downLine('ä¸çº¿')">ä¸çº¿</el-button> |
| | | <el-button type="primary" id="searchButton" @click="workStatus('ç ´æ')">ç ´æ</el-button> |
| | | <el-button type="primary" id="searchButton" @click="workStatus('å®å·¥')">å®å·¥</el-button> --> |
| | | </div> |
| | | <div id="main-body" style="min-height:240px;"> |
| | | <!-- è¡¨æ ¼å
容 --> |
| | | <el-table :data="loadData" stripe |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }" |
| | | :cell-style="{ textAlign: 'center' }"> |
| | | <!-- <el-table-column type="selection" min-width="30" /> --> |
| | | <el-table-column type="index" :label="$t('glassInfo.number')" min-width="30" /> |
| | | <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')" /> |
| | | <el-table-column prop="taskType" :label="$t('glassInfo.taskType')" /> |
| | | <el-table-column prop="glassId" :label="$t('glassInfo.glassId')" /> |
| | | <el-table-column prop="length" :label="$t('glassInfo.length')" /> |
| | | <el-table-column prop="width" :label="$t('glassInfo.width')" /> |
| | | <el-table-column prop="thickness" :label="$t('glassInfo.thickness')" /> |
| | | <el-table-column prop="workState" :label="$t('glassInfo.workState')" /> |
| | | <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" link type="primary" plain |
| | | @click="workStatus(scope.row, 'éå')">{{ $t('functionState.anew') }}</el-button> |
| | | <el-button size="mini" link type="primary" plain |
| | | @click="workStatus(scope.row, 'å®å·¥')">{{ $t('functionState.finish') }}</el-button> |
| | | <el-button size="mini" link type="primary" plain |
| | | @click="damagedTask(scope.row)">{{ $t('functionState.lose') }}</el-button> |
| | | <el-button size="mini" link type="primary" plain |
| | | @click="glassDownLine(scope.row)">{{ $t('functionState.downLine') }}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <div id="main-body" |
| | | style="width: 70%; height: 400px;margin:20px auto;background-image: url(../../src/assets/ç¿»çå°.png) ;background-size: 100% 100%;"> |
| | | <!-- ç»å¾å
容 --> |
| | | <div :style="{ |
| | | width: loadData.length > 0 ? loadData[0]['length'] + 'px' : '200px', |
| | | height: loadData.length > 0 ? loadData[0]['width'] + 'px' : '100px', |
| | | backgroundColor: 'red', |
| | | position: 'relative', |
| | | top: '110px', |
| | | left: '28px', |
| | | textAlign: 'center' |
| | | }"> |
| | | <p v-if="loadData.length > 0">{{ loadData[0]['scanId'] }}</p> |
| | | <p v-if="loadData.length > 0"> |
| | | {{ loadData[0]['length'] }} * {{ loadData[0]['width'] }} |
| | | </p> |
| | | <p v-else>ææ æ°æ®</p> <!-- å¯éï¼æ¾ç¤ºé»è®¤æ¶æ¯ --> |
| | | </div> |
| | | <div :style="{ |
| | | width: loadData.length > 0 ? loadData[1]['length'] + 'px' : '200px', |
| | | height: loadData.length > 0 ? loadData[1]['width'] + 'px' : '100px', |
| | | backgroundColor: 'red', |
| | | position: 'relative', |
| | | top: '-70px', |
| | | left: '878px', |
| | | textAlign: 'center' |
| | | }"> |
| | | <p v-if="loadData.length > 0">{{ loadData[1]['scanId'] }}</p> |
| | | <p v-if="loadData.length > 0"> |
| | | {{ loadData[1]['length'] }} * {{ loadData[1]['width'] }} |
| | | </p> |
| | | <p v-else>ææ æ°æ®</p> <!-- å¯éï¼æ¾ç¤ºé»è®¤æ¶æ¯ --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | table { |
| | | text-align: center; |
| | | width: 100%; |
| | | height: 100%; |
| | | border-collapse: collapse; |
| | | border-spacing: 0; |
| | | } |
| | | |
| | | table td { |
| | | text-align: center; |
| | | } |
| | | |
| | | #main-body { |
| | | width: 100%; |
| | | height: 100%; |
| | | border: 1px solid #ccc; |
| | | margin-top: 25px; |
| | | } |
| | | |
| | | #searchButton { |
| | | width: 100px; |
| | | height: 40px; |
| | | font-size: 16px; |
| | | border-radius: 5px; |
| | | background-color: #409EFF; |
| | | color: #fff; |
| | | border: none; |
| | | cursor: pointer; |
| | | } |
| | | </style> |
| | |
| | | // æ´æ° tableData çæ°æ® |
| | | loadData.value = data.taskingList[0]; |
| | | findMachine.value = data.machine[0]; |
| | | // console.log(data); |
| | | }; |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | |
| | | onMounted(async () => { |
| | | //使ç¨WebSocketæ¹å¼å±ç¤ºæ°æ® |
| | | socket = initializeWebSocket(socketUrl, handleMessage);// åå§å WebSocketï¼å¹¶ä¼ éæ¶æ¯å¤ç彿° |
| | | |
| | | |
| | | //ä½¿ç¨æ¥å£æ¹å¼å±ç¤ºæ°æ® |
| | | //load(); |
| | |
| | | <!-- ç»å¾å
容 --> |
| | | <div style="width: 200px; height: 100px; background-color: red; position: relative; top: 271px; left: 158px"> |
| | | <div style="width: 500px; height: 300px; position: relative; top: -250PX; left: 800px"> |
| | | <el-table :data="loadData" stripe |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }" |
| | | :cell-style="{ textAlign: 'center' }"> |
| | | <el-table :data="loadData" stripe class="custom-table" |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center',height: '80px'}" |
| | | :cell-style="{ textAlign: 'center',height: '80px'}"> |
| | | <!-- <el-table-column type="selection" min-width="30" /> --> |
| | | <el-table-column type="index" :label="$t('glassInfo.number')" min-width="55" /> |
| | | <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')"/> |
| | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | table { |
| | | text-align: center; |
| | | width: 100%; |
New file |
| | |
| | | <!-- ææ æº --> |
| | | <script setup> |
| | | import request from "@/utils/request"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import { reactive, ref, onMounted, onBeforeUnmount, onUnmounted } from 'vue' |
| | | import { useI18n } from 'vue-i18n' |
| | | import { WebSocketHost, host } from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const { t } = useI18n() |
| | | const requestData = reactive({ |
| | | account: '', |
| | | password: '', |
| | | }); |
| | | const loadData = ref([]); |
| | | const findMachine = ref([]); |
| | | const loadDataQr = ref([]); |
| | | const machineId = 3;//å½å页é¢ç设å¤ID |
| | | //使ç¨WebSocketæ¹å¼å±ç¤ºæ°æ® |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/edging`; |
| | | // å®ä¹æ¶æ¯å¤ç彿°ï¼æ´æ° receivedData åé |
| | | const handleMessage = (data) => { |
| | | // æ´æ° tableData çæ°æ® |
| | | loadData.value = data.taskingList[0]; |
| | | findMachine.value = data.machine[0]; |
| | | loadDataQr.value = data.taskingListQr[0]; |
| | | }; |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("å
³éäº") |
| | | closeWebSocket(); |
| | | }); |
| | | |
| | | onMounted(async () => { |
| | | //使ç¨WebSocketæ¹å¼å±ç¤ºæ°æ® |
| | | socket = initializeWebSocket(socketUrl, handleMessage);// åå§å WebSocketï¼å¹¶ä¼ éæ¶æ¯å¤ç彿° |
| | | |
| | | //ä½¿ç¨æ¥å£æ¹å¼å±ç¤ºæ°æ® |
| | | //load(); |
| | | }); |
| | | |
| | | // //è·åæ°æ® |
| | | // const load = async() => { |
| | | // //è·å设å¤ä»»å¡æ°æ® |
| | | // try { |
| | | // const response = await request.post('/deviceInteraction/tasking/findMachineTask', |
| | | // { |
| | | // "id": 11 |
| | | // }); // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | // if (response.code === 200) { |
| | | // loadData.value.findTaskingData= response.data; |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // } |
| | | // } catch (error) { |
| | | // // console.error('Error fetching rects :', error); |
| | | // } |
| | | // //è·å设å¤ç¶æ |
| | | // try { |
| | | // const response = await request.post('/deviceInteraction/machine/findMachine', |
| | | // { |
| | | // "id": 11 |
| | | // }); // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | // if (response.code === 200) { |
| | | // findMachine.value= response.data; |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // } |
| | | // } catch (error) { |
| | | // // console.error('Error fetching rects :', error); |
| | | // } |
| | | // } |
| | | //ä¿®æ¹å·¥ä½ç¶æ ã失败/æ£å¨å·¥ä½/å®å·¥ã |
| | | const workStatus = async (row, state) => { |
| | | let url; |
| | | if (state == "éå") { |
| | | url = "/deviceInteraction/tasking/loseMachineTask"; |
| | | } else if (state == "æ£å¨å·¥ä½") { |
| | | url = "/deviceInteraction/tasking/startMachineTask"; |
| | | } else if (state == "å®å·¥") { |
| | | url = "/deviceInteraction/tasking/finishMachineTask"; |
| | | } else { |
| | | return; |
| | | } |
| | | ElMessageBox.confirm( |
| | | t('marking.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('marking.sure'), |
| | | cancelButtonText: t('marking.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //å¼å§ä¿®æ¹ |
| | | request.post(url, |
| | | { |
| | | "id": machineId |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('marking.cancel'), |
| | | }) |
| | | }) |
| | | |
| | | } |
| | | |
| | | //å¼å·¥/æå |
| | | const machineStatus = async (state) => { |
| | | ElMessageBox.confirm( |
| | | t('marking.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('marking.sure'), |
| | | cancelButtonText: t('marking.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //ä¸çº¿æ¥å£ |
| | | request.post("/deviceInteraction/machine/updateMachineState", |
| | | { |
| | | "id": machineId, |
| | | "state": state |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('marking.cancel'), |
| | | }) |
| | | }) |
| | | } |
| | | //ç ´æ |
| | | const damagedTask = async (row) => { |
| | | ElMessageBox.confirm( |
| | | t('marking.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('marking.sure'), |
| | | cancelButtonText: t('marking.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //ä¸çº¿æ¥å£ |
| | | request.post("/deviceInteraction/tasking/damagedTask", |
| | | { |
| | | "glassId": row.glassId |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('marking.cancel'), |
| | | }) |
| | | }) |
| | | } |
| | | //ä¸çº¿(æ¿èµ°) |
| | | const glassDownLine = async (row) => { |
| | | ElMessageBox.confirm( |
| | | t('marking.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('marking.sure'), |
| | | cancelButtonText: t('marking.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //ä¸çº¿æ¥å£ |
| | | request.post("/deviceInteraction/tasking/glassDownLine", |
| | | { |
| | | "glassId": row.glassId, |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('marking.cancel'), |
| | | }) |
| | | }) |
| | | } |
| | | //ä¸çº¿ |
| | | const topLine = async () => { |
| | | |
| | | } |
| | | |
| | | </script> |
| | | <template> |
| | | <div ref="content" style="padding:0 20px;"> |
| | | <div id="div-title" style="font-size: 20px; font-weight: bold; margin:10px 0 10px 0;padding-left: 20px;"> |
| | | {{ $t('machine.scanQredging') }} |
| | | </div> |
| | | <hr /> |
| | | <br> |
| | | <div id="search"> |
| | | <!-- åè½ --> |
| | | <el-button type="primary" id="ButtonMachineStatus" |
| | | @click="machineStatus((findMachine['state'] == 'æå' ? 'å¼å·¥' : 'æå'))">{{ findMachine['state'] == 'å¼å·¥' ? $t('functionState.start') : $t('functionState.stop') }}</el-button> |
| | | <el-button type="primary" id="ButtonTopLine" @click="topLine">{{ $t('functionState.topLine') }}</el-button> |
| | | <!-- <el-button type="primary" id="searchButton" @click="downLine('ä¸çº¿')">ä¸çº¿</el-button> |
| | | <el-button type="primary" id="searchButton" @click="workStatus('ç ´æ')">ç ´æ</el-button> |
| | | <el-button type="primary" id="searchButton" @click="workStatus('å®å·¥')">å®å·¥</el-button> --> |
| | | </div> |
| | | <div id="main-body" style="min-height:240px;"> |
| | | <!-- è¡¨æ ¼å
容 --> |
| | | <el-table :data="loadData" stripe |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }" |
| | | :cell-style="{ textAlign: 'center' }"> |
| | | <!-- <el-table-column type="selection" min-width="30" /> --> |
| | | <el-table-column type="index" :label="$t('glassInfo.number')" min-width="30" /> |
| | | <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')" /> |
| | | <el-table-column prop="taskType" :label="$t('glassInfo.taskType')" /> |
| | | <el-table-column prop="glassId" :label="$t('glassInfo.glassId')" /> |
| | | <el-table-column prop="length" :label="$t('glassInfo.length')" /> |
| | | <el-table-column prop="width" :label="$t('glassInfo.width')" /> |
| | | <el-table-column prop="thickness" :label="$t('glassInfo.thickness')" /> |
| | | <el-table-column prop="workState" :label="$t('glassInfo.workState')" /> |
| | | <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" link type="primary" plain |
| | | @click="workStatus(scope.row, 'éå')">{{ $t('functionState.anew') }}</el-button> |
| | | <el-button size="mini" link type="primary" plain |
| | | @click="workStatus(scope.row, 'å®å·¥')">{{ $t('functionState.finish') }}</el-button> |
| | | <el-button size="mini" link type="primary" plain |
| | | @click="damagedTask(scope.row)">{{ $t('functionState.lose') }}</el-button> |
| | | <el-button size="mini" link type="primary" plain |
| | | @click="glassDownLine(scope.row)">{{ $t('functionState.downLine') }}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <div id="main-body" |
| | | style="width: 70%; height: 450px; margin: auto;background-image: url(../../src/assets/磨边æ«ç .png) ;background-size: 100% 100%;"> |
| | | <!-- ç»å¾å
容 --> |
| | | |
| | | <div |
| | | style="width: 150px; height: 100px; background-color: red; position: relative; top: 200px; left: 128px;text-align: center;"> |
| | | <!-- <p>{{ loadDataQr[0]['scanId'] }}</p> |
| | | <p>{{ loadDataQr[0]['length'] }}*{{ loadDataQr[0]['width'] }}</p> --> |
| | | <p v-if="loadDataQr.length > 0">{{ loadDataQr[0]['scanId'] }}</p> |
| | | <p v-if="loadDataQr.length > 0"> |
| | | {{ loadDataQr[0]['length'] }} * {{ loadDataQr[0]['width'] }} |
| | | </p> |
| | | <p v-else>ææ æ°æ®</p> <!-- å¯éï¼æ¾ç¤ºé»è®¤æ¶æ¯ --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | table { |
| | | text-align: center; |
| | | width: 100%; |
| | | height: 100%; |
| | | border-collapse: collapse; |
| | | border-spacing: 0; |
| | | } |
| | | |
| | | table td { |
| | | text-align: center; |
| | | } |
| | | |
| | | #main-body { |
| | | width: 100%; |
| | | height: 100%; |
| | | border: 1px solid #ccc; |
| | | margin-top: 25px; |
| | | } |
| | | |
| | | #searchButton { |
| | | width: 100px; |
| | | height: 40px; |
| | | font-size: 16px; |
| | | border-radius: 5px; |
| | | background-color: #409EFF; |
| | | color: #fff; |
| | | border: none; |
| | | cursor: pointer; |
| | | } |
| | | </style> |
New file |
| | |
| | | <!-- ææ æº --> |
| | | <script setup> |
| | | import request from "@/utils/request"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import { reactive, ref, onMounted, onBeforeUnmount,onUnmounted } from 'vue' |
| | | import { useI18n } from 'vue-i18n' |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | const { t } = useI18n() |
| | | const requestData = reactive({ |
| | | account: '', |
| | | password: '', |
| | | }); |
| | | const loadData = ref([]); |
| | | const findMachine = ref([]); |
| | | const machineId=23;//å½å页é¢ç设å¤ID |
| | | //使ç¨WebSocketæ¹å¼å±ç¤ºæ°æ® |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/edging`; |
| | | // å®ä¹æ¶æ¯å¤ç彿°ï¼æ´æ° receivedData åé |
| | | const handleMessage = (data) => { |
| | | // æ´æ° tableData çæ°æ® |
| | | loadData.value = data.taskingList[0]; |
| | | findMachine.value = data.machine[0]; |
| | | }; |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("å
³éäº") |
| | | closeWebSocket(); |
| | | }); |
| | | |
| | | onMounted(async () => { |
| | | //使ç¨WebSocketæ¹å¼å±ç¤ºæ°æ® |
| | | socket = initializeWebSocket(socketUrl, handleMessage);// åå§å WebSocketï¼å¹¶ä¼ éæ¶æ¯å¤ç彿° |
| | | |
| | | //ä½¿ç¨æ¥å£æ¹å¼å±ç¤ºæ°æ® |
| | | //load(); |
| | | }); |
| | | |
| | | // //è·åæ°æ® |
| | | // const load = async() => { |
| | | // //è·å设å¤ä»»å¡æ°æ® |
| | | // try { |
| | | // const response = await request.post('/deviceInteraction/tasking/findMachineTask', |
| | | // { |
| | | // "id": 11 |
| | | // }); // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | // if (response.code === 200) { |
| | | // loadData.value.findTaskingData= response.data; |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // } |
| | | // } catch (error) { |
| | | // // console.error('Error fetching rects :', error); |
| | | // } |
| | | // //è·å设å¤ç¶æ |
| | | // try { |
| | | // const response = await request.post('/deviceInteraction/machine/findMachine', |
| | | // { |
| | | // "id": 11 |
| | | // }); // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | // if (response.code === 200) { |
| | | // findMachine.value= response.data; |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // } |
| | | // } catch (error) { |
| | | // // console.error('Error fetching rects :', error); |
| | | // } |
| | | // } |
| | | //ä¿®æ¹å·¥ä½ç¶æ ã失败/æ£å¨å·¥ä½/å®å·¥ã |
| | | const workStatus = async(row,state) => { |
| | | let url; |
| | | if(state=="éå"){ |
| | | url="/deviceInteraction/tasking/loseMachineTask"; |
| | | }else if(state=="æ£å¨å·¥ä½"){ |
| | | url="/deviceInteraction/tasking/startMachineTask"; |
| | | }else if(state=="å®å·¥"){ |
| | | url="/deviceInteraction/tasking/finishMachineTask"; |
| | | }else{ |
| | | return; |
| | | } |
| | | ElMessageBox.confirm( |
| | | t('marking.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('marking.sure'), |
| | | cancelButtonText: t('marking.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //å¼å§ä¿®æ¹ |
| | | request.post(url, |
| | | { |
| | | "id": machineId |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('marking.cancel'), |
| | | }) |
| | | }) |
| | | |
| | | } |
| | | |
| | | //å¼å·¥/æå |
| | | const machineStatus = async(state) => { |
| | | ElMessageBox.confirm( |
| | | t('marking.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('marking.sure'), |
| | | cancelButtonText: t('marking.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //ä¸çº¿æ¥å£ |
| | | request.post("/deviceInteraction/machine/updateMachineState", |
| | | { |
| | | "id": machineId, |
| | | "state": state |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('marking.cancel'), |
| | | }) |
| | | }) |
| | | } |
| | | //ç ´æ |
| | | const damagedTask = async(row) => { |
| | | ElMessageBox.confirm( |
| | | t('marking.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('marking.sure'), |
| | | cancelButtonText: t('marking.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //ä¸çº¿æ¥å£ |
| | | request.post("/deviceInteraction/tasking/damagedTask", |
| | | { |
| | | "glassId": row.glassId |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('marking.cancel'), |
| | | }) |
| | | }) |
| | | } |
| | | //ä¸çº¿(æ¿èµ°) |
| | | const glassDownLine = async(row) => { |
| | | ElMessageBox.confirm( |
| | | t('marking.tips'), |
| | | t('delivery.prompt'), |
| | | { |
| | | confirmButtonText: t('marking.sure'), |
| | | cancelButtonText: t('marking.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ) |
| | | .then(() => { |
| | | //ä¸çº¿æ¥å£ |
| | | request.post("/deviceInteraction/tasking/glassDownLine", |
| | | { |
| | | "glassId": row.glassId, |
| | | }).then((res) => { // æ¿æ¢ä¸ºä½ çAPIç«¯ç¹ |
| | | if (res.code === 200) { |
| | | ElMessage.success(res.message); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: t('marking.cancel'), |
| | | }) |
| | | }) |
| | | } |
| | | //ä¸çº¿ |
| | | const topLine = async() => { |
| | | |
| | | } |
| | | |
| | | </script> |
| | | <template> |
| | | <div ref="content" style="padding:0 20px;"> |
| | | <div id="div-title" style="font-size: 20px; font-weight: bold; margin:10px 0 10px 0;padding-left: 20px;"> |
| | | {{$t('machine.edging')}} |
| | | </div> |
| | | <hr /> |
| | | <br> |
| | | <div id="search" > |
| | | <!-- åè½ --> |
| | | <el-button type="primary" id="ButtonMachineStatus" @click="machineStatus((findMachine['state']=='æå'?'å¼å·¥':'æå'))">{{findMachine['state']=='å¼å·¥'?$t('functionState.start'):$t('functionState.stop')}}</el-button> |
| | | <el-button type="primary" id="ButtonTopLine" @click="topLine">{{$t('functionState.topLine')}}</el-button> |
| | | <!-- <el-button type="primary" id="searchButton" @click="downLine('ä¸çº¿')">ä¸çº¿</el-button> |
| | | <el-button type="primary" id="searchButton" @click="workStatus('ç ´æ')">ç ´æ</el-button> |
| | | <el-button type="primary" id="searchButton" @click="workStatus('å®å·¥')">å®å·¥</el-button> --> |
| | | </div> |
| | | <div id="main-body" style="min-height:240px;"> |
| | | <!-- è¡¨æ ¼å
容 --> |
| | | <el-table :data="loadData" stripe |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }" |
| | | :cell-style="{ textAlign: 'center' }"> |
| | | <!-- <el-table-column type="selection" min-width="30" /> --> |
| | | <el-table-column type="index" :label="$t('glassInfo.number')" min-width="30" /> |
| | | <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')"/> |
| | | <el-table-column prop="taskType" :label="$t('glassInfo.taskType')"/> |
| | | <el-table-column prop="glassId" :label="$t('glassInfo.glassId')"/> |
| | | <el-table-column prop="length" :label="$t('glassInfo.length')"/> |
| | | <el-table-column prop="width" :label="$t('glassInfo.width')"/> |
| | | <el-table-column prop="thickness" :label="$t('glassInfo.thickness')"/> |
| | | <el-table-column prop="workState" :label="$t('glassInfo.workState')"/> |
| | | <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, 'éå')" >{{$t('functionState.anew')}}</el-button> |
| | | <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, 'å®å·¥')">{{$t('functionState.finish')}}</el-button> |
| | | <el-button size="mini" link type="primary" plain @click="damagedTask(scope.row)">{{$t('functionState.lose')}}</el-button> |
| | | <el-button size="mini" link type="primary" plain @click="glassDownLine(scope.row)">{{$t('functionState.downLine')}}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <div id="main-body" |
| | | style="width: 50%; height: 460px; margin: auto;background-image: url(../../src/assets/æ«ç è¯å«.png) ;background-size: 100% 100%;"> |
| | | <!-- ç»å¾å
容 --> |
| | | <div style="width: 150px; height: 100px; background-color: red; position: relative; top: 171px; left: 328px"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | table { |
| | | text-align: center; |
| | | width: 100%; |
| | | height: 100%; |
| | | border-collapse: collapse; |
| | | border-spacing: 0; |
| | | } |
| | | |
| | | table td { |
| | | text-align: center; |
| | | } |
| | | |
| | | #main-body { |
| | | width: 100%; |
| | | height: 100%; |
| | | border: 1px solid #ccc; |
| | | margin-top: 25px; |
| | | } |
| | | |
| | | #searchButton { |
| | | width: 100px; |
| | | height: 40px; |
| | | font-size: 16px; |
| | | border-radius: 5px; |
| | | background-color: #409EFF; |
| | | color: #fff; |
| | | border: none; |
| | | cursor: pointer; |
| | | } |
| | | </style> |