From a1bf701b728e79151bc34ffc8cbe479ab9ca53e4 Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期二, 11 三月 2025 16:25:38 +0800
Subject: [PATCH] 单独钢化页面新增序号显示,钢化前大理片笼部分样式及接口
---
UI-Project/src/layout/MainErpView.vue | 71 +++++++++++++----------------------
1 files changed, 27 insertions(+), 44 deletions(-)
diff --git a/UI-Project/src/layout/MainErpView.vue b/UI-Project/src/layout/MainErpView.vue
index 5528ee9..ce2f952 100644
--- a/UI-Project/src/layout/MainErpView.vue
+++ b/UI-Project/src/layout/MainErpView.vue
@@ -3,19 +3,22 @@
import userInfo from '@/stores/userInfo'
import request from '@/utils/request'
import {ElMessage} from 'element-plus'
-import {ref, watch, onMounted } from 'vue'
+import {ref, watch, onMounted, onUnmounted } from 'vue'
import deepClone from '@/utils/deepClone'
import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n'
- const { t } = useI18n()
- let language = ref(localStorage.getItem('lang') || 'zh')
+import { provide } from 'vue';
+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')
const store = userInfo()
const isCollapse = ref(false);
// const { $i18n } = useI18n(); // 鑾峰彇 i18n 瀹炰緥
const router = useRouter()
const userStore = useUserInfoStore()
// const user = userStore.user.userName
-
let userInfoStr = window.localStorage.getItem('userInfo')
console.log(userInfoStr);
// const userInfoStr = localStorage.getItem('userInfo');
@@ -29,6 +32,17 @@
})
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);
function replaceChineseWithEnglish(menuData) {
// 瀹氫箟涓縿鏂囧鐓у叧绯诲璞�
const translation = {
@@ -66,7 +80,7 @@
}
function replaceChineseWithRussian(menuData) {
// 瀹氫箟涓嫳鏂囧鐓у叧绯诲璞�
- const translation = {
+ const translation = {
'涓婄墖鏈�': 'Loading Machine',
'涓婄墖': 'Start showing a movie',
'鎺扮墖/璇嗗埆': 'Breaking /Identification',
@@ -101,7 +115,6 @@
}
//鎻愬彇鑿滃崟妯″潡鍒楄〃
let menuList = $ref([])
-
request.get('/loadGlass/sys/menu/getMenuTree').then((res) => {
if (res.code == 200) {
menuList = res.data
@@ -120,7 +133,6 @@
})
const menu = ref(null)
let indexKey = ref(null)
-
function handleOpen(key) {
indexKey.value = key
}
@@ -133,11 +145,9 @@
},
{deep: true}
)
-
router.beforeEach((to, from) => {
//return false
})
-
let openFlag = $ref(null)
//鍘熷鑿滃崟鎵撳紑
const openMenu = (menuID) => {
@@ -150,8 +160,15 @@
function toggleCollapse() {
isCollapse.value = !isCollapse.value;
}
+onMounted(() => {
+ socket = initializeWebSocket(socketUrl, handleMessage);
+});
+ onUnmounted(() => {
+ if (socket) {
+ closeWebSocket(socket);
+ }
+ });
</script>
-
<template>
<div id="all">
<el-container>
@@ -219,40 +236,29 @@
</el-container>
</div>
</template>
-
<style scoped>
-
.el-menu-vertical-demo:not(.el-menu--collapse) {
width: 200px;
min-height: 400px;
text-align: left;
-
}
-
-
-
-
#all {
background-color: #eee;
height: 100%;
}
-
.el-container {
height: 100vh;
width: 99vw;
}
-
* {
padding: 0;
margin: 0;
}
-
:deep(.sys-quit) {
float: right;
margin-right: 1rem;
width: 5rem;
}
-
/* 妯嚎 */
#line {
float: right;
@@ -264,16 +270,13 @@
position: relative;
text-align: center;
}
-
:deep(span) {
margin-right: 0;
}
-
.el-collapse {
font-size: 16px;
font-weight: bold;
}
-
#main {
width: 99%;
float: right;
@@ -281,9 +284,7 @@
background-color: #fff;
}
/*------------*/
-
/* .menu div div{
-
width: 138px;
height: 35px;
line-height: 35px;
@@ -305,24 +306,20 @@
/* background-color:#5CADFE; */
/* box-shadow: 0 8px 16px 0 rgba(0,0,0,0), 0 6px 5px 0 rgba(0,0,0,0.19); */
/* } */
-
.menu {
width: 138px;
height: 33px;
line-height: 25px;
-
color: #000000;
font-size: 16px;
padding-left: 15px;
padding-right: 2px;
}
-
ul {
height: auto;
margin: 1px auto;
text-align: center;
}
-
ul li {
height: 28px;
width: 180px;
@@ -335,16 +332,13 @@
text-align: left;
/* border-radius:8px; */
/* outline: none; */
-
/* background: #5CADFE; */
/* box-shadow: 0 8px 16px 0 rgba(0,0,0,0), 0 6px 5px 0 rgba(0,0,0,0.19); */
}
-
ul li:hover {
/* background:#5CADFE ; */
color: #ffffff;
}
-
ul li a {
text-decoration: none;
color: #000000;
@@ -353,7 +347,6 @@
ul li a:hover {
color: #1087ff;
}
-
.item_divider {
width: 118px;
height: 0px;
@@ -361,7 +354,6 @@
opacity: 0.8; */
margin-bottom: 2px;
}
-
.item a {
width: 138px;
height: 35px;
@@ -372,13 +364,11 @@
font-size: 14px;
text-decoration: none;
}
-
.menu_title {
width: 180px;
/* white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis; */
-
height: 45px;
line-height: 55px;
/* background: #fafafa; */
@@ -391,12 +381,10 @@
font-weight: bold;
overflow: hidden;
}
-
.menu_title:hover {
/* background: #dedede; */
color: #3b9af9;
}
-
.indicator {
display: block;
width: 40px;
@@ -408,7 +396,6 @@
transition: all 0.3s ease;
text-align: center;
}
-
/* 鍔ㄧ敾鏁堟灉 */
.enter-x-left {
z-index: 9;
@@ -418,19 +405,15 @@
transform: translateX(-50px);
transition: all 0.3s ease;
}
-
.enter-x-left:nth-child(1) {
animation-delay: 0.1s;
}
-
.enter-x-left:nth-child(2) {
animation-delay: 0.2s;
}
-
.enter-x-left:nth-child(3) {
animation-delay: 0.3s;
}
-
.enter-x-left:nth-child(4) {
animation-delay: 0.4s;
}
--
Gitblit v1.8.0