From acf24306aa69bb7f864e9bfa59995ccece785d30 Mon Sep 17 00:00:00 2001
From: 严智鑫 <test>
Date: 星期六, 12 十月 2024 14:56:01 +0800
Subject: [PATCH] 打标测试更改

---
 UI-Project/src/layout/MainErpView.vue                                                                                  |    8 
 JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcParameter.java                                      |   28 +
 JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/resources/application.yml                                |    4 
 JiuMuMesParent/moduleService/DeviceInteractionModule/src/test/java/com/mes/DeviceInteractionModuleApplicationTest.java |   23 +
 JiuMuMesParent/moduleService/DeviceInteractionModule/target/classes/application.yml                                    |    4 
 JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/ModbusTcp.java                                         |   80 ++++
 UI-Project/src/views/GlueDispenser/glueDispenser.vue                                                                   |  262 ++++++++++++++
 .idea/vcs.xml                                                                                                          |    1 
 UI-Project/src/views/SilkScreen/SilkScreen.vue                                                                         |  264 ++++++++++++++
 UI-Project/src/router/index.js                                                                                         |  286 +++++++-------
 JiuMuMesParent/common/servicebase/src/main/java/com/mes/tools/HexConversion.java                                       |   16 
 JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/MarkingTask.java                        |   46 +-
 JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcAgreement.java                                      |   56 --
 UI-Project/src/views/Marking/marking.vue                                                                               |    1 
 14 files changed, 856 insertions(+), 223 deletions(-)

diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 8f56832..35eb1dd 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -2,6 +2,5 @@
 <project version="4">
   <component name="VcsDirectoryMappings">
     <mapping directory="" vcs="Git" />
-    <mapping directory="$PROJECT_DIR$/jiumu" vcs="Git" />
   </component>
 </project>
\ No newline at end of file
diff --git a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/ModbusTcp.java b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/ModbusTcp.java
index 698c5bb..36430e7 100644
--- a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/ModbusTcp.java
+++ b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/ModbusTcp.java
@@ -1,14 +1,18 @@
 package com.mes.service;
 
 import com.mes.tools.HexConversion;
+import com.mes.utils.HexUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
+import java.io.IOException;
 import java.net.Socket;
+import java.net.UnknownHostException;
 import java.text.SimpleDateFormat;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.Map;
@@ -21,23 +25,87 @@
     private Map<String,PlcAgreement> plcAgreement=new LinkedHashMap<String,PlcAgreement>();
     private String Ip;
     private int Port;
+
     public Socket socket =null;//閫氳
     ModbusTcp(){}
