From 5da3a276b7847187a7c155ee069d3cd4c9e58074 Mon Sep 17 00:00:00 2001
From: HuBingJie <3146306518@qq.com>
Date: 星期日, 07 十二月 2025 23:28:14 +0800
Subject: [PATCH] 1

---
 代码管理/WCS/WCS/WIDESEAWCS_Client/src/views/Home.vue |  228 ++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 168 insertions(+), 60 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Client/src/views/Home.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Client/src/views/Home.vue"
index b893e82..5723827 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Client/src/views/Home.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Client/src/views/Home.vue"
@@ -145,34 +145,8 @@
                 :loading="loadingStates[deviceKey]?.fw">
                 澶嶄綅
               </el-button>
-              <!-- 闀挎寜锛氫笂鍗�/涓嬮檷锛堟寜涓�=1锛屾澗寮�=0锛� -->
-              <el-button type="success" size="small"
-                @pointerdown.prevent="handleLiftPress(deviceKey, 'ss')"
-                @pointerup="handleLiftRelease(deviceKey, 'ss')"
-                @pointercancel="handleLiftRelease(deviceKey, 'ss')"
-                :disabled="!isManualMode(deviceData) || deviceData['涓婂崌淇″彿鍒颁綅'] === 1"
-                :loading="activeLift && activeLift.deviceKey === deviceKey && activeLift.operationType === 'ss'">
-                涓婂崌
-              </el-button>
-              <el-button type="info" size="small"
-                @pointerdown.prevent="handleLiftPress(deviceKey, 'xj')"
-                @pointerup="handleLiftRelease(deviceKey, 'xj')"
-                @pointercancel="handleLiftRelease(deviceKey, 'xj')"
-                :disabled="!isManualMode(deviceData) || deviceData['涓嬮檷淇″彿鍒颁綅'] === 1"
-                :loading="activeLift && activeLift.deviceKey === deviceKey && activeLift.operationType === 'xj'">
-                涓嬮檷
-              </el-button>
-              <!-- 淇濋殰锛氭墜鍔ㄥ仠姝㈡寜閽紙鐐瑰嚮鍗冲彂0锛� -->
-              <el-button type="warning" size="small"
-                @click="stopLift(deviceKey, 'ss')"
-                :disabled="!isManualMode(deviceData)">
-                鍋滄涓婂崌
-              </el-button>
-              <el-button type="warning" size="small"
-                @click="stopLift(deviceKey, 'xj')"
-                :disabled="!isManualMode(deviceData)">
-                鍋滄涓嬮檷
-              </el-button>
+              <!-- 鎵撳紑鐐瑰姩闈㈡澘 -->
+              <el-button type="primary" size="small" @click="openJogDialog(deviceKey)">鐐瑰姩闈㈡澘</el-button>
             </template>
 
             <!-- 姣嶈溅鎿嶄綔鎸夐挳 -->
@@ -227,38 +201,8 @@
                 :loading="loadingStates[deviceKey]?.radarToggle" :disabled="!isManualMode(deviceData)">
                 {{ getRadarButtonText(deviceData) }}
               </el-button>
