From d1758c1be9863a10d03928bf93a42ca1bf31d07b Mon Sep 17 00:00:00 2001 From: ZengTao <2773468879@qq.com> Date: 星期四, 07 十二月 2023 13:09:43 +0800 Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes --- CanadaMes-ui/src/views/Electrical/ServoManualone.vue | 129 ++++++++++++++++++++++++++---------------- 1 files changed, 79 insertions(+), 50 deletions(-) diff --git a/CanadaMes-ui/src/views/Electrical/ServoManualone.vue b/CanadaMes-ui/src/views/Electrical/ServoManualone.vue index 88756d3..9323ec7 100644 --- a/CanadaMes-ui/src/views/Electrical/ServoManualone.vue +++ b/CanadaMes-ui/src/views/Electrical/ServoManualone.vue @@ -11,34 +11,41 @@ }}</router-link> --> <router-link to="/Electrical/Sign" tag="el-button" type="text" active-class="blue-button">{{ $t('Sign') }}</router-link> - <router-link to="/Electrical/Servomanual" tag="el-button" type="text" active-class="blue-button">{{ $t('Servo Manual') + <router-link to="/Electrical/Servomanual" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter') }}</router-link> </el-breadcrumb> <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb"> - - <router-link to="/Electrical/Servomanualone" tag="el-button" type="text" active-class="blue-button">{{ $t('Servomanualone') - }}</router-link> - <router-link to="/Electrical/Parameter1" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter1') - }}</router-link> - <router-link to="/Electrical/Parameter2" tag="el-button" type="text" @click="closeSocket()" active-class="blue-button">{{ $t('Parameter2') - }}</router-link> - <router-link to="/Electrical/Positioning1" tag="el-button" type="text" active-class="blue-button">{{ $t('Positioning1') - }}</router-link> - <router-link to="/Electrical/Positioning2" tag="el-button" type="text" active-class="blue-button">{{ $t('Positioning2') - }}</router-link> - <router-link to="/Electrical/ManualonePosition" tag="el-button" type="text" active-class="blue-button">{{ - $t('ManualonePosition') - }}</router-link> - <router-link to="/Electrical/ManualonePosition2" tag="el-button" type="text" active-class="blue-button">{{ - $t('ManualonePosition2') - }}</router-link> - <router-link to="/Electrical/AutomaticParameterSetting" tag="el-button" type="text" active-class="blue-button">{{ - $t('AutomaticParameterSetting') + <router-link to="/Electrical/Parameter2" tag="el-button" type="text" active-class="blue-button">{{ $t('Automatic State') }}</router-link> <router-link to="/Electrical/ManualJog" tag="el-button" type="text" active-class="blue-button">{{ $t('ManualJog') }}</router-link> + + <router-link to="/Electrical/ManualonePosition" tag="el-button" type="text" active-class="blue-button">{{ + $t('ManualonePosition') + }}</router-link> + +<router-link to="/Electrical/Servomanualone" tag="el-button" type="text" active-class="blue-button">{{ + $t('Servomanualone') + }}</router-link> + <router-link to="/Electrical/Parameter1" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter1') + }}</router-link> + + <router-link to="/Electrical/Positioning1" tag="el-button" type="text" active-class="blue-button">{{ + $t('Address parameter settings') + }}</router-link> + <router-link to="/Electrical/Positioning2" tag="el-button" type="text" active-class="blue-button">{{ + $t('Positioning2') + }}</router-link> + + <router-link to="/Electrical/ManualonePosition2" tag="el-button" type="text" active-class="blue-button">{{ + $t('ManualonePosition2') + }}</router-link> + <router-link to="/Electrical/AutomaticParameterSetting" tag="el-button" type="text" active-class="blue-button">{{ + $t('Speed parameter settings') + }}</router-link> + </el-breadcrumb> <el-row :gutter="26"> @@ -56,8 +63,8 @@ </el-row> <div class="button-row" style="display: flex; justify-content: space-between;"> <div v-for="(item, itemIndex) in dataGroup" :key="itemIndex"> - <el-button v-if="item.button && language === 'en-US' " :name="item.button.name" v-model="item.button.value" :class="{'action-button': true, 'error-button': item.button.name === 'Fault' && item.button.value === 1,'error-button2': item.button.name === 'NotZero' && item.button.value === 0,'fuwei': item.button.name === 'Reset' && item.button.value === 1,'huiling': item.button.name === 'Home' && item.button.value === 1,'qidong': item.button.name === 'A01 Semi-Auto' && item.button.value === 1,'qidong2': item.button.name === 'A02 Semi-Auto' && item.button.value === 1,'qidong3': item.button.name === 'A01 Semi-Auto Start' && item.button.value === 1,'qidong4': item.button.name === 'A02 Semi-Auto Start' && item.button.value === 1,'qidong5': item.button.name === 'A02 Semi-Auto Start' && item.button.value === 1}" @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{ item.button.name }}</el-button> - <el-button v-if="item.button && language === 'zh-CN' " :name="item.button.name" v-model="item.button.value" :class="{'action-button': true, 'error-button': item.button.name === '鏁呴殰' && item.button.value === 1,'error-button2': item.button.name === '鏈洖闆�' && item.button.value === 0,'fuwei': item.button.name === '澶嶄綅' && item.button.value === 1,'huiling': item.button.name === '鍥為浂' && item.button.value === 1,'qidong': item.button.name === 'A01鍗婅嚜鍔�' && item.button.value === 1,'qidong2': item.button.name === 'A02鍗婅嚜鍔�' && item.button.value === 1,'qidong3': item.button.name === 'A01鍗婅嚜鍔ㄥ惎鍔�' && item.button.value === 1,'qidong4': item.button.name === 'A02鍗婅嚜鍔ㄥ惎鍔�' && item.button.value === 1,'qidong5': item.button.name === 'A02鍗婅嚜鍔�' && item.button.value === 1 }" @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{ item.button.name }}</el-button> + <el-button v-if="item.button && language === 'en-US' " :name="item.button.name" v-model="item.button.value" :class="{'action-button': true, 'error-button': item.button.name === 'Fault' && item.button.value === 1,'error-button2': item.button.name === 'NotZero' && item.button.value === 0,'fuwei': item.button.name === 'Reset' && item.button.value === 1,'huiling': item.button.name === 'Home' && item.button.value === 1,'qidong': item.button.name === 'A01 Semi-Auto' && item.button.value === 1,'qidong2': item.button.name === 'A02 Semi-Auto' && item.button.value === 1,'qidong3': item.button.name === 'A01 Semi-Auto Start' && item.button.value === 1,'qidong4': item.button.name === 'A02 Semi-Auto Start' && item.button.value === 1,'qidong5': item.button.name === 'A02 Semi-Auto Start' && item.button.value === 1,'jiting': item.button.name === 'Abort/ResumeTasks' && item.button.value === 1}" @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{ item.button.name }}</el-button> + <el-button v-if="item.button && language === 'zh-CN' " :name="item.button.name" v-model="item.button.value" :class="{'action-button': true, 'error-button': item.button.name === '鏁呴殰' && item.button.value === 1,'error-button2': item.button.name === '鏈洖闆�' && item.button.value === 0,'fuwei': item.button.name === '澶嶄綅' && item.button.value === 1,'huiling': item.button.name === '鍥為浂' && item.button.value === 1,'qidong': item.button.name === 'A01鍗婅嚜鍔�' && item.button.value === 1,'qidong2': item.button.name === 'A02鍗婅嚜鍔�' && item.button.value === 1,'qidong3': item.button.name === 'A01鍗婅嚜鍔ㄥ惎鍔�' && item.button.value === 1,'qidong4': item.button.name === 'A02鍗婅嚜鍔ㄥ惎鍔�' && item.button.value === 1,'qidong5': item.button.name === 'A02鍗婅嚜鍔�' && item.button.value === 1,'jiting': item.button.name === '鎬ュ仠鍚庝腑姝�/缁х画閫夋嫨' && item.button.value === 1 }" @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{ item.button.name }}</el-button> </div> </div> </el-card> @@ -260,6 +267,33 @@ // ) } +// if (currentButtonName === 'Abort/ResumeTasks' || currentButtonName === '鎬ュ仠鍚庝腑姝�/缁х画閫夋嫨') { +// const data3 = []; +// const resetButtonValues3 = this.jsonData.map(item => { +// const buttonItem3 = item.find(subItem => subItem.button && ['Abort/resumeTasks', '鎬ュ仠鍚庝腑姝�/缁х画閫夋嫨'].includes(subItem.button.name)); + +// return buttonItem3 ? buttonItem3.button.value : null; +// }).filter(value => value !== null); + +// // 灏嗗緱鍒扮殑鍊兼坊鍔犲埌 data 鏁扮粍涓� +// data3.push(resetButtonValues3.flat()); + +// // 鍦� data3 鏁扮粍鍓嶉潰娣诲姞涓や釜绌烘暟缁� + +// data3.push([], [], [],[], [], [], [],[]); + +// // 鍒涘缓 jsonObject3 瀵硅薄锛屽苟娣诲姞 data3 灞炴�� +// const jsonObject3 = { data: data3 }; + +// // 鎻愪氦鏁版嵁鍒板悗绔� +// const jsonString3 = JSON.stringify(jsonObject3); +// console.log('鎬ュ仠鍚庝腑姝�/缁х画閫夋嫨:', jsonString3); +// socket?.send(jsonString3); +// // setTimeout(()=> +// // window.location.reload(),2000 +// // ) +// } + //A01鍗婅嚜鍔ㄦ彁浜� @@ -434,7 +468,7 @@ } let obj = JSON.parse(msg.data); - // console.log(obj) + console.log(obj) const weihuiling=obj.weihuiling; const jsonData2 = this.jsonData; @@ -515,22 +549,27 @@ //鏈洖闆舵洿鏂� -for (let i = 3; i < jsonData2.length; i++) { - let arr2 = jsonData2[i]; - for (let j = 3; j < arr2.length; j++) { - let obj3 = arr2[j]; - if(obj3.button){ - if (obj3.button && (obj3.button.name === "鏈洖闆�" || obj3.button.name === "NotZero" )) { - obj3.button.value = weihuiling[0][i]; - // console.log(obj3.button.value) - } +jsonData2[2][3].button.value = weihuiling[0][0]; +jsonData2[3][3].button.value = weihuiling[0][1]; +jsonData2[4][4].button.value = weihuiling[0][2]; +jsonData2[5][4].button.value = weihuiling[0][3]; - } +// for (let i = 3; i < jsonData2.length; i++) { +// let arr2 = jsonData2[i]; +// for (let j = 3; j < arr2.length; j++) { +// let obj3 = arr2[j]; +// if(obj3.button){ +// if (obj3.button && (obj3.button.name === "鏈洖闆�" || obj3.button.name === "NotZero" )) { +// obj3.button.value = weihuiling[0][i]; +// // console.log(obj3.button.value) +// } + +// } - } +// } -} +// } // console.log(jsonData2) //杩涚墖id jsonData2.forEach((item) => { @@ -548,25 +587,12 @@ } }); }); + + //鎬ュ仠 -for (let i = 0; i < jsonData2.length; i++) { - let arr2 = jsonData2[i]; - for (let j = 0; j < arr2.length; j++) { - let obj3 = arr2[j]; - if(obj3.button){ - if (obj3.button && (obj3.button.name === "鎬ュ仠鍚庝腑姝�/缁х画閫夋嫨" || obj3.button.name === "Abort/ResumeTasks" )) { - obj3.button.value = obj.resumeTasks[0][i]; - console.log(obj3.button.value) - } - } - - } - - -} @@ -687,4 +713,7 @@ .huiling { background-color: green; } +.jiting{ + background-color: green; +} </style> \ No newline at end of file -- Gitblit v1.8.0