From c2735a870182e3d870345e09b3de52c852975e7a Mon Sep 17 00:00:00 2001 From: 严智鑫 <test> Date: 星期三, 18 九月 2024 15:47:56 +0800 Subject: [PATCH] 页面路由添加 --- UI-Project/src/views/Marking/marking.vue | 72 ++++++++++-------------------------- 1 files changed, 20 insertions(+), 52 deletions(-) diff --git a/UI-Project/src/views/Marking/marking.vue b/UI-Project/src/views/Marking/marking.vue index 4421a9f..c8b2702 100644 --- a/UI-Project/src/views/Marking/marking.vue +++ b/UI-Project/src/views/Marking/marking.vue @@ -6,6 +6,7 @@ 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({ @@ -37,42 +38,7 @@ onMounted(async () => { //浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁 socket = initializeWebSocket(socketUrl, handleMessage);// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁� - - //浣跨敤鎺ュ彛鏂瑰紡灞曠ず鏁版嵁 - //load(); }); - -// //鑾峰彇鏁版嵁 -// const load = async() => { -// //鑾峰彇璁惧浠诲姟鏁版嵁 -// try { -// const response = await request.post('/deviceInteraction/tasking/findMachineTask', -// { -// "id": 11 -// }); // 鏇挎崲涓轰綘鐨凙PI绔偣 -// 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 -// }); // 鏇挎崲涓轰綘鐨凙PI绔偣 -// if (response.code === 200) { -// findMachine.value= response.data; -// } else { -// ElMessage.warning(res.msg) -// } -// } catch (error) { -// // console.error('Error fetching rects :', error); -// } -// } //淇敼宸ヤ綔鐘舵�� 銆愬け璐�/姝e湪宸ヤ綔/瀹屽伐銆� const workStatus = async(row,state) => { let url; @@ -86,11 +52,11 @@ return; } ElMessageBox.confirm( - t('marking.tips'), + t('functionState.tips'), t('delivery.prompt'), { - confirmButtonText: t('marking.sure'), - cancelButtonText: t('marking.cancel'), + confirmButtonText: t('functionState.sure'), + cancelButtonText: t('functionState.cancel'), type: 'warning', } ) @@ -110,7 +76,7 @@ .catch(() => { ElMessage({ type: 'info', - message: t('marking.cancel'), + message: t('functionState.cancel'), }) }) @@ -119,11 +85,11 @@ //寮�宸�/鏆傚仠 const machineStatus = async(state) => { ElMessageBox.confirm( - t('marking.tips'), + t('functionState.tips'), t('delivery.prompt'), { - confirmButtonText: t('marking.sure'), - cancelButtonText: t('marking.cancel'), + confirmButtonText: t('functionState.sure'), + cancelButtonText: t('functionState.cancel'), type: 'warning', } ) @@ -144,18 +110,18 @@ .catch(() => { ElMessage({ type: 'info', - message: t('marking.cancel'), + message: t('functionState.cancel'), }) }) } //鐮存崯 const damagedTask = async(row) => { ElMessageBox.confirm( - t('marking.tips'), + t('functionState.tips'), t('delivery.prompt'), { - confirmButtonText: t('marking.sure'), - cancelButtonText: t('marking.cancel'), + confirmButtonText: t('functionState.sure'), + cancelButtonText: t('functionState.cancel'), type: 'warning', } ) @@ -175,18 +141,18 @@ .catch(() => { ElMessage({ type: 'info', - message: t('marking.cancel'), + message: t('functionState.cancel'), }) }) } //涓嬬嚎(鎷胯蛋) const glassDownLine = async(row) => { ElMessageBox.confirm( - t('marking.tips'), + t('functionState.tips'), t('delivery.prompt'), { - confirmButtonText: t('marking.sure'), - cancelButtonText: t('marking.cancel'), + confirmButtonText: t('functionState.sure'), + cancelButtonText: t('functionState.cancel'), type: 'warning', } ) @@ -206,7 +172,7 @@ .catch(() => { ElMessage({ type: 'info', - message: t('marking.cancel'), + message: t('functionState.cancel'), }) }) } @@ -225,7 +191,9 @@ <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="(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> -- Gitblit v1.8.0