fix plot creator

closes #561
This commit is contained in:
Matthias 2021-11-01 19:53:06 +01:00
parent 80d82a9b49
commit 11ac1f8aba
2 changed files with 17 additions and 6 deletions

View File

@ -37,6 +37,7 @@
variant="primary" variant="primary"
title="Add indicator to plot" title="Add indicator to plot"
size="sm" size="sm"
:disabled="addNewIndicator"
@click="addNewIndicator = !addNewIndicator" @click="addNewIndicator = !addNewIndicator"
> >
Add new indicator Add new indicator
@ -54,6 +55,7 @@
</div> </div>
<PlotIndicator <PlotIndicator
v-if="selIndicatorName || addNewIndicator"
v-model="selIndicator" v-model="selIndicator"
class="mt-1" class="mt-1"
:columns="columns" :columns="columns"
@ -162,7 +164,7 @@ export default class PlotConfigurator extends Vue {
} }
set selIndicator(newValue: Record<string, IndicatorConfig>) { set selIndicator(newValue: Record<string, IndicatorConfig>) {
console.log('newValue', newValue); // console.log('newValue', newValue);
const name = Object.keys(newValue)[0]; const name = Object.keys(newValue)[0];
// this.currentPlotConfig[this.selIndicatorName] = { ...newValue[name] }; // this.currentPlotConfig[this.selIndicatorName] = { ...newValue[name] };
// this.emitPlotConfig(); // this.emitPlotConfig();
@ -316,7 +318,7 @@ export default class PlotConfigurator extends Vue {
} }
savePlotConfig() { savePlotConfig() {
this.saveCustomPlotConfig({ [this.plotConfigName]: this.plotConfig }); this.saveCustomPlotConfig({ [this.plotConfigNameLoc]: this.plotConfig });
} }
loadPlotConfig() { loadPlotConfig() {

View File

@ -45,12 +45,19 @@
</b-input-group> </b-input-group>
</b-form-group> </b-form-group>
<div class="d-flex d-flex-columns d-flex"> <div class="d-flex d-flex-columns d-flex">
<b-button v-if="addNew" variant="primary" title="Add " size="sm" @click="emitIndicator"> <b-button
Add new indicator v-if="addNew"
class="flex-grow-1"
variant="primary"
title="Add "
size="sm"
@click="emitIndicator"
>
Save indicator
</b-button> </b-button>
<b-button <b-button
v-if="addNew" v-if="addNew"
class="ml-1" class="ml-1 flex-grow-1"
variant="primary" variant="primary"
title="Add " title="Add "
size="sm" size="sm"
@ -102,7 +109,9 @@ export default class PlotIndicator extends Vue {
@Watch('selColor') @Watch('selColor')
watchColor() { watchColor() {
this.emitIndicator(); if (!this.addNew) {
this.emitIndicator();
}
} }
clickCancel() { clickCancel() {