wuyouming666
2024-04-24 ee04d1ab881479ae30c8d5600d29ac56b70f751e
UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
@@ -8,7 +8,7 @@
import { ElMessage, ElMessageBox } from 'element-plus'
import Landingindication from "./Landingindication.vue";
import Landingindicationtwo from "./Landingindicationtwo.vue";
import unloadrequest from "@/utils/unloadrequest";
import request from "@/utils/request";
const dialogFormVisiblea = ref(false)
@@ -29,7 +29,7 @@
if (typeof WebSocket === "undefined") {
  console.log("您的浏览器不支持WebSocket");
} else {
  let socketUrl = "ws://" + "localhost"+":88" + "/api/unLoadGlass/api/talk/" + viewname;
  let socketUrl = "ws://" + "localhost"+":88" + "/api/talk/" + viewname;
  if (socket != null) {
    socket.close();
    socket = null;
@@ -49,8 +49,6 @@
if (!msg.data) {
return; // 如果收到空数据,则直接返回,不执行后续逻辑
}
    let obj = JSON.parse(msg.data);
@@ -99,10 +97,10 @@
//获取流程卡号
const fetchFlowCardId = async () => {
  try {
    const response = await unloadrequest.get('/api/unLoadGlass/getflowCardId');
    const response = await request.get('unLoadGlass/downWorkStation/getflowCardId');
    console.log(response)
    if (response.code === 200) {
      flowCardOptions.value = response.data.map(item => ({ flowcard_id: item.flowcard_id }));
      flowCardOptions.value = response.data.map(item => ({ flowcard_id: item.flow_card_id }));
    } else {
      ElMessage.error(response.msg);
    }
@@ -113,7 +111,7 @@
//确认
const handleConfirm = async () => {
  try {
    const response = await unloadrequest.post('/api/unLoadGlass/updateFlowCardId', {
    const response = await request.post('unLoadGlass/downWorkStation/updateFlowCardId', {
      workstationId: workstationId.value,
      flowCardId: flowCardId.value
    }); 
@@ -147,7 +145,7 @@
//清除内容
const handleclear = async () => {
    try {
        const response = await unloadrequest.post('/api/unLoadGlass/clear', {
        const response = await request.post('unLoadGlass/downWorkStation/clear', {
            workstationId: workstationId.value,
        });
@@ -180,7 +178,7 @@
const fetchTableData = async () => {
  try {
    // 发送获取表格数据的请求,并等待响应
    const response = await unloadrequest.get('/api/unLoadGlass/getone');
    const response = await request.get('unLoadGlass/downWorkStation/getone');
    // 检查响应状态
    if (response.code === 200) {
@@ -202,7 +200,7 @@
initWebSocket();
onMounted(fetchTableData);
setInterval(fetchTableData, 2000)
// setInterval(fetchTableData, 2000)
const open = () => {
  ElMessageBox.confirm(