-              <!-- 闀挎寜锛氫笂鍗�/涓嬮檷锛堟寜涓�=1锛屾澗寮�=0锛� -->
-              <el-button type="success" size="small"
-                @pointerdown.prevent="handleLiftPress(deviceKey, 'ss')"
-                @pointerup="handleLiftRelease(deviceKey, 'ss')"
-                @mousedown.prevent="handleLiftPress(deviceKey, 'ss')"
-                @mouseup="handleLiftRelease(deviceKey, 'ss')"
-                @touchstart.prevent="handleLiftPress(deviceKey, 'ss')"
-                @touchend="handleLiftRelease(deviceKey, 'ss')"
-                @touchcancel="handleLiftRelease(deviceKey, 'ss')"
-                :disabled="!isManualMode(deviceData) || deviceData['涓婂崌淇″彿鍒颁綅'] === 1"
-                :loading="activeLift && activeLift.deviceKey === deviceKey && activeLift.operationType === 'ss'">
-                涓婂崌
-              </el-button>
-              <el-button type="info" size="small"
-                @pointerdown.prevent="handleLiftPress(deviceKey, 'xj')"
-                @pointerup="handleLiftRelease(deviceKey, 'xj')"
-                @pointercancel="handleLiftRelease(deviceKey, 'xj')"
-                :disabled="!isManualMode(deviceData) || deviceData['涓嬮檷淇″彿鍒颁綅'] === 1"
-                :loading="activeLift && activeLift.deviceKey === deviceKey && activeLift.operationType === 'xj'">
-                涓嬮檷
-              </el-button>
-              <!-- 淇濋殰锛氭墜鍔ㄥ仠姝㈡寜閽紙鐐瑰嚮鍗冲彂0锛� -->
-              <el-button type="warning" size="small"
-                @click="stopLift(deviceKey, 'ss')"
-                :disabled="!isManualMode(deviceData)">
-                鍋滄涓婂崌
-              </el-button>
-              <el-button type="warning" size="small"
-                @click="stopLift(deviceKey, 'xj')"
-                :disabled="!isManualMode(deviceData)">
-                鍋滄涓嬮檷
-              </el-button>
+              <!-- 鎵撳紑鐐瑰姩闈㈡澘 -->
+              <el-button type="primary" size="small" @click="openJogDialog(deviceKey)">鐐瑰姩闈㈡澘</el-button>
             </template>
           </div>
 
@@ -291,6 +235,66 @@
     <el-dialog v-model="showOperationDialog" title="璁惧楂樼骇鎿嶄綔" width="600px">
       <div>璁惧鍒濆鍖栥�佸啓鍏ュ弬鏁扮瓑楂樼骇鎿嶄綔鐣岄潰</div>
     </el-dialog>
+
+    <!-- 鐐瑰姩瀵硅瘽妗嗭細灏忓瓙椤甸潰 -->
+    <el-dialog
+      v-model="jogDialogVisible"
+      :title="jogDeviceKey ? (getDeviceDisplayName(jogDeviceKey) + ' 鐐瑰姩闈㈡澘') : '鐐瑰姩闈㈡澘'"
+      width="380px"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      append-to-body
+      @close="onJogDialogClosed"
+    >
+      <div class="jog-dialog">
+        <div class="jog-hint">鍦ㄦ湰闈㈡澘鍐呮寜涓嬪嵆鍙�1锛屾澗寮�鍗冲彂0锛涢潰鏉挎墦寮�鏈熼棿宸叉殏鍋滅洃鎺у埛鏂般��</div>
+        <div class="jog-status">
+          <div class="status-item">
+            <span>涓婂崌鍒颁綅锛�</span>
+            <span class="value">
+              {{ (jogDeviceData && (jogDeviceData['涓婂崌淇″彿鍒颁綅']===1 || jogDeviceData['RGV_Risingsignalplace']===1 || jogDeviceData['RiseArrived']===1)) ? '宸插埌浣�' : '鏈埌浣�' }}
+              <span class="signal-indicator" :class="getSignalClass((jogDeviceData && (jogDeviceData['涓婂崌淇″彿鍒颁綅']===1 || jogDeviceData['RGV_Risingsignalplace']===1 || jogDeviceData['RiseArrived']===1)) ? 1 : 0)"></span>
+            </span>
+          </div>
+          <div class="status-item">
+            <span>涓嬮檷鍒颁綅锛�</span>
+            <span class="value">
+              {{ (jogDeviceData && (jogDeviceData['涓嬮檷淇″彿鍒颁綅']===1 || jogDeviceData['RGV_Descentsignal']===1 || jogDeviceData['DescendArrived']===1)) ? '宸插埌浣�' : '鏈埌浣�' }}
+              <span class="signal-indicator" :class="getSignalClass((jogDeviceData && (jogDeviceData['涓嬮檷淇″彿鍒颁綅']===1 || jogDeviceData['RGV_Descentsignal']===1 || jogDeviceData['DescendArrived']===1)) ? 1 : 0)"></span>
+            </span>
+          </div>
+        </div>
+        <div class="jog-row">
+          <el-button type="success" class="jog-btn"
+            :disabled="!isManualMode(jogDeviceData) || jogDeviceData?.['涓婂崌淇″彿鍒颁綅'] === 1"
+            @pointerdown.prevent="jogDeviceKey && handleLiftPress(jogDeviceKey, 'ss')"
+            @pointerup="jogDeviceKey && handleLiftRelease(jogDeviceKey, 'ss')"
+            @pointercancel="jogDeviceKey && handleLiftRelease(jogDeviceKey, 'ss')"
+          >涓婂崌</el-button>
+          <el-button type="warning" class="jog-btn"
+            :disabled="!isManualMode(jogDeviceData)"
+            @click="jogDeviceKey && stopLift(jogDeviceKey, 'ss')"
+          >鍋滄涓婂崌</el-button>
+        </div>
+        <div class="jog-row">
+          <el-button type="info" class="jog-btn"
+            :disabled="!isManualMode(jogDeviceData) || jogDeviceData?.['涓嬮檷淇″彿鍒颁綅'] === 1"
+            @pointerdown.prevent="jogDeviceKey && handleLiftPress(jogDeviceKey, 'xj')"
+            @pointerup="jogDeviceKey && handleLiftRelease(jogDeviceKey, 'xj')"
+            @pointercancel="jogDeviceKey && handleLiftRelease(jogDeviceKey, 'xj')"
+          >涓嬮檷</el-button>
+          <el-button type="warning" class="jog-btn"
+            :disabled="!isManualMode(jogDeviceData)"
+            @click="jogDeviceKey && stopLift(jogDeviceKey, 'xj')"
+          >鍋滄涓嬮檷</el-button>
+        </div>
+      </div>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="onJogDialogClosed">鍏抽棴</el-button>
+        </div>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -317,6 +321,11 @@
       signalPollInterval: 1200, // 杞婚噺淇″彿杞闂撮殧(ms)
       lastLiftPressAt: {}, // 璁板綍姣忎釜(deviceKey-op)鏈�鍚庢寜涓嬬殑鏃堕棿鎴�
       liftReleaseInProgress: {}, // 姝e湪鍙戦�侀噴鏀�(0)鐨勬爣璁帮紝闃查噸澶�
