2.7 KiB
2.7 KiB
Context
Enterprise asset authorization currently has two hidden pages launched from enterprise customer rows. The requested workflow moves those operations to the asset lists so users can filter assets by enterprise authorization state and act on the same list they export from.
Goals
- Add enterprise authorization filters to IoT card management and device management.
- Add direct card/device enterprise authorization and recall actions beside existing export actions.
- Protect each new action with an independent button permission code.
- Remove enterprise customer row authorization shortcuts and the replaced “企业卡管理” / “企业设备列表” hidden pages.
Non-Goals
- Do not change backend endpoint paths.
- Do not add new route pages for this workflow.
- Do not preserve compatibility routes for the old “企业卡管理” or “企业设备列表” pages unless a product requirement is added later.
Decisions
- New permission codes:
iot_card:authorize_enterprisefor “授权卡给企业”.iot_card:recall_enterprise_authorizationfor “回收卡授权”.devices:authorize_enterprisefor “授权设备给企业”.devices:recall_enterprise_authorizationfor “撤销设备授权”.
- Authorization and recall dialogs will require a target/source enterprise ID, except recall may prefill or lock it when
authorized_enterprise_idis present in current filters or a single selected-row enterprise ID can be safely inferred from list response data. - List-mode operations use selected rows. Card operations submit
iccids; device operations submitdevice_nosderived from available list response identifiers such asvirtual_no. - Filter-mode operations submit only non-empty filter fields supported by
docs/授权、回收.md. - The
shop_idfilter in “授权卡给企业” and “授权设备给企业” dialogs uses the same lazyElCascadertree pattern as the add-shop dialog’s “上级店铺” field:ShopService.getShopsCascade({ parent_id }),checkStrictly: true, and submit the last selected path node asshop_id. - Old hidden pages are deleted rather than kept as redirects because the list-page authorization workflow replaces “企业卡管理” and “企业设备列表”.
Risks
- The list response field names for enterprise authorization metadata may vary. Implementation should read current API response types and use returned fields when available; if a required source enterprise cannot be inferred, require explicit enterprise selection in the recall dialog.
- Existing
add-enterprise-device-authorizationOpenSpec change overlaps conceptually but proposes a separate enterprise-device page. This change supersedes that approach for the current product direction.