From 35842da2ca7697381ffa5e7c42df04c0f1b412f8 Mon Sep 17 00:00:00 2001 From: Timmy Date: Mon, 8 Apr 2024 14:27:41 +0800 Subject: [PATCH 01/19] feat: query default action sensitivity from backend (#2500) --- saas/backend/biz/action.py | 14 ++++++++++++++ saas/backend/service/action.py | 2 +- saas/backend/service/models/action.py | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/saas/backend/biz/action.py b/saas/backend/biz/action.py index bb8c295bb..718dd5a95 100644 --- a/saas/backend/biz/action.py +++ b/saas/backend/biz/action.py @@ -41,6 +41,16 @@ class ActionBean(Action): tag: str = ActionTag.UNCHECKED.value sensitivity_level: str = "" + def __init__(self, **data): + super().__init__(**data) + if ( + "sensitivity" in data + and data["sensitivity"] + and isinstance(data["sensitivity"], int) + and 1 < data["sensitivity"] < 6 + ): + self.sensitivity_level = SensitivityLevel.get_choices()[data["sensitivity"] - 1][0] + class ActionSearchCondition(BaseModel): """操作的搜索条件""" @@ -76,6 +86,10 @@ def _fill_action_related_resource_type_name(self, action: ActionBean, name_provi def fill_sensitivity_level(self, action_sensitivity_level: Dict[str, str]): # 填充敏感度等级 for action in self.actions: + # NOTE: 模型本身已经有默认值 + if action.id not in action_sensitivity_level and action.sensitivity_level: + continue + action.sensitivity_level = action_sensitivity_level.get(action.id, SensitivityLevel.L1.value) def filter_by_scope_action_ids(self, scope_action_ids: List[str]) -> List[ActionBean]: diff --git a/saas/backend/service/action.py b/saas/backend/service/action.py index 7c4461dd2..9b9921b38 100644 --- a/saas/backend/service/action.py +++ b/saas/backend/service/action.py @@ -36,7 +36,7 @@ class ActionService: full_fields = ( "id,name,name_en,related_resource_types,version,type,hidden,description,description_en," - "related_actions,related_environments" + "related_actions,related_environments,sensitivity" ) @cachedmethod(timeout=60) diff --git a/saas/backend/service/models/action.py b/saas/backend/service/models/action.py index 2582ced52..f828b77c9 100644 --- a/saas/backend/service/models/action.py +++ b/saas/backend/service/models/action.py @@ -59,6 +59,7 @@ class Action(BaseModel): related_resource_types: List[RelatedResourceType] = [] related_actions: List[str] = [] # 依赖操作 related_environments: List[RelatedEnvironment] = [] + sensitivity: int = 1 def __init__(self, **data: Any): if "related_actions" in data and data["related_actions"] is None: From f5f27a15dc1021562ce961b2b6c06a1fecd0a50d Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Mon, 8 Apr 2024 18:36:32 +0800 Subject: [PATCH 02/19] =?UTF-8?q?feature:=20=E5=AE=8C=E6=88=90=E7=BB=AD?= =?UTF-8?q?=E6=9C=9F=E9=80=9A=E7=9F=A5=E6=A8=A1=E5=9D=97=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=BC=80=E5=8F=91(=E5=BE=85=E8=81=94?= =?UTF-8?q?=E8=B0=83)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.vue | 2 +- frontend/src/common/router-handle.js | 15 +- frontend/src/images/mail.svg | 1 + frontend/src/images/qq.svg | 1 + frontend/src/images/qw.svg | 1 + frontend/src/images/sms.svg | 1 + frontend/src/images/wechat.svg | 1 + frontend/src/language/lang/en.js | 30 ++ frontend/src/language/lang/zh.js | 29 +- frontend/src/store/index.js | 6 +- frontend/src/views/renewal-notice/index.vue | 537 ++++++++++++++++---- 11 files changed, 523 insertions(+), 101 deletions(-) create mode 100644 frontend/src/images/mail.svg create mode 100644 frontend/src/images/qq.svg create mode 100644 frontend/src/images/qw.svg create mode 100644 frontend/src/images/sms.svg create mode 100644 frontend/src/images/wechat.svg diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 7761cce48..d4540eac9 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -363,7 +363,7 @@ .views-layout { min-height: 100%; - min-width: 1120px; + /* min-width: 1120px; */ padding: 24px; } diff --git a/frontend/src/common/router-handle.js b/frontend/src/common/router-handle.js index 195156468..fd8149af8 100644 --- a/frontend/src/common/router-handle.js +++ b/frontend/src/common/router-handle.js @@ -97,7 +97,8 @@ export const getRouterDiff = (payload) => { 'permTransfer', 'myManageSpaceSubDetail', 'sensitivityLevel', - 'resourcePermManage' + 'resourcePermManage', + 'renewalNotice' ]; } if (payload === 'system_manager') { @@ -129,7 +130,8 @@ export const getRouterDiff = (payload) => { 'secondaryManageSpace', 'authorBoundary', 'myManageSpace', - 'sensitivityLevel' + 'sensitivityLevel', + 'renewalNotice' ]; } if (payload === 'rating_manager') { @@ -161,7 +163,8 @@ export const getRouterDiff = (payload) => { 'resourcePermiss', 'firstManageSpace', 'sensitivityLevel', - 'resourcePermManage' + 'resourcePermManage', + 'renewalNotice' ]; } if (payload === 'subset_manager') { @@ -382,8 +385,7 @@ export const getNavRouterDiff = (navIndex, managerPerm = '') => { 'userGroupSetting', 'memberTemplate', 'resourcePermManage', - 'userOrgPerm', - 'renewalNotice' + 'userOrgPerm' ]; if (['hasSystemNoSuperManager'].includes(managerPerm)) { // 非超管用户隐藏的路由 @@ -394,7 +396,8 @@ export const getNavRouterDiff = (navIndex, managerPerm = '') => { 'gradingAdminCreate', 'gradingAdminDetail', 'gradingAdminEdit', - 'gradingAdminUpdateTemplate' + 'gradingAdminUpdateTemplate', + 'renewalNotice' ]; const systemManagerMenu = [ ...menuList, diff --git a/frontend/src/images/mail.svg b/frontend/src/images/mail.svg new file mode 100644 index 000000000..3c5713fcb --- /dev/null +++ b/frontend/src/images/mail.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/images/qq.svg b/frontend/src/images/qq.svg new file mode 100644 index 000000000..55f13b9b7 --- /dev/null +++ b/frontend/src/images/qq.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/images/qw.svg b/frontend/src/images/qw.svg new file mode 100644 index 000000000..89134b6b3 --- /dev/null +++ b/frontend/src/images/qw.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/images/sms.svg b/frontend/src/images/sms.svg new file mode 100644 index 000000000..467651e3c --- /dev/null +++ b/frontend/src/images/sms.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/images/wechat.svg b/frontend/src/images/wechat.svg new file mode 100644 index 000000000..998924dfa --- /dev/null +++ b/frontend/src/images/wechat.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/language/lang/en.js b/frontend/src/language/lang/en.js index 98ce9e0f1..5a7918b1a 100644 --- a/frontend/src/language/lang/en.js +++ b/frontend/src/language/lang/en.js @@ -1518,6 +1518,36 @@ export const m = { '已选择的用户组权限为不可移出的管理员组': 'The selected user group permission is an administrator group that cannot be removed', '已选择的用户组权限不需要续期': 'The selected user group permissions do not need to be renewed', '组织用户组权限': 'Organizational user group permissions' + }, + renewalNotice: { + '邮件': 'Mail', + '短信': 'SMS', + '微信': 'WeChat', + '企业微信': 'WeCom', + '通知方式': 'Notice method', + '通知时间': 'Notice time', + '通知范围': 'Notice scope', + '通知日': 'Notice day', + '发送时间': 'Send time', + '整个通知范围,需要 >= 7 天': 'The entire Notice scope requires>=7 days', + '通知方式为必填项': 'Notice method required', + '通知范围为必填项': 'Notice area required', + '通知日不为必填项': 'Notice date required', + '发送时间为必填项': 'Send time required', + '过期前': 'Before expiration', + '过期后': 'After expiration', + '天内': 'within the day', + '逢': 'Encounter', + '的': '', + '发送通知': 'send notice', + '恢复默认': 'Default', + '周一': 'Monday', + '周二': 'Tuesday', + '周三': 'Wednesday', + '周四': 'Thursday', + '周五': 'Friday', + '周六': 'Saturday', + '周日': 'Sunday' } } export default { diff --git a/frontend/src/language/lang/zh.js b/frontend/src/language/lang/zh.js index 3a1eda1ff..63df65aab 100644 --- a/frontend/src/language/lang/zh.js +++ b/frontend/src/language/lang/zh.js @@ -1520,7 +1520,34 @@ export const m = { '组织用户组权限': '组织用户组权限' }, renewalNotice: { - '续期通知': '续期通知' + '邮件': '邮件', + '短信': '短信', + '微信': '微信', + '企业微信': '企业微信', + '通知方式': '通知方式', + '通知时间': '通知时间', + '通知范围': '通知范围', + '通知日': '通知日', + '发送时间': '发送时间', + '整个通知范围,需要 >= 7 天': '整个通知范围,需要 >= 7 天', + '通知方式为必填项': '通知方式为必填项', + '通知范围为必填项': '通知范围为必填项', + '通知日为必填项': '通知日为必填项', + '发送时间为必填项': '发送时间为必填项', + '过期前': '过期前', + '过期后': '过期后', + '天内': '天内', + '逢': '逢', + '的': '的', + '发送通知': '发送通知', + '恢复默认': '恢复默认', + '周一': '周一', + '周二': '周二', + '周三': '周三', + '周四': '周四', + '周五': '周五', + '周六': '周六', + '周日': '周日' } } export default { diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 6d679ae7e..3cb800b03 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -94,6 +94,9 @@ import memberTemplate from './modules/member-template'; // 用户/组织模块 import userOrOrg from './modules/user-org'; +// 续期通知 +import renewalNotice from './modules/renewal-notice'; + Vue.use(Vuex); const SITE_URL = window.SITE_URL; @@ -368,7 +371,8 @@ const store = new Vuex.Store({ userGroupSetting, sensitivityLevel, memberTemplate, - userOrOrg + userOrOrg, + renewalNotice }, state: { mainContentLoading: false, diff --git a/frontend/src/views/renewal-notice/index.vue b/frontend/src/views/renewal-notice/index.vue index 93b7baeea..dccca6515 100644 --- a/frontend/src/views/renewal-notice/index.vue +++ b/frontend/src/views/renewal-notice/index.vue @@ -1,23 +1,147 @@ @@ -32,130 +156,359 @@ label: this.$t(`m.renewalNotice['企业微信']`), value: 'WeCom', icon: 'iamcenter-qw', - selected_icon: '' + selected_icon: require('@/images/qw.svg') }, { label: this.$t(`m.renewalNotice['邮件']`), value: 'mail', - icon: 'iamcenter-youjian' + icon: 'iamcenter-youjian', + selected_icon: require('@/images/mail.svg') }, { label: this.$t(`m.renewalNotice['微信']`), value: 'WeChat', - icon: 'iamcenter-wechat' + icon: 'iamcenter-wechat', + selected_icon: require('@/images/weChat.svg') }, { label: this.$t(`m.renewalNotice['短信']`), value: 'rtx', - icon: 'iamcenter-duanxin' + icon: 'iamcenter-duanxin', + selected_icon: require('@/images/sms.svg') + } + ], + sendDaysList: [ + { + label: '周一', + value: 'monday' + }, + { + label: '周二', + value: 'tuesday' + }, + { + label: '周三', + value: 'wednesday' + }, + { + label: '周四', + value: 'thursday' + }, + { + label: '周五', + value: 'friday' + }, + { + label: '周六', + value: 'saturday' + }, + { + label: '周日', + value: 'sunday' } ], noticeForm: { - notification_types: ['mail', 'rtx'], + notification_types: ['WeCom', 'mail'], send_days: ['monday'], send_time: '10:00', expire_days_before: 15, expire_days_after: 1 - } + }, + isMethodsEmpty: false, + isAreaEmpty: false, + isDayEmpty: false, + isSendTimeEmpty: false }; }, - methods: {} + computed: { + formatDayLabel () { + const result = this.sendDaysList.filter((item) => this.noticeForm.send_days.includes(item.value)) + .map((v) => this.$t(`m.renewalNotice['${v.label}']`)); + if (result.length) { + return result.join('、'); + } + return ''; + } + }, + created () { + this.fetchSuperNoticeConfig(); + }, + methods: { + async fetchSuperNoticeConfig () { + try { + const { data } = await this.$store.dispatch('renewalNotice/getSuperNoticeConfig'); + if (data) { + this.noticeForm = Object.assign(this.noticeForm, data); + } + } catch (e) { + this.messageAdvancedError(e); + } + }, + + handleSelectNoticeType (payload) { + const isExist = this.noticeForm.notification_types.includes(payload.value); + if (isExist) { + this.noticeForm.notification_types = this.noticeForm.notification_types.filter( + (item) => item !== payload.value + ); + } else { + this.noticeForm.notification_types.push(payload.value); + } + this.isMethodsEmpty = this.noticeForm.notification_types.length < 1; + }, + + handleSubmit () {}, + + handleReset () {}, + + handleDefault () {} + } }; From d7ae290513cd15a4b643f9e051cdc2f665d9570a Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Tue, 9 Apr 2024 10:41:56 +0800 Subject: [PATCH 03/19] =?UTF-8?q?fix:=20=E7=94=A8=E6=88=B7=E7=BB=84?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E2=80=94>=E4=BA=BA=E5=91=98=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E8=AF=A6=E6=83=85=E5=88=97=E8=A1=A8=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E4=B8=8B=E5=A2=9E=E5=8A=A0=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../group-member-template-detail-table.vue | 46 ++++++++++++++++--- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/group/components/group-member-template-detail-table.vue b/frontend/src/views/group/components/group-member-template-detail-table.vue index cded688a8..58f8959ef 100644 --- a/frontend/src/views/group/components/group-member-template-detail-table.vue +++ b/frontend/src/views/group/components/group-member-template-detail-table.vue @@ -92,6 +92,7 @@ tableLoading: false, tableKeyWord: '', groupTableList: [], + searchTableData: [], pagination: { current: 1, limit: 10, @@ -110,6 +111,21 @@ this.fetchTemplateGroupList(); }, methods: { + getDataByPage (page) { + if (!page) { + this.pagination.current = page = 1; + } + let startIndex = (page - 1) * this.pagination.limit; + let endIndex = page * this.pagination.limit; + if (startIndex < 0) { + startIndex = 0; + } + if (endIndex > this.searchTableData.length) { + endIndex = this.searchTableData.length; + } + return this.searchTableData.slice(startIndex, endIndex); + }, + async fetchTemplateGroupList () { this.tableLoading = true; try { @@ -118,15 +134,27 @@ const params = { id, template_id, - page: current, - page_size: limit, + limit, + offset: limit * (current - 1), keyword: this.tableKeyWord }; const { code, data } = await this.$store.dispatch('memberTemplate/getGroupSubjectTemplateMembers', params); const { count, results } = data; this.pagination.count = count || 0; this.groupTableList = results || []; - this.emptyTableData = formatCodeData(code, this.emptyTableData, this.groupTableList.length === 0); + if (!data.hasOwnProperty('count')) { + this.pagination.count = results.length || 0; + this.searchTableData = [...results || []]; + this.groupTableList = this.getDataByPage(this.pagination.current); + } else { + this.pagination.count = count || 0; + this.groupTableList = results || []; + } + this.emptyTableData = formatCodeData( + code, + Object.assign(this.emptyTableData, { tipType: this.tableKeyWord.length > 0 ? 'search' : '' }), + this.groupTableList.length === 0 + ); } catch (e) { this.groupTableList = []; this.emptyTableData = formatCodeData(e.code, this.emptyTableData); @@ -139,6 +167,7 @@ handleSearchGroup (payload) { this.tableKeyWord = payload; this.emptyTableData.tipType = 'search'; + this.resetPagination(); this.fetchTemplateGroupList(); }, @@ -151,12 +180,17 @@ async handlePageChange (current) { this.pagination = Object.assign(this.pagination, { current }); - await this.fetchTemplateGroupList(); + if (this.emptyTableData.tipType === 'search') { + const list = this.getDataByPage(current); + this.groupTableList.splice(0, this.groupTableList.length, ...list); + } else { + await this.fetchTemplateGroupList(); + } }, - async handleLimitChange (limit) { + handleLimitChange (limit) { this.pagination = Object.assign(this.pagination, { current: 1, limit }); - await this.fetchTemplateGroupList(); + this.handlePageChange(this.pagination.current); }, handleEmptyClear () { From 0c2c7d1f6b158fd37064de637f7403db7836358e Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Tue, 9 Apr 2024 11:46:41 +0800 Subject: [PATCH 04/19] =?UTF-8?q?feature:=20=E6=B7=BB=E5=8A=A0=E7=BB=AD?= =?UTF-8?q?=E6=9C=9F=E9=80=9A=E7=9F=A5=E9=87=8D=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/renewal-notice/index.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/renewal-notice/index.vue b/frontend/src/views/renewal-notice/index.vue index dccca6515..a4215c06e 100644 --- a/frontend/src/views/renewal-notice/index.vue +++ b/frontend/src/views/renewal-notice/index.vue @@ -259,7 +259,9 @@ handleSubmit () {}, - handleReset () {}, + handleReset () { + this.fetchSuperNoticeConfig(); + }, handleDefault () {} } From 4b23630bb2bb89c5fd4e5067e5d13f0a85c5ffe2 Mon Sep 17 00:00:00 2001 From: Timmy Date: Tue, 9 Apr 2024 11:54:21 +0800 Subject: [PATCH 05/19] feat: system manager add manger action permission (#2604) --- saas/backend/account/views.py | 2 +- saas/backend/apps/approval/views.py | 6 +++++- saas/backend/apps/role/constants.py | 2 ++ saas/backend/apps/role/views/permission_audit.py | 12 +++++++++++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/saas/backend/account/views.py b/saas/backend/account/views.py index bd82a668f..977274b32 100644 --- a/saas/backend/account/views.py +++ b/saas/backend/account/views.py @@ -41,7 +41,7 @@ def retrieve(self, request, *args, **kwargs): { "timestamp": timestamp, "username": user.username, - "role": {"type": role.type, "id": role.id, "name": role.name}, + "role": {"type": role.type, "id": role.id, "name": role.name, "code": role.code}, "timezone": user.get_property("time_zone"), "name": u.display_name if u else "", } diff --git a/saas/backend/apps/approval/views.py b/saas/backend/apps/approval/views.py index a3c35b874..fc6e30690 100644 --- a/saas/backend/apps/approval/views.py +++ b/saas/backend/apps/approval/views.py @@ -26,7 +26,7 @@ from backend.common.error_codes import error_codes from backend.common.serializers import SystemQuerySLZ from backend.service.action import ActionService -from backend.service.constants import PermissionCodeEnum +from backend.service.constants import PermissionCodeEnum, RoleType from .audit import ( ActionSensitivityLevelAuditProvider, @@ -253,6 +253,10 @@ def create(self, request, *args, **kwargs): system_id = actions[0]["system_id"] action_ids = [a["id"] for a in actions] + # 校验系统管理员权限 + if request.role.type == RoleType.SYSTEM_MANAGER.value and request.role.code != system_id: + raise error_codes.FORBIDDEN + self.biz.batch_create_or_update_action_sensitivity_level( system_id, action_ids, sensitivity_level, request.user.username ) diff --git a/saas/backend/apps/role/constants.py b/saas/backend/apps/role/constants.py index cc8e263cb..65d91bc90 100644 --- a/saas/backend/apps/role/constants.py +++ b/saas/backend/apps/role/constants.py @@ -35,6 +35,8 @@ PermissionCodeEnum.MANAGE_COMMON_ACTION.value, PermissionCodeEnum.MANAGE_SYSTEM_MANAGER_MEMBER.value, PermissionCodeEnum.MANAGE_ROLE_GROUP_MEMBER.value, + PermissionCodeEnum.VIEW_AUTHORIZED_SUBJECTS.value, + PermissionCodeEnum.MANAGE_SENSITIVITY_LEVEL.value, ], RoleType.GRADE_MANAGER.value: [ PermissionCodeEnum.MANAGE_GROUP.value, diff --git a/saas/backend/apps/role/views/permission_audit.py b/saas/backend/apps/role/views/permission_audit.py index 92e7e455c..3cfddca8b 100644 --- a/saas/backend/apps/role/views/permission_audit.py +++ b/saas/backend/apps/role/views/permission_audit.py @@ -16,7 +16,8 @@ from backend.account.permissions import RolePermission from backend.apps.role.serializers import AuthorizedSubjectsSLZ, QueryAuthorizedSubjectsSLZ from backend.biz.permission_audit import QueryAuthorizedSubjects -from backend.service.constants import PermissionCodeEnum +from backend.common import error_codes +from backend.service.constants import PermissionCodeEnum, RoleType from backend.util.time import format_localtime @@ -38,6 +39,11 @@ def post(self, request, *args, **kwargs): serializer = QueryAuthorizedSubjectsSLZ(data=request.data) serializer.is_valid(raise_exception=True) data = serializer.validated_data + + # 校验系统管理员权限 + if request.role.type == RoleType.SYSTEM_MANAGER.value and request.role.code != data["system_id"]: + raise error_codes.FORBIDDEN + subjects = QueryAuthorizedSubjects(data).query_by_permission_type() return Response(subjects) @@ -52,6 +58,10 @@ def export(self, request, *args, **kwargs): serializer.is_valid(raise_exception=True) data = serializer.validated_data + # 校验系统管理员权限 + if request.role.type == RoleType.SYSTEM_MANAGER.value and request.role.code != data["system_id"]: + raise error_codes.FORBIDDEN + exported_file_name = f'{data["system_id"]}_{format_localtime()}' response = QueryAuthorizedSubjects(data).export(exported_file_name) From 0544ffeaa5772f2661335a7dd2c503be2d711acc Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Tue, 9 Apr 2024 17:10:00 +0800 Subject: [PATCH 06/19] =?UTF-8?q?feature:=20=20=E6=A0=B9=E6=8D=AE=E6=89=80?= =?UTF-8?q?=E9=80=89=E7=AE=A1=E7=90=86=E5=91=98=E8=BA=AB=E4=BB=BD=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E4=B8=8D=E5=90=8C=E6=9D=83=E9=99=90=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E7=9A=84=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.vue | 8 ++- frontend/src/common/router-handle.js | 4 +- frontend/src/components/header-nav/index.vue | 27 +++++++--- .../iam-member-template-table/index.vue | 2 +- frontend/src/components/nav/index.vue | 1 + frontend/src/router/index.js | 53 ++++++++++--------- frontend/src/store/index.js | 1 + .../views/group/components/member-table.vue | 2 +- frontend/src/views/member-template/index.vue | 2 +- frontend/src/views/perm/group-perm/index.vue | 2 +- frontend/src/views/resource-permiss/index.vue | 11 ++-- .../components/sensitivity-level-table.vue | 6 ++- .../components/sensitivity-systems.vue | 36 ++++++++----- .../components/group-perm-table.vue | 2 +- .../src/views/user/components/group-perm.vue | 2 +- .../user/components/joined-user-group.vue | 6 ++- 16 files changed, 103 insertions(+), 62 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 7761cce48..8c905f566 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -33,11 +33,14 @@ :route-name="routeName" :user-group-id="userGroupId"> - - @@ -80,6 +83,7 @@ provide () { return { reload: this.reload, + reloadCurPage: this.reloadCurPage, showNoticeAlert: this.isShowNoticeAlert }; }, diff --git a/frontend/src/common/router-handle.js b/frontend/src/common/router-handle.js index 73850ab35..733fea615 100644 --- a/frontend/src/common/router-handle.js +++ b/frontend/src/common/router-handle.js @@ -123,12 +123,10 @@ export const getRouterDiff = (payload) => { 'systemAccessRegistry', 'systemAccessOptimize', 'systemAccessComplete', - 'resourcePermiss', 'firstManageSpace', 'secondaryManageSpace', 'authorBoundary', - 'myManageSpace', - 'sensitivityLevel' + 'myManageSpace' ]; } if (payload === 'rating_manager') { diff --git a/frontend/src/components/header-nav/index.vue b/frontend/src/components/header-nav/index.vue index abc639273..74c239dfe 100644 --- a/frontend/src/components/header-nav/index.vue +++ b/frontend/src/components/header-nav/index.vue @@ -203,7 +203,7 @@ ]); export default { - name: '', + inject: ['reloadCurPage'], components: { SystemLog // IamGuide @@ -258,7 +258,7 @@ { text: this.$t(`m.nav['个人工作台']`), id: 0, show: true, type: ['staff'] }, { text: this.$t(`m.nav['管理空间']`), id: 1, show: true, type: ['all_manager'] }, { text: this.$t(`m.nav['统计分析']`), id: 2, show: false, type: ['super_manager'] }, - { text: this.$t(`m.nav['平台管理']`), id: 3, show: false, type: ['super_manager', 'system_manager'] } + { text: this.$t(`m.nav['平台管理']`), id: 3, show: false, type: ['super_manager'] } ], defaultRouteList: ['myPerm', 'userGroup', 'audit', 'user', 'addGroupPerm'], systemNoSuperList: ['myPerm', 'userGroup', 'audit', 'resourcePermiss', 'addGroupPerm'], @@ -349,8 +349,9 @@ }, routeName: { handler (value) { - const isSystemNoSuper = this.roleList.find((item) => ['system_manager'].includes(item.type) && !['super_manager'].includes(item.type)); - const list = isSystemNoSuper ? this.systemNoSuperList : this.defaultRouteList; + // const isSystemNoSuper = this.roleList.find((item) => ['system_manager'].includes(item.type) && !['super_manager'].includes(item.type)); + // const list = isSystemNoSuper ? this.systemNoSuperList : this.defaultRouteList; + const list = this.defaultRouteList; const index = list.findIndex((item) => item === value); if (index > -1) { ['addGroupPerm'].includes(value) @@ -373,6 +374,18 @@ }, immediate: true, deep: true + }, + index: { + handler (newValue, oldValue) { + if (newValue !== oldValue && oldValue && this.$route.name === this.routeName) { + // 不同导航栏下相同的权限路由名称跳转增加延时时间,防止相同接口调用多次被节流 + setTimeout(async () => { + await this.$store.dispatch('userInfo'); + this.reloadCurPage(this.$route); + }, 200); + } + }, + immediate: true } }, created () { @@ -485,9 +498,11 @@ async updateRouter (navIndex = 0) { let difference = []; const permResult = getManagerMenuPerm(this.roleList); - const list = permResult.includes('hasSystemNoSuperManager') ? this.systemNoSuperList : this.defaultRouteList; + // const list = permResult.includes('hasSystemNoSuperManager') ? this.systemNoSuperList : this.defaultRouteList; + const list = this.defaultRouteList; if (navIndex === 1) { - await this.$store.dispatch('userInfo'); + // await this.$store.dispatch('userInfo'); + console.log(555, difference); const type = this.curRole; difference = getRouterDiff(type); this.$store.commit('updataRouterDiff', type); diff --git a/frontend/src/components/iam-member-template-table/index.vue b/frontend/src/components/iam-member-template-table/index.vue index 1dad8ceb0..c8ce92ffb 100644 --- a/frontend/src/components/iam-member-template-table/index.vue +++ b/frontend/src/components/iam-member-template-table/index.vue @@ -250,7 +250,7 @@ fetchSelectedGroupCount () { this.$nextTick(() => { const selectionCount = document.getElementsByClassName('bk-page-selection-count'); - if (this.$refs.templateTableRef && selectionCount && selectionCount.length) { + if (this.$refs.templateTableRef && selectionCount && selectionCount.length && selectionCount[0].children) { selectionCount[0].children[0].innerHTML = this.currentSelectList.length; } }); diff --git a/frontend/src/components/nav/index.vue b/frontend/src/components/nav/index.vue index ac515c07d..8dd95be5c 100644 --- a/frontend/src/components/nav/index.vue +++ b/frontend/src/components/nav/index.vue @@ -500,6 +500,7 @@ this.selectCls = 'hide-iam-nav-select-cls'; if (value) { this.selectCls = 'iam-nav-select-dropdown-content'; + this.handleClearSearch(); this.resetPagination(); this.resetSubPagination(); await this.resetRoleList('handleClearSearch'); diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index be99a8ce1..44bdd651d 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -32,8 +32,8 @@ import http from '@/api'; // import il8n from '@/language'; import preload from '@/common/preload'; import { bus } from '@/common/bus'; -// import { existValue, getParamsValue, getTreeNode } from '@/common/util'; -import { existValue, getParamsValue, getManagerMenuPerm } from '@/common/util'; +import { existValue, getParamsValue } from '@/common/util'; +// import { existValue, getParamsValue, getManagerMenuPerm } from '@/common/util'; import { getRouterDiff, getNavRouterDiff } from '@/common/router-handle'; import { messageError } from '@/common/bkmagic'; @@ -87,8 +87,8 @@ export const beforeEach = async (to, from, next) => { let currentRoleId = String(to.query.current_role_id || '').trim(); let curRoleId = store.state.curRoleId; // 检验有系管没超管身份 - let hasManagerPerm = ''; - let defaultRoute = ['my-perm', 'user-group', 'audit', 'user']; + const hasManagerPerm = ''; + const defaultRoute = ['my-perm', 'user-group', 'audit', 'user']; async function getExternalRole () { const { role_id: externalRoleId } = to.query; @@ -125,25 +125,26 @@ export const beforeEach = async (to, from, next) => { } // 处理平台管理超管和系管都可以进入,但访问菜单权限不一致 - async function getPlatManageMenu () { - hasManagerPerm = ''; - let roleList = store.state.roleList; - if (roleList.length > 0) { - // 有系统管理员身份没超管身份 - hasManagerPerm = getManagerMenuPerm(roleList); - } else { - roleList = await store.dispatch('roleList', { - cancelWhenRouteChange: false, - cancelPrevious: false - }); - } - // 有系统管理员身份没超管身份 - hasManagerPerm = getManagerMenuPerm(roleList); - if (['hasSystemNoSuperManager'].includes(hasManagerPerm)) { - hasManagerPerm = 'hasSystemNoSuperManager'; - defaultRoute = ['my-perm', 'user-group', 'audit', 'resourcePermiss']; - } - } + // 暂时注释掉后期开放 + // async function getPlatManageMenu () { + // hasManagerPerm = ''; + // let roleList = store.state.roleList; + // if (roleList.length > 0) { + // 有系统管理员身份没超管身份 + // hasManagerPerm = getManagerMenuPerm(roleList); + // } else { + // roleList = await store.dispatch('roleList', { + // cancelWhenRouteChange: false, + // cancelPrevious: false + // }); + // } + // 有系统管理员身份没超管身份 + // hasManagerPerm = getManagerMenuPerm(roleList); + // if (['hasSystemNoSuperManager'].includes(hasManagerPerm)) { + // hasManagerPerm = 'hasSystemNoSuperManager'; + // defaultRoute = ['my-perm', 'user-group', 'audit', 'resourcePermiss']; + // } + // } // 根据不同权限处理不同的导航栏索引 function navDiffMenuIndex (index) { @@ -248,9 +249,9 @@ export const beforeEach = async (to, from, next) => { difference = getRouterDiff(curRole); } else { // 目前只有平台管理需要根据管理员最大身份处理路由权限 - if ([3].includes(Number(navIndex))) { - await getPlatManageMenu(); - } + // if ([3].includes(Number(navIndex))) { + // await getPlatManageMenu(); + // } difference = getNavRouterDiff(navIndex, hasManagerPerm); } if (difference.length) { diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 4903a0127..958b83af0 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -793,6 +793,7 @@ const store = new Vuex.Store({ const results = data.results || []; commit('updateRoleListTotal', data.count || 0); commit('updateRoleList', results); + // commit('updateRoleList', results.filter((item) => item.type !== 'super_manager')); return results; }); }, diff --git a/frontend/src/views/group/components/member-table.vue b/frontend/src/views/group/components/member-table.vue index 24fde78cf..cbe9cef1a 100644 --- a/frontend/src/views/group/components/member-table.vue +++ b/frontend/src/views/group/components/member-table.vue @@ -912,7 +912,7 @@ fetchCustomTotal () { this.$nextTick(() => { const selectionCount = document.getElementsByClassName('bk-page-selection-count'); - if (this.$refs.groupMemberRef && selectionCount && selectionCount.length) { + if (this.$refs.groupMemberRef && selectionCount && selectionCount.length && selectionCount[0].children) { selectionCount[0].children[0].innerHTML = this.currentSelectList.length; } }); diff --git a/frontend/src/views/member-template/index.vue b/frontend/src/views/member-template/index.vue index fc51af3e2..ea619a96b 100644 --- a/frontend/src/views/member-template/index.vue +++ b/frontend/src/views/member-template/index.vue @@ -602,7 +602,7 @@ fetchSelectedGroupCount () { this.$nextTick(() => { const selectionCount = document.getElementsByClassName('bk-page-selection-count'); - if (this.$refs.memberTemplateRef && selectionCount) { + if (this.$refs.memberTemplateRef && selectionCount && selectionCount.length && selectionCount[0].children) { selectionCount[0].children[0].innerHTML = this.currentSelectList.length; } }); diff --git a/frontend/src/views/perm/group-perm/index.vue b/frontend/src/views/perm/group-perm/index.vue index a738d4ef5..1f6a72a9b 100644 --- a/frontend/src/views/perm/group-perm/index.vue +++ b/frontend/src/views/perm/group-perm/index.vue @@ -413,7 +413,7 @@ fetchSelectedGroupCount () { this.$nextTick(() => { const selectionCount = document.getElementsByClassName('bk-page-selection-count'); - if (this.$refs.groupPermTableRef && selectionCount) { + if (this.$refs.groupPermTableRef && selectionCount && selectionCount.length && selectionCount[0].children) { selectionCount[0].children[0].innerHTML = this.currentSelectGroupList.length; } }); diff --git a/frontend/src/views/resource-permiss/index.vue b/frontend/src/views/resource-permiss/index.vue index c15f214a6..b991dd652 100644 --- a/frontend/src/views/resource-permiss/index.vue +++ b/frontend/src/views/resource-permiss/index.vue @@ -30,6 +30,7 @@ v-model="systemId" :clearable="true" :placeholder="$t(`m.verify['请选择']`)" + :disabled="['system_manager'].includes(user.role.type)" @change="handleCascadeChange" @clear="handleSystemClear"> item.id === role.code); + } + this.systemList = await this.getSystemCount(list); this.systemListStorage = [...this.systemList]; } this.emptySystemData = formatCodeData( code, this.emptySystemData, - data.length === 0 + list.length === 0 ); } catch (e) { this.emptySystemData = formatCodeData(e.code, this.emptySystemData); diff --git a/frontend/src/views/user-org-perm/components/group-perm-table.vue b/frontend/src/views/user-org-perm/components/group-perm-table.vue index eeeefc6b4..d0e07723e 100644 --- a/frontend/src/views/user-org-perm/components/group-perm-table.vue +++ b/frontend/src/views/user-org-perm/components/group-perm-table.vue @@ -603,7 +603,7 @@ fetchCustomTotal (payload) { this.$nextTick(() => { const selectionCount = document.getElementsByClassName('bk-page-selection-count'); - if (this.$refs.groupPermRef && selectionCount && selectionCount.length) { + if (this.$refs.groupPermRef && selectionCount && selectionCount.length && selectionCount[0].children) { selectionCount[0].children[0].innerHTML = payload.length; } }); diff --git a/frontend/src/views/user/components/group-perm.vue b/frontend/src/views/user/components/group-perm.vue index bd9ef069c..2f3daab58 100644 --- a/frontend/src/views/user/components/group-perm.vue +++ b/frontend/src/views/user/components/group-perm.vue @@ -736,7 +736,7 @@ fetchSelectedGroupCount () { this.$nextTick(() => { const selectionCount = document.getElementsByClassName('bk-page-selection-count'); - if (this.$refs.groupPermTableRef && selectionCount) { + if (this.$refs.groupPermTableRef && selectionCount && selectionCount.length && selectionCount[0].children) { selectionCount[0].children[0].innerHTML = this.currentSelectGroupList.length; } }); diff --git a/frontend/src/views/user/components/joined-user-group.vue b/frontend/src/views/user/components/joined-user-group.vue index c3e1d6eac..2f7eae566 100644 --- a/frontend/src/views/user/components/joined-user-group.vue +++ b/frontend/src/views/user/components/joined-user-group.vue @@ -719,7 +719,11 @@ } this.$nextTick(() => { const selectionCount = document.getElementsByClassName('bk-page-selection-count'); - if (this.$refs.groupPermTableRef && selectionCount) { + if (this.$refs.groupPermTableRef + && selectionCount + && selectionCount.length + && selectionCount[0].children + ) { selectionCount[0].children[0].innerHTML = this.currentSelectGroupList.length; } }); From f41c4d751890c1e6066d79ad96e98ce396dff0ec Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Tue, 9 Apr 2024 17:52:09 +0800 Subject: [PATCH 07/19] =?UTF-8?q?feature:=20=E5=A4=84=E7=90=86=E5=90=8C?= =?UTF-8?q?=E5=90=8D=E8=B7=AF=E7=94=B1=E6=89=8D=E9=9C=80=E8=A6=81=E5=88=B7?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/header-nav/index.vue | 27 ++++++++++++------- frontend/src/views/group/clone/index.vue | 2 +- frontend/src/views/group/create/index.vue | 2 +- frontend/src/views/group/index.vue | 2 +- .../src/views/user-group-setting/index.vue | 20 +++++++++----- 5 files changed, 33 insertions(+), 20 deletions(-) diff --git a/frontend/src/components/header-nav/index.vue b/frontend/src/components/header-nav/index.vue index 74c239dfe..81c186f92 100644 --- a/frontend/src/components/header-nav/index.vue +++ b/frontend/src/components/header-nav/index.vue @@ -264,6 +264,7 @@ systemNoSuperList: ['myPerm', 'userGroup', 'audit', 'resourcePermiss', 'addGroupPerm'], isRatingChange: false, haveManager: false, + isSameRoute: false, showNavDataLength: 0, curHeight: 78, languageList: [ @@ -275,7 +276,8 @@ label: 'English', value: 'en' } - ] + ], + curFromName: '' }; }, computed: { @@ -308,6 +310,7 @@ }, watch: { $route: function (to, from) { + this.curFromName = from.name || ''; this.hasPageTab = !!to.meta.hasPageTab; if (['permTemplateDetail', 'userGroupDetail'].includes(to.name)) { this.panels = this.getTabData(to.name); @@ -377,15 +380,11 @@ }, index: { handler (newValue, oldValue) { - if (newValue !== oldValue && oldValue && this.$route.name === this.routeName) { - // 不同导航栏下相同的权限路由名称跳转增加延时时间,防止相同接口调用多次被节流 - setTimeout(async () => { - await this.$store.dispatch('userInfo'); - this.reloadCurPage(this.$route); - }, 200); + if (oldValue && newValue !== oldValue && !this.curFromName) { + this.isSameRoute = true; } }, - immediate: true + deep: true } }, created () { @@ -501,14 +500,22 @@ // const list = permResult.includes('hasSystemNoSuperManager') ? this.systemNoSuperList : this.defaultRouteList; const list = this.defaultRouteList; if (navIndex === 1) { - // await this.$store.dispatch('userInfo'); - console.log(555, difference); + // 不同导航栏下相同的权限路由名称跳转增加延时时间,防止相同接口调用多次被节流 + await this.$store.dispatch('userInfo'); + if (this.isSameRoute) { + this.reloadCurPage(this.$route); + } const type = this.curRole; difference = getRouterDiff(type); this.$store.commit('updataRouterDiff', type); } else { difference = getNavRouterDiff(navIndex, permResult); this.$store.commit('updataNavRouterDiff', navIndex); + // 不同导航栏下相同的权限路由名称跳转增加延时时间,防止相同接口调用多次被节流 + if (this.isSameRoute) { + await this.$store.dispatch('userInfo'); + this.reloadCurPage(this.$route); + } } const curRouterName = this.$route.name; if (difference.length) { diff --git a/frontend/src/views/group/clone/index.vue b/frontend/src/views/group/clone/index.vue index 71538e52b..e5d810c7b 100644 --- a/frontend/src/views/group/clone/index.vue +++ b/frontend/src/views/group/clone/index.vue @@ -433,7 +433,7 @@ // 获取分级管理员用户组配置 async fetchUserGroupSet () { - if (!['subset_manager'].includes(this.user.role.type)) { + if (!['subset_manager', 'staff', ''].includes(this.user.role.type)) { try { const { data } = await this.$store.dispatch('userGroupSetting/getUserGroupSetConfig'); if (data) { diff --git a/frontend/src/views/group/create/index.vue b/frontend/src/views/group/create/index.vue index 3a0ae4fc3..cd7dfdd4d 100644 --- a/frontend/src/views/group/create/index.vue +++ b/frontend/src/views/group/create/index.vue @@ -361,7 +361,7 @@ methods: { // 获取分级管理员用户组配置 async fetchUserGroupSet () { - if (!['subset_manager'].includes(this.curRole)) { + if (!['subset_manager', 'staff', ''].includes(this.user.role.type)) { try { const { data } = await this.$store.dispatch('userGroupSetting/getUserGroupSetConfig'); if (data) { diff --git a/frontend/src/views/group/index.vue b/frontend/src/views/group/index.vue index c60ff24b7..6cc949c84 100644 --- a/frontend/src/views/group/index.vue +++ b/frontend/src/views/group/index.vue @@ -535,7 +535,7 @@ // 获取分级管理员用户组配置 async fetchUserGroupSet () { - if (!['subset_manager'].includes(this.curRole)) { + if (!['subset_manager', 'staff', ''].includes(this.curRole)) { try { const { data } = await this.$store.dispatch('userGroupSetting/getUserGroupSetConfig'); if (data) { diff --git a/frontend/src/views/user-group-setting/index.vue b/frontend/src/views/user-group-setting/index.vue index 0d0509d49..4502c78cf 100644 --- a/frontend/src/views/user-group-setting/index.vue +++ b/frontend/src/views/user-group-setting/index.vue @@ -26,6 +26,7 @@ - From 7c3961486dde6276585b8434268ee45f61785b9c Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Thu, 11 Apr 2024 18:38:04 +0800 Subject: [PATCH 16/19] =?UTF-8?q?fix:=20=E6=8F=90=E4=BB=B7=E6=BC=8F?= =?UTF-8?q?=E7=BC=BA=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/perm/group-perm-renewal/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/perm/group-perm-renewal/index.vue b/frontend/src/views/perm/group-perm-renewal/index.vue index 4dfbcc078..fee4ddd0b 100644 --- a/frontend/src/views/perm/group-perm-renewal/index.vue +++ b/frontend/src/views/perm/group-perm-renewal/index.vue @@ -387,8 +387,8 @@ const params = { limit: tabData.pagination.limit, offset: tabData.pagination.limit * (item.groupTabList[1].pagination.current - 1), - id: item.id - // expire_soon: true + id: item.id, + expire_soon: true }; const { current_role_id: currentRoleId, source } = this.$route.query; if (currentRoleId && source === 'email') { From ae2115cf00d7f20a1e8b2b2d9c0e9f2d7c344d74 Mon Sep 17 00:00:00 2001 From: lhzzforever Date: Fri, 12 Apr 2024 10:22:05 +0800 Subject: [PATCH 17/19] =?UTF-8?q?fix:=20=E5=A4=84=E7=90=86=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E6=98=AF=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E4=B8=8B=E7=9A=84=E8=B5=84=E6=BA=90=E5=85=A8?= =?UTF-8?q?=E9=80=89=E7=AE=A1=E7=90=86=E7=B3=BB=E7=BB=9F=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=88=99=E4=B8=BAdisabled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/resource-permiss/index.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/resource-permiss/index.vue b/frontend/src/views/resource-permiss/index.vue index b991dd652..2b6039b68 100644 --- a/frontend/src/views/resource-permiss/index.vue +++ b/frontend/src/views/resource-permiss/index.vue @@ -30,7 +30,7 @@ v-model="systemId" :clearable="true" :placeholder="$t(`m.verify['请选择']`)" - :disabled="['system_manager'].includes(user.role.type)" + :disabled="isSystemDisabled" @change="handleCascadeChange" @clear="handleSystemClear"> Date: Fri, 12 Apr 2024 16:14:08 +0800 Subject: [PATCH 18/19] =?UTF-8?q?feature:=20=E6=94=AF=E6=8C=81=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=BB=84=E6=88=90=E5=91=98=E7=BB=AD=E6=9C=9F=E7=94=A8?= =?UTF-8?q?=E6=88=B7/=E7=BB=84=E7=BB=87=E3=80=81=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=A4=9Atab=E9=A1=B9=E8=B7=A8=E9=A1=B5?= =?UTF-8?q?=E5=8B=BE=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/render-perm/index.vue | 2 +- .../views/perm/group-perm-renewal/index.vue | 216 ++++++++++-------- 2 files changed, 128 insertions(+), 90 deletions(-) diff --git a/frontend/src/components/render-perm/index.vue b/frontend/src/components/render-perm/index.vue index 3267695c9..2eb0eb659 100644 --- a/frontend/src/components/render-perm/index.vue +++ b/frontend/src/components/render-perm/index.vue @@ -103,7 +103,7 @@ handleExpanded () { this.isExpanded = !this.isExpanded; this.$emit('update:expanded', true); - this.$emit('on-expanded', true); + this.$emit('on-expanded', this.isExpanded); } } }; diff --git a/frontend/src/views/perm/group-perm-renewal/index.vue b/frontend/src/views/perm/group-perm-renewal/index.vue index fee4ddd0b..bee1272e9 100644 --- a/frontend/src/views/perm/group-perm-renewal/index.vue +++ b/frontend/src/views/perm/group-perm-renewal/index.vue @@ -9,7 +9,7 @@ :ext-cls="index > 0 ? 'group-perm-renewal-ext-cls' : ''" :class="index === tableList.length - 1 ? 'group-perm-renewal-cls' : ''" :title="item.name" - @on-expanded="handleExpanded(...arguments, item)" + @on-expanded="handleExpanded(...arguments, item, index)" > @@ -47,6 +47,7 @@ :outer-border="false" :header-border="false" :data="getTableList(item)" + :data-custom-key="`${item.name}&${item.id}-${index}`" :pagination="formatPagination(item)" @page-change="handleTablePageChange(...arguments, item)" @page-limit-change="handleTableLimitChange(...arguments, item)" @@ -126,6 +127,7 @@ :key="tableItem.prop" :label="tableItem.label" :prop="tableItem.prop" + fixed="right" > -
~
+ ~ -
+
{{ $t(`m.renewalNotice['整个通知范围,需要 >= 7 天']`) }}
-
{{ $t(`m.renewalNotice['通知范围不能为空']`) }}
+
{{ $t(`m.renewalNotice['通知范围为必填项']`) }}
@@ -82,17 +85,17 @@ {{ $t(`m.renewalNotice['通知日']`) }}
- + {{ $t(`m.renewalNotice['${item.label}']`) }} -
{{ $t(`m.renewalNotice['通知日不能为空']`) }}
+
{{ $t(`m.renewalNotice['通知日为必填项']`) }}
@@ -100,7 +103,7 @@ {{ $t(`m.renewalNotice['发送时间']`) }}
- +
{{ $t(`m.renewalNotice['过期前']`) }} {{ noticeForm.expire_days_before }} @@ -116,7 +119,7 @@ {{ noticeForm.send_time }} {{ $t(`m.renewalNotice['发送通知']`) }}
-
{{ $t(`m.renewalNotice['发送时间不能为空']`) }}
+
{{ $t(`m.renewalNotice['发送时间为必填项']`) }}
@@ -147,6 +150,7 @@ @@ -318,7 +375,7 @@ .iam-icon { color: #979ba5; margin-left: 13px; - margin-right: 4px; + margin-right: 6px; font-size: 16px; line-height: 0; } @@ -362,8 +419,8 @@ background: transparent; top: 2px; right: 3px; - border-left: 1px solid #ffffff; - border-bottom: 1px solid #ffffff; + border-left: 2px solid #ffffff; + border-bottom: 2px solid #ffffff; transform: rotate(-50deg); z-index: 9; } @@ -391,54 +448,53 @@ &:not(&:last-child) { margin-bottom: 24px; } - &.notice-area { + &.notice-scope { align-items: center; - .notice-area-title { + .notice-scope-title { margin-top: -22px; margin-bottom: 0; } - /deep/ .notice-item-area { + /deep/ .notice-item-scope { + margin-left: 0; &-input { display: flex; align-items: center; .group-box { background-color: #FAFBFD; .group-text { - padding: 0 7.5px; - font-size: 12px; + padding: 0 8px; } &.group-append { min-width: 40px; - .group-text { - padding-left: 8px; - } } } .bk-input-number { - width: 93px; + width: 88px; } } &-tip { color: #979BA5; font-size: 12px; - margin-top: 6px; + margin-top: 4px; + word-break: break-all; .icon { color: #C4C6CC; margin-right: 6px; - font-size: 16px !important; + font-size: 14px !important; } } .and-icon { - padding: 0 8px; + margin: 0 8px; color: #63656E; } } } &.notice-day { align-items: self-start; + margin-bottom: 20px !important; /deep/ .notice-day-checkbox { margin-right: 40px; - font-size: 12px; + margin-bottom: 4px; line-height: 20px; &:nth-child(5) { margin-right: 0; @@ -451,7 +507,6 @@ &.notice-send-time { align-items: baseline; .notice-item-value { - width: calc(100% - 94px); .bk-date-picker { width: 100%; } @@ -470,11 +525,12 @@ } } .notice-time-title { - min-width: 62px; + min-width: 70px; + margin-right: 20px; text-align: right; } .notice-item-value { - padding-left: 20px; + min-width: 390px; } } } @@ -505,6 +561,18 @@ .notice-time-title { min-width: 96px; } + /deep/ .notice-item-scope { + .bk-input-number { + min-width: 93px; + } + } + .notice-day { + /deep/ .notice-day-checkbox { + .bk-checkbox-text { + min-width: 51px; + } + } + } .notice-send-time { width: calc(100% - 28px); } diff --git a/frontend/src/views/user-org-perm/index.vue b/frontend/src/views/user-org-perm/index.vue index b4cc22020..61916f4af 100644 --- a/frontend/src/views/user-org-perm/index.vue +++ b/frontend/src/views/user-org-perm/index.vue @@ -49,6 +49,7 @@ type="number" v-model="formData.id" :placeholder="$t(`m.verify['请输入']`)" + :precision="0" :show-controls="false" @enter="handleSearch" /> @@ -161,6 +162,7 @@ v-if="['id'].includes(tag.name)" ref="inputRef" type="number" + :precision="0" :value="tag.value" :placeholder="$t(`m.verify['请输入']`)" :show-controls="false"