From 97478f8acc29a894f195c677f7a558b795378d92 Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Wed, 20 Sep 2023 15:24:35 +0800 Subject: [PATCH 01/93] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E8=BE=93=E5=85=A5=E5=A4=8D=E5=88=B6=E6=88=90=E5=91=98?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=89=8D=E7=AB=AF=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/group/components/iam-add-member.vue | 13 +++++++------ .../components/iam-add-member.vue | 13 +++++++------ .../my-manage-space/add-member-boundary/index.vue | 13 +++++++------ 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/frontend/src/views/group/components/iam-add-member.vue b/frontend/src/views/group/components/iam-add-member.vue index 0a62a58a9..7dccff826 100644 --- a/frontend/src/views/group/components/iam-add-member.vue +++ b/frontend/src/views/group/components/iam-add-member.vue @@ -735,13 +735,14 @@ } } catch (e) { console.error(e); - const { response } = e; + // const { response } = e; // 处理如果是前端校验为空导致的报错,使用前端自定义提示 - if (response && [400].includes(response.status)) { - this.messageWarn(this.$t(`m.verify['用户名输入格式错误']`), 3000); - } else { - this.messageAdvancedError(e); - } + // if (response && [400].includes(response.status)) { + // this.messageWarn(this.$t(`m.verify['用户名输入格式错误']`), 3000); + // } else { + // this.messageAdvancedError(e); + // } + this.messageAdvancedError(e); } finally { this.manualAddLoading = false; } diff --git a/frontend/src/views/manage-spaces/secondary-manage-space/components/iam-add-member.vue b/frontend/src/views/manage-spaces/secondary-manage-space/components/iam-add-member.vue index acf875426..130ef094b 100644 --- a/frontend/src/views/manage-spaces/secondary-manage-space/components/iam-add-member.vue +++ b/frontend/src/views/manage-spaces/secondary-manage-space/components/iam-add-member.vue @@ -656,12 +656,13 @@ } } catch (e) { console.error(e); - const { response } = e; - if (response && [400].includes(response.status)) { - this.messageWarn(this.$t(`m.verify['用户名输入格式错误']`), 3000); - } else { - this.messageAdvancedError(e); - } + // const { response } = e; + // if (response && [400].includes(response.status)) { + // this.messageWarn(this.$t(`m.verify['用户名输入格式错误']`), 3000); + // } else { + // this.messageAdvancedError(e); + // } + this.messageAdvancedError(e); } finally { this.manualAddLoading = false; } diff --git a/frontend/src/views/my-manage-space/add-member-boundary/index.vue b/frontend/src/views/my-manage-space/add-member-boundary/index.vue index 0ab8259f0..8527d8276 100644 --- a/frontend/src/views/my-manage-space/add-member-boundary/index.vue +++ b/frontend/src/views/my-manage-space/add-member-boundary/index.vue @@ -738,12 +738,13 @@ } } catch (e) { console.error(e); - const { response } = e; - if (response && [400].includes(response.status)) { - this.messageWarn(this.$t(`m.verify['用户名输入格式错误']`), 3000); - } else { - this.messageAdvancedError(e); - } + // const { response } = e; + // if (response && [400].includes(response.status)) { + // this.messageWarn(this.$t(`m.verify['用户名输入格式错误']`), 3000); + // } else { + // this.messageAdvancedError(e); + // } + this.messageAdvancedError(e); } finally { this.manualAddLoading = false; } From d53d3aed3d6a9b0a73130868eeba621a02f6bc67 Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Wed, 20 Sep 2023 20:51:59 +0800 Subject: [PATCH 02/93] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=97=A5=E6=9C=9F=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=A0=B9=E6=8D=AE=E6=97=B6=E9=97=B4=E6=88=B3?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=BD=93=E5=89=8D=E6=89=80=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E7=9A=84=E5=A4=A9=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attach-action-preview/index.vue | 2 +- .../components/iam-deadline/horizontal.vue | 44 ++++++++++++------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/frontend/src/components/attach-action-preview/index.vue b/frontend/src/components/attach-action-preview/index.vue index e43e19800..7fbc42846 100644 --- a/frontend/src/components/attach-action-preview/index.vue +++ b/frontend/src/components/attach-action-preview/index.vue @@ -96,7 +96,7 @@ this.handleInitData(this.relateActionData); } catch (e) { console.error(e); - this.messageAdvancedError(e,); + this.messageAdvancedError(e); } finally { this.isLoading = false; } diff --git a/frontend/src/components/iam-deadline/horizontal.vue b/frontend/src/components/iam-deadline/horizontal.vue index f4b83575c..432fcc345 100644 --- a/frontend/src/components/iam-deadline/horizontal.vue +++ b/frontend/src/components/iam-deadline/horizontal.vue @@ -54,25 +54,39 @@ // 4102444800: this.$t(`m.common['永久']`), 'custom': this.$t(`m.common['自定义']`) }, - currentActive: this.value, + currentActive: 4102444800, customTime: 1, isFocus: false }; }, computed: { - ...mapGetters(['user']), - isShowCustomTime () { - return this.currentActive === 'custom'; - }, - isNormal () { - return this.type === 'normal'; - }, - isDialog () { - return this.type === 'dialog'; - }, - isSuper () { - return this.user.role.type === 'super_manager'; - } + ...mapGetters(['user']), + isShowCustomTime () { + return this.currentActive === 'custom'; + }, + isNormal () { + return this.type === 'normal'; + }, + isDialog () { + return this.type === 'dialog'; + }, + isSuper () { + return this.user.role.type === 'super_manager'; + } + }, + + watch: { + value: { + handler (payload) { + if (![2592000, 7776000, 15552000, 31104000, 4102444800].includes(payload)) { + this.currentActive = 'custom'; + return; + } + this.$set(this.timeFilters, 'custom', this.$t(`m.common['自定义']`)); + this.currentActive = payload; + }, + immediate: true + } }, created () { @@ -94,7 +108,7 @@ this.handleTrigger(); this.$delete(this.timeFilters, 'custom'); this.$nextTick(() => { - this.$refs.deadlineRef.focus(); + this.$refs.deadlineRef && this.$refs.deadlineRef.focus(); }); } else { this.customTime = 1; From 0d7df545ef9ee7ffd51c0a0bd0d94a02ebd235dd Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Wed, 20 Sep 2023 21:32:12 +0800 Subject: [PATCH 03/93] =?UTF-8?q?feature:=20=E7=94=A8=E6=88=B7=E7=BB=84?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E2=80=94>=E7=94=A8=E6=88=B7=E7=BB=84?= =?UTF-8?q?=E6=88=90=E5=91=98=E5=88=97=E8=A1=A8=E6=94=AF=E6=8C=81=E8=B7=A8?= =?UTF-8?q?=E9=A1=B5=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4=E3=80=81=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E7=BB=AD=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../render-renewal-dialog/index.vue | 255 +++++++++++---- frontend/src/language/lang/en.js | 7 +- frontend/src/language/lang/zh.js | 7 +- .../delete-related-action-dialog.vue | 12 + .../views/group/components/member-table.vue | 307 +++++++++++++----- 5 files changed, 451 insertions(+), 137 deletions(-) diff --git a/frontend/src/components/render-renewal-dialog/index.vue b/frontend/src/components/render-renewal-dialog/index.vue index 63072ff9c..959dd1cc2 100644 --- a/frontend/src/components/render-renewal-dialog/index.vue +++ b/frontend/src/components/render-renewal-dialog/index.vue @@ -8,24 +8,73 @@ ext-cls="iam-group-perm-renewal-dialog" :title="$t(`m.renewal['续期']`)" @after-leave="handleAfterLeave"> -
- - - {{ data.name || '--' }} - + + diff --git a/frontend/src/language/lang/en.js b/frontend/src/language/lang/en.js index a1ae8ea8a..6e960b734 100644 --- a/frontend/src/language/lang/en.js +++ b/frontend/src/language/lang/en.js @@ -276,7 +276,8 @@ export const m = { '暂无可复制内容': 'There is currently no replicable content', '暂无可复制用户': 'There are currently no replicable users', '管理员组不能添加部门': 'The administrator group cannot add department', - '批量退出': 'Multi-quit' + '批量退出': 'Multi-quit', + '批量处理': 'Multi-process' }, // 校验 verify: { @@ -522,6 +523,7 @@ export const m = { '用户组为管理员组,不能添加部门': 'The {value} is administrator group and cannot add departments', '用户组为只读用户组不能添加成员': '{value} is read-only user groups and cannot add members', '用户组属性为只读属性': '{value} is read-only user group attribute', + '不可续期的用户组成员如下': 'The non renewable user group members are as follows: {value}', '管理员组不能添加权限': 'Administrators group cannot add permissions', '只读用户组不能添加权限': 'Read only user groups cannot add permissions' }, @@ -829,7 +831,8 @@ export const m = { '不可被申请': 'Not applicable', '该组只能管理员主动授权,用户无法主动申请': 'This group can only be actively authorized by administrators, and users cannot actively apply', '设置不可被申请,则无法申请加入此用户组': 'If the setting cannot be applied for, you cannot apply to join this user group', - '管理员已设置空间下所有用户组不可被申请': 'The administrator has set that all user groups in the space cannot be applied for' + '管理员已设置空间下所有用户组不可被申请': 'The administrator has set that all user groups in the space cannot be applied for', + '已选择的用户组成员不需要续期': 'The selected user group members do not need to be renewed' }, userGroupDetail: { '用户组名': 'Group name: ', diff --git a/frontend/src/language/lang/zh.js b/frontend/src/language/lang/zh.js index b55c32146..35a4f60fd 100644 --- a/frontend/src/language/lang/zh.js +++ b/frontend/src/language/lang/zh.js @@ -274,7 +274,8 @@ export const m = { '暂无可复制内容': '暂无可复制内容', '暂无可复制用户': '暂无可复制用户', '管理员组不能添加部门': '管理员组不能添加部门', - '批量退出': '批量退出' + '批量退出': '批量退出', + '批量处理': '批量处理' }, // 校验 verify: { @@ -522,6 +523,7 @@ export const m = { '用户组为管理员组,不能添加部门': '{value}用户组为管理员组,不能添加部门', '用户组为只读用户组不能添加成员': '{value}为只读用户组不能添加成员', '用户组属性为只读属性': '{value}为只读用户组属性', + '不可续期的用户组成员如下': '不可续期的用户组成员如下:{value}', '管理员组不能添加权限': '管理员组不能添加权限', '只读用户组不能添加权限': '只读用户组不能添加权限' }, @@ -831,7 +833,8 @@ export const m = { '不可被申请': '不可被申请', '该组只能管理员主动授权,用户无法主动申请': '该组只能管理员主动授权,用户无法主动申请', '设置不可被申请,则无法申请加入此用户组': '设置不可被申请,则无法申请加入此用户组', - '管理员已设置空间下所有用户组不可被申请': '管理员已设置空间下所有用户组不可被申请' + '管理员已设置空间下所有用户组不可被申请': '管理员已设置空间下所有用户组不可被申请', + '已选择的用户组成员不需要续期': '已选择的用户组成员不需要续期' }, userGroupDetail: { '用户组名': '用户组名:', diff --git a/frontend/src/views/group/components/delete-related-action-dialog.vue b/frontend/src/views/group/components/delete-related-action-dialog.vue index 2cf01bb09..a96909bec 100644 --- a/frontend/src/views/group/components/delete-related-action-dialog.vue +++ b/frontend/src/views/group/components/delete-related-action-dialog.vue @@ -107,6 +107,18 @@ &-content { max-height: 500px; overflow-y: auto; + &::-webkit-scrollbar { + width: 6px; + height: 6px; + } + &::-webkit-scrollbar-thumb { + background: #dcdee5; + border-radius: 3px; + } + &::-webkit-scrollbar-track { + background: transparent; + border-radius: 3px; + } .warn { color: #ffb848; } diff --git a/frontend/src/views/group/components/member-table.vue b/frontend/src/views/group/components/member-table.vue index f5990c89d..7bc617a07 100644 --- a/frontend/src/views/group/components/member-table.vue +++ b/frontend/src/views/group/components/member-table.vue @@ -2,16 +2,66 @@
- - {{ $t(`m.userGroup['添加成员']`) }} - - + + {{ $t(`m.userGroup['添加成员']`) }} + +
+ +
+ +
+ {{ $t(`m.common['批量处理']`) }} + +
+ +
+
+
- + - + diff --git a/frontend/src/views/my-manage-space/add-member-boundary/index.vue b/frontend/src/views/my-manage-space/add-member-boundary/index.vue index 76b642aa6..6767a4faf 100644 --- a/frontend/src/views/my-manage-space/add-member-boundary/index.vue +++ b/frontend/src/views/my-manage-space/add-member-boundary/index.vue @@ -2093,7 +2093,7 @@ .right { width: calc(100% - 600px); - margin: 0 20px; + padding-left: 20px; background-color: #f5f7fa; border-top: 1px solid #dcdee5; .result-preview { diff --git a/frontend/src/views/sensitivity-level/components/sensitivity-level-table.vue b/frontend/src/views/sensitivity-level/components/sensitivity-level-table.vue index 0201fc9cb..1a6c8c2ea 100644 --- a/frontend/src/views/sensitivity-level/components/sensitivity-level-table.vue +++ b/frontend/src/views/sensitivity-level/components/sensitivity-level-table.vue @@ -51,7 +51,7 @@ item.action_id); this.sensitivityTableList.forEach((item) => { if (currentSelectList.includes(item.action_id)) { - this.$refs.sensitivityTableRef && this.$refs.sensitivityTableRef.toggleRowSelection(item, true); + this.$refs.sensitivityTableRef + && this.$refs.sensitivityTableRef.toggleRowSelection(item, true); } }); if (this.currentSelectList.length < 1) { - this.$refs.sensitivityTableRef && this.$refs.sensitivityTableRef.clearSelection(); + this.$refs.sensitivityTableRef + && this.$refs.sensitivityTableRef.clearSelection(); } }); } catch (e) { @@ -271,7 +276,8 @@ async handleChangeLevel (payload, index) { try { - const { action_id, system_id, sensitivity_level } = this.sensitivityTableList[index]; + const tableData = this.sensitivityTableList[index]; + const { action_id, system_id, sensitivity_level } = tableData; const params = { actions: [ { @@ -281,20 +287,25 @@ ], sensitivity_level: payload }; - const { code } = await this.$store.dispatch('sensitivityLevel/updateActionsSensitivityLevel', params); + const { code } = await this.$store.dispatch( + 'sensitivityLevel/updateActionsSensitivityLevel', + params + ); if (code === 0) { // eslint-disable-next-line camelcase if (sensitivity_level !== payload) { ['all'].includes(this.tabActive) ? this.$set(this.sensitivityTableList[index], 'sensitivity_level', payload) : this.sensitivityTableList.splice(index, 1); + this.currentSelectList = []; + await this.fetchSensitivityLevelList(true); + this.messageSuccess(this.$t(`m.info['编辑成功']`), 3000); bus.$emit('on-tab-level-count', { name: this.tabActive, - system_id, - count: this.pagination.count - 1, + system_id: this.curSystemData.id, + count: this.pagination.count, isSearch: this.emptyData.tipType === 'search' }); - this.messageSuccess(this.$t(`m.info['编辑成功']`), 3000); } } } catch (e) { @@ -309,10 +320,14 @@ if (isChecked) { this.currentSelectList.push(row); } else { - this.currentSelectList = this.currentSelectList.filter((item) => item.action_id !== row.action_id); + this.currentSelectList = this.currentSelectList.filter( + (item) => item.action_id !== row.action_id + ); } this.$nextTick(() => { - const selectionCount = document.getElementsByClassName('bk-page-selection-count'); + const selectionCount = document.getElementsByClassName( + 'bk-page-selection-count' + ); if (this.$refs.sensitivityTableRef && selectionCount) { selectionCount[0].children[0].innerHTML = this.currentSelectList.length; } @@ -325,7 +340,9 @@ ); this.currentSelectList = [...selectGroups, ...payload]; this.$nextTick(() => { - const selectionCount = document.getElementsByClassName('bk-page-selection-count'); + const selectionCount = document.getElementsByClassName( + 'bk-page-selection-count' + ); if (this.$refs.sensitivityTableRef && selectionCount) { selectionCount[0].children[0].innerHTML = this.currentSelectList.length; } @@ -349,7 +366,7 @@ name: this.tabActive, system_id: this.curSystemData.id, count: this.pagination.count, - isSearch: this.emptyData.tipType === 'search' + isSearch: true }); }, @@ -422,6 +439,7 @@ bus.$emit('on-tab-level-count', { name: sensitivity_level, system_id: actions[0].system_id, + count: this.pagination.count, isSearch: this.emptyData.tipType === 'search' }); } diff --git a/frontend/src/views/sensitivity-level/components/sensitivity-right-layout.vue b/frontend/src/views/sensitivity-level/components/sensitivity-right-layout.vue index 82d34af9f..6e6bb770e 100644 --- a/frontend/src/views/sensitivity-level/components/sensitivity-right-layout.vue +++ b/frontend/src/views/sensitivity-level/components/sensitivity-right-layout.vue @@ -1,6 +1,12 @@
@@ -94,30 +100,21 @@ }; }, computed: { - ...mapGetters(['externalSystemId']), - formatDragWidth () { - return { - minWidth: '280px' - }; - }, - formatSystemsHeight () { - return { - maxHeight: `${getWindowHeight() - 185}px` - }; - } + ...mapGetters(['externalSystemId']), + formatDragWidth () { + return { + minWidth: '280px' + }; + }, + formatSystemsHeight () { + return { + maxHeight: `${getWindowHeight() - 185}px` + }; + } }, async created () { // this.handleSelectSystem({ id: 'all', isFirst: true }); await this.fetchSystems(); - if (this.systemListStorage.length) { - const params = { - ...this.systemList[0], - ...{ - isFirst: true - } - }; - this.handleSelectSystem(params); - } }, methods: { async fetchSystems () { @@ -129,11 +126,15 @@ } const { code, data } = await this.$store.dispatch('system/getSystems', params); if (data && data.length) { - this.systemList = _.cloneDeep([...data]); + // this.systemList = _.cloneDeep([...data]); this.systemList = await this.getSystemCount(data); this.systemListStorage = [...this.systemList]; } - this.emptySystemData = formatCodeData(code, this.emptySystemData, data.length === 0); + this.emptySystemData = formatCodeData( + code, + this.emptySystemData, + data.length === 0 + ); } catch (e) { this.emptySystemData = formatCodeData(e.code, this.emptySystemData); this.messageAdvancedError(e); @@ -147,17 +148,28 @@ const list = [...payload]; try { for (let i = 0; i < list.length; i++) { - await this.$store.dispatch('sensitivityLevel/getSensitivityLevelCount', { - system_id: payload[i].id - }).then(({ data }) => { - // const curSystemId = list[i].id; - // if (systemCountMockData[curSystemId]) { - // const { data } = systemCountMockData[curSystemId]; - this.$set(list[i], 'levelItem', data); - this.$set(list[i], 'count', data.all || 0); - }); + this.$store + .dispatch('sensitivityLevel/getSensitivityLevelCount', { + system_id: list[i].id + }) + .then(({ data }) => { + // const curSystemId = list[i].id; + // if (systemCountMockData[curSystemId]) { + // const { data } = systemCountMockData[curSystemId]; + this.$set(list[i], 'levelItem', data); + this.$set(list[i], 'count', data.all || 0); + if (i === 0) { + const params = { + ...list[i], + ...{ + isFirst: true + } + }; + this.handleSelectSystem(params); + } + }); } - // } + // } } catch (e) { this.messageAdvancedError(e); } From fd56df4378e83ffcc2b505e6dd4685dec586cc6f Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Thu, 2 Nov 2023 13:20:04 +0800 Subject: [PATCH 77/93] =?UTF-8?q?fix:=20=E5=8A=A8=E6=80=81=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E7=B3=BB=E7=BB=9F=E5=90=8D=E7=A7=B0=E7=9A=84=E6=8B=96?= =?UTF-8?q?=E6=8B=BD=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/sensitivity-systems.vue | 37 +++++++++++++------ .../src/views/sensitivity-level/index.vue | 5 +++ 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/frontend/src/views/sensitivity-level/components/sensitivity-systems.vue b/frontend/src/views/sensitivity-level/components/sensitivity-systems.vue index b854e433f..ce96ee242 100644 --- a/frontend/src/views/sensitivity-level/components/sensitivity-systems.vue +++ b/frontend/src/views/sensitivity-level/components/sensitivity-systems.vue @@ -46,11 +46,18 @@ @click.stop="handleSelectSystem(item)" >
- -
{{ item.name }}
+
+ +
+ {{ item.name }} +
+
{{ item.count || 0 }}
@@ -75,6 +82,9 @@ import { formatCodeData, getWindowHeight } from '@/common/util'; // import { systemCountMockData } from '../testData.js'; export default { + inject: { + getDragWidth: { value: 'getDragWidth', default: 280 } + }, data () { return { active: '', @@ -290,12 +300,17 @@ align-items: center; font-size: 13px; color: #63656e; - .folder-icon { - font-size: 14px; - color: #c4c6cc; - margin-right: 8px; - &-active { - color: #3a84ff; + &-left { + display: flex; + align-items: center; + word-break: break-all; + .folder-icon { + font-size: 14px; + color: #c4c6cc; + margin-right: 8px; + &-active { + color: #3a84ff; + } } } } diff --git a/frontend/src/views/sensitivity-level/index.vue b/frontend/src/views/sensitivity-level/index.vue index ecbd8ca6d..99be0c56e 100644 --- a/frontend/src/views/sensitivity-level/index.vue +++ b/frontend/src/views/sensitivity-level/index.vue @@ -30,6 +30,11 @@ SensitivitySystems, SensitivityRightLayout }, + provide: function () { + return { + getDragWidth: () => this.dragWidth + }; + }, data () { return { isDrag: false, From 657b5978471c2b9b28a152deb93a71005bc21243 Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Thu, 2 Nov 2023 14:29:41 +0800 Subject: [PATCH 78/93] =?UTF-8?q?fix:=20=E6=8F=90=E4=BA=A4=E6=BC=8F?= =?UTF-8?q?=E7=BC=BA=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/sensitivity-level-table.vue | 37 +++++++------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/frontend/src/views/sensitivity-level/components/sensitivity-level-table.vue b/frontend/src/views/sensitivity-level/components/sensitivity-level-table.vue index 1a6c8c2ea..eabbc2ecb 100644 --- a/frontend/src/views/sensitivity-level/components/sensitivity-level-table.vue +++ b/frontend/src/views/sensitivity-level/components/sensitivity-level-table.vue @@ -298,14 +298,8 @@ ? this.$set(this.sensitivityTableList[index], 'sensitivity_level', payload) : this.sensitivityTableList.splice(index, 1); this.currentSelectList = []; - await this.fetchSensitivityLevelList(true); this.messageSuccess(this.$t(`m.info['编辑成功']`), 3000); - bus.$emit('on-tab-level-count', { - name: this.tabActive, - system_id: this.curSystemData.id, - count: this.pagination.count, - isSearch: this.emptyData.tipType === 'search' - }); + await this.handleRefreshCount(); } } } catch (e) { @@ -361,13 +355,7 @@ limit: 10 }); this.resetPagination(); - await this.fetchSensitivityLevelList(true); - bus.$emit('on-tab-level-count', { - name: this.tabActive, - system_id: this.curSystemData.id, - count: this.pagination.count, - isSearch: true - }); + await this.handleRefreshCount(); }, handleSelectChange (selection, row) { @@ -429,20 +417,21 @@ }, async handleConfirmTransfer (payload) { - const { sensitivity_level, actions } = payload; this.isShowTransferSlider = false; this.curSelectData = {}; this.currentSelectList = []; this.resetPagination(); + await this.handleRefreshCount(); + }, + + async handleRefreshCount () { await this.fetchSensitivityLevelList(true); - if (payload) { - bus.$emit('on-tab-level-count', { - name: sensitivity_level, - system_id: actions[0].system_id, - count: this.pagination.count, - isSearch: this.emptyData.tipType === 'search' - }); - } + bus.$emit('on-tab-level-count', { + name: this.tabActive, + system_id: this.curSystemData.id, + count: this.pagination.count, + isSearch: this.emptyData.tipType === 'search' + }); }, async handleEmptyClear () { @@ -459,7 +448,7 @@ this.currentSelectList = []; this.emptyData.tipType = ''; this.resetPagination(); - await this.fetchSensitivityLevelList(true); + await this.handleRefreshCount(); }, resetPagination () { From c3689e4cc402122c890ef73a633ca3aa1a456868 Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Thu, 2 Nov 2023 15:21:44 +0800 Subject: [PATCH 79/93] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=93=9D?= =?UTF-8?q?=E7=9B=BE=E5=B5=8C=E5=A5=97=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/my-manage-space/add-member-boundary/index.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/my-manage-space/add-member-boundary/index.vue b/frontend/src/views/my-manage-space/add-member-boundary/index.vue index 6767a4faf..d5ad11790 100644 --- a/frontend/src/views/my-manage-space/add-member-boundary/index.vue +++ b/frontend/src/views/my-manage-space/add-member-boundary/index.vue @@ -1906,7 +1906,7 @@ .left { width: 600px; - height: 100%; + /* height: 100%; */ border-right: 1px solid #dcdee5; position: relative; @@ -2099,7 +2099,7 @@ .result-preview { display: flex; justify-content: space-between; - padding: 8px 24px 8px 0px; + padding: 8px 36px 8px 0px; .bk-button-text.is-disabled { color: #c4c6cc; } @@ -2126,7 +2126,7 @@ position: relative; margin-top: 15px; /* padding-left: 10px; */ - padding-right: 24px; + padding-right: 36px; /* height: 345px; */ height: 414px; overflow: auto; From b3d30a572fb2b25cde2a075b631585d5ad434468 Mon Sep 17 00:00:00 2001 From: Timmy Date: Thu, 2 Nov 2023 15:28:07 +0800 Subject: [PATCH 80/93] fix: fix approval action list cache (#2325) --- saas/backend/apps/approval/views.py | 2 +- saas/backend/biz/action.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/saas/backend/apps/approval/views.py b/saas/backend/apps/approval/views.py index 72cb72361..bee703e24 100644 --- a/saas/backend/apps/approval/views.py +++ b/saas/backend/apps/approval/views.py @@ -221,7 +221,7 @@ def list(self, request, *args, **kwargs): system_id = slz.validated_data["system_id"] - action_list = self.biz.list(system_id) + action_list = self.biz.list_without_cache(system_id) level_count = Counter(obj.sensitivity_level for obj in action_list.actions) data = {sensitivity_level: count for sensitivity_level, count in level_count.items()} diff --git a/saas/backend/biz/action.py b/saas/backend/biz/action.py index c114dcca7..d2ef075ea 100644 --- a/saas/backend/biz/action.py +++ b/saas/backend/biz/action.py @@ -109,6 +109,9 @@ class ActionBiz: @cachedmethod(timeout=1 * 60) # 缓存1分钟 def list(self, system_id: str) -> ActionBeanList: + return self.list_without_cache(system_id) + + def list_without_cache(self, system_id: str) -> ActionBeanList: actions = self.action_svc.list(system_id) action_list = ActionBeanList(parse_obj_as(List[ActionBean], actions)) action_list.fill_related_resource_type_name() @@ -198,7 +201,7 @@ def list_pre_application_actions( def search(self, system_id: str, condition: ActionSearchCondition) -> List[ActionBean]: """搜索过滤某个系统下的操作""" - action_list = self.list(system_id) + action_list = self.list_without_cache(system_id) # 搜索条件 if condition.keyword: action_list = ActionBeanList(action_list.filter_by_name(condition.keyword)) From ece1af87215fe9bfe248d18a317dd09b3ce2b474 Mon Sep 17 00:00:00 2001 From: Timmy Date: Thu, 2 Nov 2023 16:27:49 +0800 Subject: [PATCH 81/93] Fix action list (#2326) --- saas/backend/biz/action.py | 9 +++++++++ saas/backend/service/action.py | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/saas/backend/biz/action.py b/saas/backend/biz/action.py index d2ef075ea..860ac4824 100644 --- a/saas/backend/biz/action.py +++ b/saas/backend/biz/action.py @@ -122,6 +122,15 @@ def list_without_cache(self, system_id: str) -> ActionBeanList: return action_list + def list_without_cache(self, system_id: str) -> ActionBeanList: + action_list = self.list(system_id) + + # 填充敏感度等级 + action_sensitivity_level = self.action_svc.get_action_sensitivity_level_map(system_id) + action_list.fill_sensitivity_level(action_sensitivity_level) + + return action_list + def list_by_role(self, system_id: str, role, hidden: bool = False) -> List[ActionBean]: action_list = self.list(system_id) diff --git a/saas/backend/service/action.py b/saas/backend/service/action.py index 227dcd9b5..7c4461dd2 100644 --- a/saas/backend/service/action.py +++ b/saas/backend/service/action.py @@ -61,7 +61,6 @@ def delete(self, system_id: str, action_id: str): """删除操作""" iam.delete_action(system_id, action_id) - @cachedmethod(timeout=60) def get_action_sensitivity_level_map(self, system_id: str) -> Dict[str, str]: action_sensitivity_level = {} for action_level in ActionProcessRelation.objects.filter(system_id=system_id).values( From f4567583af03eb70aa30c2100c807f14e5f10c47 Mon Sep 17 00:00:00 2001 From: Timmy Date: Thu, 2 Nov 2023 16:33:03 +0800 Subject: [PATCH 82/93] Fix action list (#2327) --- saas/backend/apps/approval/views.py | 2 +- saas/backend/biz/action.py | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/saas/backend/apps/approval/views.py b/saas/backend/apps/approval/views.py index bee703e24..a3c35b874 100644 --- a/saas/backend/apps/approval/views.py +++ b/saas/backend/apps/approval/views.py @@ -221,7 +221,7 @@ def list(self, request, *args, **kwargs): system_id = slz.validated_data["system_id"] - action_list = self.biz.list_without_cache(system_id) + action_list = self.biz.list_without_cache_sensitivity_level(system_id) level_count = Counter(obj.sensitivity_level for obj in action_list.actions) data = {sensitivity_level: count for sensitivity_level, count in level_count.items()} diff --git a/saas/backend/biz/action.py b/saas/backend/biz/action.py index 860ac4824..bb8c295bb 100644 --- a/saas/backend/biz/action.py +++ b/saas/backend/biz/action.py @@ -109,9 +109,6 @@ class ActionBiz: @cachedmethod(timeout=1 * 60) # 缓存1分钟 def list(self, system_id: str) -> ActionBeanList: - return self.list_without_cache(system_id) - - def list_without_cache(self, system_id: str) -> ActionBeanList: actions = self.action_svc.list(system_id) action_list = ActionBeanList(parse_obj_as(List[ActionBean], actions)) action_list.fill_related_resource_type_name() @@ -122,7 +119,7 @@ def list_without_cache(self, system_id: str) -> ActionBeanList: return action_list - def list_without_cache(self, system_id: str) -> ActionBeanList: + def list_without_cache_sensitivity_level(self, system_id: str) -> ActionBeanList: action_list = self.list(system_id) # 填充敏感度等级 @@ -210,7 +207,7 @@ def list_pre_application_actions( def search(self, system_id: str, condition: ActionSearchCondition) -> List[ActionBean]: """搜索过滤某个系统下的操作""" - action_list = self.list_without_cache(system_id) + action_list = self.list_without_cache_sensitivity_level(system_id) # 搜索条件 if condition.keyword: action_list = ActionBeanList(action_list.filter_by_name(condition.keyword)) From cb33859b0f09222a715be691d454b0a1dc0e3db6 Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Thu, 2 Nov 2023 16:43:20 +0800 Subject: [PATCH 83/93] =?UTF-8?q?fix:=20=E6=88=91=E7=9A=84=E6=9D=83?= =?UTF-8?q?=E9=99=90=E9=80=80=E5=87=BA=E5=90=8E=E7=BC=93=E5=AD=98=E6=9D=A1?= =?UTF-8?q?=E6=95=B0=EF=BC=88=E8=93=9D=E7=9B=BE=E9=9C=80=E6=B1=82=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/perm/group-perm/index.vue | 40 +++++++++++--------- frontend/src/views/perm/index.vue | 6 +-- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/frontend/src/views/perm/group-perm/index.vue b/frontend/src/views/perm/group-perm/index.vue index 878a52d33..ae7a24632 100644 --- a/frontend/src/views/perm/group-perm/index.vue +++ b/frontend/src/views/perm/group-perm/index.vue @@ -244,7 +244,7 @@ this.curPageData = [...v]; return; } - this.resetPagination(); + this.resetPagination(this.pageConf.limit); }, immediate: true }, @@ -317,6 +317,7 @@ let url = ''; let params = {}; const { current, limit } = this.pageConf; + console.log(limit); if (!this.mainContentLoading) { this.tableLoading = true; } @@ -343,6 +344,9 @@ const currentSelectGroupList = this.currentSelectGroupList.map(item => item.id.toString()); this.curPageData.splice(0, this.curPageData.length, ...(data.results || [])); this.$nextTick(() => { + if (!this.currentSelectGroupList.length) { + this.$refs.groupPermTableRef && this.$refs.groupPermTableRef.clearSelection(); + } this.curPageData.forEach(item => { if (item.role_members && item.role_members.length) { item.role_members = item.role_members.map(v => { @@ -383,6 +387,15 @@ // } // return this.dataList.slice(startIndex, endIndex); }, + + fetchSelectedGroupCount () { + this.$nextTick(() => { + const selectionCount = document.getElementsByClassName('bk-page-selection-count'); + if (this.$refs.groupPermTableRef && selectionCount) { + selectionCount[0].children[0].innerHTML = this.currentSelectGroupList.length; + } + }); + }, fetchSelectedGroups (type, payload, row) { const typeMap = { @@ -395,12 +408,7 @@ (item) => item.id.toString() !== row.id.toString() ); } - this.$nextTick(() => { - const selectionCount = document.getElementsByClassName('bk-page-selection-count'); - if (this.$refs.groupPermTableRef && selectionCount) { - selectionCount[0].children[0].innerHTML = this.currentSelectGroupList.length; - } - }); + this.fetchSelectedGroupCount(); this.$emit('on-select-group', this.currentSelectGroupList); }, all: () => { @@ -408,12 +416,7 @@ const selectGroups = this.currentSelectGroupList.filter(item => !tableList.map(v => v.id.toString()).includes(item.id.toString())); this.currentSelectGroupList = [...selectGroups, ...payload]; - this.$nextTick(() => { - const selectionCount = document.getElementsByClassName('bk-page-selection-count'); - if (this.$refs.groupPermTableRef && selectionCount) { - selectionCount[0].children[0].innerHTML = this.currentSelectGroupList.length; - } - }); + this.fetchSelectedGroupCount(); this.$emit('on-select-group', this.currentSelectGroupList); } }; @@ -493,6 +496,7 @@ }); this.cancelDelete(); this.messageSuccess(this.$t(`m.info['退出成功']`), 3000); + this.currentSelectGroupList = []; this.refreshTableData(); } catch (e) { this.deleteDialogConf.loading = false; @@ -574,17 +578,19 @@ this.deleteDialogConf.loading = false; }, - resetPagination () { - this.pageConf = Object.assign(this.pageConf, { current: 1, limit: 10 }); + resetPagination (limit = 10) { + this.pageConf = Object.assign(this.pageConf, { current: 1, limit }); this.getDataByPage(); }, refreshTableData () { - this.resetPagination(); + const { limit } = this.pageConf; + this.resetPagination(limit); + this.fetchSelectedGroupCount(); if (this.isSearchPerm) { return; } - this.$emit('refresh'); + this.$emit('refresh', true, limit); } } }; diff --git a/frontend/src/views/perm/index.vue b/frontend/src/views/perm/index.vue index ac06f4c6c..e4130624b 100644 --- a/frontend/src/views/perm/index.vue +++ b/frontend/src/views/perm/index.vue @@ -316,12 +316,12 @@ await this.fetchData(); }, - async fetchData (isLoading = false) { + async fetchData (isLoading = false, limit = 10, page = 1) { this.componentLoading = isLoading; const hideApplyBtn = this.externalSystemsLayout.myPerm.hideApplyBtn; const userGroupParams = { - page_size: 10, - page: 1 + page_size: limit, + page }; if (this.externalSystemId) { userGroupParams.system_id = this.externalSystemId; From 7570dc0a9b714af3e7d7137abc33073ddf440406 Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Thu, 2 Nov 2023 17:40:42 +0800 Subject: [PATCH 84/93] =?UTF-8?q?fix:=20=E5=B1=8F=E8=94=BD=E6=95=8F?= =?UTF-8?q?=E6=84=9F=E7=AD=89=E7=BA=A7=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/store/index.js | 16 ++++++++-------- frontend/src/views/perm/group-perm/index.vue | 5 ++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index bba1a5abf..9b398805e 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -231,14 +231,14 @@ const currentNav = [ path: `${SITE_URL}resource-permiss`, disabled: false }, - { - icon: 'mingandengji', - id: 'sensitivityLevelNav', - rkey: 'sensitivityLevel', - name: il8n('nav', '敏感等级'), - path: `${SITE_URL}sensitivity-level`, - disabled: false - }, + // { + // icon: 'mingandengji', + // id: 'sensitivityLevelNav', + // rkey: 'sensitivityLevel', + // name: il8n('nav', '敏感等级'), + // path: `${SITE_URL}sensitivity-level`, + // disabled: false + // }, { icon: 'perm-manage', name: il8n('common', '设置'), diff --git a/frontend/src/views/perm/group-perm/index.vue b/frontend/src/views/perm/group-perm/index.vue index ae7a24632..2c61aa636 100644 --- a/frontend/src/views/perm/group-perm/index.vue +++ b/frontend/src/views/perm/group-perm/index.vue @@ -317,7 +317,6 @@ let url = ''; let params = {}; const { current, limit } = this.pageConf; - console.log(limit); if (!this.mainContentLoading) { this.tableLoading = true; } @@ -343,7 +342,7 @@ this.pageConf.count = data.count || 0; const currentSelectGroupList = this.currentSelectGroupList.map(item => item.id.toString()); this.curPageData.splice(0, this.curPageData.length, ...(data.results || [])); - this.$nextTick(() => { + setTimeout(() => { if (!this.currentSelectGroupList.length) { this.$refs.groupPermTableRef && this.$refs.groupPermTableRef.clearSelection(); } @@ -360,7 +359,7 @@ this.$refs.groupPermTableRef && this.$refs.groupPermTableRef.toggleRowSelection(item, true); } }); - }); + }, 200); this.groupPermEmptyData = formatCodeData(code, this.groupPermEmptyData, data.count === 0); } catch (e) { console.error(e); From 3d5ad1c7637d0a5251984d08aa1451e9777718f0 Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Fri, 3 Nov 2023 17:38:16 +0800 Subject: [PATCH 85/93] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=A9=BA=E9=97=B4=E6=A8=A1=E5=9D=97=E6=97=A0=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=AE=9E=E4=BE=8B=E6=97=B6=EF=BC=8C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=B8=85=E7=A9=BA=E9=80=89=E6=8B=A9=E7=9A=84=E6=97=A7=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grading-admin/components/render-instance-table.vue | 8 ++++++-- .../manage-spaces/components/render-instance-table.vue | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/grading-admin/components/render-instance-table.vue b/frontend/src/views/grading-admin/components/render-instance-table.vue index 1b374f134..40d2606c7 100644 --- a/frontend/src/views/grading-admin/components/render-instance-table.vue +++ b/frontend/src/views/grading-admin/components/render-instance-table.vue @@ -165,7 +165,7 @@ @on-init="handlerOnInit" />
- {{ $t(`m.common['保存']`) }} + {{ $t(`m.common['保存']`) }} {{ $t(`m.common['预览']`) }} {{ $t(`m.common['取消']`) }}
@@ -644,11 +644,15 @@ }); }, - async handlerResourceSumit () { + async handlerResourceSubmit () { window.changeDialog = true; const conditionData = this.$refs.renderResourceRef.handleGetValue(); const { isEmpty, data } = conditionData; if (isEmpty || data[0] === 'none') { + this.tableList[this.curIndex].resource_groups[this.curGroupIndex] + .related_resource_types[this.curResIndex].condition = data; + this.tableList[this.curIndex].resource_groups[this.curGroupIndex] + .related_resource_types[this.curResIndex].isError = true; this.isShowResourceInstanceSideslider = false; return; } diff --git a/frontend/src/views/manage-spaces/components/render-instance-table.vue b/frontend/src/views/manage-spaces/components/render-instance-table.vue index 1d41a91a8..d4ade28bf 100644 --- a/frontend/src/views/manage-spaces/components/render-instance-table.vue +++ b/frontend/src/views/manage-spaces/components/render-instance-table.vue @@ -659,6 +659,10 @@ const conditionData = this.$refs.renderResourceRef.handleGetValue(); const { isEmpty, data } = conditionData; if (isEmpty || data[0] === 'none') { + this.tableList[this.curIndex].resource_groups[this.curGroupIndex] + .related_resource_types[this.curResIndex].condition = data; + this.tableList[this.curIndex].resource_groups[this.curGroupIndex] + .related_resource_types[this.curResIndex].isError = true; this.isShowResourceInstanceSideslider = false; return; } From 731833a1ea6fc3df6d13c71f42bdb3274abdf57a Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Mon, 6 Nov 2023 11:39:46 +0800 Subject: [PATCH 86/93] =?UTF-8?q?feature:=20=E5=BC=80=E6=94=BE=E6=95=8F?= =?UTF-8?q?=E6=84=9F=E7=AD=89=E7=BA=A7=E8=8F=9C=E5=8D=95=E5=88=B0=E7=BA=BF?= =?UTF-8?q?=E4=B8=8A=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/store/index.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 9b398805e..bba1a5abf 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -231,14 +231,14 @@ const currentNav = [ path: `${SITE_URL}resource-permiss`, disabled: false }, - // { - // icon: 'mingandengji', - // id: 'sensitivityLevelNav', - // rkey: 'sensitivityLevel', - // name: il8n('nav', '敏感等级'), - // path: `${SITE_URL}sensitivity-level`, - // disabled: false - // }, + { + icon: 'mingandengji', + id: 'sensitivityLevelNav', + rkey: 'sensitivityLevel', + name: il8n('nav', '敏感等级'), + path: `${SITE_URL}sensitivity-level`, + disabled: false + }, { icon: 'perm-manage', name: il8n('common', '设置'), From 10500c9703da80bd3c54cb20f4cfdf1b6028fdd6 Mon Sep 17 00:00:00 2001 From: Timmy Date: Mon, 6 Nov 2023 14:26:56 +0800 Subject: [PATCH 87/93] fix: update esb auth (#2333) --- saas/backend/component/esb.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/saas/backend/component/esb.py b/saas/backend/component/esb.py index b58225c60..eff4c8709 100644 --- a/saas/backend/component/esb.py +++ b/saas/backend/component/esb.py @@ -8,6 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ +import json from typing import Dict from django.conf import settings @@ -27,19 +28,15 @@ def _call_esb_api(http_func, url_path, data, timeout=30): "Content-Type": "application/json", "X-Request-Id": local.request_id, "blueking-language": translation.get_language(), + "X-Bkapi-Authorization": json.dumps( + { + "bk_app_code": settings.APP_CODE, + "bk_app_secret": settings.APP_SECRET, + "bk_username": "admin", # 存在后台任务,无法使用登录态的方式 + } + ), } - # Note: 目前企业版ESB调用的鉴权信息都是与接口的参数一起的,并非在header头里 - common_params = { - "bk_app_code": settings.APP_CODE, - "bk_app_secret": settings.APP_SECRET, - "bk_username": "admin", # 存在后台任务,无法使用登录态的方式 - # 兼容TE版 - "app_code": settings.APP_CODE, - "app_secret": settings.APP_SECRET, - } - data.update(common_params) - url = url_join(settings.BK_COMPONENT_INNER_API_URL, url_path) return do_blueking_http_request(ComponentEnum.ESB.value, http_func, url, data, headers, timeout) From 89ecc5b4a0e52e98a5680a5031d98412c42c4430 Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Mon, 6 Nov 2023 17:38:42 +0800 Subject: [PATCH 88/93] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=BB=84=E8=BF=87=E6=9C=9F=E6=9C=AA=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E7=BB=AD=E6=9C=9F=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../perm-apply/apply-custom-perm/index.vue | 17 +++++++++-------- .../perm-apply/apply-join-user-group/index.vue | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/frontend/src/views/perm-apply/apply-custom-perm/index.vue b/frontend/src/views/perm-apply/apply-custom-perm/index.vue index 615919081..cdae89157 100644 --- a/frontend/src/views/perm-apply/apply-custom-perm/index.vue +++ b/frontend/src/views/perm-apply/apply-custom-perm/index.vue @@ -924,13 +924,14 @@ }; }); } - this.personalUserGroup.forEach(v => { - if (String(item.id) === v.id) { - this.$set(item, 'expired_at', v.expired_at); - this.$set(item, 'expired_at_display', v.expired_at_display); + if (this.personalUserGroup.length) { + const hasSelected = this.personalUserGroup.find((v) => String(v.id) === String(item.id)); + if (hasSelected) { + this.$set(item, 'expired_at', hasSelected.expired_at); + this.$set(item, 'expired_at_display', hasSelected.expired_at_display); this.$refs.groupTableRef && this.$refs.groupTableRef.toggleRowSelection(item, true); } - }); + } }); }); } catch (e) { @@ -943,7 +944,7 @@ async fetchCurUserGroup () { try { const { data } = await this.$store.dispatch('perm/getPersonalGroups', { - page_size: 100, + page_size: 1000, page: 1 }); if (data.results && data.results.length) { @@ -987,10 +988,10 @@ await this.fetchCommonActions(this.systemValue); } if (this.sysAndtid) { - // 获取用户组数据 - await this.fetchUserGroupList(); // 获取个人用户的用户组列表 await this.fetchCurUserGroup(); + // 获取用户组数据 + await this.fetchUserGroupList(); // 获取推荐操作 await this.fetchRecommended(); } diff --git a/frontend/src/views/perm-apply/apply-join-user-group/index.vue b/frontend/src/views/perm-apply/apply-join-user-group/index.vue index df9578dab..7a032f3a6 100644 --- a/frontend/src/views/perm-apply/apply-join-user-group/index.vue +++ b/frontend/src/views/perm-apply/apply-join-user-group/index.vue @@ -197,6 +197,7 @@ {{ row.name }} + ({{ row.expired_at_display }}) @@ -1000,6 +1001,14 @@ }; }); } + if (this.defaultSelectedGroups.length) { + const hasSelected = this.defaultSelectedGroups.find((v) => String(v.id) === String(item.id)); + if (hasSelected) { + this.$set(item, 'expired_at', hasSelected.expired_at); + this.$set(item, 'expired_at_display', hasSelected.expired_at_display); + this.$refs.groupTableRef && this.$refs.groupTableRef.toggleRowSelection(item, true); + } + } if (currentSelectedGroups.includes(item.id.toString()) || this.curUserGroup.includes(item.id.toString())) { this.$refs.groupTableRef && this.$refs.groupTableRef.toggleRowSelection(item, true); @@ -1050,6 +1059,14 @@ }; }); } + if (this.defaultSelectedGroups.length) { + const hasSelected = this.defaultSelectedGroups.find((v) => String(v.id) === String(item.id)); + if (hasSelected) { + this.$set(item, 'expired_at', hasSelected.expired_at); + this.$set(item, 'expired_at_display', hasSelected.expired_at_display); + this.$refs.groupTableRef && this.$refs.groupTableRef.toggleRowSelection(item, true); + } + } if (currentSelectedGroups.includes(item.id.toString()) || this.curUserGroup.includes(item.id.toString())) { this.$refs.groupTableRef && this.$refs.groupTableRef.toggleRowSelection(item, true); From 5505db88f04f9d7ad9baad293dbd4573ef74c762 Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Mon, 6 Nov 2023 17:55:14 +0800 Subject: [PATCH 89/93] =?UTF-8?q?feature:=20=E7=94=B3=E8=AF=B7=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E7=94=A8=E6=88=B7=E7=BB=84=E5=A2=9E=E5=8A=A0=E8=BF=87?= =?UTF-8?q?=E6=9C=9F=E6=97=B6=E9=97=B4=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apply-join-user-group/index.vue | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/perm-apply/apply-join-user-group/index.vue b/frontend/src/views/perm-apply/apply-join-user-group/index.vue index 7a032f3a6..e2882ca74 100644 --- a/frontend/src/views/perm-apply/apply-join-user-group/index.vue +++ b/frontend/src/views/perm-apply/apply-join-user-group/index.vue @@ -194,10 +194,24 @@ @@ -1680,4 +1694,20 @@ display: none; } } + +.user-group-name { + display: flex; + align-items: center; + &-label { + color: #3a84ff; + max-width: calc(100% - 50px); + word-break: break-all; + cursor: pointer; + } + &-expired { + color: #313238; + line-height: 1; + margin-left: 5px; + } +} From c4ddd7b5b0faed58c01c3514b885e4666483ea6d Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Tue, 7 Nov 2023 11:10:42 +0800 Subject: [PATCH 90/93] =?UTF-8?q?fix:=20=E7=94=B3=E8=AF=B7=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E7=94=A8=E6=88=B7=E7=BB=84=E5=A4=84=E7=90=86=E5=AF=B9?= =?UTF-8?q?=E8=B6=85=E8=BF=87=E4=B8=AA100=E4=B8=AA=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=BB=84=E7=9A=84=E8=87=AA=E5=AE=9A=E4=B9=89message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/common/bkmagic.js | 4 ++-- frontend/src/language/lang/en.js | 3 ++- frontend/src/language/lang/zh.js | 3 ++- frontend/src/store/index.js | 16 ++++++++-------- .../perm-apply/apply-join-user-group/index.vue | 17 +++++++---------- 5 files changed, 21 insertions(+), 22 deletions(-) diff --git a/frontend/src/common/bkmagic.js b/frontend/src/common/bkmagic.js index 02ab1c5ed..028d3a8ea 100644 --- a/frontend/src/common/bkmagic.js +++ b/frontend/src/common/bkmagic.js @@ -85,7 +85,7 @@ export const messageWarn = (message, delay = 3000, ellipsisLine = 3) => { // message高阶用法 -export const messageAdvancedError = (details, delay = 8000, ellipsisLine = 3) => { +export const messageAdvancedError = (details, delay = 8000, ellipsisLine = 3, externalMsg = '') => { // 区分内外部链接 let linkContent = { url: '' @@ -106,7 +106,7 @@ export const messageAdvancedError = (details, delay = 8000, ellipsisLine = 3) => linkMap[isTencent](); const { code, data, message, statusText, response } = details; let errCode = null; - const errMsg = message || data.msg || statusText; + const errMsg = externalMsg || (message || data.msg || statusText); if (code) { errCode = code; } diff --git a/frontend/src/language/lang/en.js b/frontend/src/language/lang/en.js index 4159a583d..a46247761 100644 --- a/frontend/src/language/lang/en.js +++ b/frontend/src/language/lang/en.js @@ -530,7 +530,8 @@ export const m = { '用户组属性为只读属性': '{value} is read-only user group attribute', '不可续期的用户组成员如下': 'The non renewable user group members are as follows: {value}', '管理员组不能添加权限': 'Administrators group cannot add permissions', - '只读用户组不能添加权限': 'Read only user groups cannot add permissions' + '只读用户组不能添加权限': 'Read only user groups cannot add permissions', + '申请加入失败,用户组数量超出上限(100个),请在“我的权限”中退出用户组后重试': 'Application to join failed. The number of user groups exceeds the maximum limit (100), please exit {value} user group in "My permissions" and try again' }, // 二次确认弹窗相关 dialog: { diff --git a/frontend/src/language/lang/zh.js b/frontend/src/language/lang/zh.js index a1b9cda6f..ebfec5cba 100644 --- a/frontend/src/language/lang/zh.js +++ b/frontend/src/language/lang/zh.js @@ -530,7 +530,8 @@ export const m = { '用户组属性为只读属性': '{value}为只读用户组属性', '不可续期的用户组成员如下': '不可续期的用户组成员如下:{value}', '管理员组不能添加权限': '管理员组不能添加权限', - '只读用户组不能添加权限': '只读用户组不能添加权限' + '只读用户组不能添加权限': '只读用户组不能添加权限', + '申请加入失败,用户组数量超出上限(100个),请在“我的权限”中退出用户组后重试': '申请加入失败,用户组数量超出上限(100个),请在"我的权限"中退出{value}个用户组后重试' }, // 二次确认弹窗相关 dialog: { diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index bba1a5abf..9b398805e 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -231,14 +231,14 @@ const currentNav = [ path: `${SITE_URL}resource-permiss`, disabled: false }, - { - icon: 'mingandengji', - id: 'sensitivityLevelNav', - rkey: 'sensitivityLevel', - name: il8n('nav', '敏感等级'), - path: `${SITE_URL}sensitivity-level`, - disabled: false - }, + // { + // icon: 'mingandengji', + // id: 'sensitivityLevelNav', + // rkey: 'sensitivityLevel', + // name: il8n('nav', '敏感等级'), + // path: `${SITE_URL}sensitivity-level`, + // disabled: false + // }, { icon: 'perm-manage', name: il8n('common', '设置'), diff --git a/frontend/src/views/perm-apply/apply-join-user-group/index.vue b/frontend/src/views/perm-apply/apply-join-user-group/index.vue index e2882ca74..6adc1f419 100644 --- a/frontend/src/views/perm-apply/apply-join-user-group/index.vue +++ b/frontend/src/views/perm-apply/apply-join-user-group/index.vue @@ -1517,11 +1517,16 @@ }); } catch (e) { console.error(e); + const applyCount = this.defaultSelectedGroups.length + this.currentSelectedGroups.length; if (['admin'].includes(this.user.username)) { this.isShowConfirmDialog = true; - } else { - this.messageAdvancedError(e); + return; + } + if (applyCount >= 100) { + this.messageAdvancedError(e, 8000, 3, this.$t(`m.info['申请加入失败,用户组数量超出上限(100个),请在“我的权限”中退出用户组后重试']`, { value: applyCount - 100 })); + return; } + this.messageAdvancedError(e); } finally { this.submitLoading = false; } @@ -1622,13 +1627,6 @@ border-right: 1px solid #dfe0e5; border-bottom: 1px solid #dfe0e5; } - .user-group-name { - color: #3a84ff; - cursor: pointer; - &:hover { - color: #699df4; - } - } } .apply-selected-groups { padding: 10px 0; @@ -1705,7 +1703,6 @@ cursor: pointer; } &-expired { - color: #313238; line-height: 1; margin-left: 5px; } From 00eecdba8146955df0db54d1b37e460ef11b8fe9 Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Tue, 7 Nov 2023 11:46:37 +0800 Subject: [PATCH 91/93] =?UTF-8?q?feature:=20=E7=94=B3=E8=AF=B7=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E7=94=A8=E6=88=B7=E7=BB=84=E6=B7=BB=E5=8A=A0=E7=BB=AD?= =?UTF-8?q?=E6=9C=9F=E6=8F=90=E7=A4=BA=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../perm-apply/apply-custom-perm/index.vue | 8 +++-- .../apply-join-user-group/index.vue | 33 +++++++++++++++++-- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/perm-apply/apply-custom-perm/index.vue b/frontend/src/views/perm-apply/apply-custom-perm/index.vue index cdae89157..7c92dbd61 100644 --- a/frontend/src/views/perm-apply/apply-custom-perm/index.vue +++ b/frontend/src/views/perm-apply/apply-custom-perm/index.vue @@ -335,8 +335,10 @@
{{ row.name }}
- - {{$t(`m.permApply['你已获得该组权限,但是已过期']`)}} + + ( + {{ row.expired_at_display }}{{ $t(`m.common[',']`) }} {{ $t(`m.permApply['去续期']`) }} + )
@@ -2619,6 +2622,7 @@ align-items: center; .user-group-name { max-width: 200px; + margin-right: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; diff --git a/frontend/src/views/perm-apply/apply-join-user-group/index.vue b/frontend/src/views/perm-apply/apply-join-user-group/index.vue index 6adc1f419..c1b9d7cc7 100644 --- a/frontend/src/views/perm-apply/apply-join-user-group/index.vue +++ b/frontend/src/views/perm-apply/apply-join-user-group/index.vue @@ -198,7 +198,8 @@ - ({{ row.expired_at_display }}) + + + ({{ row.expired_at_display }}) +
@@ -1543,6 +1558,15 @@ }, _ => _); }, + handleBatchRenewal () { + this.$router.push({ + name: 'permRenewal', + query: { + tab: 'group' + } + }); + }, + resetDataAfterClose () { this.curResIndex = -1; this.groupIndex = -1; @@ -1698,9 +1722,12 @@ align-items: center; &-label { color: #3a84ff; - max-width: calc(100% - 50px); + max-width: calc(100% - 80px); word-break: break-all; cursor: pointer; + &-expired { + max-width: calc(100% - 150px); + } } &-expired { line-height: 1; From 0d935021a07f0d57d6a3013e182b05a3d4c4198c Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Tue, 7 Nov 2023 11:49:03 +0800 Subject: [PATCH 92/93] =?UTF-8?q?fix:=20=E6=8F=90=E4=BB=B7=E6=BC=8F?= =?UTF-8?q?=E7=BC=BAhover?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/perm-apply/apply-join-user-group/index.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/views/perm-apply/apply-join-user-group/index.vue b/frontend/src/views/perm-apply/apply-join-user-group/index.vue index c1b9d7cc7..fc72003b5 100644 --- a/frontend/src/views/perm-apply/apply-join-user-group/index.vue +++ b/frontend/src/views/perm-apply/apply-join-user-group/index.vue @@ -1725,6 +1725,9 @@ max-width: calc(100% - 80px); word-break: break-all; cursor: pointer; + &:hover { + color: #699df4; + } &-expired { max-width: calc(100% - 150px); } From d44337cbe5f56eb2e279950197aabc636971b419 Mon Sep 17 00:00:00 2001 From: Timmy Date: Tue, 7 Nov 2023 15:07:24 +0800 Subject: [PATCH 93/93] docs: add v1.10.16 version log (#2337) --- saas/resources/version_log/change_log.md | 26 +++++++++++++++++++++ saas/resources/version_log/change_log_en.md | 26 +++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/saas/resources/version_log/change_log.md b/saas/resources/version_log/change_log.md index 78fb0bc7b..d66a997d4 100644 --- a/saas/resources/version_log/change_log.md +++ b/saas/resources/version_log/change_log.md @@ -1,3 +1,29 @@ + +# V1.10.16 版本更新日志 + +### 功能优化 +* 优化添加系统和操作侧边栏处理接口调用多次异常导致有时无法聚合问题 +* 我的权限列表增加底部版本声明 +* 用户组成员列表支持跨页批量删除、批量续期 +* 组织架构人员选择器设计改版 +* 产品文档链接改为动态配置项 +* 申请加入用户组超过100条自定义错误信息 +* 申请加入用户组—>过期用户组添加续期 + +### 缺陷修复 +* 修复用户组新建、克隆添加组权限重新编辑不变更操作后,无法回显之前所选项 +* 修复分级管理员下多个无限制操作实例无法批量粘贴 +* 修复聚合批量操作下处理个别操作聚合报错,导致拿不到授权范围接口数据 +* 修复编辑授权边界或者编辑管理空间没有同步勾选依赖操作 +* 修复批量复粘贴无可复制属性条件内容时会导致展示无限制问题 +* 修复删除完所有自定义权限后,页面样式出现一个方框 +* 修复批量编辑无交集的操作导致出现空白页 +* 修复权限模板编辑关联实例后提示授权的用户组更新信息不完整 +* 修复管理空间模块无选择实例时,没有清空选择的旧数据 +* 修复自定义日期选择器无法根据时间戳显示当前所选择的天数 + +--- + # V1.10.15 版本更新日志 diff --git a/saas/resources/version_log/change_log_en.md b/saas/resources/version_log/change_log_en.md index 572429441..fa0abf367 100644 --- a/saas/resources/version_log/change_log_en.md +++ b/saas/resources/version_log/change_log_en.md @@ -1,3 +1,29 @@ + +# V1.10.16 Version Update Log + +### Optimization Updates +* Optimized handling of multiple API calls in the sidebar for adding systems and operations, addressing aggregation issues. +* Added version declaration at the bottom of the "My Permissions" list. +* Added support for batch deletion and renewal of members in user groups across multiple pages. +* Redesigned the organization structure member selector. +* Made the product documentation link a dynamic configuration item. +* Added custom error message for exceeding 100 requests to join a user group. +* Added group renewal for expired user groups in the "Apply to Join User Group" feature. + +### Bug Fixes +* Fixed an issue where creating or cloning a user group and re-editing the group permissions without changing the operations would not display the previously selected options. +* Fixed the inability to batch paste multiple unrestricted operations under a hierarchical administrator. +* Fixed an error in the aggregation of individual operations in batch operations, resulting in missing authorization scope data. +* Fixed the lack of synchronization of dependency operations when editing authorization boundaries or editing management spaces. +* Fixed an issue where batch paste would show unlimited content when there were no copyable attribute conditions. +* Fixed a styling issue where a box appeared after deleting all custom permissions. +* Fixed a blank page issue caused by batch editing operations with no intersection. +* Fixed incomplete update information prompt for user groups after editing associated instances in permission template editing. +* Fixed the failure to clear old data when there are no selected instances in the management space module. +* Fixed the inability of the custom date selector to display the selected days based on the timestamp. + +--- + # V1.10.15 Version Update Log