forked from github/dataease
Merge pull request #11492 from dataease/pr@dev-v2@feat_dataset-params
feat(仪表板): 数据集计算字段支持设置参数
This commit is contained in:
commit
b23c0d5651
@ -1192,9 +1192,20 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
setViewDataDetails(viewId, chartDataInfo) {
|
setViewDataDetails(viewId, chartDataInfo) {
|
||||||
this.canvasViewDataInfo[viewId] = chartDataInfo.data
|
this.canvasViewDataInfo[viewId] = chartDataInfo.data
|
||||||
const viewInfo = this.canvasViewInfo[viewId]
|
const viewInfo = this.canvasViewInfo[viewId]
|
||||||
if (viewInfo.tableId !== chartDataInfo.tableId) {
|
const oldCalParams = viewInfo.calParams
|
||||||
this.canvasViewInfo[viewId]['calcParams'] = chartDataInfo.calcParams || null
|
? viewInfo.calParams.reduce((map, params) => {
|
||||||
|
map[params.id] = params.value
|
||||||
|
return map
|
||||||
|
}, {})
|
||||||
|
: {}
|
||||||
|
if (chartDataInfo.calParams) {
|
||||||
|
chartDataInfo.calParams.forEach(paramsItem => {
|
||||||
|
if (oldCalParams[paramsItem.id]) {
|
||||||
|
paramsItem.value = oldCalParams[paramsItem.id]
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.canvasViewInfo[viewId]['calParams'] = chartDataInfo.calParams || null
|
||||||
},
|
},
|
||||||
getViewDataDetails(viewId) {
|
getViewDataDetails(viewId) {
|
||||||
return this.canvasViewDataInfo[viewId]
|
return this.canvasViewDataInfo[viewId]
|
||||||
|
Loading…
Reference in New Issue
Block a user