Merge branch 'dev-3.7' of git.mesalab.cn:nezha/nezha-fronted into dev-3.8

This commit is contained in:
zyh
2023-08-07 15:28:38 +08:00
3 changed files with 22 additions and 6 deletions

View File

@@ -429,6 +429,9 @@ export default {
if (!this.chart.groupId || this.chart.groupId == -1) { if (!this.chart.groupId || this.chart.groupId == -1) {
this.chart.groupId = '' this.chart.groupId = ''
} }
if (this.chart.type === 'group' && !this.chart.param.collapse == undefined) {
this.chart.param.collapse = false
}
if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) { if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) {
this.chart.param.rightYAxis = { this.chart.param.rightYAxis = {
elementNames: [], elementNames: [],
@@ -473,6 +476,9 @@ export default {
if (!this.chart.groupId || this.chart.groupId == -1) { if (!this.chart.groupId || this.chart.groupId == -1) {
this.chart.groupId = '' this.chart.groupId = ''
} }
if (this.chart.type === 'group' && !this.chart.param.collapse == undefined) {
this.chart.param.collapse = false
}
if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) { if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) {
this.chart.param.rightYAxis = { this.chart.param.rightYAxis = {
elementNames: [], elementNames: [],

View File

@@ -40,14 +40,18 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<!--Default collapse--> <!--Default collapse-->
<el-form-item class="form-item--half-width" v-if="isGroup(chartConfig.type)" :label='$t("dashboard.dashboard.chartForm.collapse")' prop="param.collapse"> <el-form-item class="form-item--half-width" v-if="isGroup(chartConfig.type)" :label='$t("dashboard.dashboard.chartForm.collapseState")' prop="param.collapse">
<el-switch <el-select
id="chart-box-collapse" id="chart-box-collapse"
v-model="chartConfig.param.collapse" v-model="chartConfig.param.collapse"
:active-value="true" placeholder=""
:inactive-value="false" popper-class="right-box-select-top prevent-clickoutside"
size="small"
@change="change" @change="change"
size="small"/> >
<el-option :label="$t('overall.expand')" :value="false"></el-option>
<el-option :label="$t('overall.collapse')" :value="true"></el-option>
</el-select>
</el-form-item> </el-form-item>
</div> </div>
<div class="form-items--half-width-group" v-if="!isGroup(chartConfig.type)"> <div class="form-items--half-width-group" v-if="!isGroup(chartConfig.type)">
@@ -417,7 +421,7 @@ export default {
this.chartConfig.span = 12 this.chartConfig.span = 12
this.chartConfig.param = { this.chartConfig.param = {
link: this.chartConfig.param.link, link: this.chartConfig.param.link,
collapse: true, collapse: false,
enable: { enable: {
visibility: false, visibility: false,
repeat: false repeat: false

View File

@@ -604,6 +604,9 @@ export default {
if (!this.chart.groupId || this.chart.groupId == -1) { if (!this.chart.groupId || this.chart.groupId == -1) {
this.chart.groupId = '' this.chart.groupId = ''
} }
if (this.chart.type === 'group' && !this.chart.param.collapse == undefined) {
this.chart.param.collapse = false
}
if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) { if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) {
this.chart.param.rightYAxis = { this.chart.param.rightYAxis = {
elementNames: [], elementNames: [],
@@ -648,6 +651,9 @@ export default {
if (!this.chart.groupId || this.chart.groupId == -1) { if (!this.chart.groupId || this.chart.groupId == -1) {
this.chart.groupId = '' this.chart.groupId = ''
} }
if (this.chart.type === 'group' && !this.chart.param.collapse == undefined) {
this.chart.param.collapse = false
}
if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) { if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) {
this.chart.param.rightYAxis = { this.chart.param.rightYAxis = {
elementNames: [], elementNames: [],