feat: 套餐分层级
This commit is contained in:
@@ -19,6 +19,24 @@ export const normalizeAssetInfo = (data = {}) => ({
|
||||
: data.is_expiring === true || data.is_expiring === 1
|
||||
});
|
||||
|
||||
const normalizePackageHistoryNode = (node = {}) => ({
|
||||
...node,
|
||||
children: Array.isArray(node.children)
|
||||
? node.children.map(normalizePackageHistoryNode)
|
||||
: [],
|
||||
expand_by_default: node.expand_by_default === true || node.expand_by_default === 1
|
||||
});
|
||||
|
||||
export const normalizeAssetPackageHistory = (data = {}) => ({
|
||||
...data,
|
||||
items: Array.isArray(data.items)
|
||||
? data.items.map(normalizePackageHistoryNode)
|
||||
: [],
|
||||
page: Number(data.page),
|
||||
size: Number(data.size),
|
||||
total: Number(data.total)
|
||||
});
|
||||
|
||||
export const isAssetRealNameCompleted = (assetInfo = {}) => {
|
||||
if (assetInfo.asset_type === 'device') {
|
||||
return (assetInfo.cards || []).some((card) => Number(card?.real_name_status) === 1);
|
||||
@@ -50,7 +68,7 @@ export const assetApi = {
|
||||
url: '/api/c/v1/asset/package-history',
|
||||
method: 'GET',
|
||||
data: { identifier, page, page_size, ...params }
|
||||
});
|
||||
}).then(normalizeAssetPackageHistory);
|
||||
},
|
||||
|
||||
getPackages(identifier, packageType = '') {
|
||||
|
||||
Reference in New Issue
Block a user