-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat:用户个人视角 权限管理优化 #11138 #11365
feat:用户个人视角 权限管理优化 #11138 #11365
Conversation
# Reviewed, transaction id: 28286
:resource-name="item.resourceTypeName" | ||
:loading="item.tableLoading" | ||
:group-name="item.resourceTypeName" | ||
:type="'AUTHORIZATION'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没必要多余写个变量,直接type="AUTHORIZATION"就行
<i :class="{ | ||
'manage-icon manage-icon-down-shape': item.activeFlag, | ||
'manage-icon manage-icon-right-shape': !item.activeFlag, | ||
'shape-icon': true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个可以把manage-icon放到下面
<span | ||
:class="{ | ||
'resource-name': true, | ||
'hover-link': ['codecc_task', 'pipeline', 'pipeline_group'].includes(row.resourceType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['codecc_task', 'pipeline', 'pipeline_group'].includes(row.resourceType)
你下面已经有个computed了这个可以在处理数据的时候就用个字段存起来的
const refTable = ref(null); | ||
const resourceType = computed(() => props.resourceType); | ||
const projectId = computed(() => route.params?.projectCode || route.query?.projectCode); | ||
const tableList = computed(() => props.data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个没有意义,不过你可以data里面加一些字段方便上面的template用
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里怎么还是没改,你直接用Props.data就行
const route = useRoute(); | ||
const { t } = useI18n(); | ||
const refTable = ref(null); | ||
const resourceType = computed(() => props.resourceType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个直接用props就行,没必要再弄个computed
* 跳转页面 | ||
*/ | ||
function handleToResourcePage (row) { | ||
if (!(['codecc_task', 'pipeline', 'pipeline_group'].includes(row.resourceType))) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里这个判断还重复了
case 'pipeline_group': | ||
window.open(`${location.origin}/console/pipeline/${projectId.value}/list/listAuth/${row.resourceCode}/${row.resourceName}?groupId=${row.groupId}`) | ||
return | ||
case 'codecc_task': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
像这几个很多地方用到的,用枚举来维护,不要到处写的都是'codecc_task', 'pipeline', 'pipeline_group'
const { t } = useI18n(); | ||
const detailGroupTable = userDetailGroupTable(); | ||
const projectTable = computed(() => props.sourceList.filter(item => item.type === "AUTHORIZATION")); | ||
const sourceTable= computed(() => props.sourceList.filter(item => item.type === "GROUP")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我看你下面HandoverType有这个枚举,怎么不用?
# Reviewed, transaction id: 28321
<span | ||
:class="{ | ||
'resource-name': true, | ||
'hover-link': LINKABLE_RESOURCE_TYPES.includes(row.resourceType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我说的是这个表达式,可以直接放到下面的computed提前声明
const refTable = ref(null); | ||
const resourceType = computed(() => props.resourceType); | ||
const projectId = computed(() => route.params?.projectCode || route.query?.projectCode); | ||
const tableList = computed(() => props.data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里
* 跳转页面 | ||
*/ | ||
function handleToResourcePage (row) { | ||
if (!LINKABLE_RESOURCE_TYPES.includes(row.resourceType)) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样就没必要在这里再计算一次了
# Reviewed, transaction id: 28332
# Reviewed, transaction id: 28334
# Reviewed, transaction id: 28335
:resource-name="item.resourceTypeName" | ||
:loading="item.tableLoading" | ||
:group-name="item.resourceTypeName" | ||
type="AUTHORIZATION" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个枚举已经有了,直接用
> | ||
<bk-collapse-panel | ||
v-model="item.activeFlag" | ||
:item-click="(type) => collapseClick(type, 'GROUP')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里也是
:resource-name="item.resourceTypeName" | ||
:loading="item.tableLoading" | ||
:group-name="item.resourceTypeName" | ||
type="GROUP" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里
const refTable = ref(null); | ||
const resourceType = computed(() => props.resourceType); | ||
const projectId = computed(() => route.params?.projectCode || route.query?.projectCode); | ||
const tableList = computed(() => props.data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里怎么还是没改,你直接用Props.data就行
return { | ||
'permission-icon permission-icon-down-shape': activeFlag, | ||
'permission-icon permission-icon-right-shape': !activeFlag, | ||
'shape-icon': true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里也是permission-icon 放下面去
# Reviewed, transaction id: 28346
# Reviewed, transaction id: 28347
@@ -47,7 +43,7 @@ | |||
:resource-name="item.resourceTypeName" | |||
:loading="item.tableLoading" | |||
:group-name="item.resourceTypeName" | |||
:type="'AUTHORIZATION'" | |||
type="AUTHORIZATION" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
枚举
@@ -97,7 +89,7 @@ | |||
:resource-name="item.resourceTypeName" | |||
:loading="item.tableLoading" | |||
:group-name="item.resourceTypeName" | |||
:type="'GROUP'" | |||
type="GROUP" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
枚举
.../devops-manage/src/components/user-group/components/children/permission-manage/tab-table.vue
Show resolved
Hide resolved
# Reviewed, transaction id: 28358
|
||
if (currentRequestId === requestId) { | ||
detailSourceList.value.forEach(item => { | ||
if (authorizationList && item === authorizationItem) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你这里authorizationList其实是个object,这种命名是有歧义的,如果是返回的空对象,这个if还是有可能可以进去的,这个会导致item.tableData是undefined,这个异常你有处理不?
# Reviewed, transaction id: 28363
# Reviewed, transaction id: 28370
# Reviewed, transaction id: 28382
# Reviewed, transaction id: 28397
#11138