diff --git a/core/core-frontend/src/assets/svg/t-heatmap-dark.svg b/core/core-frontend/src/assets/svg/t-heatmap-dark.svg new file mode 100644 index 0000000000..0e550c0c4b --- /dev/null +++ b/core/core-frontend/src/assets/svg/t-heatmap-dark.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/core/core-frontend/src/assets/svg/t-heatmap-origin.svg b/core/core-frontend/src/assets/svg/t-heatmap-origin.svg new file mode 100644 index 0000000000..a19b1d00ed --- /dev/null +++ b/core/core-frontend/src/assets/svg/t-heatmap-origin.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/core/core-frontend/src/assets/svg/t-heatmap.svg b/core/core-frontend/src/assets/svg/t-heatmap.svg new file mode 100644 index 0000000000..b6c865615f --- /dev/null +++ b/core/core-frontend/src/assets/svg/t-heatmap.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + 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 6d41a1aa60..436510023e 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue @@ -316,7 +316,8 @@ const boardMoveActive = computed(() => { 'table-normal', 'table-pivot', 'symbolic-map', - 'heat-map' + 'heat-map', + 't-heatmap' ] return element.value.isPlugin || CHARTS.includes(element.value.innerType) }) diff --git a/core/core-frontend/src/components/icon-custom/src/Icon.vue b/core/core-frontend/src/components/icon-custom/src/Icon.vue index c476fd042e..9558839098 100644 --- a/core/core-frontend/src/components/icon-custom/src/Icon.vue +++ b/core/core-frontend/src/components/icon-custom/src/Icon.vue @@ -679,6 +679,9 @@ import icon_single_line_outlined from '@/assets/svg/icon_single-line_outlined.sv import icon_todo_outlined from '@/assets/svg/icon_todo_outlined.svg' import icon_file_doc_colorful from '@/assets/svg/icon_file-doc_colorful.svg' import icon_font from '@/assets/svg/icon_font.svg' +import tHeatmap from '@/assets/svg/t-heatmap.svg' +import tHeatmapDark from '@/assets/svg/t-heatmap-dark.svg' +import tHeatmapOrigin from '@/assets/svg/t-heatmap-origin.svg' const iconMap = { '401': _401, icon_adjustment_outlined, @@ -1356,7 +1359,10 @@ const iconMap = { calculate, 'icon_file-doc_colorful': icon_file_doc_colorful, icon_font, - clock + clock, + 't-heatmap': tHeatmap, + 't-heatmap-dark': tHeatmapDark, + 't-heatmap-origin': tHeatmapOrigin } const props = defineProps({ diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index a00d722c6a..449b1651e9 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -1116,6 +1116,7 @@ export default { table_column_fixed: '固定列宽', table_column_custom: '自定义', chart_table_pivot: '透视表', + chart_table_heatmap: '热力图', table_pivot_row: '数据行', field_error_tips: '该字段所对应的数据集原始字段发生变更(包括维度、指标,字段类型,字段被删除等),建议重新编辑', diff --git a/core/core-frontend/src/models/chart/chart.d.ts b/core/core-frontend/src/models/chart/chart.d.ts index 2dff80aff4..0365d5f5f0 100644 --- a/core/core-frontend/src/models/chart/chart.d.ts +++ b/core/core-frontend/src/models/chart/chart.d.ts @@ -68,6 +68,8 @@ declare interface Chart { flowMapStartName?: Axis[] flowMapEndName?: Axis[] showPosition: string + + extColor: Axis[] } declare type CustomAttr = DeepPartial | JSONString> declare type CustomStyle = DeepPartial | JSONString> diff --git a/core/core-frontend/src/models/chart/editor.d.ts b/core/core-frontend/src/models/chart/editor.d.ts index 72186e22dc..b2e21a1170 100644 --- a/core/core-frontend/src/models/chart/editor.d.ts +++ b/core/core-frontend/src/models/chart/editor.d.ts @@ -57,7 +57,7 @@ declare type AxisType = | 'area' | 'flowMapStartName' | 'flowMapEndName' - | 'flowMapColor' + | 'extColor' /** * 轴配置 */ diff --git a/core/core-frontend/src/views/chart/components/editor/filter/auth-tree/RowAuth.vue b/core/core-frontend/src/views/chart/components/editor/filter/auth-tree/RowAuth.vue index d969d385d4..62b70de1f6 100644 --- a/core/core-frontend/src/views/chart/components/editor/filter/auth-tree/RowAuth.vue +++ b/core/core-frontend/src/views/chart/components/editor/filter/auth-tree/RowAuth.vue @@ -144,7 +144,7 @@ const getTimeValue = dynamicTimeSetting => { label: '年初', value: 'yearBeginning' } - ].find(ele => ele.value === relativeToCurrent).label + ].find(ele => ele.value === relativeToCurrent)?.label return timeValue } timeValue = `${timeNum}${relativeToCurrentTypeMap[relativeToCurrentType]}${ diff --git a/core/core-frontend/src/views/chart/components/editor/index.vue b/core/core-frontend/src/views/chart/components/editor/index.vue index e1e958e836..b88c890b5c 100644 --- a/core/core-frontend/src/views/chart/components/editor/index.vue +++ b/core/core-frontend/src/views/chart/components/editor/index.vue @@ -413,6 +413,8 @@ const dimensionItemRemove = item => { view.value.flowMapStartName.splice(item.index, 1) } else if (item.removeType === 'flowMapEndName') { view.value.flowMapEndName.splice(item.index, 1) + } else if (item.removeType === 'extColor') { + view.value.extColor.splice(item.index, 1) } } @@ -524,7 +526,12 @@ const onCustomFlowMapEndNameSort = item => { customSortAxis.value = 'flowMapEndName' customSort() } - +const onCustomExtColorSort = item => { + recordSnapshotInfo('render') + state.customSortField = view.value.extColor[item.index] + customSortAxis.value = 'extColor' + customSort() +} const onMove = e => { recordSnapshotInfo('calcData') state.moveId = e.draggedContext.element.id @@ -798,6 +805,10 @@ const addFlowMapEndName = e => { addAxis(e, 'flowMapEndName') } +const addExtColor = e => { + addAxis(e, 'extColor') +} + const onAxisChange = (e, axis: AxisType) => { if (e.removed) { const { element } = e.removed @@ -1110,6 +1121,11 @@ const onChangeFlowMapPointForm = val => { renderChart(view.value) } +const onChangExtColorForm = val => { + view.value.extColor = val + renderChart(view.value) +} + const showRename = val => { recordSnapshotInfo('render') state.itemForm = JSON.parse(JSON.stringify(val)) @@ -1135,6 +1151,7 @@ const removeItems = ( | 'drillFields' | 'flowMapStartName' | 'flowMapEndName' + | 'extColor' ) => { recordSnapshotInfo('calcData') let axis = [] @@ -1170,6 +1187,9 @@ const removeItems = ( case 'flowMapEndName': axis = view.value.flowMapEndName?.splice(0) break + case 'extColor': + axis = view.value.extColor?.splice(0) + break } axis?.length && emitter.emit('removeAxis', { axisType: _type, axis, editType: 'remove' }) } @@ -1223,6 +1243,11 @@ const saveRename = ref => { axis = view.value.flowMapEndName[index] view.value.flowMapEndName[index].chartShowName = chartShowName break + case 'extColor': + axisType = 'extColor' + axis = view.value.extColor[index] + view.value.extColor[index].chartShowName = chartShowName + break default: break } @@ -2131,6 +2156,64 @@ const deleteChartFieldItem = id => { + +
+ + {{ chartViewInstance.axisConfig.extColor.name }} + + + + + + +
+
+ + + + +
+
+