feat: chart-system 添加legend
This commit is contained in:
@@ -53,6 +53,11 @@
|
||||
line-height: 32px;
|
||||
}
|
||||
}
|
||||
.chart-system-top-box {
|
||||
.el-form-item__content {
|
||||
line-height: 32px;
|
||||
}
|
||||
}
|
||||
.chart-title-config {
|
||||
border: 1px solid $--border-color-light;
|
||||
border-radius: 2px;
|
||||
|
||||
@@ -110,7 +110,7 @@ export default {
|
||||
legend = chartInfo.elements[expressionIndex].expression
|
||||
}
|
||||
// 处理legend别名
|
||||
alias = chartInfo.datasource === 'system' ? '' : (alias + this.handleLegendAlias(legend, chartInfo.elements[expressionIndex].legend))
|
||||
alias = alias + this.handleLegendAlias(legend, chartInfo.elements[expressionIndex].legend)
|
||||
if (!alias) {
|
||||
alias = legend
|
||||
}
|
||||
|
||||
@@ -244,6 +244,7 @@ export default {
|
||||
break
|
||||
}
|
||||
case 'system': {
|
||||
this.chartInfo.elements = this.chartInfo.param.datasource
|
||||
if (this.chartInfo.type === 'assetInfo') {
|
||||
this.$get('asset/asset/' + this.chartDetailInfo.id).then(res => {
|
||||
this.chartData = res.data
|
||||
|
||||
@@ -354,7 +354,8 @@ export default {
|
||||
group: '',
|
||||
select: '',
|
||||
limit: 100,
|
||||
sort: 'desc'
|
||||
sort: 'desc',
|
||||
legend: ''
|
||||
}
|
||||
],
|
||||
valueMapping: []
|
||||
@@ -439,6 +440,9 @@ export default {
|
||||
if (this.editChart.param.enable.legend && !this.editChart.param.legend) {
|
||||
this.editChart.param.legend = { placement: 'bottom', values: [], show: true }
|
||||
}
|
||||
if (this.editChart.param.datasource && !this.editChart.param.datasource[0].legend) {
|
||||
this.editChart.param.datasource[0].legend = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
label-position= "top"
|
||||
label-width="120px"
|
||||
>
|
||||
|
||||
<div v-loading="loading" v-for="(item, index) in chartConfig.param.datasource " :key="index" class="chart-system-top-box">
|
||||
<div class="chart-title chart-title-config">
|
||||
<span class="chart-title-content el-form-item" :class="{
|
||||
'is-error' : systemNameShow[0].error,
|
||||
@@ -26,7 +28,8 @@
|
||||
</span>
|
||||
</div>
|
||||
<transition name="el-zoom-in-top">
|
||||
<div class="system-chart-config" v-loading="loading" v-for="(item, index) in chartConfig.param.datasource " :key="index" v-show="systemNameShow[0].show">
|
||||
<div v-show="systemNameShow[0].show">
|
||||
<div class="system-chart-config">
|
||||
<div class="system-chart-config-left">
|
||||
<ul>
|
||||
<li
|
||||
@@ -91,7 +94,23 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-row style="display: flex">
|
||||
<el-col class="legend-title">
|
||||
<span class="legend-title__span">{{$t('dashboard.panel.chartForm.legend')}} </span>
|
||||
<el-popover placement="top" trigger="hover" width="211" popper-class="prevent-clickoutside">
|
||||
<div :style="{'word-break':language!=='cn'?'keep-all':'break-all'}">{{$t('dashboard.panel.chartForm.legendTip')}}</div>
|
||||
<i @mouseover="rz" class="nz-icon nz-icon-info-normal" slot="reference" style="font-size: 14px; -webkit-transform:scale(0.75);display:inline-block;"></i>
|
||||
</el-popover>
|
||||
</el-col>
|
||||
<el-col style="flex: 1">
|
||||
<el-form-item style="margin: 0 0 10px 0">
|
||||
<el-input size="small" v-model="item.legend" @change="change" style="line-height: 32px"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
<!--title-->
|
||||
<div class="form__sub-title">
|
||||
<span>{{$t('dashboard.panel.chartForm.displayConfig')}}</span>
|
||||
|
||||
Reference in New Issue
Block a user