perf: 修改 labels 关联

This commit is contained in:
ibuler
2023-12-18 17:55:46 +08:00
committed by 老广
parent f10e31bd60
commit 5cefbbfb51
4 changed files with 20 additions and 7 deletions

View File

@@ -383,7 +383,7 @@ export default {
if (Array.isArray(resData) && resData.length) {
this.asyncDataList = resData
this.notSelectDataList = resData
this.initData(true)
this.initData(false)
this.isLastPage = resData.length < this.pageSize
} else {
this.notSelectDataList = []

View File

@@ -15,6 +15,7 @@
import { GenericListPage } from '@/layout/components'
import BindDialog from './BindDialog.vue'
import LabelResourcesDialog from '@/views/labels/LabelResourcesDialog.vue'
import { mapGetters } from 'vuex'
export default {
components: {
@@ -31,10 +32,13 @@ export default {
tableConfig: {
url: '/api/v1/labels/labels/',
columnsShow: {
default: ['name', 'value', 'res_count', 'date_created', 'date_updated', 'actions'],
default: ['name', 'value', 'res_count', 'date_created', 'action'],
min: ['name', 'action']
},
columnsMeta: {
name: {
formatter: (row) => row.name
},
res_count: {
formatter: (row) => {
const onClick = () => {
@@ -54,6 +58,9 @@ export default {
callback: ({ row }) => {
this.label = row
this.bindVisible = true
},
can: () => {
return !this.currentOrgIsRoot
}
}
]
@@ -67,6 +74,9 @@ export default {
}
}
},
computed: {
...mapGetters(['currentOrgIsRoot'])
},
methods: {
handleClickResCount(row) {
this.label = row

View File

@@ -1,5 +1,11 @@
<template>
<Dialog :title="$tc('labels.BindResource')" destroy-on-close v-bind="$attrs" v-on="$listeners">
<Dialog
:show-buttons="false"
:title="$tc('labels.BindResource')"
destroy-on-close
v-bind="$attrs"
v-on="$listeners"
>
<ListTable :header-actions="headerActions" :table-config="tableConfig" />
</Dialog>
</template>

View File

@@ -120,10 +120,7 @@ export default {
ajax: {
url: '/api/v1/rbac/system-roles/?id!=00000000-0000-0000-0000-000000000004',
transformOption: (item) => {
if (item.name !== 'SystemComponent') {
return { label: item.display_name, value: item.id }
}
return false
return { label: item.display_name, value: item.id }
}
}
},