From 708f980f0f351bfe47d7936151bf52ed4d4a7bc4 Mon Sep 17 00:00:00 2001
From: wangzhibo <wangzhibo@shsening.com>
Date: 星期六, 18 七月 2026 18:00:56 +0800
Subject: [PATCH] 业务表支持部门数据权限
---
src/modules/basicdata/controller/admin/buyer.ts | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/modules/basicdata/controller/admin/buyer.ts b/src/modules/basicdata/controller/admin/buyer.ts
index 1359b0f..8a0c2a2 100644
--- a/src/modules/basicdata/controller/admin/buyer.ts
+++ b/src/modules/basicdata/controller/admin/buyer.ts
@@ -2,6 +2,7 @@
import { BasicdataBuyerEntity } from '../../entity/buyer';
import { BasicdataBuyerService } from '../../service/buyer';
import { BaseSysDepartmentEntity } from '../../../base/entity/sys/department';
+import { WithDeptFilterWhere } from '../../../base/middleware/with-dept-filter-where'
/**
* 璐拱鏂圭鐞�
@@ -12,7 +13,7 @@
service: BasicdataBuyerService,
pageQueryOp: {
fieldEq: ['a.departmentId', 'a.name', 'a.contact'],
- fieldLike: ['a.name','a.address'],
+ fieldLike: ['a.name', 'a.address'],
select: ['a.*', 'b.name AS departmentName'],
join: [
{
@@ -22,6 +23,15 @@
type: 'leftJoin',
},
],
+ where: async ctx => {
+ const conditions: any[][] = [];
+ conditions.push(...(await WithDeptFilterWhere(ctx, { alias: 'a', field: 'departmentId' })));
+
+ // 鍏朵粬鍏宠仈琛紙涓句緥锛�
+ // conditions.push(...(await deptFilterWhere(ctx, 'd', 'id')));
+
+ return conditions;
+ },
},
})
-export class AdminOperationBuyerController extends BaseController {}
\ No newline at end of file
+export class AdminOperationBuyerController extends BaseController { }
\ No newline at end of file
--
Gitblit v1.9.1