-    ModbusTcp(String Ip,int Port){
+    public ModbusTcp(String Ip,int Port){
         this.Ip=Ip;
         this.Port=Port;
+        try {
+            socket=new Socket(Ip,Port);
+        }catch (UnknownHostException e) {
+            throw new RuntimeException(e);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
     }
-
     //杩炴帴
     //@Scheduled(fixedDelay = 1000)
     public void a()throws Exception{
+        //read();
         log.info("123");
     }
 
-    public int getValueInt(){
-        return 0;
+    //璇诲彇鏁版嵁
+    public void read(PlcAgreement plcAgreement)throws Exception{
+        int bufSizes = 0;
+        byte[] msgs = new byte[2048];
+        //鍐欏叆璇诲彇鍦板潃
+        DataOutputStream outToServer = new DataOutputStream(socket.getOutputStream());
+        outToServer.write(HexConversion.stringToInt(plcAgreement.requestHead));
+        outToServer.flush();
+        //璇诲彇鍐呭
+        DataInputStream in = new DataInputStream(socket.getInputStream());
+        bufSizes = in.read(msgs);
+        String message = HexConversion.byteToHexString(bufSizes, msgs);//鍗佽繘鍒跺瓧鑺傛暟缁勮浆鍗佸叚杩涘埗瀛楃涓�
+        //鑾峰彇鍙傛暟鍊�
+        Map<String, PlcParameter> plcParameters=plcAgreement.getPlcParameters();
+        for (String key:plcParameters.keySet()){
+            PlcParameter plcParameter=plcParameters.get(key);
+            if("bit".equals(plcParameter.getType())){
+                byte font=msgs[plcParameter.getAddressStart()];
+                String[] fontBitString=String.format("%8s", Integer.toBinaryString((int)font)).replace(" ", "0").split("");
+                byte[] bit=new byte[1];
+                bit[0]=Byte.parseByte(fontBitString[plcParameter.getAddressLength()]);
+                plcParameter.setReadByte(bit);
+            }else{
+                plcParameter.setReadByte(Arrays.copyOfRange(msgs,plcParameter.getAddressStart(),(plcParameter.getAddressStart()+plcParameter.getAddressLength())));
+            }
+        }
     }
-    public double getValueDouble(){
-        return 0;
+    //鍐欏叆鏁版嵁
+    public void write(PlcParameter plcParameter){
+        try {
+            if (plcParameter.getWriteValue() != null && !"".equals(plcParameter.getWriteValue())) {
+                //鍐欏叆鍙戦�佹暟鎹�
+                DataOutputStream out = new DataOutputStream(socket.getOutputStream());
+                out.write(HexConversion.stringToInt(plcParameter.getWriteValue().toString()));
+                out.flush();
+            }
+        } catch (IOException e) {
+            log.info("鍐欏叆鏁版嵁寮傚父");
+            throw new RuntimeException(e);
+        }
+    }
+    //鍐欏叆鏁版嵁
+    public void write(String key,String writeValue)throws Exception{
+        if (writeValue != null && !"".equals(writeValue)) {
+            //鍐欏叆鍙戦�佹暟鎹�
+            DataOutputStream out = new DataOutputStream(socket.getOutputStream());
+            out.write(HexConversion.stringToInt(writeValue));
+            out.flush();
+        }
+    }
+    //鍐�
+    public String message(String senddate, String address) {
+        String Herd = "0110" + address;
+        int length = senddate.length() / 4;
+        String dates = Herd + HexUtil.intTo2ByteHex(length) + HexUtil.intTo1ByteHex(length * 2) + senddate;
+        int lengths = dates.length() / 2;
+        String date = "00000000" + HexUtil.intTo2ByteHex(lengths) + dates;
+        return date;
+    }
+    public PlcAgreement getPlcAgreement(String key){
+        return plcAgreement.get(key);
     }
 }
diff --git a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcAgreement.java b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcAgreement.java
index 8b4a87c..978d6d2 100644
--- a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcAgreement.java
+++ b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcAgreement.java
@@ -20,7 +20,7 @@
 @Slf4j
 public class PlcAgreement {
 
-    public Socket socket =null;//閫氳
+    //public Socket socket =null;//閫氳
     /**
      * 鍗忚鍙傛暟
      */
@@ -86,46 +86,22 @@
         }
         return false;
     }
-
-    //璇诲彇鏁版嵁
-    public void read()throws Exception{
-        int bufSizes = 0;
-        byte[] msgs = new byte[2048];
-        //鍐欏叆璇诲彇鍦板潃
-        DataOutputStream outToServer = new DataOutputStream(socket.getOutputStream());
-        outToServer.write(HexConversion.stringToInt(this.requestHead));
-        outToServer.flush();
-        //璇诲彇鍐呭
-        DataInputStream in = new DataInputStream(socket.getInputStream());
-        bufSizes = in.read(msgs);
-        String message = HexConversion.byteToHexString(bufSizes, msgs);//鍗佽繘鍒跺瓧鑺傛暟缁勮浆鍗佸叚杩涘埗瀛楃涓�
-        //鑾峰彇鍙傛暟鍊�
-        for (String key:parameters.keySet()){
-            parameters.get(key).setReadValue(message);
+    //鑾峰彇姝ゅ湴鍧�鍏ㄩ儴鍙傛暟
+    public Map<String,PlcParameter> getPlcParameters(){
+        return parameters;
+    }
+    //閫氳繃鍙傛暟鍚嶇О鑾峰彇
+    public PlcParameter getPlcParameter(String name){
+        return parameters.get(name);
+    }
+    //閫氳繃鍙傛暟搴忓彿鑾峰彇
+    public PlcParameter getPlcParameter(int index){
+        String key=parameterKeys.get(index);
+        if(key!=null&& !key.isEmpty()){
+            return this.getPlcParameter(key);
         }
-    }
-    //鍐欏叆鏁版嵁
-    public void write(String key,String writeValue)throws Exception{
-        parameters.get(key);
-        if (writeValue != null && !"".equals(writeValue)) {
-            //鍐欏叆鍙戦�佹暟鎹�
-            DataOutputStream out = new DataOutputStream(socket.getOutputStream());
-            out.write(HexConversion.stringToInt(writeValue));
-            out.flush();
-        }
-    }
-    //鍐�
-    public String message(String senddate, String address) {
-        String Herd = "0110" + address;
-        int length = senddate.length() / 4;
-        String dates = Herd + HexUtil.intTo2ByteHex(length) + HexUtil.intTo1ByteHex(length * 2) + senddate;
-        int lengths = dates.length() / 2;
-        String date = "00000000" + HexUtil.intTo2ByteHex(lengths) + dates;
-        return date;
-    }
-
-    public String getValueString(String key){
-        return parameters.get(key).toString();
+        log.info("鏃犳晥涓嬫爣:{},涓嬫爣鑼冨洿:0-{}",index,parameterKeys.size());
+        return null;
     }
     public int getValueInt(){
         return 0;
diff --git a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcParameter.java b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcParameter.java
index e8b539f..02f483a 100644
--- a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcParameter.java
+++ b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcParameter.java
@@ -28,7 +28,7 @@
     /**
      * 璧峰鍦板潃
      */
-    private int addressIndex=0;
+    private int addressStart=0;
     /**
      * 闀垮害
      */
@@ -39,7 +39,11 @@
     private String type="int";
 
     /**
-     * 瀹炴椂璇诲彇鐨勫��
+     * 瀹炴椂璇诲彇鐨刡yte鍊�
+     */
+    private byte[] readByte=null;
+    /**
+     * 瀹炴椂璇诲彇鐨刡yte鍊艰浆鎹㈡垚 瀵瑰簲绫诲瀷
      */
     private Object readValue=null;
 
@@ -51,9 +55,9 @@
     PlcParameter(){
 
     }
-    PlcParameter(String codeId, int addressIndex, int addressLength, String type){
+    PlcParameter(String codeId, int addressStart, int addressLength, String type){
         this.CodeId=codeId;
-        this.addressIndex=addressIndex;
+        this.addressStart=addressStart;
         this.addressLength=addressLength;
         this.type=type;
     }
@@ -66,12 +70,12 @@
         CodeId = codeId;
     }
 
-    public int getAddressIndex() {
-        return addressIndex;
+    public int getAddressStart() {
+        return addressStart;
     }
 
-    public void setAddressIndex(int addressIndex) {
-        this.addressIndex = addressIndex;
+    public void setAddressStart(int addressIndex) {
+        this.addressStart = addressStart;
     }
 
     public int getAddressLength() {
@@ -98,6 +102,14 @@
         this.readValue = readValue;
     }
 
+    public byte[] getReadByte() {
+        return this.readByte;
+    }
+
+    public void setReadByte(byte[] readByte) {
+        this.readByte = readByte;
+    }
+
     public Object getWriteValue() {
         return writeValue;
     }
diff --git a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/tools/HexConversion.java b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/tools/HexConversion.java
index 6191d85..4996e62 100644
--- a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/tools/HexConversion.java
+++ b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/tools/HexConversion.java
@@ -52,4 +52,20 @@
         numberHex = String.format("%2s", numberHex).replace(' ', '0');
         return numberHex;
     }
+
+    /**
+     * 浠巄yte鏁扮粍涓彇int鏁板�硷紝鏈柟娉曢�傜敤浜�(浣庝綅鍦ㄥ墠锛岄珮浣嶅湪鍚�)鐨勯『搴忥紝鍜屽拰intToBytes()閰嶅浣跨敤
+     *
+     * @param src: byte鏁扮粍
+     * @param offset: 浠庢暟缁勭殑绗琽ffset浣嶅紑濮�
+     * @return int鏁板��
+     */
+    public static int bytesToInt(byte[] src, int offset) {
+        int value;
+        value = (int) ((src[offset] & 0xFF)
+                | ((src[offset+1] & 0xFF)<<8)
+                | ((src[offset+2] & 0xFF)<<16)
+                | ((src[offset+3] & 0xFF)<<24));
+        return value;
+    }
 }
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/MarkingTask.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/MarkingTask.java
index d17fa08..9029a4b 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/MarkingTask.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/MarkingTask.java
@@ -14,6 +14,9 @@
 import com.mes.md.mapper.TaskingMapper;
 import com.mes.md.mapper.WorkTaskDetailMapper;
 import com.mes.md.service.TaskingService;
+import com.mes.service.ModbusTcp;
+import com.mes.service.PlcAgreement;
+import com.mes.service.PlcParameter;
 import com.mes.tools.WebSocketServer;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
@@ -47,33 +50,41 @@
     public void plcMarkingTask(Long machineId) {
         Machine machine=machineMapper.selectById(machineId);
         PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
-        String taskRequestTypeValue = plcParameterObject.getPlcParameter("A06_request_word").getValue();
-        String glassIdeValue = plcParameterObject.getPlcParameter("A05_scanning_ID").getValue();
-        String confirmationWrodValue = plcParameterObject.getPlcParameter("MES_confirmation_word").getValue();
-        String confirmationWrodAddress = plcParameterObject.getPlcParameter("MES_confirmation_word").getAddress();
-        String currentSlot = plcParameterObject.getPlcParameter("Current_slot").getValue();
-        if ("0".equals(taskRequestTypeValue)) {
-            if ("0".equals(confirmationWrodValue)) {
+        ModbusTcp modbusTcp =new ModbusTcp(machine.getIp(),machine.getPort());
+        PlcAgreement plcAgreement=modbusTcp.getPlcAgreement("DB14.0");
+        PlcParameter plcRequest =plcAgreement.getPlcParameter(0);//璇锋眰瀛�
+        PlcParameter plcRequestID =plcAgreement.getPlcParameter(1);//璇锋眰ID
+        PlcParameter mesSend =plcAgreement.getPlcParameter(10);//鍙戦�佸瓧
+        PlcParameter mesSendID =plcAgreement.getPlcParameter(11);//鍙戦�両D
+
+        PlcParameter plcReport =plcAgreement.getPlcParameter(0);//姹囨姤瀛�
+        PlcParameter plcReportID =plcAgreement.getPlcParameter(1);//姹囨姤ID
+        PlcParameter mesConfirm =plcAgreement.getPlcParameter(10);//纭瀛�
+        PlcParameter mesConfirmID =plcAgreement.getPlcParameter(11);//纭ID
+        plcRequest.getReadValue();
+        if ("0".equals(plcRequest.getReadValue())) {
+            if ("0".equals(mesSend.getReadValue())) {
                 log.info("2銆佽幏鍙栧埌鐨勮姹傚瓧涓�0锛屼笖鍙戦�佸瓧涓�0锛屼笉鎵ц浠诲姟");
                 return;
             }
             log.info("2銆佽幏鍙栧埌鐨勮姹傚瓧涓�0锛屽皢鍙戦�佸瓧鏀逛负0");
-            S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, 0);
+            mesSend.setWriteValue("0");
+            modbusTcp.write(mesSend);//鍚慞LC鍙戦��
             return;
         }
-        if (!"0".equals(confirmationWrodValue)) {
+        if (!"0".equals(mesSend.getReadValue())) {
             log.info("2銆佽幏鍙栧埌鐨勮姹傚瓧涓嶄负0锛屽皢鍙戦�佸瓧涓嶄负0锛岀洿鎺ョ粨鏉�");
             return;
         }
-        if ("1".equals(taskRequestTypeValue)) {
-            log.info("2銆佽繘鐗囪姹傦紝涓斿彂閫佸瓧涓�0锛屾墽琛屾墦鏍囦换鍔�");
-            plcRequest(glassIdeValue, confirmationWrodAddress, currentSlot,machine);
-        }else if ("3".equals(taskRequestTypeValue)) {
-            log.info("2銆佸畬鎴愯姹傦紝鎵ц瀹屾垚浠诲姟");
-            plcReport(glassIdeValue, confirmationWrodAddress, currentSlot,machine);
+        if ("1".equals(mesConfirm.getReadValue())&&"0".equals(mesConfirm.getReadValue())) {
+            log.info("2銆佹眹鎶ヨ姹傦紝涓旂‘璁ゅ瓧涓�0锛屽畬鎴愭墦鏍囦换鍔�");
+            plcReport(mesConfirm,machine);
+        }else if ("1".equals(plcRequest.getReadValue())) {
+            log.info("2銆佷换鍔¤姹傦紝鎵ц鍙戦�佷换鍔�");
+            plcRequest(mesSend,machine);
         }
     }
-    public void plcRequest(String glassIdeValue, String confirmationWrodAddress, String currentSlot, Machine machine) {
+    public void plcRequest(PlcParameter mesSend, Machine machine) {
         //鏌ユ壘鎵撴爣鏈轰换鍔�
         Tasking tasking=taskingService.startMachineTask(machine);
         if(tasking!=null&&"寮�宸�".equals(machine.getState())){//鏈変换鍔�
@@ -83,13 +94,12 @@
         }
 
     }
-    public void plcReport(String glassIdeValue, String confirmationWrodAddress, String currentSlot, Machine machine) {
+    public void plcReport(PlcParameter mesConfirm, Machine machine) {
         //鏌ユ壘鎵撴爣鏈哄伐浣滅殑浠诲姟
         //鏌ユ壘鎵撴爣鏈轰换鍔�
         int finishCount=taskingService.finishMachineTask(machine);
         if(finishCount>0){//鏁版嵁宸叉爣璁板畬鎴�
             log.info("姝e父姹囨姤锛�");
-
         }else{
             log.info("褰撳墠鏃犲叡宸ヤ綔鐨勪换鍔★紝鏃犳晥姹囨姤瀹屾垚锛�");
         }
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/resources/application.yml b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/resources/application.yml
index 2c53e00..848387d 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/resources/application.yml
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/resources/application.yml
@@ -8,8 +8,8 @@
     name: deviceInteraction
 mybatis-plus:
   mapper-locations: classpath*:mapper/*.xml
-  configuration:
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+#  configuration:
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 mes:
   threshold: 3
   ratio: 10
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/test/java/com/mes/DeviceInteractionModuleApplicationTest.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/test/java/com/mes/DeviceInteractionModuleApplicationTest.java
index 8cc2ba9..e57dd51 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/test/java/com/mes/DeviceInteractionModuleApplicationTest.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/test/java/com/mes/DeviceInteractionModuleApplicationTest.java
@@ -2,6 +2,7 @@
 
 import com.mes.md.mapper.AccountMapper;
 import com.mes.md.service.AccountService;
+import com.mes.tools.HexConversion;
 import lombok.extern.slf4j.Slf4j;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -9,7 +10,10 @@
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
+import java.util.Random;
 
 /**
  * @Author : yanzhixin
@@ -35,6 +39,23 @@
         log.info("瀹屾暣璺緞");
     }
     @Test
+    public void testByte() {
+        //String url = getClass().getResource("").getPath();
+        //log.info("瀹屾暣璺緞锛歿}", Arrays.asList(url));
+        byte[] msgs = new byte[2048];
+        msgs[0]=(byte)0;
+        msgs[1]=Byte.parseByte("1") ;
+        int g=HexConversion.bytesToInt(msgs,0);
+
+        String message = HexConversion.byteToHexString(4, msgs);
+        byte font=msgs[1];
+        String[] fontBit=String.format("%8s", Integer.toBinaryString((int)font)).replace(" ", "0").split("");
+        byte[] bit=new byte[1];
+        bit[0]=Byte.parseByte(fontBit[7]) ;
+        log.info("缁撴灉:{},{}",fontBit,bit);
+        //log.info("缁撴灉:{},{},{},{},{}",msgs,message,g,(msgs[0] & 0xFF),((msgs[1] & 0xFF)<<8));
+    }
+    @Test
     public void testFindAccount() {
         Map<String, Object> Account=accountService.selectAccount("beibo","57858555");
         if(Account.isEmpty()){
@@ -43,4 +64,6 @@
         log.info("{}",Account);
     }
 
+
+
 }
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/target/classes/application.yml b/JiuMuMesParent/moduleService/DeviceInteractionModule/target/classes/application.yml
index 2c53e00..848387d 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/target/classes/application.yml
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/target/classes/application.yml
@@ -8,8 +8,8 @@
     name: deviceInteraction
 mybatis-plus:
   mapper-locations: classpath*:mapper/*.xml
-  configuration:
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+#  configuration:
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 mes:
   threshold: 3
   ratio: 10
diff --git a/UI-Project/src/layout/MainErpView.vue b/UI-Project/src/layout/MainErpView.vue
index e999560..dbbb8f9 100644
--- a/UI-Project/src/layout/MainErpView.vue
+++ b/UI-Project/src/layout/MainErpView.vue
@@ -5,7 +5,8 @@
 import {ElMessage} from 'element-plus'
 import {ref, watch, onMounted } from 'vue'
 import deepClone from '@/utils/deepClone'
-import { useRouter } from 'vue-router';  
+import { useRouter } from 'vue-router';
+
 import { useI18n } from 'vue-i18n'
 const userData = ref(null)
 let menuList = $ref([])
@@ -130,6 +131,7 @@
                        @click="quit"
                        round>
               <el-icon size="large">
+                <CirclePlus />
                 <SwitchButton size=""/>{{ $t('main.quit') }}
               </el-icon>
             </el-button>
@@ -147,7 +149,7 @@
         <el-row :span="20">
             <el-menu :default-active="activePath" class="el-menu-vertical-demo" >
               <div class="menu">
-            <div v-for="items in menuList">
+            <div v-for="items in menuList" :key="items">
               <div class='menu_title' v-show="!isCollapse"
                    @click="openMenu(items.menu_id)">
                 <span>鈽�</span>
@@ -155,7 +157,7 @@
               </div>
               <ul class='enter-x-left'
                   v-show="openFlag==items.menu_id">
-                <li v-for="page in items.pages"
+                <li v-for="page in items.pages" :key="page"
                     style="margin-bottom:2px">
                   <router-link :to="{path:page.page_url}">
                     {{ page.page_name }}
diff --git a/UI-Project/src/router/index.js b/UI-Project/src/router/index.js
index 78351ef..3c48123 100644
--- a/UI-Project/src/router/index.js
+++ b/UI-Project/src/router/index.js
@@ -23,84 +23,84 @@
       name: 'main',
       component: () => import('../layout/MainErpView.vue'),
       children: [
-        {
-          /*----------- 鑷姩涓婄墖 ----------------*/
-          path: 'UpperSlice',
-          name: 'upperSlice',
-          component: () => import('../views/UpperSlice/upperSlice.vue'),
-          children: [
-            {
-              path: '/UpperSlice/upperSlice',
-              name: 'upperSlice',
-              component: () => import('../views/UpperSlice/upperSlice.vue'),
-            }
-          ]
-        },
-        {
-          /*----------- 鑷姩鎵爜 ----------------*/
-          path: 'ScanQrCodesIdentify',
-          name: 'scanQrCodesIdentify',
-          component: () => import('../views/ScanQrCodesIdentify/scanQrCodesIdentify.vue'),
-          children: [
-            {
-              path: '/ScanQrCodesIdentify/scanQrCodesIdentify',
-              name: 'scanQrCodesIdentify',
-              component: () => import('../views/ScanQrCodesIdentify/scanQrCodesIdentify.vue'),
-            }
-          ]
-        },
-        {
-          /*----------- 纾ㄨ竟鏈� ----------------*/
-          path: 'Edging',
-          name: 'edging',
-          component: () => import('../views/Edging/edging.vue'),
-          children: [
-            {
-              path: '/Edging/edging',
-              name: 'edging',
-              component: () => import('../views/Edging/edging.vue'),
-            }
-          ]
-        },
-        {
-          /*----------- 娓呮礂鏈� ----------------*/
-          path: 'Cleaning',
-          name: 'cleaning',
-          component: () => import('../views/Cleaning/cleaning.vue'),
-          children: [
-            {
-              path: '/Cleaning/cleaning',
-              name: 'cleaning',
-              component: () => import('../views/Cleaning/cleaning.vue'),
-            }
-          ]
-        },flipSlice
-        {
-          /*----------- 缈荤墖鍙� ----------------*/
-          path: 'FlipSlice',
-          name: 'flipSlice',
-          component: () => import('../views/FlipSlice/flipSlice.vue'),
-          children: [
-            {
-              path: '/FlipSlice/flipSlice',
-              name: 'flipSlice',
-              component: () => import('../views/FlipSlice/flipSlice.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: 'UpperSlice',
+        //   name: 'upperSlice',
+        //   component: () => import('../views/UpperSlice/upperSlice.vue'),
+        //   children: [
+        //     {
+        //       path: '/UpperSlice/upperSlice',
+        //       name: 'upperSlice',
+        //       component: () => import('../views/UpperSlice/upperSlice.vue'),
+        //     }
+        //   ]
+        // },
+        // {
+        //   /*----------- 鑷姩鎵爜 ----------------*/
+        //   path: 'ScanQrCodesIdentify',
+        //   name: 'scanQrCodesIdentify',
+        //   component: () => import('../views/ScanQrCodesIdentify/scanQrCodesIdentify.vue'),
+        //   children: [
+        //     {
+        //       path: '/ScanQrCodesIdentify/scanQrCodesIdentify',
+        //       name: 'scanQrCodesIdentify',
+        //       component: () => import('../views/ScanQrCodesIdentify/scanQrCodesIdentify.vue'),
+        //     }
+        //   ]
+        // },
+        // {
+        //   /*----------- 纾ㄨ竟鏈� ----------------*/
+        //   path: 'Edging',
+        //   name: 'edging',
+        //   component: () => import('../views/Edging/edging.vue'),
+        //   children: [
+        //     {
+        //       path: '/Edging/edging',
+        //       name: 'edging',
+        //       component: () => import('../views/Edging/edging.vue'),
+        //     }
+        //   ]
+        // },
+        // {
+        //   /*----------- 娓呮礂鏈� ----------------*/
+        //   path: 'Cleaning',
+        //   name: 'cleaning',
+        //   component: () => import('../views/Cleaning/cleaning.vue'),
+        //   children: [
+        //     {
+        //       path: '/Cleaning/cleaning',
+        //       name: 'cleaning',
+        //       component: () => import('../views/Cleaning/cleaning.vue'),
+        //     }
+        //   ]
+        // },flipSlice
+        // {
+        //   /*----------- 缈荤墖鍙� ----------------*/
+        //   path: 'FlipSlice',
+        //   name: 'flipSlice',
+        //   component: () => import('../views/FlipSlice/flipSlice.vue'),
+        //   children: [
+        //     {
+        //       path: '/FlipSlice/flipSlice',
+        //       name: 'flipSlice',
+        //       component: () => import('../views/FlipSlice/flipSlice.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',
@@ -140,71 +140,71 @@
             }
           ]
         },
-        {
-          /*----------- 鐑樺共绾� ----------------*/
-          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: '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',
diff --git a/UI-Project/src/views/GlueDispenser/glueDispenser.vue b/UI-Project/src/views/GlueDispenser/glueDispenser.vue
new file mode 100644
index 0000000..7914991
--- /dev/null
+++ b/UI-Project/src/views/GlueDispenser/glueDispenser.vue
@@ -0,0 +1,262 @@
+<!--  鐐硅兌鏈�  -->
+<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=15;//褰撳墠椤甸潰鐨勮澶嘔D
+//浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
+let socket = null;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/glueDispenser`;
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� 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锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
+});
+//淇敼宸ヤ綔鐘舵�� 銆愬け璐�/姝e湪宸ヤ綔/瀹屽伐銆�
+const workStatus = async(row,state) => {
+  let url;
+  if(state=="閲嶅彂"){
+    url="/deviceInteraction/tasking/loseMachineTask";
+  }else if(state=="姝e湪宸ヤ綔"){
+    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) => { // 鏇挎崲涓轰綘鐨凙PI绔偣  
+              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) => { // 鏇挎崲涓轰綘鐨凙PI绔偣  
+              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) => { // 鏇挎崲涓轰綘鐨凙PI绔偣  
+              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) => { // 鏇挎崲涓轰綘鐨凙PI绔偣  
+              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.glueDispenser')}}
+    </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>
+    </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: 100%; height: 460px;background-image: url(../../src/assets/鑷姩鎵撴爣鏈�.png) ;background-size: 100% 100%;"> -->
+      <!-- 鐢诲浘鍐呭 -->
+      <!-- <div style="width: 100px; height: 100px; background-color: red; position: relative; top: 171px; left: 218px">
+      </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>
\ No newline at end of file
diff --git a/UI-Project/src/views/Marking/marking.vue b/UI-Project/src/views/Marking/marking.vue
index c8b2702..8ebac0c 100644
--- a/UI-Project/src/views/Marking/marking.vue
+++ b/UI-Project/src/views/Marking/marking.vue
@@ -206,6 +206,7 @@
         :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="isMarking" :label="$t('glassInfo.isMarking')"/>
         <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')"/>
diff --git a/UI-Project/src/views/SilkScreen/SilkScreen.vue b/UI-Project/src/views/SilkScreen/SilkScreen.vue
new file mode 100644
index 0000000..99c5adc
--- /dev/null
+++ b/UI-Project/src/views/SilkScreen/SilkScreen.vue
@@ -0,0 +1,264 @@
+<!--  涓濆嵃鏈�  -->
+<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=13;//褰撳墠椤甸潰鐨勮澶嘔D
+//浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
+let socket = null;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/silkScreen`;
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� 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锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
+});
+//淇敼宸ヤ綔鐘舵�� 銆愬け璐�/姝e湪宸ヤ綔/瀹屽伐銆�
+const workStatus = async(row,state) => {
+  let url;
+  if(state=="閲嶅彂"){
+    url="/deviceInteraction/tasking/loseMachineTask";
+  }else if(state=="姝e湪宸ヤ綔"){
+    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) => { // 鏇挎崲涓轰綘鐨凙PI绔偣  
+              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) => { // 鏇挎崲涓轰綘鐨凙PI绔偣  
+              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) => { // 鏇挎崲涓轰綘鐨凙PI绔偣  
+              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) => { // 鏇挎崲涓轰綘鐨凙PI绔偣  
+              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.silkScreen')}}
+    </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>
+    </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="isSilkScreen" :label="$t('glassInfo.isSilkScreen')"/>
+        <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="silkScreenX" :label="$t('glassInfo.silkScreenX')"/>
+        <el-table-column prop="silkScreenY" :label="$t('glassInfo.silkScreenY')"/>
+        <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: 100%; height: 460px;background-image: url(../../src/assets/a.png) ;background-size: 100% 100%;">
+      <!-- 鐢诲浘鍐呭 -->
+      <div style="width: 100px; height: 100px; background-color: red; position: relative; top: 171px; left: 218px">
+      </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>
\ No newline at end of file

--
Gitblit v1.8.0