+
+      // 鐐瑰姩瀛愰〉闈紙瀵硅瘽妗嗭級
+      jogDialogVisible: false,
+      jogDeviceKey: null,
+      jogSignalPollingTimer: null,
 
       // 鐐瑰嚮寮忓崌闄嶆帶鍒剁姸鎬�
       activeLiftStates: {}, // { [deviceKey]: { ss: boolean, xj: boolean } }
@@ -682,6 +691,12 @@
           return this.inboundDeviceData
       }
     }
+    ,
+    // 鐐瑰姩瀵硅瘽妗嗗綋鍓嶈澶囨暟鎹�
+    jogDeviceData() {
+      const map = this.currentMonitorDataMap()
+      return this.jogDeviceKey && map ? map[this.jogDeviceKey] : null
+    }
   },
   methods: {
     // 鏆傚仠/鎭㈠鐩戞帶杞
@@ -690,6 +705,80 @@
       if (this.pollingTimer) {
         clearTimeout(this.pollingTimer)
         this.pollingTimer = null
+      }
+    },
+    // 鎵撳紑/鍏抽棴 鐐瑰姩瀵硅瘽妗�
+    openJogDialog(deviceKey) {
+      this.jogDeviceKey = deviceKey
+      this.jogDialogVisible = true
+      // 鎵撳紑鏃舵殏鍋滅洃鎺э紝閬垮厤鍒锋柊褰卞搷鐐瑰姩閲婃斁0
+      this.pauseMonitoring()
+      // 鍚姩浠呴拡瀵硅璁惧鐨勪俊鍙疯疆璇�
+      this.startJogSignalPolling(deviceKey)
+    },
+    onJogDialogClosed() {
+      // 缁熶竴鍏抽棴閫昏緫
+      this.jogDialogVisible = false
+      this.jogDeviceKey = null
+      // 鍋滄瀵硅瘽妗嗗唴鐨勮交閲忎俊鍙疯疆璇�
+      this.stopJogSignalPolling()
+      // 鍏抽棴鏃舵仮澶嶇洃鎺�
+      this.resumeMonitoring()
+    },
+    // 瀵硅瘽妗嗗唴锛氫粎杞褰撳墠璁惧鐨勪笂/涓嬪埌浣嶄俊鍙�
+    startJogSignalPolling(deviceKey) {
+      this.stopJogSignalPolling()
+      this.jogSignalPollingTimer = setInterval(async () => {
+        try {
+          if (!this.jogDialogVisible || !deviceKey) {
+            this.stopJogSignalPolling()
+            return
+          }
+          const response = await this.http.post('api/Rgvoperainform/GetDeviceStatusDto', {
+            off: 1,
+            monitorType: this.currentMonitorType
+          })
+          if (response && response.status && response.data) {
+            const keys = Object.keys(response.data)
+            const respKey = keys.find(k => k.toLowerCase() === String(deviceKey).toLowerCase())
+            const dev = respKey ? response.data[respKey] : null
+            if (!dev) return
+            const updateMap = (mapObj) => {
+              if (!mapObj) return null
+              const devOld = mapObj[deviceKey] || {}
+              const patch = { ...devOld }
+              const riseVal = Object.prototype.hasOwnProperty.call(dev, '涓婂崌淇″彿鍒颁綅') ? dev['涓婂崌淇″彿鍒颁綅']
+                : (Object.prototype.hasOwnProperty.call(dev, 'RGV_Risingsignalplace') ? dev['RGV_Risingsignalplace']
+                : (Object.prototype.hasOwnProperty.call(dev, 'RiseArrived') ? dev['RiseArrived'] : undefined))
+              const downVal = Object.prototype.hasOwnProperty.call(dev, '涓嬮檷淇″彿鍒颁綅') ? dev['涓嬮檷淇″彿鍒颁綅']
+                : (Object.prototype.hasOwnProperty.call(dev, 'RGV_Descentsignal') ? dev['RGV_Descentsignal']
+                : (Object.prototype.hasOwnProperty.call(dev, 'DescendArrived') ? dev['DescendArrived'] : undefined))
+              if (riseVal !== undefined) patch['涓婂崌淇″彿鍒颁綅'] = riseVal
+              if (downVal !== undefined) patch['涓嬮檷淇″彿鍒颁綅'] = downVal
+              return { ...mapObj, [deviceKey]: patch }
+            }
+            if (this.currentMonitorType === 'inbound') {
+              const next = updateMap(this.inboundDeviceData)
+              if (next) this.inboundDeviceData = next
+            } else if (this.currentMonitorType === 'outbound') {
+              const next = updateMap(this.outboundDeviceData)
+              if (next) this.outboundDeviceData = next
+            } else if (this.currentMonitorType === 'safetydoor') {
+              const next = updateMap(this.safetyDoorDeviceData)
+              if (next) this.safetyDoorDeviceData = next
+            } else if (this.currentMonitorType === 'platform') {
+              const next = updateMap(this.platformDeviceData)
+              if (next) this.platformDeviceData = next
+            }
+            if (typeof this.$forceUpdate === 'function') this.$forceUpdate()
+          }
+        } catch (_) { /* ignore */ }
+      }, this.signalPollInterval)
+    },
+    stopJogSignalPolling() {
+      if (this.jogSignalPollingTimer) {
+        clearInterval(this.jogSignalPollingTimer)
+        this.jogSignalPollingTimer = null
       }
     },
     resumeMonitoring() {
@@ -1869,6 +1958,25 @@
   gap: 10px;
 }
 
+/* 鐐瑰姩瀵硅瘽妗嗘牱寮� */
+.jog-dialog {
+  display: flex;
+  flex-direction: column;
+  gap: 12px;
+}
+.jog-hint {
+  color: #909399;
+  font-size: 12px;
+}
+.jog-row {
+  display: grid;
+  grid-template-columns: 1fr 1fr;
+  gap: 10px;
+}
+.jog-btn {
+  width: 100%;
+}
+
 .operation-panel {
   text-align: center;
   padding: 20px;

--
Gitblit v1.9.3