CN-268 feat: panel重构--地图
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="cn-chart">
|
<div class="cn-chart">
|
||||||
<loading :loading="loading"></loading>
|
<loading :loading="loading && !isTabs"></loading>
|
||||||
<chart-no-data v-if="!loading && (isNoData || isError)"></chart-no-data>
|
<chart-no-data v-if="isNoData"></chart-no-data>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
|
|
||||||
<chart-tabs
|
<chart-tabs
|
||||||
@@ -79,7 +79,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isNoData () {
|
isNoData () {
|
||||||
return _.isEmpty(this.chartData)
|
return !this.loading && (_.isEmpty(this.chartData) || this.isError) && !this.isSingleValue && !this.isTabs
|
||||||
},
|
},
|
||||||
chartOption () {
|
chartOption () {
|
||||||
if (this.customChartOption) {
|
if (this.customChartOption) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="chart-header" :class="{'chart-header--title-chart': isTitle}">
|
<div class="chart-header" :class="{'chart-header--title-chart': isTitle}">
|
||||||
<div class="chart-header__title">{{chartInfo.name}}</div>
|
<div class="chart-header__title">{{chartInfo.name}}</div>
|
||||||
<chart-error :isError="isError" :errorInfo="errorInfo"></chart-error>
|
<chart-error :isError="isError" :errorInfo="errorInfo"></chart-error>
|
||||||
<div class="chart-header__tools" v-if="!isTitle">
|
<div class="chart-header__tools" v-if="!isTitle && !isTabs">
|
||||||
<el-popover trigger="click" placement="top" :content="chartInfo.remark" v-if="chartInfo.remark">
|
<el-popover trigger="click" placement="top" :content="chartInfo.remark" v-if="chartInfo.remark">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<span class="header__operation-btn"><i class="cn-icon el-icon-info"></i></span>
|
<span class="header__operation-btn"><i class="cn-icon el-icon-info"></i></span>
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { isTitle } from './charts/tools'
|
import { isTitle, isTabs } from './charts/tools'
|
||||||
import ChartError from '@/components/charts/ChartError'
|
import ChartError from '@/components/charts/ChartError'
|
||||||
export default {
|
export default {
|
||||||
name: 'ChartHeader',
|
name: 'ChartHeader',
|
||||||
@@ -45,7 +45,8 @@ export default {
|
|||||||
},
|
},
|
||||||
setup (props) {
|
setup (props) {
|
||||||
return {
|
return {
|
||||||
isTitle: isTitle(props.chartInfo.type)
|
isTitle: isTitle(props.chartInfo.type),
|
||||||
|
isTabs: isTabs(props.chartInfo.type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<div :class="{'panel-chart--fullscreen': isFullscreen, 'panel-chart--title-chart': isTitle}" class="panel-chart" :id="isFullscreen ? ('chart-screen-' + chartInfo.id ) : ('chart-local-' + chartInfo.id)">
|
<div :class="{'panel-chart--fullscreen': isFullscreen, 'panel-chart--title-chart': isTitle}" class="panel-chart" :id="isFullscreen ? ('chart-screen-' + chartInfo.id ) : ('chart-local-' + chartInfo.id)">
|
||||||
<!-- title和工具栏,支持浮动 -->
|
<!-- title和工具栏,支持浮动 -->
|
||||||
<chart-header
|
<chart-header
|
||||||
v-if="!isFullscreen && showHeader"
|
v-if="!isFullscreen && showHeader && !isSingleValue"
|
||||||
:is-error="isError"
|
:is-error="isError"
|
||||||
:error-info="errorInfo"
|
:error-info="errorInfo"
|
||||||
:chart-data="chartData"
|
:chart-data="chartData"
|
||||||
@@ -271,7 +271,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.getChartData()
|
this.showLoading(true)
|
||||||
|
setTimeout(() => {
|
||||||
|
this.getChartData()
|
||||||
|
}, 200)
|
||||||
},
|
},
|
||||||
setup (props) {
|
setup (props) {
|
||||||
const dateRangeValue = 60
|
const dateRangeValue = 60
|
||||||
|
|||||||
@@ -3,14 +3,13 @@
|
|||||||
class="cn-chart cn-chart__tabs"
|
class="cn-chart cn-chart__tabs"
|
||||||
v-model="activeTab"
|
v-model="activeTab"
|
||||||
@tab-click="changeTab"
|
@tab-click="changeTab"
|
||||||
:style="computePosition"
|
:ref="`chart-${chartInfo.id}`"
|
||||||
:ref="`chart-${chart.id}`"
|
|
||||||
>
|
>
|
||||||
<el-tab-pane
|
<el-tab-pane
|
||||||
v-for="tab in chartInfo.children"
|
v-for="tab in chartInfo.children"
|
||||||
:label="tab.i18n ? $t(tab.i18n) : tab.name" :name="`${tab.id}`"
|
:label="tab.i18n ? $t(tab.i18n) : tab.name" :name="`${tab.id}`"
|
||||||
:key="tab.id"
|
:key="tab.id"
|
||||||
:ref="`chart-${chart.id}`"
|
:ref="`chart-${chartInfo.id}`"
|
||||||
>
|
>
|
||||||
<template v-for="chart in tab.children" :key="chart.id">
|
<template v-for="chart in tab.children" :key="chart.id">
|
||||||
<panel-chart
|
<panel-chart
|
||||||
@@ -46,13 +45,12 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
showFullscreen () {
|
showFullscreen () {
|
||||||
|
|
||||||
|
},
|
||||||
|
changeTab (tab) {
|
||||||
|
this.activeTab = tab.paneName
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setup (props) {
|
setup (props) {
|
||||||
|
|||||||
Reference in New Issue
Block a user