diff --git a/core/core-frontend/src/components/visualization/OuterParamsSet.vue b/core/core-frontend/src/components/visualization/OuterParamsSet.vue index fa9f0868f2..68f820b335 100644 --- a/core/core-frontend/src/components/visualization/OuterParamsSet.vue +++ b/core/core-frontend/src/components/visualization/OuterParamsSet.vue @@ -71,9 +71,9 @@ 选择参数关联组件 - +
-
+
@@ -95,7 +95,7 @@
- {{ baseFilter.label }} + {{ findFilterName(baseFilter.id) }}
- +
-
+
@@ -131,7 +131,7 @@
图表
关联字段或参数
-
+
-
- - - +
+
+ + + +
-
- - - +
+
+ + + +
{{ baseDatasetInfo.name }}
@@ -177,27 +184,38 @@
-
- 选择关联的图表 - 全选 +
+
选择关联的图表
+
+
+ 全选 +
- - +
+ +
+
+ +
{{ viewInfo.chartName }}
@@ -372,6 +390,18 @@ const initParams = async () => { getPanelViewList(dvInfo.value.id) } +const datasetInfoChange = datasetInfo => { + let viewCheckCount = 0 + datasetInfo.datasetViews.forEach(dsView => { + if (dsView['checked']) { + viewCheckCount++ + } + }) + datasetInfo['checkAll'] = viewCheckCount === datasetInfo.datasetViews.length + datasetInfo['checkAllIsIndeterminate'] = + viewCheckCount > 0 && viewCheckCount < datasetInfo.datasetViews.length +} + const paramsCheckedAdaptor = (outerParamsInfo, newBaseFilterInfo, newBaseDatasetInfo) => { const dsFieldIdSelected = {} const viewMatchIds = [] @@ -414,14 +444,36 @@ const cancel = () => { } const save = () => { - if (checkArrayRepeat(state.outerParams.outerParamsInfoArray, 'paramName')) { - ElMessage.warning({ - message: t('visualization.repeat_params'), - showClose: true + const outerParamsCopy = deepCopy(state.outerParams) + console.log('targetViewInfoList0==' + outerParamsCopy) + outerParamsCopy.outerParamsInfoArray?.forEach(outerParamsInfo => { + outerParamsInfo.targetViewInfoList = [] + outerParamsInfo.filterInfo?.forEach(baseFilterInfo => { + // 存在过滤器选项被选 + if (baseFilterInfo.filterSelected) { + outerParamsInfo.targetViewInfoList.push({ + targetViewId: baseFilterInfo.filterSelected, + targetDsId: baseFilterInfo.id, + targetFieldId: 'empty' + }) + } }) - return - } - updateOuterParamsSet(state.outerParams).then(() => { + console.log('targetViewInfoList1==' + outerParamsInfo.targetViewInfoList) + outerParamsInfo.datasetInfo?.forEach(baseDatasetInfo => { + // 存在数据集字段被选中 + if (baseDatasetInfo.fieldIdSelected) { + baseDatasetInfo.datasetViews?.forEach(dsView => { + outerParamsInfo.targetViewInfoList.push({ + targetViewId: dsView.chartId, + targetDsId: baseDatasetInfo.id, + targetFieldId: baseDatasetInfo.fieldIdSelected + }) + }) + } + }) + console.log('targetViewInfoList2==' + outerParamsInfo.targetViewInfoList) + }) + updateOuterParamsSet(outerParamsCopy).then(() => { ElMessage({ message: t('commons.save_success'), type: 'success', @@ -501,6 +553,9 @@ const addOuterParamsInfo = () => { state.outerParams.checked = true const outerParamsInfo = deepCopy(state.defaultOuterParamsInfo) outerParamsInfo['paramsInfoId'] = generateID() + const newBaseFilterInfo = deepCopy(state.baseFilterInfo) + const newBaseDatasetInfo = deepCopy(state.baseDatasetInfo) + paramsCheckedAdaptor(outerParamsInfo, newBaseFilterInfo, newBaseDatasetInfo) state.outerParamsInfoArray.push(outerParamsInfo) state.mapOuterParamsInfoArray[outerParamsInfo.paramsInfoId] = outerParamsInfo curEditDataId.value = outerParamsInfo['paramsInfoId'] @@ -530,6 +585,10 @@ const optInit = () => { initParams() } +const findFilterName = id => { + return dvMainStore.canvasViewInfo[id]?.title +} + defineExpose({ optInit }) @@ -602,6 +661,8 @@ defineExpose({ .preview-show { border-left: 1px solid #e6e6e6; background-size: 100% 100% !important; + height: 100%; + overflow-y: auto; } .view-type-icon { @@ -650,6 +711,11 @@ defineExpose({ width: 100%; } +.outer-dataset-content { + width: 100%; + padding-left: 16px; +} + .inner-filter-content { width: 100%; margin-top: 12px; @@ -794,6 +860,7 @@ defineExpose({ height: 16px; border-radius: 4px; padding: 0px 1px; + color: rgba(100, 106, 115, 1); &:hover { background: rgba(31, 35, 41, 0.1); cursor: pointer; @@ -801,10 +868,23 @@ defineExpose({ } .ds-view-content { - width: 100%; + width: calc(100% - 16px); border-radius: 4px; - margin-top: 8px; + margin: 8px 16px 0 16px; padding: 12px; background: rgba(245, 246, 247, 1); } + +.ds-content-title { + font-size: 14px; + font-weight: 500; + color: rgba(100, 106, 115, 1); +} + +.custom-view-diver { + width: 1px; + margin: 4px 4px; + height: 14px; + background: rgba(31, 35, 41, 0.15); +}