feat:NEZ-2383 chart编辑页面支持 repeat 配置项

This commit is contained in:
zyh
2022-11-14 16:00:18 +08:00
parent 84cb0666eb
commit afe2d0dba5
3 changed files with 51 additions and 2 deletions

View File

@@ -580,6 +580,11 @@ export default {
result: ''
}
}
if (obj.type === 'group' && !obj.param.repeat) {
obj.param.repeat = {
variable: ''
}
}
// this.editChart.varType = 1
if (obj.param.enable.legend && !obj.param.legend) {
obj.param.legend = { placement: 'bottom', values: [], show: true }

View File

@@ -247,6 +247,46 @@
</div>
</transition>
</div>
<!-- repeat -->
<div v-if="params.type === 'group'">
<div class="form__sub-title">
<span>{{$t('dashboard.repeat')}}</span>
<el-switch
v-model="chartConfig.param.enable.repeat"
size="small"
@change="change"
></el-switch>
</div>
<transition name="el-zoom-in-top">
<div
v-if="chartConfig.param.enable.repeat"
class="form-items--half-width-group"
>
<!-- variable -->
<el-form-item
:label="$t('dashboard.panel.variableName')"
class="form-item--half-width"
prop="param.repeat.variable"
:rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}"
>
<el-select
v-model="chartConfig.param.repeat.variable"
:placeholder="$t('el.select.placeholder')"
popper-class="right-box-select-top prevent-clickoutside"
size="small"
@change="change"
>
<el-option
v-for="item in variables"
:key="item.name"
:label="$t(item.name)"
:value="item.name"
></el-option>
</el-select>
</el-form-item>
</div>
</transition>
</div>
</el-form>
</div>
@@ -320,7 +360,8 @@ export default {
link: this.chartConfig.param.link,
collapse: true,
enable: {
visibility: false
visibility: false,
repeat: false
},
showHeader: this.chartConfig.param.showHeader,
visibility: {
@@ -328,6 +369,9 @@ export default {
operator: 'equal',
varValue: '',
result: 'show'
},
repeat: {
variable: ''
}
}
break

View File

@@ -42,7 +42,7 @@
<pick-time id="panel" ref="pickTime" v-model="searchTime" :refresh-data-func="dateChange" :use-chart-unit="false" class="margin-r-10" :sign="showPanel.id"></pick-time>
<!-- 切换查看模式 -->
<button slot="reference" class="top-tool-btn view-mode" :title="$t('overall.viewMode')" @click="cycle">
<button class="top-tool-btn view-mode" :title="$t('overall.viewMode')" @click="cycle">
<i class="nz-icon nz-icon-moshiqiehuan"></i>
</button>