From d570c17ef710ae29f1eefdd3367d50ae3a79b98b Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 18 Sep 2024 17:20:38 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=9B=BE=E7=89=87=E7=BB=84=E5=9B=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/StaticResourceServer.java | 5 - .../src/assets/svg/picture-group-dark.svg | 1 + .../src/assets/svg/picture-group-origin.svg | 1 + .../src/assets/svg/picture-group.svg | 1 + .../src/components/icon-group/chart-list.ts | 4 +- .../src/custom-component/component-list.ts | 2 +- .../custom-component/picture-group/Attr.vue | 180 +++--- .../picture-group/Component.vue | 179 +++++- .../src/models/chart/chart-senior.d.ts | 4 + .../editor/dataset-select/DatasetSelect.vue | 2 +- .../editor-senior/components/Threshold.vue | 72 ++- .../dialog/PictureGroupThresholdEdit.vue | 598 ++++++++++++++++++ .../editor/editor-style/ChartStyle.vue | 12 +- .../views/chart/components/editor/index.vue | 2 +- .../chart/components/editor/util/chart.ts | 21 +- .../js/panel/common/common_table.ts | 9 + .../chart/components/js/panel/types/index.ts | 2 +- .../views/chart/components/views/index.vue | 5 +- 18 files changed, 940 insertions(+), 160 deletions(-) create mode 100644 core/core-frontend/src/assets/svg/picture-group-dark.svg create mode 100644 core/core-frontend/src/assets/svg/picture-group-origin.svg create mode 100644 core/core-frontend/src/assets/svg/picture-group.svg create mode 100644 core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/PictureGroupThresholdEdit.vue diff --git a/core/core-backend/src/main/java/io/dataease/visualization/server/StaticResourceServer.java b/core/core-backend/src/main/java/io/dataease/visualization/server/StaticResourceServer.java index 20ed12e4f7..fa583af1cc 100644 --- a/core/core-backend/src/main/java/io/dataease/visualization/server/StaticResourceServer.java +++ b/core/core-backend/src/main/java/io/dataease/visualization/server/StaticResourceServer.java @@ -1,6 +1,5 @@ package io.dataease.visualization.server; - import io.dataease.api.visualization.StaticResourceApi; import io.dataease.api.visualization.request.StaticResourceRequest; import io.dataease.exception.DEException; @@ -17,13 +16,9 @@ import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import org.w3c.dom.Document; import org.xml.sax.SAXException; - -import javax.imageio.ImageIO; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import java.awt.image.BufferedImage; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; diff --git a/core/core-frontend/src/assets/svg/picture-group-dark.svg b/core/core-frontend/src/assets/svg/picture-group-dark.svg new file mode 100644 index 0000000000..087a800c6e --- /dev/null +++ b/core/core-frontend/src/assets/svg/picture-group-dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/core/core-frontend/src/assets/svg/picture-group-origin.svg b/core/core-frontend/src/assets/svg/picture-group-origin.svg new file mode 100644 index 0000000000..007ed92b1e --- /dev/null +++ b/core/core-frontend/src/assets/svg/picture-group-origin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/core/core-frontend/src/assets/svg/picture-group.svg b/core/core-frontend/src/assets/svg/picture-group.svg new file mode 100644 index 0000000000..087a800c6e --- /dev/null +++ b/core/core-frontend/src/assets/svg/picture-group.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/core/core-frontend/src/components/icon-group/chart-list.ts b/core/core-frontend/src/components/icon-group/chart-list.ts index 259e70e714..7ac375750f 100644 --- a/core/core-frontend/src/components/icon-group/chart-list.ts +++ b/core/core-frontend/src/components/icon-group/chart-list.ts @@ -41,6 +41,7 @@ import treemap from '@/assets/svg/treemap.svg' import waterfall from '@/assets/svg/waterfall.svg' import wordCloud from '@/assets/svg/word-cloud.svg' import tHeatmap from '@/assets/svg/t-heatmap.svg' +import pictureGroup from '@/assets/svg/picture-group.svg' const iconChartMap = { 'area-stack': areaStack, @@ -85,7 +86,8 @@ const iconChartMap = { treemap: treemap, waterfall: waterfall, 'word-cloud': wordCloud, - 't-heatmap': tHeatmap + 't-heatmap': tHeatmap, + 'picture-group': pictureGroup } export { iconChartMap } diff --git a/core/core-frontend/src/custom-component/component-list.ts b/core/core-frontend/src/custom-component/component-list.ts index a845956877..fe1f45713e 100644 --- a/core/core-frontend/src/custom-component/component-list.ts +++ b/core/core-frontend/src/custom-component/component-list.ts @@ -306,7 +306,7 @@ const list = [ component: 'UserView', name: '图表', label: '图表', - propValue: { textValue: '' }, + propValue: { textValue: '', urlList: [] }, icon: 'bar', innerType: 'bar', editing: false, diff --git a/core/core-frontend/src/custom-component/picture-group/Attr.vue b/core/core-frontend/src/custom-component/picture-group/Attr.vue index 57855165be..156bae32ff 100644 --- a/core/core-frontend/src/custom-component/picture-group/Attr.vue +++ b/core/core-frontend/src/custom-component/picture-group/Attr.vue @@ -1,31 +1,38 @@ diff --git a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/PictureGroupThresholdEdit.vue b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/PictureGroupThresholdEdit.vue new file mode 100644 index 0000000000..95079d2d06 --- /dev/null +++ b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/PictureGroupThresholdEdit.vue @@ -0,0 +1,598 @@ + + + + + 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 d1174bd15b..1a1e729725 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 @@ -28,9 +28,10 @@ import FlowMapLineSelector from '@/views/chart/components/editor/editor-style/co import FlowMapPointSelector from '@/views/chart/components/editor/editor-style/components/FlowMapPointSelector.vue' import CommonEvent from '@/custom-component/common/CommonEvent.vue' import CommonBorderSetting from '@/custom-component/common/CommonBorderSetting.vue' +import PictureGroupAttr from '@/custom-component/picture-group/Attr.vue' const dvMainStore = dvMainStoreWithOut() -const { dvInfo, batchOptStatus } = storeToRefs(dvMainStore) +const { dvInfo, batchOptStatus, curComponent } = storeToRefs(dvMainStore) const { t } = useI18n() const state = { @@ -144,6 +145,10 @@ const eventsShow = computed(() => { ) }) +const pictureGroupShow = computed(() => { + return curComponent.value?.innerType === 'picture-group' +}) + const showProperties = (property: EditorProperty) => properties.value?.includes(property) const onMiscChange = (val, prop) => { @@ -607,6 +612,11 @@ watch( @onChangeYAxisExtForm="onChangeYAxisExtForm" /> + 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 295cc04abd..346dc3b41e 100644 --- a/core/core-frontend/src/views/chart/components/editor/index.vue +++ b/core/core-frontend/src/views/chart/components/editor/index.vue @@ -1784,7 +1784,7 @@ const deleteChartFieldItem = id => { {{ t('chart.switch_chart') }} 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 4cd09393a7..d76473c7d8 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 @@ -1160,6 +1160,13 @@ export const CHART_TYPE_CONFIGS = [ value: 'indicator', title: t('chart.chart_indicator'), icon: 'indicator' + }, + { + render: 'custom', + category: 'quota', + value: 'picture-group', + title: '图片组', + icon: 'picture-group' } ] }, @@ -1505,20 +1512,6 @@ export const CHART_TYPE_CONFIGS = [ icon: 'rich-text' } ] - }, - { - category: 'other', - title: '图片组', - display: 'hidden', - details: [ - { - render: 'custom', - category: 'quota', - value: 'picture-group', - title: '图片图', - icon: 'picture' - } - ] } ] diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts index b7bfc48158..e6d9a334c5 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts @@ -610,6 +610,9 @@ export function mappingColor(value, defaultColor, field, type) { color = t[type] flag = true } + } else if (t.term === 'default') { + color = t[type] + flag = true } if (flag) { break @@ -648,6 +651,9 @@ export function mappingColor(value, defaultColor, field, type) { color = t[type] flag = true } + } else if (t.term === 'default') { + color = t[type] + flag = true } if (flag) { break @@ -688,6 +694,9 @@ export function mappingColor(value, defaultColor, field, type) { color = t[type] flag = true } + } else if (t.term === 'default') { + color = t[type] + flag = true } if (flag) { break 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 89b29f4d11..b9e55b2430 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_GROUP = 'picture_group', + 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 f38404b21d..3bac39d426 100644 --- a/core/core-frontend/src/views/chart/components/views/index.vue +++ b/core/core-frontend/src/views/chart/components/views/index.vue @@ -125,7 +125,7 @@ const { view, showPosition, element, active, searchCount, scale } = toRefs(props const titleShow = computed(() => { return ( - !['rich-text', 'Picture'].includes(element.value.innerType) && + !['rich-text', 'picture-group'].includes(element.value.innerType) && state.title_show && showPosition.value !== 'viewDialog' ) @@ -678,7 +678,7 @@ const chartAreaShow = computed(() => { return true } } - if (['rich-text', 'Picture'].includes(view.value.type)) { + if (['rich-text', 'picture-group'].includes(view.value.type)) { return true } if (view.value?.isPlugin) { @@ -911,6 +911,7 @@ const loadPluginCategory = data => { ref="chartComponent" :element="element" :active="active" + :view="view" :show-position="showPosition" >