From 902f423642e0bd17806c9b3c8bcabf4d5787772a Mon Sep 17 00:00:00 2001 From: wangfei <3597712270@qq.com> Date: 星期一, 19 八月 2024 15:18:04 +0800 Subject: [PATCH] 钢化模块进炉中视图顺序更改,所有视图点击变色(部分) --- UI-Project/src/views/Identify/identify.vue | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/UI-Project/src/views/Identify/identify.vue b/UI-Project/src/views/Identify/identify.vue index d973668..d71f75c 100644 --- a/UI-Project/src/views/Identify/identify.vue +++ b/UI-Project/src/views/Identify/identify.vue @@ -21,7 +21,7 @@ @click="showDialog(rect.glass_id)" :style="{ position: 'absolute', top: `${rect.y_axis}px`, left: `${rect.x_axis}px`, width: `${rect.width}px`, height: `${rect.height}px`, - backgroundColor: getRectColor(rect.glass_state) + backgroundColor: rect.isActive ? '#ADFF2F' : getRectColor(rect.glass_state) }" > <!-- 绠ご --> @@ -34,7 +34,7 @@ </div> </div> </el-scrollbar> - <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;"> + <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose"> <el-button type="warning" plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;"> {{ $t('order.dilapidation') }} </el-button> @@ -76,7 +76,16 @@ function showDialog(glassId: number) { currentGlassId.value = glassId; blind.value = true; + adjustedRects.value = adjustedRects.value.map(rect => + rect.glass_id === glassId ? { ...rect, isActive: true } : rect + ); } +const handleDialogClose = () => { + adjustedRects.value = adjustedRects.value.map(rect => ({ + ...rect, + isActive: false + })); +} // 鐮存崯 const handleDamage = async () => { try { @@ -221,7 +230,8 @@ widtha: rect.width , heighta: rect.height , height: rect.height * 0.165 , - glass_state: rect.glass_state + glass_state: rect.glass_state, + isActive: false })); }; webSocket.onerror = (error) => { -- Gitblit v1.8.0