From 6ecc40e6e07311fed312f3657cf9cbf86cb695ef Mon Sep 17 00:00:00 2001 From: leafage-collb <3303710797@qq.com> Date: Tue, 23 Jul 2024 11:04:14 +0800 Subject: [PATCH 01/17] =?UTF-8?q?feat:=20=E6=8F=92=E4=BB=B6=E5=8F=AF?= =?UTF-8?q?=E8=A7=81=E8=8C=83=E5=9B=B4=E3=80=81=E5=B7=B2=E7=9F=A5=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/loader/index.vue | 2 + .../loader/loading/visible-range.vue | 42 ++ .../src/components/pass-plugin-title.vue | 10 + .../src/components/user-selector/index.vue | 40 +- .../src/components/user-selector/tree.vue | 608 +++++++++--------- webfe/package_vue/src/language/lang/en.js | 9 + webfe/package_vue/src/language/lang/zh.js | 9 + webfe/package_vue/src/store/modules/plugin.js | 22 +- .../base-config/comps/base-info-item.vue | 1 - .../plugin/base-config/visible-range.vue | 293 +++++++-- .../plugin-center/plugin/summary/index.vue | 7 +- .../package_vue/static/json/paas_static.ce.js | 6 + .../package_vue/static/json/paas_static.ee.js | 6 + 13 files changed, 687 insertions(+), 368 deletions(-) create mode 100644 webfe/package_vue/src/components/loader/loading/visible-range.vue diff --git a/webfe/package_vue/src/components/loader/index.vue b/webfe/package_vue/src/components/loader/index.vue index 2e86aa09a6..69b130d197 100644 --- a/webfe/package_vue/src/components/loader/index.vue +++ b/webfe/package_vue/src/components/loader/index.vue @@ -89,6 +89,7 @@ import ImageManageLoading from './loading/image-manage.vue'; import ProcessServiceLoading from './loading/process-service.vue'; import PluinVersionListLoading from './loading/pluin-version-list.vue'; import PersistentStorageLoading from './loading/persistent-storage.vue'; +import VisibleRangeLoading from './loading/visible-range.vue'; export default { components: { ByUserLoading, @@ -154,6 +155,7 @@ export default { ProcessServiceLoading, PluinVersionListLoading, PersistentStorageLoading, + VisibleRangeLoading, }, props: { isLoading: { diff --git a/webfe/package_vue/src/components/loader/loading/visible-range.vue b/webfe/package_vue/src/components/loader/loading/visible-range.vue new file mode 100644 index 0000000000..e52d7d4c3e --- /dev/null +++ b/webfe/package_vue/src/components/loader/loading/visible-range.vue @@ -0,0 +1,42 @@ + + diff --git a/webfe/package_vue/src/components/pass-plugin-title.vue b/webfe/package_vue/src/components/pass-plugin-title.vue index ecc31b4c91..b60413cbb0 100644 --- a/webfe/package_vue/src/components/pass-plugin-title.vue +++ b/webfe/package_vue/src/components/pass-plugin-title.vue @@ -41,6 +41,7 @@ {{ $t('插件文档') }} + {{ tips }} @@ -74,6 +75,10 @@ export default { type: String, default: '', }, + tips: { + type: String, + default: '', + }, }, data() { return { @@ -204,6 +209,11 @@ export default { font-weight: bold; cursor: pointer; } + .tips { + margin-left: 16px; + font-size: 12px; + color: #979BA5; + } } } diff --git a/webfe/package_vue/src/components/user-selector/index.vue b/webfe/package_vue/src/components/user-selector/index.vue index 83fab7615d..9f9b3fd00a 100644 --- a/webfe/package_vue/src/components/user-selector/index.vue +++ b/webfe/package_vue/src/components/user-selector/index.vue @@ -30,7 +30,7 @@
{{ $t('已选择') }} diff --git a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/index.vue b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/index.vue index 048ecf2166..a0297c094d 100644 --- a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/index.vue +++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/index.vue @@ -2,16 +2,24 @@
- + + + - +
{{ $t('申请灰度发布') }} @@ -24,27 +32,28 @@ {{ $t('取消') }}
-

+

+ + 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 7dba12bd31..a47f325595 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 @@ -19,8 +19,13 @@ :rules="rules.strategy" > - {{ $t('先灰度后全量发布') }} - {{ $t('直接全量发布') }} + + {{ item.name }} + - + ext-cls="projec-id-tag-cls" + > - - {{ $t('选择组织') }} -
+ + {{ $t('选择组织') }} + +
-
    +
    • {{ $t('发布策略') }}:
      -
      --
      +
      + {{ releaseStrategyMap.find(v => v.value === data.latest_release_strategy.strategy)?.name }} +
    • -
    • +
    • {{ $t('灰度范围') }}:
      -
      --
      +
      +
      +

      {{ $t('蓝盾项目') }}:

      +

      {{ data.latest_release_strategy.bkci_project.join() }}

      +
      +
      +

      {{ $t('组织') }}:

      +
        +
      • {{ item.name }}
      • +
      +
      +
    -
@@ -128,6 +154,18 @@ export default { type: String, default: 'edit', }, + data: { + type: Object, + default: () => {}, + }, + step: { + type: String, + default: 'create', + }, + versionData: { + type: Object, + default: () => {}, + }, }, data() { return { @@ -140,6 +178,10 @@ export default { isShow: false, apiHost: window.BK_COMPONENT_API_URL, departments: [], + releaseStrategyMap: [ + { value: 'gray', name: this.$t('先灰度后全量发布') }, + { value: 'full', name: this.$t('直接全量发布') }, + ], rules: { strategy: [ { @@ -173,11 +215,44 @@ export default { isFullRelease() { return this.releaseStrategy.strategy === 'full'; }, + versionId() { + return this.$route.query.versionId; + }, + }, + watch: { + data: { + handler(newValue) { + if (this.step === 'release') { + this.releaseStrategy = newValue?.latest_release_strategy || {}; + this.departments = newValue.latest_release_strategy?.organization || []; + } + if (this.versionId) { + this.setVersionDefaultValue(); + } + }, + immediate: true, + deep: true, + }, }, methods: { + // 重新申请设置默认值 + setVersionDefaultValue() { + if (!this.versionData) return; + const { latest_release_strategy: { strategy, bkci_project, organization } } = this.versionData; + this.releaseStrategy = { + strategy, + bkci_project, + organization, + }; + this.departments = organization || []; + }, // 表单校验 validate() { - return Promise.all([this.$refs.releaseStrategyForm.validate(), this.$refs.childForm.validate()]); + const validateForm = [this.$refs.releaseStrategyForm.validate()]; + if (!this.isFullRelease) { + validateForm.push(this.$refs.childForm.validate()); + } + return Promise.all(validateForm); }, // 向外抛出当前表单数据 getFormData() { @@ -192,6 +267,18 @@ export default { this.departments = payload; this.isShow = false; }, + // 过滤出指定部门 + handleDepartments(data, type) { + const TCID = 2874; + const prefix = '腾讯公司/'; + + if (type === 'search') { + // 搜索过滤出指定部门数据 + return [data.filter(v => v.full_name.startsWith(prefix))]; + } + const tc = data.find(v => v.id === TCID); + return tc ? [tc] : []; + }, }, }; @@ -201,6 +288,31 @@ export default { .mt16 { margin-top: 16px; } + .release-strategy-cls { + .range { + min-width: 323px; + padding: 12px 16px; + background: #F5F7FA; + border-radius: 2px; + font-size: 12px; + color: #979BA5; + + .c-item { + margin-bottom: 16px; + &:last-child { + margin-bottom: 0; + } + .c-title, + .c-value { + line-height: 20px; + } + .c-value { + margin-top: 4px; + color: #313238; + } + } + } + } .gray-range { padding: 12px 16px; background: #f5f7fa; @@ -217,11 +329,11 @@ export default { } .projec-id-tag-cls { /deep/ .tag-list .key-node { - background-color: #FAFBFD; - border: 1px solid #DCDEE5; + background-color: #fafbfd; + border: 1px solid #dcdee5; border-radius: 2px; .tag { - background-color: #FAFBFD; + background-color: #fafbfd; } } } diff --git a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/view-mode.vue b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/view-mode.vue index f7b110dc86..7ffbb337c7 100644 --- a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/view-mode.vue +++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/view-mode.vue @@ -29,6 +29,7 @@ export default { min-height: 32px; line-height: 32px; margin-bottom: 6px; + font-size: 12px; &:last-child { margin-bottom: 0px; } @@ -38,6 +39,7 @@ export default { } .value { margin-left: 8px; + color: #313238; } } } diff --git a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/visible-range.vue b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/visible-range.vue new file mode 100644 index 0000000000..7884976971 --- /dev/null +++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/visible-range.vue @@ -0,0 +1,64 @@ + + + + + diff --git a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/index.vue b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/index.vue index 211606a103..9d8bd47c0b 100644 --- a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/index.vue +++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/index.vue @@ -75,7 +75,25 @@
+
+ +
+

{{ $t('暂无版本发布') }}

+

{{ $t('请先完成对默认分支的测试') }}

+ + {{ $t('前往测试') }} + +
+
+
+ - {{ $t(curVersionStatus[row.status]) || '--' }} + {{ $t(curVersionStatus[row.status]) || '--' }} @@ -321,7 +352,8 @@
- @@ -740,6 +791,9 @@ export default { color: #3a84ff; font-weight: 700; } + .status-text { + margin-left: 5px; + } } .dot { @@ -879,6 +933,25 @@ export default { margin: 0 auto !important; padding-top: 16px !important; } + .exception-wrap-cls { + margin-top: 100px; + /deep/ .bk-exception-img.part-img .exception-image { + height: 180px; + } + .exception-wrapper { + .title { + font-size: 24px; + color: #63656E; + margin-bottom: 16px; + } + .tips { + font-size: 14px; + color: #979BA5; + margin-bottom: 8px; + } + } + } + } 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 new file mode 100644 index 0000000000..253de356da --- /dev/null +++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/version-details/index.vue @@ -0,0 +1,383 @@ + + + + + diff --git a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/version-release.vue b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/version-release.vue index cd3b6d5ad0..aced89c6ca 100644 --- a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/version-release.vue +++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/version-release.vue @@ -19,6 +19,7 @@ :name="isOfficialVersion ? $t('发布') : $t('测试')" :no-shadow="true" :version-data="curRelease" + :status-map="PLUGIN_TEST_VERSION_STATUS" /> Date: Wed, 14 Aug 2024 16:44:00 +0800 Subject: [PATCH 05/17] =?UTF-8?q?fix:=20=E8=A1=A5=E5=85=85=E7=81=B0?= =?UTF-8?q?=E5=BA=A6=E5=8F=91=E5=B8=83=E7=BB=86=E8=8A=82(=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=EF=BC=8C=E8=B7=B3=E8=BD=AC=E9=93=BE=E6=8E=A5=EF=BC=8C?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=85=A5=E9=97=AE=E9=A2=98)=20#=20R?= =?UTF-8?q?eviewed,=20transaction=20id:=2015278?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../package_vue/src/components/card/card.vue | 1 + .../plugin/base-config/visible-range.vue | 41 ++++++++++-- .../version-manager/create-version/index.vue | 3 +- .../create-version/new-version/index.vue | 10 +++ .../new-version/release-content.vue | 18 ++++++ .../new-version/release-strategy.vue | 57 +++++++++-------- .../version-manager/version-details/index.vue | 64 ++++++++++++++++--- 7 files changed, 152 insertions(+), 42 deletions(-) diff --git a/webfe/package_vue/src/components/card/card.vue b/webfe/package_vue/src/components/card/card.vue index 9c368656c2..5fe5ee5688 100644 --- a/webfe/package_vue/src/components/card/card.vue +++ b/webfe/package_vue/src/components/card/card.vue @@ -16,6 +16,7 @@ @@ -259,6 +286,12 @@ export default { } .visible-range-form { padding: 24px 0; + .visible-range-form-cls { + /deep/ .bk-form-item.is-error .bk-button { + border-color: #ea3636; + color: #ea3636; + } + } .render-member-wrapper { margin-top: 12px; padding: 12px 12px 12px 36px; diff --git a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/index.vue b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/index.vue index f18c1bc9c5..5557a053a6 100644 --- a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/index.vue +++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/index.vue @@ -64,7 +64,7 @@ export default { this.getNewVersionFormat(); }, methods: { - // 获取新建版本表单格式 - 是否需要请求 + // 获取新建版本表单格式 async getNewVersionFormat() { this.schemeLoading = true; const params = { @@ -73,7 +73,6 @@ export default { type: 'prod', }; try { - // 多次请求? const res = await this.$store.dispatch('plugin/getNewVersionFormat', params); this.scheme = res; } catch (e) { diff --git a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/index.vue b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/index.vue index a0297c094d..2547ce7d83 100644 --- a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/index.vue +++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/index.vue @@ -34,6 +34,7 @@

@@ -168,18 +169,27 @@ export default { padding-left: 264px; display: flex; align-items: center; + flex-wrap: nowrap; left: 0; right: 0; bottom: 0; height: 48px; + z-index: 9; background: #fafbfd; box-shadow: 0 -1px 0 0 #dcdee5; + .button-warpper { + display: flex; + flex-grow: 0; + } } .release-tips { color: #979ba5; font-size: 12px; margin-left: 16px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; /deep/ em { font-weight: 700; } diff --git a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/release-content.vue b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/release-content.vue index e24f620a36..457c6ca671 100644 --- a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/release-content.vue +++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/release-content.vue @@ -35,6 +35,7 @@ :text="true" title="primary" size="small" + @click="toTestDetails" > {{ $t('查看测试数据') }} @@ -98,6 +99,7 @@ {{ $t('查看测试数据') }} @@ -151,6 +153,10 @@ export default { type: Object, default: () => {}, }, + versionInfo: { + type: Object, + default: () => {}, + }, }, data() { return { @@ -288,6 +294,18 @@ export default { }; return params; }, + // 测试详情 + 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', + }, + }); + }, }, }; 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 a47f325595..ade1115f43 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 @@ -10,6 +10,7 @@ :label-width="120" :model="releaseStrategy" ref="releaseStrategyForm" + ext-cls="release-strategy-form-cls" >
- + - + this.releaseStrategy.bkci_project?.length || this.departments.length, + message: this.$t('蓝盾项目 ID 和 组织至少填写一个'), trigger: 'blur', }, ], @@ -233,6 +215,12 @@ export default { immediate: true, deep: true, }, + 'releaseStrategy.bkci_project.length'() { + this.triggerValidate(); + }, + 'departments.length'() { + this.triggerValidate(); + }, }, methods: { // 重新申请设置默认值 @@ -250,10 +238,14 @@ export default { validate() { const validateForm = [this.$refs.releaseStrategyForm.validate()]; if (!this.isFullRelease) { - validateForm.push(this.$refs.childForm.validate()); + validateForm.push(this.$refs.grayscaleRangeForm.validate()); } return Promise.all(validateForm); }, + // 手动触发校验 + triggerValidate() { + this.$refs.grayscaleRangeForm?.validate(); + }, // 向外抛出当前表单数据 getFormData() { return this.releaseStrategy; @@ -288,6 +280,14 @@ export default { .mt16 { margin-top: 16px; } + .release-strategy-form-cls { + /deep/ .bk-form-item.is-error { + .gray-range .bk-button { + border-color: #ea3636; + color: #ea3636; + } + } + } .release-strategy-cls { .range { min-width: 323px; @@ -323,6 +323,9 @@ export default { &::after { display: unset; } + .bk-label::after { + display: none; + } } .from-tip { color: #979ba5; 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 253de356da..5ff2202bab 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 @@ -53,16 +53,17 @@ size="small" text class="ml10" + @click="viewApprovalDetails" > {{ $t('撤销提单') }}
- @@ -72,8 +73,14 @@ :data="versionData" step="release" /> -
-
+
+
-

+

@@ -167,6 +178,9 @@ export default { bkci_project: [], organization: [], }, + scheme: { + source_versions: [], + }, }; }, computed: { @@ -198,13 +212,16 @@ export default { isFullReleaseSuccessful() { return this.releaseStatus === 'successful' && this.approvalStatus === 'FINISHED'; }, + curVersionData() { + return this.scheme.source_versions.find(v => v.name === this.versionData.source_version_name); + }, }, created() { this.init(); }, methods: { init() { - Promise.all([this.getReleaseDetail(), this.getVisibleRange()]).finally(() => { + Promise.all([this.getReleaseDetail(), this.getVisibleRange(), this.getNewVersionFormat()]).finally(() => { this.isLoading = false; }); }, @@ -241,9 +258,11 @@ export default { // 只允许扩大灰度范围 this.releaseStrategyMode = 'edit'; this.isRequestGrayRelease = true; - if (type === 'full') { // 全量 + if (type === 'full') { + // 全量 this.versionData.latest_release_strategy.strategy = 'full'; - } else { // 扩大灰度范围 + } else { + // 扩大灰度范围 this.versionData.latest_release_strategy.strategy = 'gray'; } }, @@ -262,10 +281,11 @@ export default { const formData = this.$refs.releaseStrategy.getFormData(); const params = { strategy: formData.strategy, - ...formData.strategy === 'gray' && { // 仅在灰度 + ...(formData.strategy === 'gray' && { + // 仅在灰度 bkci_project: formData.bkci_project, organization: formData.organization, - }, + }), }; // 提交 this.applyGrayRelease(params); @@ -317,6 +337,23 @@ export default { } }, + // 获取schema + async getNewVersionFormat() { + try { + const res = await this.$store.dispatch('plugin/getNewVersionFormat', { + pdId: this.pdId, + pluginId: this.pluginId, + type: 'prod', + }); + this.scheme = res; + } catch (e) { + this.$bkMessage({ + theme: 'error', + message: e.detail || e.message || this.$t('接口异常'), + }); + } + }, + // 重新申请 handleReapply() { this.$router.push({ @@ -342,17 +379,26 @@ export default { padding-left: 264px; display: flex; align-items: center; + flex-wrap: nowrap; left: 0; right: 0; bottom: 0; height: 48px; + z-index: 9; background: #fafbfd; box-shadow: 0 -1px 0 0 #dcdee5; + .button-warpper { + display: flex; + flex-shrink: 0; + } } .release-tips { color: #979ba5; font-size: 12px; margin-left: 16px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; /deep/ em { font-weight: 700; } From 27c95345a7ed47812d46de62c28629277ed2903f Mon Sep 17 00:00:00 2001 From: leafage-collb <3303710797@qq.com> Date: Thu, 15 Aug 2024 15:31:16 +0800 Subject: [PATCH 06/17] =?UTF-8?q?fix:=20Codecc=E7=8A=B6=E6=80=81=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E3=80=81=E4=BD=93=E9=AA=8C=E4=BC=98=E5=8C=96=E9=A1=B9?= =?UTF-8?q?=20#=20Reviewed,=20transaction=20id:=2015405?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webfe/package_vue/src/common/constants.js | 11 ++- .../src/components/paas-plugin-nav.vue | 16 +++- .../src/components/pass-plugin-title.vue | 35 ++++++-- .../plugin/base-config/visible-range.vue | 2 +- .../new-version/release-strategy.vue | 41 +++++++-- .../plugin/version-manager/index.vue | 86 ++++++++++++++----- .../version-manager/version-details/index.vue | 2 + 7 files changed, 151 insertions(+), 42 deletions(-) diff --git a/webfe/package_vue/src/common/constants.js b/webfe/package_vue/src/common/constants.js index 2d4d7aa9b1..5f21c8761b 100644 --- a/webfe/package_vue/src/common/constants.js +++ b/webfe/package_vue/src/common/constants.js @@ -280,8 +280,11 @@ export const CIRCLED_NUMBERS = [ * Codecc 版本发布状态 */ export const CODECC_RELEASE_STATUS = { - pending: '灰度中', - successful: '已全量发布', - interrupted: '发布异常', - failed: '发布异常', + gray_approval_in_progress: '灰度发布审批中', + in_gray: '灰度中', + gray_approval_failed: '灰度审批失败', + full_approval_in_progress: '全量发布审批中', + fully_released: '已全量发布', + full_approval_failed: '全量发布审批失败', + rolled_back: '已回滚', }; diff --git a/webfe/package_vue/src/components/paas-plugin-nav.vue b/webfe/package_vue/src/components/paas-plugin-nav.vue index 16fe9997dc..3f421eed0c 100644 --- a/webfe/package_vue/src/components/paas-plugin-nav.vue +++ b/webfe/package_vue/src/components/paas-plugin-nav.vue @@ -68,6 +68,7 @@ const PLUGIN_NAV_MAP = { PROCESS_MANAGE: 'pluginProcess', STRUCTURE_LOG: 'pluginLog', CONFIGURATION_MANAGE: 'pluginDeployEnv', + VISIBLE_RANGE_MANAGE: 'pluginVisibleRange', }; export default { @@ -139,7 +140,7 @@ export default { this.navTree = await this.initNavByRegion(appNav.pluginList); // 根据接口返回开关控制是否显示当前菜单项 if (hideNavMap.length) { - this.navTree = this.navTree.filter(nav => !hideNavMap.includes(nav.name)); + this.navTree = this.filterMenu(this.navTree, hideNavMap); } await this.initRouterPermission(); } @@ -147,6 +148,19 @@ export default { await this.selectRouterByName(this.curRouteName); }, + // 根据接口返回开关控制是否显示当前菜单项 + filterMenu(tree, hideNav) { + return tree.filter((item) => { + const nameToCheck = item.destRoute?.name || item.name; + if (hideNav.includes(nameToCheck)) return false; + // 如果有 children,递归过滤 children + if (item.children?.length) { + item.children = this.filterMenu(item.children, hideNav); + } + return true; + }); + }, + /** * 根据接口来展示对应的导航项 */ diff --git a/webfe/package_vue/src/components/pass-plugin-title.vue b/webfe/package_vue/src/components/pass-plugin-title.vue index 4df8c96c3a..415bf195dc 100644 --- a/webfe/package_vue/src/components/pass-plugin-title.vue +++ b/webfe/package_vue/src/components/pass-plugin-title.vue @@ -23,12 +23,12 @@
- +
- {{ statusMap[versionData.status] }} + {{ statusMap[versionData[statusKey]] }}
-
+
+ +
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 dc7b51a8a1..ff9ff1586b 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 @@ -81,6 +81,8 @@ :data="versionData" step="release" /> + +
Date: Wed, 11 Sep 2024 17:08:28 +0800 Subject: [PATCH 15/17] =?UTF-8?q?fix:=20=E5=8F=AF=E8=A7=81=E8=8C=83?= =?UTF-8?q?=E5=9B=B4/=E7=81=B0=E5=BA=A6=E7=9A=84=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20tof=5Fid=20=E5=AD=97=E6=AE=B5=20&=20?= =?UTF-8?q?=E4=BD=93=E9=AA=8C=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/user-selector/index.scss | 10 ++++-- .../src/components/user-selector/index.vue | 32 +++++++++++++++++-- webfe/package_vue/src/language/lang/en.js | 1 + webfe/package_vue/src/language/lang/zh.js | 1 + .../plugin/base-config/visible-range.vue | 2 +- .../new-version/release-content.vue | 11 +++---- .../new-version/release-strategy.vue | 11 ++++++- .../version-manager/version-details/index.vue | 2 +- 8 files changed, 56 insertions(+), 14 deletions(-) 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 cbdf8e0a7c..df6f20238d 100644 --- a/webfe/package_vue/src/language/lang/en.js +++ b/webfe/package_vue/src/language/lang/en.js @@ -2806,4 +2806,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 2b6a8a69a6..52b552c5fa 100644 --- a/webfe/package_vue/src/language/lang/zh.js +++ b/webfe/package_vue/src/language/lang/zh.js @@ -2943,4 +2943,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('申请扩大灰度范围') }} Date: Wed, 11 Sep 2024 18:38:35 +0800 Subject: [PATCH 16/17] =?UTF-8?q?fix:=20=E6=96=87=E6=A1=88=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20&=20=E7=89=88=E6=9C=AC=E5=8F=91=E5=B8=83-=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E7=89=88=E6=9C=AC=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=9C=89=E4=BB=BB=E5=8A=A1=E6=AD=A3=E5=9C=A8=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20#=20Reviewed,=20transaction=20id:=2018158?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webfe/package_vue/src/language/lang/en.js | 5 +++- webfe/package_vue/src/language/lang/zh.js | 5 +++- .../new-version/release-content.vue | 12 +++++----- .../new-version/release-strategy.vue | 7 ++++-- .../plugin/version-manager/index.vue | 23 +++++++++++++++++-- .../version-manager/version-details/index.vue | 13 ++++++++--- 6 files changed, 50 insertions(+), 15 deletions(-) diff --git a/webfe/package_vue/src/language/lang/en.js b/webfe/package_vue/src/language/lang/en.js index df6f20238d..8a92635f45 100644 --- a/webfe/package_vue/src/language/lang/en.js +++ b/webfe/package_vue/src/language/lang/en.js @@ -2798,7 +2798,7 @@ export default { 申请灰度发布: 'Apply for Gray Release', 扩大灰度范围: 'Expand Gray Release Scope', 申请全量发布: 'Apply for Full Release', - 重新申请: 'Reapply', + 申请扩大灰度范围: 'Apply to expand the gray range', 已测试版本: 'Tested Version', 最小范围可以选择中心: 'Minimum Scope Can Select Center', '灰度发布审批中,请耐心等待': 'Gray release approval in progress, please wait patiently', @@ -2807,4 +2807,7 @@ export default { '灰度发布需由工具管理员进行审批;若选择了灰度组织范围,还需要由工具发布者的组长同时进行审批。': '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', + 测试号: 'Test number', + 已终止: 'Terminated', + '主版本号、次版本号、修正版本号': 'Major version number, minor version number, patch version number', }; diff --git a/webfe/package_vue/src/language/lang/zh.js b/webfe/package_vue/src/language/lang/zh.js index 52b552c5fa..e3dda73449 100644 --- a/webfe/package_vue/src/language/lang/zh.js +++ b/webfe/package_vue/src/language/lang/zh.js @@ -2935,7 +2935,7 @@ export default { 申请灰度发布: '申请灰度发布', 扩大灰度范围: '扩大灰度范围', 申请全量发布: '申请全量发布', - 重新申请: '重新申请', + 申请扩大灰度范围: '申请扩大灰度范围', 已测试版本: '已测试版本', 最小范围可以选择中心: '最小范围可以选择中心', '灰度发布审批中,请耐心等待': '灰度发布审批中,请耐心等待', @@ -2944,4 +2944,7 @@ export default { '灰度发布需由工具管理员进行审批;若选择了灰度组织范围,还需要由工具发布者的组长同时进行审批。': '灰度发布需由工具管理员进行审批;若选择了灰度组织范围,还需要由工具发布者的组长同时进行审批。', 已终止当前的发布版本: '已终止当前的发布版本', 扩大灰度范围不允许删除已经灰度过的组织: '扩大灰度范围不允许删除已经灰度过的组织', + 测试号: '测试号', + 已终止: '已终止', + '主版本号、次版本号、修正版本号': '主版本号、次版本号、修正版本号', }; diff --git a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/release-content.vue b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/release-content.vue index 5ae102722d..f3338f2b14 100644 --- a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/release-content.vue +++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/release-content.vue @@ -184,14 +184,14 @@ export default { version: [ { required: true, - message: '必填项', + message: this.$t('必填项'), trigger: 'blur', }, ], comment: [ { required: true, - message: '必填项', + message: this.$t('必填项'), trigger: 'blur', }, ], @@ -220,7 +220,7 @@ export default { deep: true, }, 'releaseContent.version'(newVal) { - this.releaseContent.versionDisplay = `${newVal} (主版本号、次版本号、修正版本号)`; + this.releaseContent.versionDisplay = `${newVal} (${this.$t('主版本号、次版本号、修正版本号')})`; }, 'releaseContent.source_versions'() { this.releaseContent.comment = this.curVersionData.message; @@ -259,16 +259,16 @@ export default { 'self-fill': '', }; this.releaseContent.version = versionMapping[data.version_no] || ''; - // 重新申请默认值 + // 重新发布默认值 if (this.versionId) { this.setVersionDefaultValue(data); } }, - // 重新申请设置默认值 + // 重新发布设置默认值 setVersionDefaultValue() { const { source_version_name, semver_type, comment } = this.versionData; const version = this.versionTypes.find(v => v.key === semver_type).value; - const versionDisplay = `${version} (主版本号、次版本号、修正版本号)`; + const versionDisplay = `${version} (${this.$t('主版本号、次版本号、修正版本号')})`; this.releaseContent = { ...this.releaseContent, source_versions: source_version_name, 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 d32242a8db..8a6d49dece 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 @@ -19,7 +19,7 @@ :error-display-type="'normal'" :rules="rules.strategy" > - + v.id === id) !== -1; }, + handleChange(value) { + this.$emit('strategy-change', value); + }, }, }; diff --git a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/index.vue b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/index.vue index 14a8781499..faf4d9b728 100644 --- a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/index.vue +++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/index.vue @@ -508,6 +508,7 @@ export default { this.curVersionType = this.$route.query.type || 'test'; } this.getVersionList(); + this.getReleasedVersion(); if (this.isCodecc) { this.getRollbackVersion(); } @@ -580,6 +581,25 @@ export default { return statusParams; }, + // 获取指定状态版本,判断是否有版本正在灰度或者发布中 + async getReleasedVersion() { + if (!this.isOfficialVersion) return; + try { + const res = await this.$store.dispatch('plugin/getVersionsManagerList', { + data: { + pdId: this.pdId, + pluginId: this.pluginId, + }, + pageParams: { type: 'prod' }, + statusParams: 'status=pending&status=initial', + }); + // 当前是否已有任务进行中 + this.curIsPending = !!res.results.length; + } catch (e) { + console.error(e); + } + }, + // 获取版本列表 async getVersionList(page = 1) { this.isTableLoading = true; @@ -597,8 +617,6 @@ export default { }); this.versionList = res.results; this.pagination.count = res.count; - // 当前是否已有任务进行中 - this.curIsPending = this.versionList.find(item => item.status === 'pending'); this.updateTableEmptyConfig(); this.tableEmptyConf.isAbnormal = false; } catch (e) { @@ -933,6 +951,7 @@ export default { message: this.$t('已终止当前的发布版本'), }); this.getVersionList(); + this.getReleasedVersion(); } catch (e) { this.$bkMessage({ theme: 'error', 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 61f2233836..8f53aad114 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 @@ -80,6 +80,7 @@ :mode="releaseStrategyMode" :data="versionData" step="release" + @strategy-change="handleStrategyChange" /> @@ -98,7 +99,7 @@ class="mr8" @click="handleReapply" > - {{ $t('重新申请') }} + {{ $t('重新发布') }} - {{ $t('申请扩大灰度范围') }} + {{ $t(submitText) }} From 58be94bfc5e91042e8f6030c5766d635aafebb31 Mon Sep 17 00:00:00 2001 From: leafage-collb <3303710797@qq.com> Date: Thu, 12 Sep 2024 12:21:47 +0800 Subject: [PATCH 17/17] =?UTF-8?q?fix:=20=E7=81=B0=E5=BA=A6=E5=8F=91?= =?UTF-8?q?=E5=B8=83-=E5=B7=B2=E7=81=B0=E5=BA=A6=E7=9A=84=E9=A1=B9?= =?UTF-8?q?=E7=9B=AEid=E4=B8=8D=E8=83=BD=E9=80=9A=E8=BF=87backspace?= =?UTF-8?q?=E9=94=AE=E5=88=A0=E9=99=A4=20&=20=E6=96=87=E6=A1=88=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20#=20Reviewed,=20transaction=20id:=2018240?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webfe/package_vue/src/language/lang/en.js | 2 +- webfe/package_vue/src/language/lang/zh.js | 2 +- .../create-version/new-version/index.vue | 5 ++++- .../new-version/release-strategy.vue | 17 ++++++++++++++++- .../plugin/version-manager/index.vue | 2 +- .../version-manager/version-details/index.vue | 5 ++++- 6 files changed, 27 insertions(+), 6 deletions(-) diff --git a/webfe/package_vue/src/language/lang/en.js b/webfe/package_vue/src/language/lang/en.js index 8a92635f45..1e39872976 100644 --- a/webfe/package_vue/src/language/lang/en.js +++ b/webfe/package_vue/src/language/lang/en.js @@ -2804,7 +2804,7 @@ export default { '灰度发布审批中,请耐心等待': 'Gray release approval in progress, please wait patiently', '审批未通过,请修改发布信息后重新申请': 'Approval not passed, please modify the release information and reapply', '请输入蓝盾项目 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.', + '灰度发布需由工具管理员进行审批;若选择了灰度组织范围,还需要由工具发布者的直属Leader同时进行审批。': 'Gray release requires approval from the tool administrator; if a gray organization range is selected, approval from the tool publishers immediate leader is also required.', 已终止当前的发布版本: 'The current release version has been terminated', 扩大灰度范围不允许删除已经灰度过的组织: 'Expanding the gray range does not allow deleting organizations that have already been grayed out', 测试号: 'Test number', diff --git a/webfe/package_vue/src/language/lang/zh.js b/webfe/package_vue/src/language/lang/zh.js index e3dda73449..26001524cc 100644 --- a/webfe/package_vue/src/language/lang/zh.js +++ b/webfe/package_vue/src/language/lang/zh.js @@ -2941,7 +2941,7 @@ export default { '灰度发布审批中,请耐心等待': '灰度发布审批中,请耐心等待', '审批未通过,请修改发布信息后重新申请': '审批未通过,请修改发布信息后重新申请', '请输入蓝盾项目 ID,多个 ID 以英文分号分隔,最多可输入 10 个 ID': '请输入蓝盾项目 ID,多个 ID 以英文分号分隔,最多可输入 10 个 ID', - '灰度发布需由工具管理员进行审批;若选择了灰度组织范围,还需要由工具发布者的组长同时进行审批。': '灰度发布需由工具管理员进行审批;若选择了灰度组织范围,还需要由工具发布者的组长同时进行审批。', + '灰度发布需由工具管理员进行审批;若选择了灰度组织范围,还需要由工具发布者的直属Leader同时进行审批。': '灰度发布需由工具管理员进行审批;若选择了灰度组织范围,还需要由工具发布者的直属Leader同时进行审批。', 已终止当前的发布版本: '已终止当前的发布版本', 扩大灰度范围不允许删除已经灰度过的组织: '扩大灰度范围不允许删除已经灰度过的组织', 测试号: '测试号', diff --git a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/index.vue b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/index.vue index 2547ce7d83..f802603920 100644 --- a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/index.vue +++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/create-version/new-version/index.vue @@ -73,7 +73,7 @@ export default { }, computed: { releaseTips() { - return this.$t('灰度发布需由工具管理员进行审批;若选择了灰度组织范围,还需要由工具发布者的组长同时进行审批。'); + return this.$t('灰度发布需由工具管理员进行审批;若选择了灰度组织范围,还需要由工具发布者的直属Leader同时进行审批。'); }, }, created() { @@ -193,6 +193,9 @@ export default { /deep/ em { font-weight: 700; } + /deep/ span { + color: #ea3636; + } } } 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 8a6d49dece..ba8bdfff5f 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 @@ -45,6 +45,7 @@ > @@ -207,6 +210,7 @@ export default { ], organizationLevel: [], disableDeletionMapping: {}, + focusLastTag: '', rules: { strategy: [ { @@ -356,6 +360,17 @@ export default { h('span', { class: ['text'], attrs: { tabIndex: 0 } }, node.id), ]); }, + handleKeyDown(event) { + // 已经灰度的项目id不能通过 backspace 键删除 + if (event.key === 'Backspace' && this.disableDeletionMapping[this.focusLastTag]) { + this.$refs.tagInputRef.isCanRemoveTag = false; + } + }, + handleFocus(values) { + if (values.length) { + this.focusLastTag = values[values.length - 1]; + } + }, handleBlur(input) { if (input !== '') { this.releaseStrategy.bkci_project.push(input); diff --git a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/index.vue b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/index.vue index faf4d9b728..c5f611c55d 100644 --- a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/index.vue +++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/index.vue @@ -470,7 +470,7 @@ export default { // Codecc 空状态 isCodeccEmpty() { if (this.filterStatus.length) return false; - if (!this.versionList.length && this.curPluginInfo.has_test_version && this.isOfficialVersion) return true; + if (!this.versionList.length && this.isCodecc) return true; return false; }, isCodecc() { 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 8f53aad114..dd1ffd4080 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 @@ -207,7 +207,7 @@ export default { return this.$route.query.versionId; }, releaseTips() { - return this.$t('灰度发布需由工具管理员进行审批;若选择了灰度组织范围,还需要由工具发布者的组长同时进行审批。'); + return this.$t('灰度发布需由工具管理员进行审批;若选择了灰度组织范围,还需要由工具发布者的直属Leader同时进行审批。'); }, // 审批失败要用 release 的 status 来判断 releaseStatus() { @@ -454,6 +454,9 @@ export default { /deep/ em { font-weight: 700; } + /deep/ span { + color: #ea3636; + } } .mb16 { margin-bottom: 16px;