mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-23 03:57:34 +00:00
perf: 修改 tree menu
This commit is contained in:
@@ -235,10 +235,11 @@ export default {
|
|||||||
setDefaultFormatterIfNeed(col) {
|
setDefaultFormatterIfNeed(col) {
|
||||||
if (!col.formatter) {
|
if (!col.formatter) {
|
||||||
col.formatter = (row, column, cellValue) => {
|
col.formatter = (row, column, cellValue) => {
|
||||||
const value = cellValue || '-'
|
let value = cellValue
|
||||||
let padding = '0'
|
let padding = '0'
|
||||||
if (value === '-') {
|
if (!value && value !== 0) {
|
||||||
padding = '6px'
|
padding = '6px'
|
||||||
|
value = '-'
|
||||||
}
|
}
|
||||||
return <span style={{ marginLeft: padding }}>{value}</span>
|
return <span style={{ marginLeft: padding }}>{value}</span>
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<GenericListPage :table-config="tableConfig" :header-actions="headerActions" :help-message="notice" />
|
<GenericListPage :header-actions="headerActions" :help-message="notice" :table-config="tableConfig" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -14,6 +14,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: '/api/v1/assets/domains/',
|
url: '/api/v1/assets/domains/',
|
||||||
|
columnsExclude: ['assets', 'gateway'],
|
||||||
|
columnsExtra: ['asset_count', 'gateway_count'],
|
||||||
columnsShow: {
|
columnsShow: {
|
||||||
min: ['name', 'actions'],
|
min: ['name', 'actions'],
|
||||||
default: ['name', 'asset_count', 'gateway_count', 'comment', 'actions']
|
default: ['name', 'asset_count', 'gateway_count', 'comment', 'actions']
|
||||||
@@ -22,7 +24,7 @@ export default {
|
|||||||
asset_count: {
|
asset_count: {
|
||||||
label: this.$t('assets.Assets'),
|
label: this.$t('assets.Assets'),
|
||||||
formatter: function(row) {
|
formatter: function(row) {
|
||||||
return <span> { row.assets.length } </span>
|
return <span> {row.assets.length} </span>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
gateway_count: {
|
gateway_count: {
|
||||||
|
Reference in New Issue
Block a user