| | |
| | | :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> |
| | | |
| | | <!-- æ¯è½¦æä½æé® --> |
| | |
| | | :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> |
| | | |
| | |
| | | <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> |
| | | |
| | |
| | | signalPollInterval: 1200, // è½»éä¿¡å·è½®è¯¢é´é(ms) |
| | | lastLiftPressAt: {}, // è®°å½æ¯ä¸ª(deviceKey-op)æåæä¸çæ¶é´æ³ |
| | | liftReleaseInProgress: {}, // æ£å¨åééæ¾(0)çæ è®°ï¼é²éå¤ |
| | | |
| | | // ç¹å¨å页é¢ï¼å¯¹è¯æ¡ï¼ |
| | | jogDialogVisible: false, |
| | | jogDeviceKey: null, |
| | | jogSignalPollingTimer: null, |
| | | |
| | | // ç¹å»å¼åéæ§å¶ç¶æ |
| | | activeLiftStates: {}, // { [deviceKey]: { ss: boolean, xj: boolean } } |
| | |
| | | return this.inboundDeviceData |
| | | } |
| | | } |
| | | , |
| | | // ç¹å¨å¯¹è¯æ¡å½åè®¾å¤æ°æ® |
| | | jogDeviceData() { |
| | | const map = this.currentMonitorDataMap() |
| | | return this.jogDeviceKey && map ? map[this.jogDeviceKey] : null |
| | | } |
| | | }, |
| | | methods: { |
| | | // æå/æ¢å¤çæ§è½®è¯¢ |
| | |
| | | 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() { |
| | |
| | | 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; |