modify
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 6m13s

This commit is contained in:
sexygoat
2026-04-02 13:42:57 +08:00
parent 411206e039
commit 8df7024a45
83 changed files with 1830 additions and 1865 deletions

View File

@@ -284,7 +284,7 @@
<!-- 设备详情弹窗 -->
<ElDialog v-model="deviceDetailDialogVisible" title="设备详情" width="1000px">
<div v-if="deviceDetailLoading" style="text-align: center; padding: 40px 0">
<div v-if="deviceDetailLoading" style=" padding: 40px 0;text-align: center">
<ElIcon class="is-loading" :size="40"><Loading /></ElIcon>
</div>
<div v-else-if="currentDeviceDetail">
@@ -398,14 +398,16 @@
</ElCard>
<!-- 已绑定卡片列表 -->
<div v-if="deviceCardsLoading" style="text-align: center; padding: 40px 0">
<div v-if="deviceCardsLoading" style=" padding: 40px 0;text-align: center">
<ElIcon class="is-loading" :size="40"><Loading /></ElIcon>
</div>
<div v-else>
<ElTable :data="deviceCards" border style="width: 100%">
<ElTableColumn prop="slot_position" label="插槽位置" width="120" align="center">
<template #default="{ row }">
<div style="display: flex; align-items: center; justify-content: center; gap: 4px">
<div
style="display: flex; gap: 4px; align-items: center; justify-content: center"
>
<span>{{ row.slot_position }}</span>
<ElTag v-if="row.is_current" type="success" size="small">当前</ElTag>
</div>
@@ -435,7 +437,7 @@
</ElTable>
<div
v-if="deviceCards.length === 0"
style="text-align: center; padding: 20px; color: #909399"
style=" padding: 20px; color: #909399;text-align: center"
>
暂无设备绑定的卡
</div>
@@ -451,7 +453,7 @@
/>
<!-- 设置限速对话框 -->
<ElDialog v-model="speedLimitDialogVisible" title="设置限速" width="500px">
<ElDialog v-model="speedLimitDialogVisible" title="设置限速" width="50%">
<ElForm
ref="speedLimitFormRef"
:model="speedLimitForm"
@@ -469,7 +471,7 @@
controls-position="right"
style="width: 100%"
/>
<div style="color: #909399; font-size: 12px; margin-top: 4px">单位: KB/s</div>
<div style=" margin-top: 4px; font-size: 12px;color: #909399">单位: KB/s</div>
</ElFormItem>
<ElFormItem label="上行速率" prop="upload_speed">
<ElInputNumber
@@ -479,7 +481,7 @@
controls-position="right"
style="width: 100%"
/>
<div style="color: #909399; font-size: 12px; margin-top: 4px">单位: KB/s</div>
<div style=" margin-top: 4px; font-size: 12px;color: #909399">单位: KB/s</div>
</ElFormItem>
</ElForm>
<template #footer>
@@ -492,7 +494,7 @@
<!-- 切换SIM卡对话框 -->
<ElDialog v-model="switchCardDialogVisible" title="切换SIM卡" width="600px">
<div v-if="loadingDeviceCards" style="text-align: center; padding: 40px">
<div v-if="loadingDeviceCards" style=" padding: 40px;text-align: center">
<ElIcon class="is-loading" :size="40"><Loading /></ElIcon>
<div style="margin-top: 16px">加载设备绑定的卡列表中...</div>
</div>
@@ -534,9 +536,11 @@
:label="`${card.iccid} - 插槽${card.slot_position} - ${card.carrier_name}${card.is_current ? ' (当前)' : ''}`"
:value="card.iccid"
>
<div style="display: flex; justify-content: space-between; align-items: center">
<div style="display: flex; align-items: center; justify-content: space-between">
<span>{{ card.iccid }}</span>
<ElTag size="small" style="margin-left: 10px">插槽{{ card.slot_position }}</ElTag>
<ElTag size="small" style="margin-left: 10px"
>插槽{{ card.slot_position }}</ElTag
>
</div>
</ElOption>
</ElSelect>
@@ -1042,7 +1046,6 @@
}
} catch (error: any) {
console.error('解绑卡失败:', error)
ElMessage.error(error?.message || '解绑失败')
}
})
.catch(() => {
@@ -1214,13 +1217,15 @@
prop: 'last_online_time',
label: '最后在线时间',
width: 180,
formatter: (row: Device) => row.last_online_time ? formatDateTime(row.last_online_time) : '-'
formatter: (row: Device) =>
row.last_online_time ? formatDateTime(row.last_online_time) : '-'
},
{
prop: 'last_gateway_sync_at',
label: '最后同步时间',
width: 180,
formatter: (row: Device) => row.last_gateway_sync_at ? formatDateTime(row.last_gateway_sync_at) : '-'
formatter: (row: Device) =>
row.last_gateway_sync_at ? formatDateTime(row.last_gateway_sync_at) : '-'
},
{
prop: 'batch_no',
@@ -1310,7 +1315,6 @@
}
} catch (error) {
console.error(error)
ElMessage.error('获取设备列表失败')
} finally {
loading.value = false
}
@@ -1368,7 +1372,6 @@
await getTableData()
} catch (error) {
console.error(error)
ElMessage.error('删除失败')
}
})
.catch(() => {
@@ -1416,7 +1419,6 @@
}
} catch (error) {
console.error(error)
ElMessage.error('分配失败')
} finally {
allocateLoading.value = false
}
@@ -1467,7 +1469,6 @@
}
} catch (error) {
console.error(error)
ElMessage.error('回收失败')
} finally {
recallLoading.value = false
}
@@ -1510,7 +1511,6 @@
}
} catch (error) {
console.error('获取套餐系列列表失败:', error)
ElMessage.error('获取套餐系列列表失败')
} finally {
seriesLoading.value = false
}
@@ -1711,7 +1711,6 @@
}
} catch (error: any) {
console.error('重启设备失败:', error)
ElMessage.error(error?.message || '重启失败')
}
})
.catch(() => {
@@ -1740,7 +1739,6 @@
}
} catch (error: any) {
console.error('恢复出厂设置失败:', error)
ElMessage.error(error?.message || '操作失败')
}
})
.catch(() => {
@@ -1776,7 +1774,6 @@
}
} catch (error: any) {
console.error('设置限速失败:', error)
ElMessage.error(error?.message || '设置失败')
} finally {
speedLimitLoading.value = false
}
@@ -1818,7 +1815,6 @@
}
} catch (error) {
console.error('加载设备绑定卡列表失败:', error)
ElMessage.error('加载卡列表失败')
} finally {
loadingDeviceCards.value = false
}
@@ -1843,7 +1839,6 @@
}
} catch (error: any) {
console.error('切换SIM卡失败:', error)
ElMessage.error(error?.message || '切换失败')
} finally {
switchCardLoading.value = false
}
@@ -1881,7 +1876,6 @@
}
} catch (error: any) {
console.error('设置WiFi失败:', error)
ElMessage.error(error?.message || '设置失败')
} finally {
setWiFiLoading.value = false
}
@@ -1915,12 +1909,12 @@
})
}
if (hasAuth('device:set_speed_limit')) {
items.push({
key: 'speed-limit',
label: '设置限速'
})
}
// if (hasAuth('device:set_speed_limit')) {
// items.push({
// key: 'speed-limit',
// label: '设置限速'
// })
// }
if (hasAuth('device:switch_sim')) {
items.push({