Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 公共流程导入流程覆盖支持搜索 #7518

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions frontend/desktop/src/pages/task/TaskList/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,21 @@
</NoData>
</div>
</bk-table>
<bk-pagination
<div
v-if="countLoading || listLoading || pagination.count"
class="bk-table-pagination-wrapper"
v-bkloading="{ isLoading: countLoading || listLoading, zIndex: 100 }"
size="small"
v-bind="pagination"
:location="'left'"
:align="'right'"
:show-limit="true"
:show-total-count="true"
@change="onPageChange"
@limit-change="onPageLimitChange">
</bk-pagination>
v-bkloading="{ isLoading: countLoading || listLoading, zIndex: 100 }">
<bk-pagination
size="small"
v-bind="pagination"
:location="'left'"
:align="'right'"
:show-limit="true"
:show-total-count="true"
@change="onPageChange"
@limit-change="onPageLimitChange">
</bk-pagination>
</div>
</div>
</div>
</skeleton>
Expand Down Expand Up @@ -1224,6 +1227,10 @@
margin-left: 16px;
}
}
.bk-table-pagination-wrapper {
height: 64px;
border: 1px solid #dfe0e5;
}
</style>
<style lang="scss">
.task-status-popover {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
</div>
</bk-table-column>
<bk-table-column :label="$t('是否覆盖已有子流程(实验功能,请谨慎使用并选择正确的流程)')" :width="400" :render-header="renderTableHeader">
<template slot-scope="{ row }">
<template slot-scope="{ row, $index }">
<div class="tpl-overrider-select">
<bk-select
style="width: 180px;"
Expand All @@ -147,6 +147,7 @@
enable-scroll-load
:scroll-loading="{ isLoading: scrollLoading }"
:remote-method="onCommonTplSearch"
@toggle="subFlowIndex = $index"
@clear="onClearRefer(row)"
@selected="onSelectRefer(row, $event)"
@scroll-end="onSelectScrollLoad(row)">
Expand Down Expand Up @@ -251,6 +252,8 @@
importPending: false,
tplLoading: false,
scrollLoading: false,
flowName: '',
subFlowIndex: 0,
topFlowPagination: {
current: 1,
count: 0
Expand Down Expand Up @@ -397,8 +400,10 @@
// 公共模板下拉框搜索
handleCommonTplSearch (val) {
this.commonPagination.current = 1
this.commonFlowName = val
const params = this.getQueryData(true)
this.flowName = val
const row = this.subFlowList[this.subFlowIndex]
const isCommon = this.common || row?.refer === 'useCommonExisting'
const params = this.getQueryData(isCommon)
this.getTemplateData(params)
},
// 下拉框滚动加载
Expand All @@ -419,13 +424,11 @@
}
}
},
getQueryData (common = undefined) {
let tplName, offset, projectId
getQueryData (common = this.common) {
let offset, projectId
if (common) {
tplName = this.commonFlowName
offset = (this.commonPagination.current - 1) * this.commonPagination.limit
} else {
tplName = this.flowName
offset = (this.pagination.current - 1) * this.pagination.limit
projectId = this.project_id
}
Expand All @@ -434,7 +437,7 @@
common,
offset,
limit: 15,
pipeline_template__name__icontains: tplName || undefined
pipeline_template__name__icontains: this.flowName || undefined
}
return data
},
Expand Down
Loading