Files
luo d3b5f55c64
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 3m41s
feat:更换企业授权
2026-06-22 10:36:33 +08:00

47 lines
4.0 KiB
Markdown

## 1. API And Types
- [x] 1.1 Extend IoT card list query params with `authorized_enterprise_id?: number` and `is_authorized_to_enterprise?: boolean | null`.
- [x] 1.2 Extend device list query params with `authorized_enterprise_id?: number` and `is_authorized_to_enterprise?: boolean | null`.
- [x] 1.3 Align enterprise card authorization request types with `selection_type: 'list' | 'range' | 'filter'`, list/range/filter fields, and optional `remark`.
- [x] 1.4 Align enterprise device authorization request types with `selection_type: 'list' | 'filter'`, list/filter fields, and optional `remark`.
- [x] 1.5 Keep using `EnterpriseService.allocateCards`, `recallCards`, `allocateDevices`, and `recallDevices`; update method types only if needed.
## 2. IoT Card Management
- [x] 2.1 Add enterprise authorization filters to the IoT card search form and request payload.
- [x] 2.2 Add “授权卡给企业” before the export button with permission `iot_card:authorize_enterprise`.
- [x] 2.3 Add “回收卡授权” before the export button with permission `iot_card:recall_enterprise_authorization`.
- [x] 2.4 Implement card authorization dialog with target enterprise selection, selection mode, list/range/filter inputs, optional remark, validation, submit, loading state, and result display.
- [x] 2.4.1 Update the card authorization dialog shop filter to use the same lazy shop cascade tree as the add-shop dialog “上级店铺” field, and submit the last selected node as `shop_id`.
- [x] 2.5 Implement card recall dialog with target/source enterprise resolution, selection mode, list/range/filter inputs, optional remark, validation, submit, loading state, and result display.
- [x] 2.6 Refresh the IoT card list after successful authorization or recall.
## 3. Device Management
- [x] 3.1 Add enterprise authorization filters to the device search form and request payload.
- [x] 3.2 Add “授权设备给企业” before the export button with permission `devices:authorize_enterprise`.
- [x] 3.3 Add “撤销设备授权” before the export button with permission `devices:recall_enterprise_authorization`.
- [x] 3.4 Implement device authorization dialog with target enterprise selection, selection mode, list/filter inputs, optional remark, validation, submit, loading state, and result display.
- [x] 3.4.1 Update the device authorization dialog shop filter to use the same lazy shop cascade tree as the add-shop dialog “上级店铺” field, and submit the last selected node as `shop_id`.
- [x] 3.5 Implement device recall dialog with target/source enterprise resolution, selection mode, list/filter inputs, validation, submit, loading state, and result display.
- [x] 3.6 Refresh the device list after successful authorization or recall.
## 4. Remove Replaced Enterprise Authorization Pages
- [x] 4.1 Remove “卡授权” and “设备授权” operations from the enterprise customer action column.
- [x] 4.2 Remove navigation logic to enterprise card/device authorization pages.
- [x] 4.3 Remove hidden routes for `/asset-management/enterprise-cards` and `/asset-management/enterprise-devices`.
- [x] 4.4 Remove `RoutesAlias.EnterpriseCards` and `RoutesAlias.EnterpriseDevices`.
- [x] 4.5 Delete the replaced “企业卡管理” page file `src/views/asset-management/enterprise-cards/index.vue`.
- [x] 4.6 Delete the replaced “企业设备列表” page file `src/views/asset-management/enterprise-devices/index.vue`.
- [x] 4.7 Verify no imports, route aliases, menu entries, or navigation calls reference the deleted pages.
## 5. Validation
- [x] 5.1 Verify IoT card list filters send correct query parameters and reset correctly.
- [x] 5.2 Verify device list filters send correct query parameters and reset correctly.
- [x] 5.3 Verify all four new buttons obey their permission codes.
- [x] 5.4 Verify list/range/filter authorization and recall flows against API contracts from `docs/授权、回收.md`.
- [x] 5.5 Run targeted ESLint for modified files.
- [ ] 5.6 Run `openspec validate update-enterprise-asset-authorization-entry --strict` when the OpenSpec CLI is available.