From 3f3ee3456e9f6ef8cce8daafbca107ce6d365079 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Tue, 16 Dec 2025 22:52:07 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=94=AF=E6=8C=81=E4=BB=85=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=85=B6=E4=BB=96=E7=94=A8=E6=88=B7=E7=9A=84=E6=B5=81?= =?UTF-8?q?=E6=B0=B4=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/certd/pipeline/crud.tsx | 6 ++++++ .../user/pipeline/pipeline-controller.ts | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx b/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx index 100cb5bb5..e4641dc80 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/pipeline/crud.tsx @@ -145,6 +145,9 @@ export default function ({ crudExpose, context: { selectedRowKeys } }: CreateCru }, }, }, + search: { + col: { span: 3 }, + }, form: { afterSubmit({ form, res, mode }) { if (mode === "add") { @@ -262,6 +265,7 @@ export default function ({ crudExpose, context: { selectedRowKeys } }: CreateCru type: "number", search: { show: true, + col: { span: 3 }, }, column: { width: 100, @@ -277,6 +281,7 @@ export default function ({ crudExpose, context: { selectedRowKeys } }: CreateCru show: computed(() => { return userStore.isAdmin && settingStore.sysPublic.managerOtherUserPipeline; }), + col: { span: 3 }, }, form: { show: false, @@ -297,6 +302,7 @@ export default function ({ crudExpose, context: { selectedRowKeys } }: CreateCru component: { name: "a-input", }, + col: { span: 3 }, }, form: { rules: [{ required: true, message: t("certd.fields.required") }], diff --git a/packages/ui/certd-server/src/controller/user/pipeline/pipeline-controller.ts b/packages/ui/certd-server/src/controller/user/pipeline/pipeline-controller.ts index d1f88e379..5f143bf1b 100644 --- a/packages/ui/certd-server/src/controller/user/pipeline/pipeline-controller.ts +++ b/packages/ui/certd-server/src/controller/user/pipeline/pipeline-controller.ts @@ -33,7 +33,20 @@ export class PipelineController extends CrudController { async page(@Body(ALL) body) { const isAdmin = await this.authService.isAdmin(this.ctx); const publicSettings = await this.sysSettingsService.getPublicSettings(); - if (!(publicSettings.managerOtherUserPipeline && isAdmin)) { + + let onlyOther = false + if(isAdmin){ + if(publicSettings.managerOtherUserPipeline){ + //管理员管理 其他用户 + if( body.query.userId === -1){ + //如果只查询其他用户 + onlyOther = true; + delete body.query.userId; + } + }else{ + body.query.userId = this.getUserId(); + } + }else{ body.query.userId = this.getUserId(); } @@ -44,6 +57,9 @@ export class PipelineController extends CrudController { if (title) { qb.andWhere('(title like :title or content like :content)', { title: `%${title}%`, content: `%${title}%` }); } + if(onlyOther){ + qb.andWhere('user_id != :userId', { userId: this.getUserId() }); + } }; if (!body.sort || !body.sort?.prop) { body.sort = { prop: 'order', asc: false };