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 606c3df97d..86c91541ad 100644 --- a/core/core-frontend/src/components/icon-custom/src/Icon.vue +++ b/core/core-frontend/src/components/icon-custom/src/Icon.vue @@ -693,6 +693,9 @@ 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' +import pictureGroupDark from '@/assets/svg/picture-group-dark.svg' +import pictureGroupOrigin from '@/assets/svg/picture-group-origin.svg' +import pictureGroup from '@/assets/svg/picture-group.svg' const iconMap = { '401': _401, icon_link_calculated_outlined, @@ -1384,7 +1387,10 @@ const iconMap = { clock, 't-heatmap': tHeatmap, 't-heatmap-dark': tHeatmapDark, - 't-heatmap-origin': tHeatmapOrigin + 't-heatmap-origin': tHeatmapOrigin, + 'picture-group': pictureGroup, + 'picture-group-dark': pictureGroupDark, + 'picture-group-origin': pictureGroupOrigin } const props = defineProps({ diff --git a/core/core-frontend/src/custom-component/picture-group/Attr.vue b/core/core-frontend/src/custom-component/picture-group/Attr.vue new file mode 100644 index 0000000000..57855165be --- /dev/null +++ b/core/core-frontend/src/custom-component/picture-group/Attr.vue @@ -0,0 +1,357 @@ + + + + + { + e.target.value = '' + } + " + @change="reUpload" + /> + + + + + + + + + + + + + 支持JPG、PNG、GIF、SVG + + + + 重新上传 + + + + + + 适应组件 + 原始尺寸 + 等比适应 + + + + + + + + + diff --git a/core/core-frontend/src/custom-component/picture-group/Component.vue b/core/core-frontend/src/custom-component/picture-group/Component.vue new file mode 100644 index 0000000000..2ca938e064 --- /dev/null +++ b/core/core-frontend/src/custom-component/picture-group/Component.vue @@ -0,0 +1,90 @@ + + + + + 请上传图片... + + + + + + + diff --git a/core/core-frontend/src/utils/components.ts b/core/core-frontend/src/utils/components.ts index 077835fca1..3d35be10a9 100644 --- a/core/core-frontend/src/utils/components.ts +++ b/core/core-frontend/src/utils/components.ts @@ -35,6 +35,8 @@ import ScrollText from '@/custom-component/scroll-text/Component.vue' import ScrollTextAttr from '@/custom-component/scroll-text/Attr.vue' import PopArea from '@/custom-component/pop-area/Component.vue' import PopAreaAttr from '@/custom-component/pop-area/Attr.vue' +import PictureGroup from '@/custom-component/picture-group/Component.vue' +import PictureGroupAttr from '@/custom-component/picture-group/Attr.vue' export const componentsMap = { VText: VText, VQuery, @@ -72,7 +74,9 @@ export const componentsMap = { ScrollText: ScrollText, ScrollTextAttr: ScrollTextAttr, PopArea: PopArea, - PopAreaAttr: PopAreaAttr + PopAreaAttr: PopAreaAttr, + PictureGroup: PictureGroup, + PictureGroupAttr: PictureGroupAttr } export default function findComponent(key) { diff --git a/core/core-frontend/src/views/chart/components/editor/util/chart.ts b/core/core-frontend/src/views/chart/components/editor/util/chart.ts index 3fd8b6c68e..4cd09393a7 100644 --- a/core/core-frontend/src/views/chart/components/editor/util/chart.ts +++ b/core/core-frontend/src/views/chart/components/editor/util/chart.ts @@ -1508,14 +1508,14 @@ export const CHART_TYPE_CONFIGS = [ }, { category: 'other', - title: '图片', + title: '图片组', display: 'hidden', details: [ { render: 'custom', category: 'quota', - value: 'Picture', - title: '图片', + value: 'picture-group', + title: '图片图', icon: 'picture' } ] diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/Picture.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/Picture.ts deleted file mode 100644 index 472638090b..0000000000 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/Picture.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { AbstractChartView, ChartLibraryType, ChartRenderType } from '../../types' -import { useI18n } from '@/hooks/web/useI18n' - -const { t } = useI18n() -/** - * 富文本图表 - */ -export class PictureChartView extends AbstractChartView { - properties: EditorProperty[] = ['background-overall-component', 'border-style'] - propertyInner: EditorPropertyInner = { - 'background-overall-component': ['all'], - 'border-style': ['all'] - } - axis: AxisType[] = ['filter'] - axisConfig: AxisConfig = {} - constructor() { - super(ChartRenderType.CUSTOM, ChartLibraryType.PICTURE, 'Picture') - } -} diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/picture-group.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/picture-group.ts new file mode 100644 index 0000000000..0679e1e868 --- /dev/null +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/picture-group.ts @@ -0,0 +1,35 @@ +import { AbstractChartView, ChartLibraryType, ChartRenderType } from '../../types' +import { useI18n } from '@/hooks/web/useI18n' + +const { t } = useI18n() +/** + * 图片组图表 + */ +export class PictureGroupView extends AbstractChartView { + properties: EditorProperty[] = [ + 'background-overall-component', + 'border-style', + 'threshold', + 'function-cfg' + ] + propertyInner: EditorPropertyInner = { + 'background-overall-component': ['all'], + 'border-style': ['all'], + threshold: ['tableThreshold'], + 'function-cfg': ['emptyDataStrategy'] + } + axis: AxisType[] = ['xAxis', 'yAxis', 'filter'] + axisConfig: AxisConfig = { + xAxis: { + name: `${t('chart.dimension')}`, + type: 'd' + }, + yAxis: { + name: `${t('chart.quota')}`, + type: 'q' + } + } + constructor() { + super(ChartRenderType.CUSTOM, ChartLibraryType.PICTURE_GROUP, 'picture-group') + } +} diff --git a/core/core-frontend/src/views/chart/components/js/panel/types/index.ts b/core/core-frontend/src/views/chart/components/js/panel/types/index.ts index bb84e11bd6..89b29f4d11 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/types/index.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/types/index.ts @@ -15,7 +15,7 @@ export enum ChartLibraryType { ECHARTS = 'echarts', S2 = 's2', RICH_TEXT = 'rich-text', - PICTURE = 'Picture', + PICTURE_GROUP = 'picture_group', INDICATOR = 'indicator' } export abstract class ChartWrapper { diff --git a/core/core-frontend/src/views/chart/components/views/index.vue b/core/core-frontend/src/views/chart/components/views/index.vue index 6d790aca12..7e437cb2ae 100644 --- a/core/core-frontend/src/views/chart/components/views/index.vue +++ b/core/core-frontend/src/views/chart/components/views/index.vue @@ -43,7 +43,7 @@ import { storeToRefs } from 'pinia' import { checkAddHttp, setIdValueTrans } from '@/utils/canvasUtils' import { Base64 } from 'js-base64' import DeRichTextView from '@/custom-component/rich-text/DeRichTextView.vue' -import DePictureV2 from '@/custom-component/picture/Component.vue' +import DePictureGroup from '@/custom-component/picture-group/component.vue' import ChartEmptyInfo from '@/views/chart/components/views/components/ChartEmptyInfo.vue' import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot' import { viewFieldTimeTrans } from '@/utils/viewUtils' @@ -897,11 +897,15 @@ const loadPluginCategory = data => { @onJumpClick="jumpClick" @resetLoading="() => (loading = false)" /> - + :active="active" + :show-position="showPosition" + > +