fix: 修复一些问题;entity详情页调整;
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
.cn-icon-arrow-left-circle {
|
||||
color: $--color-primary;
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
.cn-panel, .cn-panel>.cn-chart__tabs>.el-tabs__content>.el-tab-pane {
|
||||
|
||||
@@ -65,7 +65,15 @@ export function timeUnitFormatter (time, sourceUnit = 'ms', targetUnit, dot = 2)
|
||||
// unitType = time / number / byte
|
||||
export default function unitConvert (value, unitType, sourceUnit, targetUnit, dot = 2) {
|
||||
if (unitType === unitTypes.string) {
|
||||
return [value, '']
|
||||
if (value) {
|
||||
if (typeof value === 'string') {
|
||||
return [value, '']
|
||||
} else {
|
||||
return ['-', '']
|
||||
}
|
||||
} else {
|
||||
return ['-', '']
|
||||
}
|
||||
}
|
||||
if (!Number(value) && Number(value) !== 0) {
|
||||
return ['-', '']
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<template>
|
||||
<div style="padding: 10px 0 20px 20px;">
|
||||
<div v-if="!$_.isEmpty(tabs)" class="entity-detail-tool">
|
||||
<div v-if="typeName" class="entity-detail-tool">
|
||||
<div>
|
||||
<i class="cn-icon cn-icon-arrow-left-circle"></i>
|
||||
<span>{{typeName}} {{$t('overall.detail')}}</span>
|
||||
<span @click="goBack" style="cursor: pointer;"><i class="cn-icon cn-icon-arrow-left-circle"></i></span>
|
||||
</div>
|
||||
<el-radio-group v-model="tab" size="mini">
|
||||
<el-radio-group v-model="tab" size="mini" @change="changeTab">
|
||||
<el-radio-button v-for="tab in tabs" :key="tab.key" :label="tab.label"></el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
@@ -71,7 +70,7 @@ export default {
|
||||
setup (props, ctx) {
|
||||
let tab = ''
|
||||
if (!_.isEmpty(props.tabs)) {
|
||||
tab = ref(props.tabs[0].key)
|
||||
tab = ref(props.tabs[0].label)
|
||||
}
|
||||
// data
|
||||
const dateRangeValue = 60
|
||||
@@ -90,6 +89,11 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goBack () {
|
||||
this.$emit('goBack')
|
||||
},
|
||||
changeTab (label) {
|
||||
},
|
||||
async init () {
|
||||
const panels = await getPanelList({ type: this.panelType })
|
||||
if (panels && panels.length > 0) {
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
></entity-list>
|
||||
</div>
|
||||
</div>
|
||||
<cn-panel v-else :entity="currentEntity" :type-name="typeName" :tabs="panelTabs"></cn-panel>
|
||||
<cn-panel v-else :entity="currentEntity" :type-name="typeName" :tabs="panelTabs" @goBack="showDetail = false"></cn-panel>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user