Skip to content

Commit

Permalink
feat: add tips (#371)
Browse files Browse the repository at this point in the history
Co-authored-by: polo <[email protected]>
  • Loading branch information
huangpeng0428 and polo authored Nov 11, 2021
1 parent 87c4636 commit 87c3ca1
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 6 deletions.
26 changes: 24 additions & 2 deletions frontend/src/views/group/components/add-group-perm-sideslider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,20 @@
<bk-table-column type="selection" align="center" :selectable="getIsSelect"></bk-table-column>
<bk-table-column :label="$t(`m.permTemplate['模板名']`)">
<template slot-scope="{ row }">
<Icon v-if="!getIsSelect(row)" type="error-fill" class="error-icon" />
<bk-popover placement="top" :delay="[300, 0]" ext-cls="iam-tooltips-cls">
<template>
<Icon v-if="!getIsSelect(row)" type="error-fill" class="error-icon" />
</template>
<div slot="content" class="iam-perm-apply-action-popover-content">
该模板无法选择的原因是:分级管理员缩小了授权范围,但是没有同步删除模板里的操作,如需选择请重新编辑模板或者创建新的模板。
<bk-button
text
:loading="editLoading"
@click="handleEdit(row)">
去编辑
</bk-button>
</div>
</bk-popover>
<span class="perm-template-name" :title="row.name" @click="handleViewTemplateDetail(row)">{{ row.name }}</span>
</template>
</bk-table-column>
Expand Down Expand Up @@ -506,6 +519,14 @@
handleSliderClose () {
this.$emit('update:isShow', false)
this.$emit('animation-end')
},
handleEdit (data) {
window.localStorage.setItem('iam-header-title-cache', `${this.$t(`m.nav['编辑权限模板']`)}(${data.name})`)
this.$router.push({
name: 'permTemplateEdit',
params: { id: data.id, systemId: data.system.id }
})
}
}
}
Expand Down Expand Up @@ -585,7 +606,8 @@
font-size: 14px;
color: #ffb400;
position: absolute;
left: -5px;
left: -15px;
top: -11px;
}
}
</style>
29 changes: 25 additions & 4 deletions frontend/src/views/perm-template/components/render-action.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@
<bk-popover placement="top" :delay="[300, 0]" ext-cls="iam-tooltips-cls">
<template v-if="act.disabled">
<span class="text" :class="{ 'text-through': act.tag === 'delete' && mode === 'detail' }">{{ act.name }}</span>
<Icon v-if="act.tag === 'delete'" type="error-fill" class="error-icon" />
</template>
<template v-else>
<span class="text" :class="{ 'text-through': act.tag === 'delete' && mode === 'detail' }">{{ act.name }}</span>
<Icon v-if="act.tag === 'delete'" type="error-fill" class="error-icon" />
</template>
<div slot="content" class="iam-perm-apply-action-popover-content">
<div>
Expand All @@ -55,6 +53,19 @@
</div>
</div>
</bk-popover>

<bk-popover placement="top" :delay="[300, 0]" ext-cls="iam-tooltips-cls">
<template v-if="act.tag === 'delete'">
<Icon type="error-fill" class="error-icon" />
</template>
<div slot="content" class="iam-perm-apply-action-popover-content">
<div>

由于分级管理员的授权范围没有包含此操作,<br>
如需使用该模板进行新的授权必须先删除该操作。
</div>
</div>
</bk-popover>
<template v-if="isCompare && act.hasOwnProperty('flag') && ['added', 'cancel'].includes(act.flag)">
<bk-tag :theme="act.flag === 'added' ? 'success' : 'danger'">
{{ act.flag === 'added' ? $t(`m.common['新增']`) : $t(`m.common['移除']`) }}
Expand Down Expand Up @@ -92,11 +103,9 @@
<bk-popover placement="top" :delay="[300, 0]" ext-cls="iam-tooltips-cls">
<template v-if="act.disabled">
<span class="text" :class="{ 'text-through': act.tag === 'delete' && mode === 'detail' }">{{ act.name }}</span>
<Icon v-if="act.tag === 'delete'" type="error-fill" class="error-icon" />
</template>
<template v-else>
<span class="text" :class="{ 'text-through': act.tag === 'delete' && mode === 'detail' }">{{ act.name }}</span>
<Icon v-if="act.tag === 'delete'" type="error-fill" class="error-icon" />
</template>
<div slot="content" class="iam-perm-apply-action-popover-content">
<div>
Expand All @@ -111,6 +120,18 @@
</div>
</div>
</bk-popover>
<bk-popover placement="top" :delay="[300, 0]" ext-cls="iam-tooltips-cls">
<template v-if="act.tag === 'delete'">
<Icon type="error-fill" class="error-icon" />
</template>
<div slot="content" class="iam-perm-apply-action-popover-content">
<div>

由于分级管理员的授权范围没有包含此操作,<br>
如需使用该模板进行新的授权必须先删除该操作。
</div>
</div>
</bk-popover>
<template v-if="isCompare && act.hasOwnProperty('flag') && ['added', 'cancel'].includes(act.flag)">
<bk-tag :theme="act.flag === 'added' ? 'success' : 'danger'">
{{ act.flag === 'added' ? $t(`m.common['新增']`) : $t(`m.common['移除']`) }}
Expand Down

0 comments on commit 87c3ca1

Please sign in to comment.