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) {
|
||||
if (!col.formatter) {
|
||||
col.formatter = (row, column, cellValue) => {
|
||||
const value = cellValue || '-'
|
||||
let value = cellValue
|
||||
let padding = '0'
|
||||
if (value === '-') {
|
||||
if (!value && value !== 0) {
|
||||
padding = '6px'
|
||||
value = '-'
|
||||
}
|
||||
return <span style={{ marginLeft: padding }}>{value}</span>
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<GenericListPage :table-config="tableConfig" :header-actions="headerActions" :help-message="notice" />
|
||||
<GenericListPage :header-actions="headerActions" :help-message="notice" :table-config="tableConfig" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -14,6 +14,8 @@ export default {
|
||||
return {
|
||||
tableConfig: {
|
||||
url: '/api/v1/assets/domains/',
|
||||
columnsExclude: ['assets', 'gateway'],
|
||||
columnsExtra: ['asset_count', 'gateway_count'],
|
||||
columnsShow: {
|
||||
min: ['name', 'actions'],
|
||||
default: ['name', 'asset_count', 'gateway_count', 'comment', 'actions']
|
||||
@@ -22,7 +24,7 @@ export default {
|
||||
asset_count: {
|
||||
label: this.$t('assets.Assets'),
|
||||
formatter: function(row) {
|
||||
return <span> { row.assets.length } </span>
|
||||
return <span> {row.assets.length} </span>
|
||||
}
|
||||
},
|
||||
gateway_count: {
|
||||
|
Reference in New Issue
Block a user