fix(operator): fix operator edit issue
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m51s

This commit is contained in:
sexygoat
2026-04-10 14:00:21 +08:00
parent 9a6f085cde
commit 2b3119c549
53 changed files with 547 additions and 418 deletions

View File

@@ -1,7 +1,12 @@
<template>
<div class="single-card-page">
<!-- 资产查询区域 -->
<AssetSearchCard :has-card-info="!!cardInfo" @search="handleSearch" @refresh="handleRefresh" />
<AssetSearchCard
ref="assetSearchCardRef"
:has-card-info="!!cardInfo"
@search="handleSearch"
@refresh="handleRefresh"
/>
<!-- 卡片内容区域 -->
<div v-if="cardInfo" class="card-content-area slide-in">
@@ -21,6 +26,7 @@
@show-set-wifi="showSetWiFiDialog"
@enable-binding-card="handleEnableBindingCard"
@disable-binding-card="handleDisableBindingCard"
@navigate-to-card="handleNavigateToCard"
/>
</div>
@@ -120,6 +126,9 @@
const route = useRoute()
// ========== 组件引用 ==========
const assetSearchCardRef = ref<InstanceType<typeof AssetSearchCard>>()
// ========== 核心数据状态(使用 composable ==========
const {
cardInfo,
@@ -174,16 +183,11 @@
* 处理资产搜索
*/
const handleSearch = async ({ identifier }: { identifier: string }) => {
// 更新搜索框的值
assetSearchCardRef.value?.updateSearchValue(identifier)
// fetchAssetDetail 内部已经会并行加载所有相关数据,不需要重复调用
await fetchAssetDetail(identifier)
if (cardInfo.value) {
// 并行加载相关数据
await Promise.all([
loadPackageList(cardInfo.value.identifier),
loadCurrentPackage(cardInfo.value.identifier),
loadRealtimeStatus(cardInfo.value.identifier, cardInfo.value.asset_type),
loadAssetWallet(cardInfo.value.identifier)
])
}
}
/**
@@ -269,19 +273,35 @@
/**
* 绑定卡操作 - 启用绑定卡
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const handleEnableBindingCard = async (_card: any) => {
// TODO: 实现启用绑定卡逻辑
ElMessage.info('启用绑定卡功能待实现')
const handleEnableBindingCard = async (payload: { card: any }) => {
const { card } = payload
try {
const { CardService } = await import('@/api/modules')
await CardService.enableIotCard(card.iccid)
ElMessage.success('启用成功')
// 刷新资产信息
await handleRefresh()
} catch (error: any) {
console.error('启用绑定卡失败:', error)
ElMessage.error(error?.message || '启用失败')
}
}
/**
* 绑定卡操作 - 停用绑定卡
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const handleDisableBindingCard = async (_card: any) => {
// TODO: 实现停用绑定卡逻辑
ElMessage.info('停用绑定卡功能待实现')
const handleDisableBindingCard = async (payload: { card: any }) => {
const { card } = payload
try {
const { CardService } = await import('@/api/modules')
await CardService.disableIotCard(card.iccid)
ElMessage.success('停用成功')
// 刷新资产信息
await handleRefresh()
} catch (error: any) {
console.error('停用绑定卡失败:', error)
ElMessage.error(error?.message || '停用失败')
}
}
/**
@@ -314,6 +334,13 @@
dailyRecordsDialogVisible.value = true
}
/**
* 跳转到绑定卡信息
*/
const handleNavigateToCard = async (iccid: string) => {
await handleSearch({ identifier: iccid })
}
/**
* URL参数自动加载
*/