From c4c370df2c35bfa0d893ef873da90bacb4d74f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=85=E5=B1=85?= Date: Fri, 9 Oct 2026 16:18:56 +0800 Subject: [PATCH] =?UTF-8?q?feat(supply-chain):=20=E5=90=84=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=95=B0=E6=8D=AE=E5=88=86=E7=B1=BB=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E3=80=8C=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90=E4=BE=8B=E5=A4=96?= =?UTF-8?q?=E3=80=8D=EF=BC=8C=E6=9D=83=E9=99=90=E7=BB=9F=E4=B8=80=E4=BB=A5?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0=E4=B8=BA?= =?UTF-8?q?=E5=87=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 配置弹窗移除「数据权限例外」输入项,保存时不再写入该字段(旧配置下次保存即清空) - 数据范围不再按人收窄:部门负责人/总负责人/普通账号一律看全部利润中心 - 设置结构、settings 接口返回与权限节点描述同步移除 dataScopeGrants --- .../DepartmentDistributionView.tsx | 21 +----- .../lib/supply-chain-permission-settings.ts | 4 +- ...y-chain-department-distribution.service.ts | 67 +++---------------- ...pply-chain-department-distribution.test.ts | 40 ++--------- 4 files changed, 16 insertions(+), 116 deletions(-) diff --git a/furniture-3d-system/src/app/supply-chain/management/blank-pages/DepartmentDistributionView.tsx b/furniture-3d-system/src/app/supply-chain/management/blank-pages/DepartmentDistributionView.tsx index 1e4cf89c..fa01db0c 100644 --- a/furniture-3d-system/src/app/supply-chain/management/blank-pages/DepartmentDistributionView.tsx +++ b/furniture-3d-system/src/app/supply-chain/management/blank-pages/DepartmentDistributionView.tsx @@ -28,13 +28,12 @@ type SettingsDraft = { virtualOwnerProfitCenter: string ownerProfitCenterOverride: string profitCenterAlias: string - dataScopeGrants: string targetRows: TargetRowDraft[] } const EMPTY_DRAFT: SettingsDraft = { brandScope: '', brandOwnerAlias: '', virtualOwnerProfitCenter: '', ownerProfitCenterOverride: '', - profitCenterAlias: '', dataScopeGrants: '', + profitCenterAlias: '', targetRows: [{ profitCenter: '', newProductSuccess: '', newProductMoving: '', saRatio: '', saTargetRatio: '' }], } @@ -81,18 +80,6 @@ function mapToLines(value: Record) { return Object.entries(value).map(([key, item]) => `${key}=${item}`).join('\n') } -function grantsToLines(value: Array<{ user: string; scopes: string[] }>) { - return value.map((grant) => `${grant.user}=${grant.scopes.join(',')}`).join('\n') -} - -function linesToGrants(value: string) { - return value.split('\n').map((line) => line.trim()).filter(Boolean).map((line) => { - const separator = line.includes('=') ? '=' : line.includes(':') ? ':' : ':' - const [user, ...rest] = line.split(separator) - return { user: user.trim(), scopes: rest.join(separator).split(/[,,;;]+/).map((item) => item.trim()).filter(Boolean) } - }).filter((grant) => grant.user && grant.scopes.length > 0) -} - function targetRowPayload(row: TargetRowDraft | undefined) { return { newProductSuccess: Number(row?.newProductSuccess ?? 0), @@ -245,7 +232,6 @@ export function DepartmentDistributionView({ virtualOwnerProfitCenter: mapToLines(settings.virtualOwnerProfitCenter ?? {}), ownerProfitCenterOverride: mapToLines(settings.ownerProfitCenterOverride ?? {}), profitCenterAlias: mapToLines(settings.profitCenterAlias ?? {}), - dataScopeGrants: grantsToLines(settings.dataScopeGrants ?? []), targetRows: [ { profitCenter: '', @@ -277,7 +263,6 @@ export function DepartmentDistributionView({ virtualOwnerProfitCenter: linesToMap(draft.virtualOwnerProfitCenter), ownerProfitCenterOverride: linesToMap(draft.ownerProfitCenterOverride), profitCenterAlias: linesToMap(draft.profitCenterAlias), - dataScopeGrants: linesToGrants(draft.dataScopeGrants), targets: targetRowPayload(draft.targetRows.find((row) => !row.profitCenter) ?? draft.targetRows[0]), profitCenterTargets: draft.targetRows .filter((row) => row.profitCenter) @@ -405,10 +390,6 @@ export function DepartmentDistributionView({ 利润中心合并(一行一条:原利润中心=并入的利润中心,如 运营中心E=运营中心G)