diff --git a/core/core-frontend/src/locales/en.ts b/core/core-frontend/src/locales/en.ts index 838898a0bb..88772e14c3 100644 --- a/core/core-frontend/src/locales/en.ts +++ b/core/core-frontend/src/locales/en.ts @@ -1867,6 +1867,13 @@ Scatter chart (bubble) chart: {a} (series name), {b} (data name), {c} (value arr export_raw_details: 'Raw Details', field_is_empty_export_error: 'No fields available, unable to export', chart_symbolic_map: 'Symbolic map', + symbolic: 'Symbolic', + symbolic_shape: 'Symbolic Shape', + symbolic_upload_hint: 'Supports SVG, JPG, JPEG, PNG files within 1MB', + symbolic_range: 'Range', + symbolic_error_icon: 'Please select the correct icon file!', + symbolic_error_size: 'The file size cannot exceed 1MB!', + symbolic_error_range: 'The second range value must be greater than the first range value', chart_stock_line: 'K line', liquid_condition_style_tips: `Condition style settings, determine water wave chart interval colors, leave blank to disable thresholds, range (0-100), incremental levels
Example: input 30,70; this means: divided into 3 segments, namely [0,30], [30,70], [70,100]`, conversion_rate: 'Conversion rate', diff --git a/core/core-frontend/src/locales/tw.ts b/core/core-frontend/src/locales/tw.ts index 337bdcc971..4310a7508e 100644 --- a/core/core-frontend/src/locales/tw.ts +++ b/core/core-frontend/src/locales/tw.ts @@ -1827,6 +1827,13 @@ export default { export_raw_details: '導出原始明細', field_is_empty_export_error: '目前無欄位,無法匯出', chart_symbolic_map: '符號地圖', + symbolic: '符號', + symbolic_shape: '符號形狀', + symbolic_upload_hint: '支持 1MB 以內的 SVG, JPG, JPEG, PNG 文件', + symbolic_range: '區間', + symbolic_error_icon: '請選擇正確的圖標文件!', + symbolic_error_size: '文件大小不能超過 1MB!', + symbolic_error_range: '第二個區間值必須大于第一個區間值', chart_stock_line: 'K 線圖', liquid_condition_style_tips: `條件樣式設定,決定水波圖區間顏色,為空則不啟用閾值,範圍(0-100),逐級遞增
例如:輸入 30,70;表示:分為3段,分別為[0,30],[30,70],[70,100]`, conversion_rate: '轉換率', diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 523ec4e8e3..fdead27394 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -1829,6 +1829,13 @@ export default { export_raw_details: '导出原始明细', field_is_empty_export_error: '当前无字段,无法导出', chart_symbolic_map: '符号地图', + symbolic: '符号', + symbolic_shape: '符号形状', + symbolic_upload_hint: '支持 1MB 以内的 SVG, JPG, JPEG, PNG 文件', + symbolic_range: '区间', + symbolic_error_icon: '请选择正确的图标文件!', + symbolic_error_size: '文件大小不能超过 1MB!', + symbolic_error_range: '第二个区间值必须大于第一个区间值', chart_stock_line: 'K 线图', liquid_condition_style_tips: `条件样式设置,决定水波图颜色,为空则不开启阈值,范围(0-100),逐级递增
例如:输入 30,70;表示:分为3段,分别为[0,30],[30,70],[70,100]`, conversion_rate: '转化率', diff --git a/core/core-frontend/src/models/chart/editor.d.ts b/core/core-frontend/src/models/chart/editor.d.ts index d37556b4fa..308aad1cb4 100644 --- a/core/core-frontend/src/models/chart/editor.d.ts +++ b/core/core-frontend/src/models/chart/editor.d.ts @@ -2,6 +2,7 @@ declare type EditorProperty = | 'background-overall-component' | 'border-style' | 'basic-style-selector' + | 'symbolic-style-selector' | 'dual-basic-style-selector' | 'label-selector' | 'tooltip-selector' diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue index 72afb6d013..e96b5ca190 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue @@ -14,6 +14,7 @@ import { storeToRefs } from 'pinia' import CollapseSwitchItem from '@/components/collapse-switch-item/src/CollapseSwitchItem.vue' import { ElCollapse, ElCollapseItem } from 'element-plus-secondary' import BasicStyleSelector from '@/views/chart/components/editor/editor-style/components/BasicStyleSelector.vue' +import SymbolicStyleSelector from '@/views/chart/components/editor/editor-style/components/SymbolicStyleSelector.vue' import DualBasicStyleSelector from '@/views/chart/components/editor/editor-style/components/DualBasicStyleSelector.vue' import ComponentPosition from '@/components/visualization/common/ComponentPosition.vue' import BackgroundOverallCommon from '@/components/visualization/component-background/BackgroundOverallCommon.vue' @@ -363,6 +364,22 @@ watch( @onStyleAttrChange="onStyleAttrChange" > + + + + + { - const rawFile = uploadFile.raw - let validIcon = true - if (!acceptedFileType.includes(rawFile.type)) { - ElMessage.error('请选择正确的图标文件!') - validIcon = false - } - if (rawFile.size / 1024 / 1024 > 1) { - ElMessage.error('文件大小不能超过 1MB!') - validIcon = false - } - if (!validIcon) { - iconUpload.value?.clearFiles() - state.fileList.splice(0) - const customIcon = state.basicStyleForm.customIcon - if (customIcon) { - let file = '' - // 图片 - if (customIcon.startsWith('data')) { - file = customIcon - } else { - // svg - file = svgStrToUrl(customIcon) - } - file && (state.fileList[0] = { url: file }) - } - } else { - if (rawFile.type === 'image/svg+xml') { - state.basicStyleForm.customIcon = await rawFile.text() - changeBasicStyle('customIcon') - } else { - const fileReader = new FileReader() - fileReader.onloadend = () => { - state.basicStyleForm.customIcon = fileReader.result as string - changeBasicStyle('customIcon') - } - fileReader.readAsDataURL(rawFile) - } - } -} - -const changeMapSymbol = () => { - const { mapSymbol, customIcon } = state.basicStyleForm - if (mapSymbol === 'custom' && customIcon) { - let file - if (customIcon.startsWith('data')) { - file = customIcon - } else { - file = svgStrToUrl(state.basicStyleForm.customIcon) - } - file && (state.fileList[0] = { url: file }) - } - changeBasicStyle('mapSymbol') -} - -const customSymbolicMapSizeRange = computed(() => { - let { extBubble } = JSON.parse(JSON.stringify(props.chart)) - return ['symbolic-map'].includes(props.chart.type) && extBubble?.length > 0 -}) -const mapCustomRangeValidate = prop => { - const { mapSymbolSizeMax = '0', mapSymbolSizeMin = '1' } = state.basicStyleForm - let max = parseInt(mapSymbolSizeMax) - let min = parseInt(mapSymbolSizeMin) - state.basicStyleForm.mapSymbolSizeMin = Math.max(min, 0) - state.basicStyleForm.mapSymbolSizeMax = Math.max(max, 1) - if (max < min) { - ElMessage.warning('第二个区间值必须大于第一个区间值') - return - } - changeBasicStyle(prop) -} /** * 表格是否合并单元格 */ @@ -571,154 +488,7 @@ onMounted(() => { -
- - - - - - - - - - - - - -
- - - -
-
-
-
-
- - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - -
-
- - - - - - - - -
-
+ diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/SymbolicStyleSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/SymbolicStyleSelector.vue new file mode 100644 index 0000000000..9e32eac0f9 --- /dev/null +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/SymbolicStyleSelector.vue @@ -0,0 +1,320 @@ + + + + + diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts index 99754aa4ce..b3149db75a 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts @@ -25,6 +25,7 @@ export class SymbolicMap extends L7ChartView { 'background-overall-component', 'border-style', 'basic-style-selector', + 'symbolic-style-selector', 'title-selector', 'label-selector', 'tooltip-selector' @@ -35,13 +36,13 @@ export class SymbolicMap extends L7ChartView { 'colors', 'alpha', 'mapBaseStyle', - 'symbolicMapStyle', 'zoom', 'showLabel', 'autoFit', 'mapCenter', 'zoomLevel' ], + 'symbolic-style-selector': ['symbolicMapStyle'], 'label-selector': ['color', 'fontSize', 'showFields', 'customContent'], 'tooltip-selector': [ 'color',