feat: 新增更新资产实名认证策略
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m5s

This commit is contained in:
sexygoat
2026-04-20 15:10:23 +08:00
parent d721c4b8a9
commit 3acb626a34
10 changed files with 352 additions and 21 deletions

View File

@@ -592,6 +592,14 @@
</ElButton>
</template>
</ElDialog>
<!-- 实名认证策略对话框 -->
<RealnamePolicyDialog
v-model="realnamePolicyDialogVisible"
:asset-identifier="currentRealnamePolicyAsset"
:current-policy="currentRealnamePolicy"
@confirm="handleConfirmRealnamePolicy"
/>
</ElCard>
</div>
</ArtTableFullScreen>
@@ -623,6 +631,7 @@
import { useAuth } from '@/composables/useAuth'
import { formatDateTime } from '@/utils/business/format'
import type { PackageSeriesResponse } from '@/types/api'
import RealnamePolicyDialog from '@/components/device/RealnamePolicyDialog.vue'
defineOptions({ name: 'DeviceList' })
@@ -755,6 +764,11 @@
switch_mode: [{ required: true, message: '请选择切卡模式', trigger: 'change' }]
})
// 实名认证策略相关
const realnamePolicyDialogVisible = ref(false)
const currentRealnamePolicyAsset = ref<string>('')
const currentRealnamePolicy = ref<string>('none')
// 搜索表单初始值
const initialSearchState = {
virtual_no: '',
@@ -1601,6 +1615,35 @@
case 'switch-mode':
showSwitchModeDialog(deviceNo, device?.switch_mode)
break
case 'realname-policy':
showRealnamePolicyDialog(deviceNo, device?.realname_policy)
break
}
}
// 显示实名认证策略对话框
const showRealnamePolicyDialog = (deviceNo: string, currentPolicy?: string) => {
currentRealnamePolicyAsset.value = deviceNo
currentRealnamePolicy.value = currentPolicy ?? 'none'
realnamePolicyDialogVisible.value = true
}
// 确认设置实名认证策略
const handleConfirmRealnamePolicy = async (data: { realname_policy: string }) => {
try {
const res = await AssetService.updateRealnamePolicy(
currentRealnamePolicyAsset.value,
data.realname_policy
)
if (res.code === 0) {
ElMessage.success('设置实名认证策略成功')
realnamePolicyDialogVisible.value = false
await getTableData()
} else {
ElMessage.error(res.msg || '设置失败')
}
} catch (error) {
console.error('设置实名认证策略失败:', error)
}
}
@@ -1913,6 +1956,14 @@
})
}
if (hasAuth('asset:realname_policy')) {
moreActions.push({
label: '实名认证策略',
handler: () => handleDeviceOperation('realname-policy', row.virtual_no, row),
type: 'primary'
})
}
// if (hasAuth('device:manual_deactivate')) {
// moreActions.push({
// label: '手动停用',