Skip to content

Commit

Permalink
Merge pull request #2672 from TencentBlueKing/ft_renewal_notice
Browse files Browse the repository at this point in the history
Ft renewal notice
  • Loading branch information
zhu327 authored May 22, 2024
2 parents 43e612f + f62e26e commit c376541
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 94 deletions.
1 change: 1 addition & 0 deletions frontend/src/language/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,7 @@ export const m = {
'管理类API白名单创建': 'Management class API whitelist create',
'管理类API白名单删除': 'Management class API whitelist delete',
'操作敏感等级更新': 'Action sensitivity level update',
'续期通知更新': 'Renewal notice update',
'回滚事件': 'Rollback event',
'管理空间用户组成员续期': 'Management space group members renew',
'用户组成员续期': 'Group members renew',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/language/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,7 @@ export const m = {
'管理类API白名单创建': '管理类API白名单创建',
'管理类API白名单删除': '管理类API白名单删除',
'操作敏感等级更新': '操作敏感等级更新',
'续期通知更新': '续期通知更新',
'回滚事件': '回滚事件',
'管理空间用户组成员续期': '管理空间用户组成员续期',
'用户组成员续期': '用户组成员续期',
Expand Down
43 changes: 14 additions & 29 deletions frontend/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ export const beforeEach = async (to, from, next) => {
if (existValue('externalApp') || to.query.noFrom) {
next();
} else {
// next();
next({ path: `${SITE_URL}${defaultRoute[navIndex]}` });
next();
// next({ path: `${SITE_URL}${defaultRoute[navIndex]}` });
}
} else {
next();
Expand Down Expand Up @@ -295,35 +295,20 @@ export const beforeEach = async (to, from, next) => {
// next();
} else {
const noFrom = !from.name;
// permTemplateCreate
if (['permTemplateDetail', 'permTemplateEdit', 'permTemplateDiff'].includes(to.name) && noFrom) {
next({ path: `${SITE_URL}perm-template` });
// } else if (['createUserGroup', 'userGroupDetail'].includes(to.name) && noFrom) {
// } else if (['createUserGroup'].includes(to.name) && noFrom) {
} else if (['createUserGroup'].includes(to.name)) {
if (noFrom) {
if (existValue('externalApp')) {
next();
} else {
next({ path: `${SITE_URL}${defaultRoute[navIndex]}` });
}
} else {
next();
}
// if (existValue('externalApp')) { // 如果是外部嵌入的页面
// next();
// } else {
// next({ path: `${SITE_URL}user-group` });
// }
// 这里刷新staff菜单会跳转分级管理员列表,所以单独处理
} else if (['gradingAdminDetail', 'gradingAdminCreate'].includes(to.name) && !['', 'staff'].includes(curRole)) {
if (noFrom) {
next({ path: `${SITE_URL}rating-manager` });
} else {
next();
}
} else if (['gradingAdminEdit', 'myPerm'].includes(to.name)) {
next();
// } else if (['createUserGroup'].includes(to.name)) {
// if (noFrom) {
// if (existValue('externalApp')) {
// next();
// } else {
// next({ path: `${SITE_URL}${defaultRoute[navIndex]}` });
// }
// } else {
// next();
// }
// } else if (['myPerm'].includes(to.name)) {
// next();
} else {
next();
}
Expand Down
116 changes: 66 additions & 50 deletions frontend/src/views/audit/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
ref="tableRef"
row-key="id"
v-bkloading="{ isLoading: tableLoading, opacity: 1 }"
:cell-class-name="getCellClass"
@page-change="pageChange"
@page-limit-change="limitChange"
@expand-change="handleExpandChange">
Expand Down Expand Up @@ -399,7 +400,8 @@
'management.api.allow.list.config.create': this.$t(`m.audit['管理类API白名单创建']`),
'management.api.allow.list.config.delete': this.$t(`m.audit['管理类API白名单删除']`),
'group.transfer': this.$t(`m.audit['用户组权限交接']`),
'action.sensitivity.level.update': this.$t(`m.audit['操作敏感等级更新']`)
'action.sensitivity.level.update': this.$t(`m.audit['操作敏感等级更新']`),
'role.update.notification.config': this.$t(`m.audit['续期通知更新']`)
},
currentMonth: '',
noDetailType: NO_DETAIL_TYPE,
Expand Down Expand Up @@ -541,14 +543,21 @@
await this.fetchAuditList();
},
getCellClass ({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0 && ['role.update.notification.config'].includes(row.type)) {
return 'audit-renewal-notice-cell-cls';
}
return '';
},
refreshCurrentQuery () {
const { limit, current } = this.pagination;
const params = {};
const queryParams = {
limit,
current,
month: this.currentMonth,
...this.searchParams
...this.searchParams
};
window.history.replaceState({}, '', `?${buildURLParams(queryParams)}`);
for (const key in this.searchParams) {
Expand All @@ -564,10 +573,10 @@
}
}
return {
...params,
limit,
current,
month: this.currentMonth
...params,
limit,
current,
month: this.currentMonth
};
},
Expand All @@ -591,7 +600,7 @@
object_type: '',
object_id: '',
status: '',
...this.searchParams
...this.searchParams
};
try {
const { code, data } = await this.$store.dispatch('audit/getAuditList', params);
Expand Down Expand Up @@ -704,7 +713,8 @@
{ id: 'authorization.api.allow.list.config.delete', name: this.$t(`m.audit['授权类API白名单删除']`) },
{ id: 'management.api.allow.list.config.create', name: this.$t(`m.audit['管理类API白名单创建']`) },
{ id: 'management.api.allow.list.config.delete', name: this.$t(`m.audit['管理类API白名单删除']`) },
{ id: 'action.sensitivity.level.update', name: this.$t(`m.audit['操作敏感等级更新']`) }
{ id: 'action.sensitivity.level.update', name: this.$t(`m.audit['操作敏感等级更新']`) },
{ id: 'role.update.notification.config', name: this.$t(`m.audit['续期通知更新']`) }
];
if (value === '') {
return Promise.resolve(list);
Expand Down Expand Up @@ -786,7 +796,7 @@
});
}
if (this.onlyExtraInfoType.includes(row.detail.type)) {
if (row.detail.type !== 'role.group.renew' && row.detail.type !== 'template.version.sync') {
if (!['role.group.renew', 'template.version.sync'].includes(row.detail.type)) {
row.detail.extra_info.policies.forEach(item => {
item.system_id = row.detail.extra_info.system.id;
item.system_name = row.detail.extra_info.system.name;
Expand All @@ -804,48 +814,54 @@
}
};
</script>
<style lang="postcss">
.iam-audit-wrapper {
.audit-search-select {
margin-left: 10px;
float: right;

<style lang="postcss" scoped>
.iam-audit-wrapper {
.audit-search-select {
margin-left: 10px;
float: right;
}
.audit-table {
margin-top: 16px;
border-right: none;
border-bottom: none;
.bk-table-expanded-cell {
padding: 0 30px 0 45px !important;
}
&.set-border {
border-right: 1px solid #dfe0e5;
border-bottom: 1px solid #dfe0e5;
}
.audit-detail-wrapper {
position: relative;
padding: 16px 50px 16px 165px;
min-height: 60px;
p {
line-height: 24px;
}
.empty-wrapper {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
img {
width: 60px;
}
.audit-table {
margin-top: 16px;
border-right: none;
border-bottom: none;
.bk-table-expanded-cell {
padding: 0 30px 0 45px !important;
}
&.set-border {
border-right: 1px solid #dfe0e5;
border-bottom: 1px solid #dfe0e5;
}
.audit-detail-wrapper {
position: relative;
padding: 16px 50px 16px 165px;
min-height: 60px;
p {
line-height: 24px;
}
.empty-wrapper {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
img {
width: 60px;
}
}
}
.audit-detail-table {
border: none;
.bk-table-row-last {
td {
border-bottom: 1px solid #dfe0e5 !important;
}
}
}
}
}
.audit-detail-table {
border: none;
.bk-table-row-last {
td {
border-bottom: 1px solid #dfe0e5 !important;
}
}
}
/deep/ .audit-renewal-notice-cell-cls {
.cell {
display: none;
}
}
}
}
</style>
26 changes: 14 additions & 12 deletions frontend/src/views/renewal-notice/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -326,27 +326,29 @@
return;
}
this.submitLoading = true;
try {
const typeMap = {
submit: async () => {
const typeMap = {
submit: async () => {
try {
if (JSON.stringify(this.noticeForm) !== JSON.stringify(this.noticeFormReset)) {
await this.fetchSuperNoticeConfig(true, false, false);
}
await this.$store.dispatch('renewalNotice/updateSuperNoticeConfig', this.noticeForm);
this.messageSuccess(this.$t(`m.info['保存成功']`), 3000);
},
status: async () => {
} finally {
this.submitLoading = false;
}
},
status: async () => {
try {
await this.$store.dispatch('renewalNotice/updateSuperNoticeConfig', this.noticeForm);
const msg = this.noticeForm.enable ? this.$t(`m.renewalNotice['开启成功']`) : this.$t(`m.renewalNotice['关闭成功']`);
this.messageSuccess(msg, 3000);
} finally {
this.submitLoading = false;
}
};
typeMap[payload]();
} catch (e) {
this.messageAdvancedError(e);
} finally {
this.submitLoading = false;
}
}
};
return typeMap[payload]();
},
handleSelectNoticeType (payload) {
Expand Down
2 changes: 1 addition & 1 deletion saas/resources/templates/group_expired_mail.html
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
过期成员
</th>
<th style="padding:13px; color: #000; font-weight: normal; background: #f5f6fa; text-align: left; ">
到期时间
有效期
</th>
</tr>
</thead>
Expand Down
4 changes: 2 additions & 2 deletions saas/resources/templates/user_expired_mail.html
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
所属系统
</th>
<th style="padding:13px; color: #000; font-weight: normal; background: #f5f6fa; text-align: left;">
到期时间
有效期
</th>
</tr>
</thead>
Expand Down Expand Up @@ -298,7 +298,7 @@
描述
</th>
<th style="padding:13px; color: #000; font-weight: normal; background: #f5f6fa; text-align: left;">
到期时间
有效期
</th>
</tr>
</thead>
Expand Down

0 comments on commit c376541

Please sign in to comment.