fix:时序图option从config中获取
This commit is contained in:
@@ -182,18 +182,11 @@ export default {
|
||||
this.legends = []
|
||||
this.series = chartOption.series = this.handleTimeSeries(this.chartInfo, chartOption.series[0], this.chartData) // 生成series和legends
|
||||
|
||||
const styleOption = this.$lodash.get(this.chartInfo, 'param.option', {})
|
||||
chartOption.series.forEach(item => {
|
||||
if (item.lineStyle && styleOption.lineWidth != undefined) {
|
||||
item.lineStyle.width = styleOption.lineWidth
|
||||
} else if (item.lineStyle) {
|
||||
if (item.lineStyle) {
|
||||
item.lineStyle.width = this.lineOption.lineWidth
|
||||
}
|
||||
if (styleOption.pointSize != undefined) {
|
||||
item.symbolSize = styleOption.pointSize
|
||||
} else {
|
||||
item.symbolSize = this.lineOption.pointSize
|
||||
}
|
||||
})
|
||||
|
||||
this.isGrey = this.legends.map(() => false)
|
||||
|
||||
@@ -256,7 +256,6 @@ export default {
|
||||
mode: 'all',
|
||||
sort: 'none'
|
||||
},
|
||||
option: undefined
|
||||
},
|
||||
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1, orderNum: 0 }],
|
||||
panel: '',
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<div @click="download('pdf')">{{$t('notebook.downloadAs',{format:'PDF'})}}</div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-has="'notebook_view'">
|
||||
<div @click="download('html')">{{$t('notebook.downloadAs',{format:'markdown'})}}</div>
|
||||
<div @click="download('markdown')">{{$t('notebook.downloadAs',{format:'markdown'})}}</div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-has="'notebook_view'">
|
||||
<div @click="downloadJson()">{{$t('notebook.downloadNotebook')}} JSON</div>
|
||||
|
||||
@@ -403,44 +403,6 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<!-- option -->
|
||||
<div v-if="isTimeSeries(chartConfig.type)">
|
||||
<div class="form__sub-title">
|
||||
<span>{{$t('dashboard.dashboard.chartForm.option')}}</span>
|
||||
</div>
|
||||
<div
|
||||
class="form-items--half-width-group"
|
||||
>
|
||||
<!--lineWidth-->
|
||||
<el-form-item
|
||||
v-if="chartConfig.type!=='point'"
|
||||
:label="$t('dashboard.dashboard.chartForm.lineWidth')"
|
||||
class="form-item--half-width"
|
||||
prop="param.option.lineWidth"
|
||||
>
|
||||
<el-input-number
|
||||
size="small"
|
||||
:controls="false"
|
||||
@change="change"
|
||||
show-word-limit
|
||||
v-model="chartConfig.param.option.lineWidth"/>
|
||||
</el-form-item>
|
||||
<!--pointSize-->
|
||||
<el-form-item
|
||||
:label="$t('dashboard.dashboard.chartForm.pointSize')"
|
||||
class="form-item--half-width"
|
||||
prop="param.option.pointSize"
|
||||
>
|
||||
<el-input-number
|
||||
size="small"
|
||||
:controls="false"
|
||||
@change="change"
|
||||
show-word-limit
|
||||
v-model="chartConfig.param.option.pointSize"/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right Y Axis -->
|
||||
<div v-if="isTimeSeries(chartConfig.type)">
|
||||
<div class="form__sub-title">
|
||||
@@ -1356,9 +1318,6 @@ export default {
|
||||
computed: {
|
||||
minStep () {
|
||||
return this.nzDefaultConfig.minStep
|
||||
},
|
||||
lineOption () {
|
||||
return this.nzDefaultConfig.option
|
||||
}
|
||||
},
|
||||
data () {
|
||||
@@ -1459,8 +1418,7 @@ export default {
|
||||
tooltip: {
|
||||
mode: 'all',
|
||||
sort: 'none'
|
||||
},
|
||||
option: this.lineOption
|
||||
}
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.chartConfig.param.thresholds.push({ value: undefined, color: randomcolor() })
|
||||
|
||||
@@ -175,9 +175,6 @@ export default {
|
||||
panelChart
|
||||
},
|
||||
computed: {
|
||||
lineOption () {
|
||||
return this.nzDefaultConfig.option
|
||||
},
|
||||
chartLastPosition () {
|
||||
return this.$store.getters.getChartLastPosition
|
||||
},
|
||||
@@ -418,8 +415,7 @@ export default {
|
||||
tooltip: {
|
||||
mode: 'all',
|
||||
sort: 'none'
|
||||
},
|
||||
option: this.lineOption
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -462,8 +458,7 @@ export default {
|
||||
tooltip: {
|
||||
mode: 'all',
|
||||
sort: 'none'
|
||||
},
|
||||
option: this.lineOption
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -694,8 +689,11 @@ export default {
|
||||
max: undefined
|
||||
}
|
||||
}
|
||||
if (!obj.param.option) {
|
||||
obj.param.option = this.lineOption
|
||||
if (!obj.param.tooltip || !obj.param.tooltip.mode) {
|
||||
obj.param.tooltip = {
|
||||
mode: 'all',
|
||||
sort: 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
if (obj.type == 'table') {
|
||||
@@ -731,12 +729,6 @@ export default {
|
||||
delete item.chartId
|
||||
})
|
||||
}
|
||||
if (obj.param && (!obj.param.tooltip || !obj.param.tooltip.mode)) {
|
||||
obj.param.tooltip = {
|
||||
mode: 'all',
|
||||
sort: 'none'
|
||||
}
|
||||
}
|
||||
this.editChart = this.$lodash.cloneDeep(obj)
|
||||
this.oldData = this.$lodash.cloneDeep(obj)
|
||||
if (this.stableTime) {
|
||||
|
||||
@@ -272,7 +272,6 @@ export default {
|
||||
mode: 'all',
|
||||
sort: 'none'
|
||||
},
|
||||
option: undefined
|
||||
},
|
||||
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1, orderNum: 0, step: undefined }],
|
||||
panel: '',
|
||||
|
||||
Reference in New Issue
Block a user