From ac7acc1d898b5b83e653c3b65a77d982c01a5000 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期二, 23 九月 2025 13:48:31 +0800
Subject: [PATCH] 1、报警数据推送去掉固定code条件
---
UI-Project/src/layout/MainErpView.vue | 138 +++++++++++++++++++++++++++++++++++++++------
1 files changed, 118 insertions(+), 20 deletions(-)
diff --git a/UI-Project/src/layout/MainErpView.vue b/UI-Project/src/layout/MainErpView.vue
index f4d3163..80e65e3 100644
--- a/UI-Project/src/layout/MainErpView.vue
+++ b/UI-Project/src/layout/MainErpView.vue
@@ -8,8 +8,8 @@
import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n'
import { provide } from 'vue';
-import {host, WebSocketHost} from '@/utils/constants'
-import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService';
+// import {host, WebSocketHost} from '@/utils/constants'
+// import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService';
const globalDate = ref('');
const { t } = useI18n()
let language = ref(localStorage.getItem('lang') || 'zh')
@@ -31,17 +31,15 @@
})
router.push('/login')
}
-let socket = null;
-const socketUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/mainMes`;
-const handleMessage = (data) => {
- if(data.globalDate!=null){
- window.localStorage.setItem('getglobalDate', data.globalDate[0])
- }else{
- globalDate.value = ''
- }
- }
- let getglobalDate = window.localStorage.getItem('getglobalDate')
- provide('globalDate', getglobalDate);
+// let socket = null;
+// const socketUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/mainMes`;
+// const handleMessage = (data) => {
+// if(data.globalDate!=null){
+// window.localStorage.setItem('getglobalDate', data.globalDate[0])
+// }else{
+// globalDate.value = ''
+// }
+// }
function replaceChineseWithEnglish(menuData) {
// 瀹氫箟涓縿鏂囧鐓у叧绯诲璞�
const translation = {
@@ -81,16 +79,23 @@
// 瀹氫箟涓嫳鏂囧鐓у叧绯诲璞�
const translation = {
'涓婄墖鏈�': 'Loading Machine',
- '涓婄墖': 'Start showing a movie',
+ '涓婄墖涓�绾�': 'First line on film',
+ '涓婄墖浜岀嚎': 'Second line on film',
'鎺扮墖/璇嗗埆': 'Breaking /Identification',
+ '鎺扮墖涓�绾�': 'Broken piece line',
+ '鎺扮墖浜岀嚎': 'Broken pieces with two lines',
'鍗у紡缂撳瓨': 'Horizontal cache',
+ '鍗у紡缂撳瓨涓�鍙风嚎': 'Horizontal Cache 1',
+ '鍗у紡缂撳瓨浜屽彿绾�': 'Horizontal Cache 2',
'纾ㄨ竟鍓嶅崸寮忕紦瀛�': 'Horizontal buffer before edge grinding',
'涓嬬墖鍗у紡缂撳瓨': 'Offline horizontal cache',
'纾ㄨ竟锛堝喎鍔犲伐锛�': 'Grinding edge (cold processing)',
+ '纾ㄨ竟(鍐峰姞宸�)': 'Grinding edge (cold processing)',
'1绾跨(杈�(鍐峰姞宸�)': '1-line edge grinding (cold processing)',
'2绾跨(杈�(鍐峰姞宸�)': '2-line edge grinding (cold processing)',
'澶х悊鐗囩': 'Dali slice cage',
'閽㈠寲': 'Toughened',
+ '閽㈠寲鏌ヨ': 'Tempered steel inquiry',
'閽㈠寲鍓�': 'Before Tempering',
'閽㈠寲鍚�': 'After Tempering',
'涓嬬墖鍙�': 'Next Stage',
@@ -98,10 +103,72 @@
'鐢ㄦ埛绠$悊': 'User Management',
'鏉冮檺绠$悊': 'Rights Management',
'瑙掕壊绠$悊': 'Roles',
+ '绯荤粺閰嶇疆': 'system configuration',
'鍙鍖栫郴缁�': 'visualization system',
'鎶ュ伐绠$悊': 'Job reporting management',
'浠撳偍涓績': 'Storage Center',
'鍘熺墖浠撳偍': 'Original film storage',
+ '涓┖': 'Hollow',
+ '涓┖涓�绾�': 'Hollow Line',
+ '涓┖浜岀嚎': 'Hollow Second Line',
+ '涓┖涓夌嚎': 'Hollow three line',
+ '涓┖鐞嗙墖绗�': 'Hollow Film processing cage',
+ '鎶橀摑妗嗕竴绾�': '1 Fold aluminum frame',
+ '鎶橀摑妗嗕簩绾�': '2 Fold aluminum frame',
+ '鎶橀摑妗嗕笁绾�': '3 Fold aluminum frame',
+ '澶у睆鏄剧ず': 'Large Screen Display',
+ };
+ menuData.forEach(menu => {
+ menu.menuName = translation[menu.menuName] || menu.menuName;
+ // if (menu.children) {
+ menu.children && menu.children.forEach(submenu => {
+ submenu.menuName = translation[submenu.menuName] || submenu.menuName;
+ });
+ // }
+ });
+}
+function replaceChineseWithKorean(menuData) {
+ // 瀹氫箟涓煩鏂囧鐓у叧绯诲璞�
+ const translation = {
+ '涓婄墖鏈�': '搿滊敥 毹胳嫚',
+ '涓婄墖涓�绾�': '鞝勴幐 鞚检劆',
+ '涓婄墖浜岀嚎': '鞝勴幐 2靹�.',
+ '鎺扮墖/璇嗗埆': '旎ろ寘/鞁濍硠',
+ '鎺扮墖涓�绾�': '頃� 欷勲 飒缄皽雼�',
+ '鎺扮墖浜岀嚎': '飒缄皽旮� 2 靹�',
+ '鍗у紡缂撳瓨': '靾橅弶 氩勴嵓',
+ '鍗у紡缂撳瓨涓�鍙风嚎': '靾橅弶 旌愳嫓 1順胳劆',
+ '鍗у紡缂撳瓨浜屽彿绾�': '靾橅弶 旌愳嫓 2順胳劆',
+ '纾ㄨ竟鍓嶅崸寮忕紦瀛�': '鞐愳 鞝� 靾橅弶 氩勴嵓',
+ '涓嬬墖鍗у紡缂撳瓨': '鞏鸽霐� 靾橅弶 氩勴嵓',
+ '纾ㄨ竟锛堝喎鍔犲伐锛�': '霛检澑1 鞐愳 (旖滊摐 鞗岉偣) ',
+ '纾ㄨ竟(鍐峰姞宸�)': '霛检澑1 鞐愳 (旖滊摐 鞗岉偣) ',
+ '1绾跨(杈�(鍐峰姞宸�)': '霛检澑1 鞐愳 (旖滊摐 鞗岉偣) ',
+ '2绾跨(杈�(鍐峰姞宸�)': '霛检澑2 鞐愳 (旖滊摐 鞗岉偣) ',
+ '澶х悊鐗囩': '鞙犽Μ 攵勲 旒�鞚挫',
+ '閽㈠寲': '臧曧檾',
+ '閽㈠寲鏌ヨ': '臧曧檾 臁绊殞',
+ '閽㈠寲鍓�': '臧曧檾 鞝�',
+ '閽㈠寲鍚�': '臧曧檾 頉�',
+ '涓嬬墖鍙�': '鞏鸽霐� 鞀ろ厡鞚挫厴',
+ '绯荤粺绠$悊': '鞁滌姢韰� 甏�毽�',
+ '鐢ㄦ埛绠$悊': '靷毄鞛� 甏�毽�',
+ '鏉冮檺绠$悊': '甓岉暅 甏�毽�',
+ '瑙掕壊绠$悊': '鞐暊 甏�毽�',
+ '绯荤粺閰嶇疆': '鞁滌姢韰� 甑劚',
+ '鍙鍖栫郴缁�': '鞁滉皝頇� 鞁滌姢韰�',
+ '鎶ュ伐绠$悊': '鞁犽 甏�毽�',
+ '浠撳偍涓績': '彀疥碃 鞝�鞛� 靹柬劙',
+ '鍘熺墖浠撳偍': '鞗愲掣 彀疥碃',
+ '涓┖': '欷戧车',
+ '涓┖涓�绾�': '欷戧车 鞚检劆',
+ '涓┖浜岀嚎': '欷戧车 2靹�',
+ '涓┖涓夌嚎': '欷戧车 3靹�',
+ '涓┖鐞嗙墖绗�': '欷戧车毽� 韼鸽”',
+ '鎶橀摑妗嗕竴绾�': '鞎岆(氙鸽妱 韰岆憪毽� 鞚检劆鞚� 鞝戨嫟',
+ '鎶橀摑妗嗕簩绾�': '鞎岆(氙鸽妱 頂勲爤鞛� 2靹� 鞝戧赴',
+ '鎶橀摑妗嗕笁绾�': '鞎岆(氙鸽妱 韰岆憪毽� 靹� 欷勳潉 鞝戨嫟.',
+ '澶у睆鏄剧ず': '雽�順� 頇旊┐ 響滌嫓',
};
menuData.forEach(menu => {
menu.menuName = translation[menu.menuName] || menu.menuName;
@@ -124,9 +191,19 @@
if (language.value === 'py') {
replaceChineseWithEnglish(menuList);
}
+ if (language.value === 'kr') {
+ replaceChineseWithKorean(menuList);
+ }
} else {
ElMessage.warning(res.msg)
router.push('/login')
+ }
+})
+request.post('/loadGlass/sys/menu/getNowDate').then((res) => {
+ if (res.code == 200) {
+ window.localStorage.setItem('getglobalDate', res.data)
+ } else {
+ ElMessage.warning(res.msg)
}
})
const menu = ref(null)
@@ -159,13 +236,34 @@
isCollapse.value = !isCollapse.value;
}
onMounted(() => {
- socket = initializeWebSocket(socketUrl, handleMessage);
+ // fetchlack()
+ // socket = initializeWebSocket(socketUrl, handleMessage);
});
- onUnmounted(() => {
- if (socket) {
- closeWebSocket(socket);
- }
- });
+// const fetchlack = async () => {
+// try {
+// console.log(33333);
+// const response = await request.post('/loadGlass/sys/menu/getNowDate')
+// console.log(response.code);
+// if (response.code == 200) {
+// console.log(11111);
+// console.log(response.data);
+// console.log(2222);
+// // window.localStorage.setItem('getglobalDate', response.data)
+// } else {
+// ElMessage.error(response.message);
+// }
+// }
+// catch (error) {
+// // 澶勭悊閿欒
+// }
+// }
+ let getglobalDate = window.localStorage.getItem('getglobalDate')
+ provide('globalDate', getglobalDate);
+ // onUnmounted(() => {
+ // if (socket) {
+ // closeWebSocket(socket);
+ // }
+ // });
</script>
<template>
<div id="all">
--
Gitblit v1.8.0