mirror of
https://github.com/jumpserver/lina.git
synced 2025-10-21 23:59:22 +00:00
perf: 修改 labels 关联
This commit is contained in:
@@ -383,7 +383,7 @@ export default {
|
|||||||
if (Array.isArray(resData) && resData.length) {
|
if (Array.isArray(resData) && resData.length) {
|
||||||
this.asyncDataList = resData
|
this.asyncDataList = resData
|
||||||
this.notSelectDataList = resData
|
this.notSelectDataList = resData
|
||||||
this.initData(true)
|
this.initData(false)
|
||||||
this.isLastPage = resData.length < this.pageSize
|
this.isLastPage = resData.length < this.pageSize
|
||||||
} else {
|
} else {
|
||||||
this.notSelectDataList = []
|
this.notSelectDataList = []
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
import { GenericListPage } from '@/layout/components'
|
import { GenericListPage } from '@/layout/components'
|
||||||
import BindDialog from './BindDialog.vue'
|
import BindDialog from './BindDialog.vue'
|
||||||
import LabelResourcesDialog from '@/views/labels/LabelResourcesDialog.vue'
|
import LabelResourcesDialog from '@/views/labels/LabelResourcesDialog.vue'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -31,10 +32,13 @@ export default {
|
|||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: '/api/v1/labels/labels/',
|
url: '/api/v1/labels/labels/',
|
||||||
columnsShow: {
|
columnsShow: {
|
||||||
default: ['name', 'value', 'res_count', 'date_created', 'date_updated', 'actions'],
|
default: ['name', 'value', 'res_count', 'date_created', 'action'],
|
||||||
min: ['name', 'action']
|
min: ['name', 'action']
|
||||||
},
|
},
|
||||||
columnsMeta: {
|
columnsMeta: {
|
||||||
|
name: {
|
||||||
|
formatter: (row) => row.name
|
||||||
|
},
|
||||||
res_count: {
|
res_count: {
|
||||||
formatter: (row) => {
|
formatter: (row) => {
|
||||||
const onClick = () => {
|
const onClick = () => {
|
||||||
@@ -54,6 +58,9 @@ export default {
|
|||||||
callback: ({ row }) => {
|
callback: ({ row }) => {
|
||||||
this.label = row
|
this.label = row
|
||||||
this.bindVisible = true
|
this.bindVisible = true
|
||||||
|
},
|
||||||
|
can: () => {
|
||||||
|
return !this.currentOrgIsRoot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -67,6 +74,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['currentOrgIsRoot'])
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleClickResCount(row) {
|
handleClickResCount(row) {
|
||||||
this.label = row
|
this.label = row
|
||||||
|
@@ -1,5 +1,11 @@
|
|||||||
<template>
|
<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" />
|
<ListTable :header-actions="headerActions" :table-config="tableConfig" />
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -120,11 +120,8 @@ export default {
|
|||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/v1/rbac/system-roles/?id!=00000000-0000-0000-0000-000000000004',
|
url: '/api/v1/rbac/system-roles/?id!=00000000-0000-0000-0000-000000000004',
|
||||||
transformOption: (item) => {
|
transformOption: (item) => {
|
||||||
if (item.name !== 'SystemComponent') {
|
|
||||||
return { label: item.display_name, value: item.id }
|
return { label: item.display_name, value: item.id }
|
||||||
}
|
}
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hidden: () => {
|
hidden: () => {
|
||||||
|
Reference in New Issue
Block a user