diff --git a/webfe/package_vue/src/components/user-selector/index.scss b/webfe/package_vue/src/components/user-selector/index.scss index 8ef621b922..f6a109b709 100644 --- a/webfe/package_vue/src/components/user-selector/index.scss +++ b/webfe/package_vue/src/components/user-selector/index.scss @@ -126,13 +126,19 @@ white-space: nowrap; vertical-align: top; } - .delete-depart-icon { + .delete-depart-icon, + .disabled-del { display: block; width: 16px; - margin: 4px 6px 0 0; + margin-right: 6px; cursor: pointer; float: right; } + .disabled-del { + cursor: not-allowed; + color: #e3e3e3; + transform: rotate(45deg); + } } .folder-icon { position: relative; diff --git a/webfe/package_vue/src/components/user-selector/index.vue b/webfe/package_vue/src/components/user-selector/index.vue index c727c71c3b..5674978933 100644 --- a/webfe/package_vue/src/components/user-selector/index.vue +++ b/webfe/package_vue/src/components/user-selector/index.vue @@ -89,14 +89,32 @@ 0 - {{ $t('清空') }} + + + {{ $t('清空') }} +
{{ item.name }} - + + +
@@ -200,6 +218,14 @@ export default { departmentsFn: { type: Function, }, + clearable: { + type: Boolean, + default: false, + }, + organizeDisableIconFn: { + type: Function, + default: () => false, + }, }, data() { return { @@ -709,6 +735,8 @@ export default { name: item.name, id: item.id, type: 'department', + // 兼容插件 + ...(this.departmentsType === 'tc' && { tof_id: item.extras?.code || '' }), }); }); if (!this.customClose) { diff --git a/webfe/package_vue/src/language/lang/en.js b/webfe/package_vue/src/language/lang/en.js index 97c38012ab..0c1e7dca7a 100644 --- a/webfe/package_vue/src/language/lang/en.js +++ b/webfe/package_vue/src/language/lang/en.js @@ -2775,4 +2775,5 @@ export default { '请输入蓝盾项目 ID,多个 ID 以英文分号分隔,最多可输入 10 个 ID': 'Please enter Blue Shield Project IDs, separate multiple IDs with English semicolons, up to 10 IDs', '灰度发布需由工具管理员进行审批;若选择了灰度组织范围,还需要由工具发布者的组长同时进行审批。': 'Gray release needs to be approved by the tool administrator; if a gray organization scope is selected, it also needs to be approved by the team leader of the tool publisher.', 已终止当前的发布版本: 'The current release version has been terminated', + 扩大灰度范围不允许删除已经灰度过的组织: 'Expanding the gray range does not allow deleting organizations that have already been grayed out', }; diff --git a/webfe/package_vue/src/language/lang/zh.js b/webfe/package_vue/src/language/lang/zh.js index a204268bc2..e138ccb980 100644 --- a/webfe/package_vue/src/language/lang/zh.js +++ b/webfe/package_vue/src/language/lang/zh.js @@ -2912,4 +2912,5 @@ export default { '请输入蓝盾项目 ID,多个 ID 以英文分号分隔,最多可输入 10 个 ID': '请输入蓝盾项目 ID,多个 ID 以英文分号分隔,最多可输入 10 个 ID', '灰度发布需由工具管理员进行审批;若选择了灰度组织范围,还需要由工具发布者的组长同时进行审批。': '灰度发布需由工具管理员进行审批;若选择了灰度组织范围,还需要由工具发布者的组长同时进行审批。', 已终止当前的发布版本: '已终止当前的发布版本', + 扩大灰度范围不允许删除已经灰度过的组织: '扩大灰度范围不允许删除已经灰度过的组织', }; diff --git a/webfe/package_vue/src/views/plugin-center/plugin/base-config/visible-range.vue b/webfe/package_vue/src/views/plugin-center/plugin/base-config/visible-range.vue index 94ea482105..8c98d3f9b5 100644 --- a/webfe/package_vue/src/views/plugin-center/plugin/base-config/visible-range.vue +++ b/webfe/package_vue/src/views/plugin-center/plugin/base-config/visible-range.vue @@ -2,7 +2,7 @@
import card from '@/components/card/card.vue'; import viewMode from './view-mode.vue'; +import pluginBaseMixin from '@/mixins/plugin-base-mixin'; export default { name: 'ReleaseContent', @@ -136,6 +137,7 @@ export default { card, viewMode, }, + mixins: [pluginBaseMixin], props: { mode: { type: String, @@ -298,13 +300,8 @@ export default { toTestDetails() { const url = this.isEdit ? this.curVersionData.url : this.versionInfo.url; const id = url.split('=')[1]; - this.$router.push({ - name: 'pluginVersionRelease', - query: { - release_id: id, - type: 'test', - }, - }); + const newTabUrl = `${location.origin}/plugin-center/plugin/${this.pdId}/${this.pluginId}/version-release?release_id=${id}&type=test`; + window.open(newTabUrl, '_blank'); }, }, }; diff --git a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/release-strategy.vue b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/release-strategy.vue index 116c9b9f68..d32242a8db 100644 --- a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/release-strategy.vue +++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/release-strategy.vue @@ -148,6 +148,8 @@ :custom-close="true" :range="'departments'" :departments-fn="handleDepartments" + :clearable="isDetailStep" + :organize-disable-icon-fn="handleDisableIconFn" departments-type="tc" @sumbit="handleSubmit" /> @@ -198,6 +200,7 @@ export default { isShow: false, apiHost: window.BK_COMPONENT_API_URL, departments: [], + initDepartments: [], releaseStrategyMap: [ { value: 'gray', name: this.$t('先灰度后全量发布') }, { value: 'full', name: this.$t('直接全量发布') }, @@ -246,6 +249,7 @@ export default { if (this.isDetailStep) { this.releaseStrategy = cloneDeep(newValue?.latest_release_strategy || {}); this.departments = newValue.latest_release_strategy?.organization || []; + this.initDepartments = cloneDeep(this.departments); if (this.departments.length) { this.requestAllOrganization(this.departments); } @@ -307,9 +311,9 @@ export default { this.isShow = true; }, async handleSubmit(payload) { + await this.requestAllOrganization(payload); this.releaseStrategy.organization = payload; this.departments = payload; - await this.requestAllOrganization(payload); this.isShow = false; }, // 请求组织的层级结构 @@ -357,6 +361,11 @@ export default { this.releaseStrategy.bkci_project.push(input); } }, + // 是否允许删除已勾选的组织 + handleDisableIconFn(id) { + if (!this.isDetailStep) return false; + return this.initDepartments.findIndex(v => v.id === id) !== -1; + }, }, }; diff --git a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/version-details/index.vue b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/version-details/index.vue index ff9ff1586b..61f2233836 100644 --- a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/version-details/index.vue +++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/version-details/index.vue @@ -137,7 +137,7 @@ :loading="isApplyLoading" @click="handleSubmit" > - {{ $t('申请灰度发布') }} + {{ $t('申请扩大灰度范围') }}