feat: 新增设备切卡模式
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 3m57s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 3m57s
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
@reboot-device="handleRebootDevice"
|
||||
@reset-device="handleResetDevice"
|
||||
@show-switch-card="showSwitchCardDialog"
|
||||
@show-switch-mode="showSwitchModeDialog"
|
||||
@show-set-wifi="showSetWiFiDialog"
|
||||
@enable-binding-card="handleEnableBindingCard"
|
||||
@disable-binding-card="handleDisableBindingCard"
|
||||
@@ -88,6 +89,12 @@
|
||||
:cards="cardInfo?.cards"
|
||||
@confirm="handleConfirmSwitchCard"
|
||||
/>
|
||||
<SwitchModeDialog
|
||||
v-model="switchModeDialogVisible"
|
||||
:device-identifier="cardInfo?.virtual_no || ''"
|
||||
:current-mode="cardInfo?.switch_mode as number"
|
||||
@confirm="handleConfirmSwitchMode"
|
||||
/>
|
||||
<WiFiConfigDialog
|
||||
v-model="setWiFiDialogVisible"
|
||||
:card-no="deviceRealtime?.current_iccid"
|
||||
@@ -127,6 +134,7 @@
|
||||
// 引入对话框组件
|
||||
import {
|
||||
SwitchCardDialog,
|
||||
SwitchModeDialog,
|
||||
WiFiConfigDialog,
|
||||
PackageRechargeDialog,
|
||||
DailyRecordsDialog,
|
||||
@@ -183,6 +191,7 @@
|
||||
|
||||
// ========== 对话框状态 ==========
|
||||
const switchCardDialogVisible = ref(false)
|
||||
const switchModeDialogVisible = ref(false)
|
||||
const setWiFiDialogVisible = ref(false)
|
||||
const rechargeDialogVisible = ref(false)
|
||||
const dailyRecordsDialogVisible = ref(false)
|
||||
@@ -292,6 +301,33 @@
|
||||
switchCardDialogVisible.value = false
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示切换模式对话框
|
||||
*/
|
||||
const showSwitchModeDialog = () => {
|
||||
switchModeDialogVisible.value = true
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认切换模式
|
||||
*/
|
||||
const handleConfirmSwitchMode = async (form: { switch_mode: number }) => {
|
||||
try {
|
||||
const { DeviceService } = await import('@/api/modules')
|
||||
const identifier = cardInfo.value?.virtual_no || ''
|
||||
const res = await DeviceService.setSwitchMode(identifier, form.switch_mode)
|
||||
if (res.code === 0) {
|
||||
ElMessage.success('设置切卡模式成功')
|
||||
switchModeDialogVisible.value = false
|
||||
await refreshAsset(cardInfo.value!.identifier, cardInfo.value!.asset_type)
|
||||
} else {
|
||||
ElMessage.error(res.msg || '设置切卡模式失败')
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error('设置切卡模式失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示WiFi配置对话框
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user