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

4.0 KiB

1. API And Types

  • 1.1 Extend IoT card list query params with authorized_enterprise_id?: number and is_authorized_to_enterprise?: boolean | null.
  • 1.2 Extend device list query params with authorized_enterprise_id?: number and is_authorized_to_enterprise?: boolean | null.
  • 1.3 Align enterprise card authorization request types with selection_type: 'list' | 'range' | 'filter', list/range/filter fields, and optional remark.
  • 1.4 Align enterprise device authorization request types with selection_type: 'list' | 'filter', list/filter fields, and optional remark.
  • 1.5 Keep using EnterpriseService.allocateCards, recallCards, allocateDevices, and recallDevices; update method types only if needed.

2. IoT Card Management

  • 2.1 Add enterprise authorization filters to the IoT card search form and request payload.
  • 2.2 Add “授权卡给企业” before the export button with permission iot_card:authorize_enterprise.
  • 2.3 Add “回收卡授权” before the export button with permission iot_card:recall_enterprise_authorization.
  • 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.
  • 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.
  • 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.
  • 2.6 Refresh the IoT card list after successful authorization or recall.

3. Device Management

  • 3.1 Add enterprise authorization filters to the device search form and request payload.
  • 3.2 Add “授权设备给企业” before the export button with permission devices:authorize_enterprise.
  • 3.3 Add “撤销设备授权” before the export button with permission devices:recall_enterprise_authorization.
  • 3.4 Implement device authorization dialog with target enterprise selection, selection mode, list/filter inputs, optional remark, validation, submit, loading state, and result display.
  • 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.
  • 3.5 Implement device recall dialog with target/source enterprise resolution, selection mode, list/filter inputs, validation, submit, loading state, and result display.
  • 3.6 Refresh the device list after successful authorization or recall.

4. Remove Replaced Enterprise Authorization Pages

  • 4.1 Remove “卡授权” and “设备授权” operations from the enterprise customer action column.
  • 4.2 Remove navigation logic to enterprise card/device authorization pages.
  • 4.3 Remove hidden routes for /asset-management/enterprise-cards and /asset-management/enterprise-devices.
  • 4.4 Remove RoutesAlias.EnterpriseCards and RoutesAlias.EnterpriseDevices.
  • 4.5 Delete the replaced “企业卡管理” page file src/views/asset-management/enterprise-cards/index.vue.
  • 4.6 Delete the replaced “企业设备列表” page file src/views/asset-management/enterprise-devices/index.vue.
  • 4.7 Verify no imports, route aliases, menu entries, or navigation calls reference the deleted pages.

5. Validation

  • 5.1 Verify IoT card list filters send correct query parameters and reset correctly.
  • 5.2 Verify device list filters send correct query parameters and reset correctly.
  • 5.3 Verify all four new buttons obey their permission codes.
  • 5.4 Verify list/range/filter authorization and recall flows against API contracts from docs/授权、回收.md.
  • 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.