From 2af0346d04dc60eb9e35cff2c7ca742d2635f3c2 Mon Sep 17 00:00:00 2001 From: sexygoat <1538832180@qq.com> Date: Tue, 24 Mar 2026 16:47:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B5=84=E4=BA=A7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=AD=97=E6=AE=B5=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../asset-management/device-list/index.vue | 70 ++++- src/views/my-simcard/single-card/index.vue | 290 ++++++++++-------- 2 files changed, 222 insertions(+), 138 deletions(-) diff --git a/src/views/asset-management/device-list/index.vue b/src/views/asset-management/device-list/index.vue index 2cf9a7f..56bed1c 100644 --- a/src/views/asset-management/device-list/index.vue +++ b/src/views/asset-management/device-list/index.vue @@ -1479,27 +1479,71 @@ // ========== 设备操作相关 ========== + // 获取设备IMEI(通过virtual_no) + const getDeviceImei = async (virtualNo: string): Promise => { + try { + const res = await AssetService.resolveAsset(virtualNo) + if (res.code === 0 && res.data && res.data.asset_type === 'device') { + return res.data.imei || null + } + return null + } catch (error) { + console.error('获取设备IMEI失败:', error) + return null + } + } + // 设备操作路由 - const handleDeviceOperation = (command: string, deviceNo: string) => { + const handleDeviceOperation = async (command: string, deviceNo: string) => { switch (command) { case 'view-cards': handleViewCardsByDeviceNo(deviceNo) break - case 'reboot': - handleRebootDevice(deviceNo) + case 'reboot': { + const imei = await getDeviceImei(deviceNo) + if (!imei) { + ElMessage.error('无法获取设备IMEI,无法执行重启操作') + return + } + handleRebootDevice(imei) break - case 'reset': - handleResetDevice(deviceNo) + } + case 'reset': { + const imei = await getDeviceImei(deviceNo) + if (!imei) { + ElMessage.error('无法获取设备IMEI,无法执行重置操作') + return + } + handleResetDevice(imei) break - case 'speed-limit': - showSpeedLimitDialog(deviceNo) + } + case 'speed-limit': { + const imei = await getDeviceImei(deviceNo) + if (!imei) { + ElMessage.error('无法获取设备IMEI,无法执行限速操作') + return + } + showSpeedLimitDialog(imei) break - case 'switch-card': - showSwitchCardDialog(deviceNo) + } + case 'switch-card': { + const imei = await getDeviceImei(deviceNo) + if (!imei) { + ElMessage.error('无法获取设备IMEI,无法执行切卡操作') + return + } + showSwitchCardDialog(imei) break - case 'set-wifi': - showSetWiFiDialog(deviceNo) + } + case 'set-wifi': { + const imei = await getDeviceImei(deviceNo) + if (!imei) { + ElMessage.error('无法获取设备IMEI,无法执行WiFi设置操作') + return + } + showSetWiFiDialog(imei) break + } case 'manual-deactivate': handleManualDeactivateDevice() break @@ -1654,8 +1698,8 @@ } // 显示切换SIM卡对话框 - const showSwitchCardDialog = async (deviceNo: string) => { - currentOperatingImei.value = deviceNo + const showSwitchCardDialog = async (imei: string) => { + currentOperatingImei.value = imei switchCardForm.target_iccid = '' deviceBindingCards.value = [] switchCardDialogVisible.value = true diff --git a/src/views/my-simcard/single-card/index.vue b/src/views/my-simcard/single-card/index.vue index 9bf3d28..3f73392 100644 --- a/src/views/my-simcard/single-card/index.vue +++ b/src/views/my-simcard/single-card/index.vue @@ -1,10 +1,7 @@ - {{ - cardInfo?.shop_name || '--' - }} + + + {{ cardInfo?.series_name || '--' }} @@ -384,11 +408,11 @@ {{ formatDateTime(cardInfo?.created_at) }} - + + + + + @@ -731,7 +755,9 @@ label-width="120px" > - {{ cardInfo?.imei || cardInfo?.virtual_no }} + {{ + cardInfo?.imei || cardInfo?.virtual_no + }} @@ -791,7 +821,9 @@ label-width="120px" > - {{ cardInfo?.imei || cardInfo?.virtual_no }} + {{ + cardInfo?.imei || cardInfo?.virtual_no + }} - + - {{ cardInfo?.imei || cardInfo?.virtual_no }} + {{ + cardInfo?.imei || cardInfo?.virtual_no + }} @@ -953,8 +982,14 @@ @@ -2560,6 +2595,11 @@ // 当前套餐卡片 .current-package-card { + .package-actions { + margin-top: 16px; + text-align: right; + } + .traffic-progress-wrapper { margin-top: 24px; padding: 20px;