fix: 调整chart-time-series的堆叠按钮位置
This commit is contained in:
@@ -81,6 +81,9 @@
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: $--color-text-primary;
|
color: $--color-text-primary;
|
||||||
}
|
}
|
||||||
|
.tool__icon-active {
|
||||||
|
color: $--color-primary;
|
||||||
|
}
|
||||||
.nz-chart-dropdown {
|
.nz-chart-dropdown {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 44px;
|
top: 44px;
|
||||||
@@ -162,6 +165,9 @@
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: $--color-text-primary;
|
color: $--color-text-primary;
|
||||||
}
|
}
|
||||||
|
.tool__icon-active {
|
||||||
|
color: $--color-primary;
|
||||||
|
}
|
||||||
.nz-chart-dropdown {
|
.nz-chart-dropdown {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 44px;
|
top: 44px;
|
||||||
|
|||||||
@@ -49,6 +49,11 @@
|
|||||||
:sign="chartInfo.id"
|
:sign="chartInfo.id"
|
||||||
@unitChange="unitChange"
|
@unitChange="unitChange"
|
||||||
>
|
>
|
||||||
|
<template v-slot:stack v-if="isTimeSeries(chartInfo.type)">
|
||||||
|
<button class="top-tool-btn top-tool-btn--text margin-r-10" :title="$t('dashboard.dashboard.chartForm.stack')" @click="changeStack">
|
||||||
|
<i class="nz-icon nz-icon-duidiezhuzhuangtu" :class="isStack ? 'tool__icon-active' : ''"/>
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
</pick-time>
|
</pick-time>
|
||||||
</span>
|
</span>
|
||||||
<span class="chart-header__tool" v-if="showSaveBtn(from)">
|
<span class="chart-header__tool" v-if="showSaveBtn(from)">
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
@mouseleave="mouseLeaveChart"
|
@mouseleave="mouseLeaveChart"
|
||||||
v-my-loading="chartLoading"
|
v-my-loading="chartLoading"
|
||||||
>
|
>
|
||||||
<div class="uplot-toolbox" @click="changeStack">
|
<!-- <div class="uplot-toolbox" @click="changeStack">-->
|
||||||
<i class="nz-icon nz-icon-duidiezhuzhuangtu" :style="{color: isStack ? toolboxIconColor.active : toolboxIconColor.inactive}"/>
|
<!-- <i class="nz-icon nz-icon-duidiezhuzhuangtu" :style="{color: isStack ? toolboxIconColor.active : toolboxIconColor.inactive}"/>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<div class="showMore" v-if="chartIndex !== legends.length && from == 'explore'"><i class="nz-icon nz-icon-jinggao"></i>{{$t("dashboard.dashboard.moreTitle")}} <span class="moreChart" @click="showMore">{{$t("dashboard.dashboard.showAll")+ (chartIndex+1)}}</span></div>
|
<div class="showMore" v-if="chartIndex !== legends.length && from == 'explore'"><i class="nz-icon nz-icon-jinggao"></i>{{$t("dashboard.dashboard.moreTitle")}} <span class="moreChart" @click="showMore">{{$t("dashboard.dashboard.showAll")+ (chartIndex+1)}}</span></div>
|
||||||
<div class="chart__canvas" style="position:relative" :class="{'chart-cursor-default':cursorDefault}">
|
<div class="chart__canvas" style="position:relative" :class="{'chart-cursor-default':cursorDefault}">
|
||||||
<div :id="`chart-canvas-${chartId}`"></div>
|
<div :id="`chart-canvas-${chartId}`"></div>
|
||||||
@@ -270,7 +270,8 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
padding: [15, this.autoPadRight, 15, 15],
|
padding: [15, 15, 15, 15],
|
||||||
|
// padding: [15, this.autoPadRight, 15, 15],
|
||||||
legend: {
|
legend: {
|
||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -66,9 +66,9 @@
|
|||||||
<i class="nz-icon nz-icon-plus tool__icon" :title="$t('tip.add')"></i>
|
<i class="nz-icon nz-icon-plus tool__icon" :title="$t('tip.add')"></i>
|
||||||
</span>
|
</span>
|
||||||
<!-- refresh -->
|
<!-- refresh -->
|
||||||
<span v-if="!isExportHtml" class="chart-header__tool" @click="refreshChart">
|
<span v-if="!isExportHtml && isTimeSeries(chartInfo.type)" class="chart-header__tool" @click="changeStack">
|
||||||
<div :title="$t('dashboard.refresh')" effect="light" placement="top">
|
<div :title="$t('dashboard.dashboard.chartForm.stack')" effect="light" placement="top">
|
||||||
<i class="nz-icon nz-icon-replay tool__icon"></i>
|
<i class="nz-icon nz-icon-duidiezhuzhuangtu tool__icon" :class="isStack ? 'tool__icon-active' : ''"/>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
<!-- screen -->
|
<!-- screen -->
|
||||||
@@ -124,10 +124,12 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import chartHeaderMixin from '@/components/chart/chartHeaderMixin'
|
import chartHeaderMixin from '@/components/chart/chartHeaderMixin'
|
||||||
|
import {isTimeSeries} from "@/components/chart/chart/tools";
|
||||||
export default {
|
export default {
|
||||||
name: 'chartHeader',
|
name: 'chartHeader',
|
||||||
mixins: [chartHeaderMixin],
|
mixins: [chartHeaderMixin],
|
||||||
methods: {
|
methods: {
|
||||||
|
isTimeSeries,
|
||||||
openUrl () {
|
openUrl () {
|
||||||
window.open(this.chartInfo.param.link)
|
window.open(this.chartInfo.param.link)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import bus from '@/libs/bus'
|
import bus from '@/libs/bus'
|
||||||
|
import {isTimeSeries} from './chart/tools'
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
chartInfo: Object,
|
chartInfo: Object,
|
||||||
@@ -43,13 +44,15 @@ export default {
|
|||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
dropdownMenuShow: false,
|
dropdownMenuShow: false,
|
||||||
errorText: ''
|
errorText: '',
|
||||||
|
isStack: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showFullscreen () {
|
showFullscreen () {
|
||||||
this.$emit('showFullscreen', true)
|
this.$emit('showFullscreen', true)
|
||||||
},
|
},
|
||||||
|
isTimeSeries,
|
||||||
refreshChart () {
|
refreshChart () {
|
||||||
this.$emit('refresh')
|
this.$emit('refresh')
|
||||||
},
|
},
|
||||||
@@ -106,6 +109,10 @@ export default {
|
|||||||
unitChange (val) {
|
unitChange (val) {
|
||||||
this.$emit('unitChange', val)
|
this.$emit('unitChange', val)
|
||||||
},
|
},
|
||||||
|
changeStack () {
|
||||||
|
this.isStack = !this.isStack
|
||||||
|
this.$emit('changeStack', this.isStack)
|
||||||
|
},
|
||||||
showDownloadCsv (type) {
|
showDownloadCsv (type) {
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@@ -184,5 +191,10 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
try {
|
||||||
|
this.isStack = !!this.chartInfo.param.stack
|
||||||
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default {
|
|||||||
isInit: true, // 是否是初始化,初始化时为true,图表初始化结束后设为false
|
isInit: true, // 是否是初始化,初始化时为true,图表初始化结束后设为false
|
||||||
legends: [], // { name, alias, color, statistics: [{type: min, value: xxx}, ...] }
|
legends: [], // { name, alias, color, statistics: [{type: min, value: xxx}, ...] }
|
||||||
toolboxIconColor: {
|
toolboxIconColor: {
|
||||||
active: '#53a3cb',
|
active: '#FA901C',
|
||||||
inactive: '#7e7e7e'
|
inactive: '#7e7e7e'
|
||||||
},
|
},
|
||||||
chartId: '',
|
chartId: '',
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
@downloadCSV="beforeDownloadCSV"
|
@downloadCSV="beforeDownloadCSV"
|
||||||
@groupShow="groupShow"
|
@groupShow="groupShow"
|
||||||
@showFullscreen="showFullscreen"
|
@showFullscreen="showFullscreen"
|
||||||
|
@changeStack="changeStack"
|
||||||
></chart-header>
|
></chart-header>
|
||||||
<!-- 全屏的header -->
|
<!-- 全屏的header -->
|
||||||
<chart-screen-header
|
<chart-screen-header
|
||||||
@@ -50,6 +51,7 @@
|
|||||||
@refresh="refresh"
|
@refresh="refresh"
|
||||||
@dateChange="dateChange"
|
@dateChange="dateChange"
|
||||||
@close="showFullscreen"
|
@close="showFullscreen"
|
||||||
|
@changeStack="changeStack"
|
||||||
></chart-screen-header>
|
></chart-screen-header>
|
||||||
<!-- chart -->
|
<!-- chart -->
|
||||||
<!-- 数据查询后传入chart组件,chart组件内不查询,只根据接传递的数据来渲染 -->
|
<!-- 数据查询后传入chart组件,chart组件内不查询,只根据接传递的数据来渲染 -->
|
||||||
@@ -834,6 +836,11 @@ export default {
|
|||||||
this.$refs.chart && this.$refs.chart.$refs['chart' + this.chartInfo.id].initChart()
|
this.$refs.chart && this.$refs.chart.$refs['chart' + this.chartInfo.id].initChart()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
changeStack () {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.chart && this.$refs.chart.$refs['chart' + this.chartInfo.id].changeStack()
|
||||||
|
})
|
||||||
|
},
|
||||||
unitChange (val) {
|
unitChange (val) {
|
||||||
this.$emit('update:chartInfo', 'unit', val)
|
this.$emit('update:chartInfo', 'unit', val)
|
||||||
this.chartInfo.unit = val
|
this.chartInfo.unit = val
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<div class="interval-refresh margin-r-10" style="position: relative">
|
<div class="interval-refresh margin-r-10" style="position: relative">
|
||||||
<time-picker v-if="showTimePicker" :showLocked="showLocked" ref="timePicker" v-model="searchTime" :default-pick="defaultPick" :show-empty="showEmpty" class="time-picker margin-r-10" size="small" @change="dateChange" :sign="sign"></time-picker>
|
<time-picker v-if="showTimePicker" :showLocked="showLocked" ref="timePicker" v-model="searchTime" :default-pick="defaultPick" :show-empty="showEmpty" class="time-picker margin-r-10" size="small" @change="dateChange" :sign="sign"></time-picker>
|
||||||
<multipleTime v-if="showMultiple" ref="multipleTime" :stepSearchTime="searchTime" class="multiple-time margin-r-10" @change="dateChange(searchTime)"/>
|
<multipleTime v-if="showMultiple" ref="multipleTime" :stepSearchTime="searchTime" class="multiple-time margin-r-10" @change="dateChange(searchTime)"/>
|
||||||
|
<slot name="stack"></slot>
|
||||||
<chart-unit v-if="useChartUnit" v-model="unit" ref="chartUnit" class="margin-r-10"></chart-unit>
|
<chart-unit v-if="useChartUnit" v-model="unit" ref="chartUnit" class="margin-r-10"></chart-unit>
|
||||||
<div v-show="useRefresh" class="top-tool-btn-group">
|
<div v-show="useRefresh" class="top-tool-btn-group">
|
||||||
<button :id="id+'-refresh'" class="top-tool-btn top-tool-btn--text" @click="antiShake" :title="id === 'explore' ? '': $t('dashboard.refresh')">
|
<button :id="id+'-refresh'" class="top-tool-btn top-tool-btn--text" @click="antiShake" :title="id === 'explore' ? '': $t('dashboard.refresh')">
|
||||||
|
|||||||
Reference in New Issue
Block a user