diff --git a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue
index b3af403303..eb7e036a7b 100644
--- a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue
+++ b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue
@@ -45,6 +45,7 @@ import DragInfo from '@/components/visualization/common/DragInfo.vue'
import { activeWatermark } from '@/components/watermark/watermark'
import { personInfoApi } from '@/api/user'
import PopArea from '@/custom-component/pop-area/Component.vue'
+import DatasetParamsComponent from '@/components/visualization/DatasetParamsComponent.vue'
const snapshotStore = snapshotStoreWithOut()
const dvMainStore = dvMainStoreWithOut()
@@ -203,6 +204,7 @@ const isShowArea = ref(false)
const svgFilterAttrs = ['width', 'height', 'top', 'left', 'rotate', 'backgroundColor']
const commonFilterAttrs = ['width', 'height', 'top', 'left', 'rotate']
const userViewEnlargeRef = ref(null)
+const customDatasetParamsRef = ref(null)
const linkJumpRef = ref(null)
const linkageRef = ref(null)
const mainDomId = ref('editor-' + canvasId.value)
@@ -1346,6 +1348,10 @@ const userViewEnlargeOpen = (opt, item) => {
)
}
+const datasetParamsInit = item => {
+ customDatasetParamsRef.value?.optInit(item)
+}
+
const initSnapshotTimer = () => {
snapshotTimer.value = setInterval(() => {
snapshotStore.snapshotCatchToStore()
@@ -1531,6 +1537,7 @@ defineExpose({
@onDragging="onDragging($event, item, index)"
@onResizing="onResizing($event, item, index)"
@userViewEnlargeOpen="userViewEnlargeOpen($event, item)"
+ @datasetParamsInit="datasetParamsInit(item)"
@linkJumpSetOpen="linkJumpSetOpen(item)"
@linkageSetOpen="linkageSetOpen(item)"
>
@@ -1596,6 +1603,7 @@ defineExpose({
+
diff --git a/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue b/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue
index dcb454b941..821e72d8e6 100644
--- a/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue
+++ b/core/core-frontend/src/components/data-visualization/canvas/ComponentWrapper.vue
@@ -90,7 +90,7 @@ const { config, showPosition, index, canvasStyleData, canvasViewInfo, dvInfo, se
toRefs(props)
let currentInstance
const component = ref(null)
-const emits = defineEmits(['userViewEnlargeOpen', 'onPointClick'])
+const emits = defineEmits(['userViewEnlargeOpen', 'datasetParamsInit', 'onPointClick'])
const htmlToImage = () => {
setTimeout(() => {
@@ -254,6 +254,7 @@ const deepScale = computed(() => scale.value / 100)
:show-position="showPosition"
:class="{ 'wrapper-edit-bar-active': active }"
@userViewEnlargeOpen="opt => emits('userViewEnlargeOpen', opt)"
+ @datasetParamsInit="() => emits('datasetParamsInit')"
>
+
diff --git a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue
index d6a8db35d5..5045976ceb 100644
--- a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue
+++ b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue
@@ -31,6 +31,7 @@
:show-position="showPosition"
:canvas-id="canvasId"
@userViewEnlargeOpen="userViewEnlargeOpen"
+ @datasetParamsInit="datasetParamsInit"
@linkJumpSetOpen="linkJumpSetOpen"
@linkageSetOpen="linkageSetOpen"
>
@@ -132,6 +133,7 @@ const {
const { editorMap, areaData, isCtrlOrCmdDown } = storeToRefs(composeStore)
const emit = defineEmits([
'userViewEnlargeOpen',
+ 'datasetParamsInit',
'onStartResize',
'onStartMove',
'onDragging',
@@ -324,6 +326,10 @@ const userViewEnlargeOpen = opt => {
emit('userViewEnlargeOpen', opt)
}
+const datasetParamsInit = opt => {
+ emit('datasetParamsInit', opt)
+}
+
const getPointStyle = point => {
let { width, height } = defaultStyle.value
const { sizeX, sizeY } = element.value
diff --git a/core/core-frontend/src/components/visualization/ComponentEditBar.vue b/core/core-frontend/src/components/visualization/ComponentEditBar.vue
index 5081780ba6..c6fd01997d 100644
--- a/core/core-frontend/src/components/visualization/ComponentEditBar.vue
+++ b/core/core-frontend/src/components/visualization/ComponentEditBar.vue
@@ -60,7 +60,7 @@
effect="dark"
placement="top"
content="输入计算数据"
- v-if="barShowCheck('datasetParams')"
+ v-if="barShowCheck('datasetParams') && datasetParamsSetShow"
>
@@ -199,6 +199,7 @@ import { ElMessage, ElTooltip, ElButton } from 'element-plus-secondary'
import CustomTabsSort from '@/custom-component/de-tabs/CustomTabsSort.vue'
import { exportPivotExcel } from '@/views/chart/components/js/panel/common/common_table'
import { XpackComponent } from '@/components/plugin'
+import DatasetParamsComponent from '@/components/visualization/DatasetParamsComponent.vue'
const dvMainStore = dvMainStoreWithOut()
const snapshotStore = snapshotStoreWithOut()
const copyStore = copyStoreWithOut()
@@ -206,6 +207,7 @@ const customTabsSortRef = ref(null)
const authShow = computed(() => !dvInfo.value.weight || dvInfo.value.weight > 3)
const emits = defineEmits([
'userViewEnlargeOpen',
+ 'datasetParamsInit',
'closePreview',
'showViewDetails',
'amRemoveItem',
@@ -434,6 +436,7 @@ const deleteComponent = () => {
const datasetParamsInit = () => {
// do init
+ emits('datasetParamsInit')
}
const copyComponent = () => {
@@ -562,6 +565,10 @@ const initCurFields = () => {
}
// 富文本-End
+const datasetParamsSetShow = computed(() => {
+ return canvasViewInfo.value[element.value.id]?.calParams?.length > 0
+})
+
onMounted(() => {
if (element.value.component === 'UserView') {
eventBus.on('initCurFields-' + element.value.id, initCurFields)
diff --git a/core/core-frontend/src/components/visualization/DatasetParamsComponent.vue b/core/core-frontend/src/components/visualization/DatasetParamsComponent.vue
index c2e1df39d0..d6676da614 100644
--- a/core/core-frontend/src/components/visualization/DatasetParamsComponent.vue
+++ b/core/core-frontend/src/components/visualization/DatasetParamsComponent.vue
@@ -1,29 +1,21 @@
-
+
-
+
-
+
diff --git a/core/core-frontend/src/custom-component/indicator/DeIndicator.vue b/core/core-frontend/src/custom-component/indicator/DeIndicator.vue
index 4e5778548a..7c7dc2fc53 100644
--- a/core/core-frontend/src/custom-component/indicator/DeIndicator.vue
+++ b/core/core-frontend/src/custom-component/indicator/DeIndicator.vue
@@ -361,7 +361,7 @@ const calcData = (view, callback) => {
chartData.value = res?.data as Partial
emit('onDrillFilters', res?.drillFilters)
- dvMainStore.setViewDataDetails(view.id, chartData.value)
+ dvMainStore.setViewDataDetails(view.id, res)
renderChart(res)
}
callback?.()
diff --git a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue
index 56d3458717..31f3f9b5e6 100644
--- a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue
+++ b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue
@@ -377,7 +377,7 @@ const calcData = (view: Chart, callback) => {
state.totalItems = res?.totalItems
const curViewInfo = canvasViewInfo.value[element.value.id]
curViewInfo['curFields'] = res.data.fields
- dvMainStore.setViewDataDetails(element.value.id, state.data)
+ dvMainStore.setViewDataDetails(element.value.id, res)
initReady.value = true
initCurFields(res)
}
@@ -398,7 +398,7 @@ const calcData = (view: Chart, callback) => {
state.totalItems = 0
const curViewInfo = canvasViewInfo.value[element.value.id]
curViewInfo['curFields'] = []
- dvMainStore.setViewDataDetails(element.value.id, state.data)
+ dvMainStore.setViewDataDetails(element.value.id, state.viewDataInfo)
initReady.value = true
initCurFields(curViewInfo)
callback?.()
diff --git a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts
index 1a1a159a76..12201c30eb 100644
--- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts
+++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts
@@ -1189,8 +1189,12 @@ export const dvMainStore = defineStore('dataVisualization', {
mobileLayout: false
}
},
- setViewDataDetails(viewId, dataInfo) {
- this.canvasViewDataInfo[viewId] = dataInfo
+ setViewDataDetails(viewId, chartDataInfo) {
+ this.canvasViewDataInfo[viewId] = chartDataInfo.data
+ const viewInfo = this.canvasViewInfo[viewId]
+ if (viewInfo.tableId !== chartDataInfo.tableId) {
+ this.canvasViewInfo[viewId]['calcParams'] = chartDataInfo.calcParams || null
+ }
},
getViewDataDetails(viewId) {
return this.canvasViewDataInfo[viewId]
diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue
index 855df7707b..801366ed29 100644
--- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue
+++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue
@@ -180,7 +180,7 @@ const calcData = async (view, callback) => {
dynamicAreaId.value = country.value + dynamicAreaId.value
}
}
- dvMainStore.setViewDataDetails(view.id, chartData.value)
+ dvMainStore.setViewDataDetails(view.id, res)
if (
!res.drill &&
!res.chartExtRequest?.filter?.length &&
diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue
index 3bb7de47d3..a30f2e6fab 100644
--- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue
+++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue
@@ -136,7 +136,7 @@ const calcData = (view: Chart, callback, resetPageInfo = true) => {
} else {
chartData.value = res?.data as Partial
state.totalItems = res?.totalItems
- dvMainStore.setViewDataDetails(view.id, chartData.value)
+ dvMainStore.setViewDataDetails(view.id, res)
emit('onDrillFilters', res?.drillFilters)
renderChart(res as unknown as Chart, resetPageInfo)
}