Fix chart display element options not saving on create
This commit is contained in:
parent
03e194ffb6
commit
46cb048be2
@ -1,7 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div>
|
||||||
v-if="options"
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
class="mb-3"
|
class="mb-3"
|
||||||
>
|
>
|
||||||
@ -16,7 +14,7 @@
|
|||||||
label-class="text-primary"
|
label-class="text-primary"
|
||||||
>
|
>
|
||||||
<b-form-select
|
<b-form-select
|
||||||
v-model="options.type"
|
:value="displayElementOptions.type"
|
||||||
:options="chartTypes"
|
:options="chartTypes"
|
||||||
@change="typeChanged"
|
@change="typeChanged"
|
||||||
/>
|
/>
|
||||||
@ -445,8 +443,8 @@ export default {
|
|||||||
this.options.colorScheme = (colorscheme || {}).value || ''
|
this.options.colorScheme = (colorscheme || {}).value || ''
|
||||||
},
|
},
|
||||||
|
|
||||||
typeChanged () {
|
typeChanged (type) {
|
||||||
this.options = reporter.ChartOptionsMaker(this.options) || {}
|
this.options = reporter.ChartOptionsMaker({ ...this.options, type })
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -546,12 +546,12 @@ export default {
|
|||||||
|
|
||||||
currentDisplayElement: {
|
currentDisplayElement: {
|
||||||
get () {
|
get () {
|
||||||
return this.displayElements.currentIndex !== undefined ? this.currentDisplayElements[this.displayElements.currentIndex] : undefined
|
return this.displayElements.currentIndex !== undefined ? this.currentBlock.elements[this.displayElements.currentIndex] : undefined
|
||||||
},
|
},
|
||||||
|
|
||||||
set (element) {
|
set (element) {
|
||||||
if (this.displayElements.currentIndex !== undefined) {
|
if (this.displayElements.currentIndex !== undefined) {
|
||||||
this.currentDisplayElements[this.displayElements.currentIndex] = element
|
this.currentBlock.elements.splice(this.displayElements.currentIndex, 1, element)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user