8000 fix: 插件使用范围编辑-如果已选中后面页的空间,更新选项时会回显异常问题修复 --story=141353228 by ywywZhou · Pull Request #190 · TencentBlueKing/BKFlow · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: 插件使用范围编辑-如果已选中后面页的空间,更新选项时会回显异常问题修复 --story=141353228 #190

8000 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

Merged
merged 1 commit into from
Apr 21, 2025
Merged
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
12 changes: 7 additions & 5 deletions frontend/src/views/admin/Plugin/RangEditDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
</div>
<bk-option
v-if="!searchValue"
id="*"
:name="$t('* (对所有空间公开)')" />
v-bind="allSpaceOption" />
<bk-option
v-for="option in spaceList"
:id="option.id"
Expand Down Expand Up @@ -88,6 +87,10 @@
},
totalPage: 1,
searchValue: '',
allSpaceOption: {
id: '*',
name: this.$t('* (对所有空间公开)'),
},
spaceList: [],
isExpand: false,
selectedOptions: [],
Expand Down Expand Up @@ -156,13 +159,12 @@
},
handleSpaceSelected(val, options) {
// 最后一次选中的是否为全选
const lastOption = options[options.length - 1];
const isLastOptionSelectAll = lastOption.id === '*';
const isLastOptionSelectAll = val[val.length - 1] === '*';

// 存在一开始选中的空间在最后几页,列表里面不存在的清空。更新选项时,options会没有后面页选中的选项
const { white_list: whiteList } = this.row.config;
const selectedOptions = [...whiteList, ...options];
this.selectedOptions = isLastOptionSelectAll ? [lastOption] : val.reduce((acc, id) => {
this.selectedOptions = isLastOptionSelectAll ? [this.allSpaceOption] : val.reduce((acc, id) => {
if (id === '*') return acc;
const option = selectedOptions.find(option => Number(option.id) === id);
option && acc.push(option);
Expand Down
Loading
0