fix: 资产信息字段显示隐藏根据角色
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m24s

This commit is contained in:
luo
2026-07-13 16:40:35 +08:00
parent 4c0207c6e6
commit 2c8524485b
11 changed files with 382 additions and 34 deletions

View File

@@ -2,6 +2,9 @@
* 资产信息格式化工具函数
*/
import { getCarrierTypeLabel } from '@/config/constants/carrierTypes'
import type { CarrierType } from '@/types/api'
type TagType = 'primary' | 'success' | 'warning' | 'info' | 'danger'
export function useAssetFormatters() {
@@ -76,6 +79,13 @@ export function useAssetFormatters() {
return policyMap[policy] || '未知'
}
// 获取运营商类型名称
const getCarrierTypeName = (carrierType?: string | null) => {
const normalizedCarrierType = carrierType?.trim()
if (!normalizedCarrierType) return '-'
return getCarrierTypeLabel(normalizedCarrierType as CarrierType)
}
// 获取资产状态名称
const getAssetStatusName = (status?: number) => {
if (status === undefined || status === null) return '未知'
@@ -252,6 +262,7 @@ export function useAssetFormatters() {
getRealNameStatusName,
getRealNameStatusType,
getRealnamePolicyName,
getCarrierTypeName,
getAssetStatusName,
getAssetStatusType,
getOnlineStatusName,