mirror of
https://github.com/certd/certd.git
synced 2026-04-24 12:27:25 +08:00
chore: 支持仅查询其他用户的流水线
This commit is contained in:
@@ -145,6 +145,9 @@ export default function ({ crudExpose, context: { selectedRowKeys } }: CreateCru
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
search: {
|
||||||
|
col: { span: 3 },
|
||||||
|
},
|
||||||
form: {
|
form: {
|
||||||
afterSubmit({ form, res, mode }) {
|
afterSubmit({ form, res, mode }) {
|
||||||
if (mode === "add") {
|
if (mode === "add") {
|
||||||
@@ -262,6 +265,7 @@ export default function ({ crudExpose, context: { selectedRowKeys } }: CreateCru
|
|||||||
type: "number",
|
type: "number",
|
||||||
search: {
|
search: {
|
||||||
show: true,
|
show: true,
|
||||||
|
col: { span: 3 },
|
||||||
},
|
},
|
||||||
column: {
|
column: {
|
||||||
width: 100,
|
width: 100,
|
||||||
@@ -277,6 +281,7 @@ export default function ({ crudExpose, context: { selectedRowKeys } }: CreateCru
|
|||||||
show: computed(() => {
|
show: computed(() => {
|
||||||
return userStore.isAdmin && settingStore.sysPublic.managerOtherUserPipeline;
|
return userStore.isAdmin && settingStore.sysPublic.managerOtherUserPipeline;
|
||||||
}),
|
}),
|
||||||
|
col: { span: 3 },
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
show: false,
|
show: false,
|
||||||
@@ -297,6 +302,7 @@ export default function ({ crudExpose, context: { selectedRowKeys } }: CreateCru
|
|||||||
component: {
|
component: {
|
||||||
name: "a-input",
|
name: "a-input",
|
||||||
},
|
},
|
||||||
|
col: { span: 3 },
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
rules: [{ required: true, message: t("certd.fields.required") }],
|
rules: [{ required: true, message: t("certd.fields.required") }],
|
||||||
|
|||||||
@@ -33,7 +33,20 @@ export class PipelineController extends CrudController<PipelineService> {
|
|||||||
async page(@Body(ALL) body) {
|
async page(@Body(ALL) body) {
|
||||||
const isAdmin = await this.authService.isAdmin(this.ctx);
|
const isAdmin = await this.authService.isAdmin(this.ctx);
|
||||||
const publicSettings = await this.sysSettingsService.getPublicSettings();
|
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();
|
body.query.userId = this.getUserId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,6 +57,9 @@ export class PipelineController extends CrudController<PipelineService> {
|
|||||||
if (title) {
|
if (title) {
|
||||||
qb.andWhere('(title like :title or content like :content)', { title: `%${title}%`, content: `%${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) {
|
if (!body.sort || !body.sort?.prop) {
|
||||||
body.sort = { prop: 'order', asc: false };
|
body.sort = { prop: 'order', asc: false };
|
||||||
|
|||||||
Reference in New Issue
Block a user