From 39adf31696d9e3589388f71e55d65bf7481f6e9d Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 22 May 2024 18:32:57 +0800 Subject: [PATCH 01/38] =?UTF-8?q?feat(=E5=9B=BE=E8=A1=A8):=20=E5=B5=8C?= =?UTF-8?q?=E5=85=A5=E5=BC=8F=E5=A4=A7=E5=B1=8F=E3=80=81=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=90=91=E5=A4=96=E9=83=A8=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/panel/DashboardPreview.vue | 4 ++- .../src/pages/panel/ViewWrapper.vue | 4 ++- .../modules/data-visualization/dvMain.ts | 4 +++ .../views/components/ChartComponentG2Plot.vue | 32 +++++++++++++++++-- .../views/components/ChartComponentS2.vue | 25 +++++++++++++-- .../views/chart/components/views/index.vue | 21 ++++++++++++ .../data-visualization/PreviewCanvas.vue | 3 +- 7 files changed, 84 insertions(+), 9 deletions(-) diff --git a/core/core-frontend/src/pages/panel/DashboardPreview.vue b/core/core-frontend/src/pages/panel/DashboardPreview.vue index 61571aca40..6ac5e941e1 100644 --- a/core/core-frontend/src/pages/panel/DashboardPreview.vue +++ b/core/core-frontend/src/pages/panel/DashboardPreview.vue @@ -47,7 +47,9 @@ onBeforeMount(async () => { // div嵌入 if (embeddedStore.outerParams) { try { - attachParam = JSON.parse(embeddedStore.outerParams) + const outerPramsParse = JSON.parse(embeddedStore.outerParams) + attachParam = outerPramsParse.attachParam + dvMainStore.setEmbeddedCallBack(outerPramsParse.callBackFlag || 'no') } catch (e) { console.error(e) ElMessage.error(t('visualization.outer_param_decode_error')) diff --git a/core/core-frontend/src/pages/panel/ViewWrapper.vue b/core/core-frontend/src/pages/panel/ViewWrapper.vue index 742aa4063f..420879cfc2 100644 --- a/core/core-frontend/src/pages/panel/ViewWrapper.vue +++ b/core/core-frontend/src/pages/panel/ViewWrapper.vue @@ -66,7 +66,9 @@ onBeforeMount(async () => { // div嵌入 if (embeddedStore.outerParams) { try { - attachParam = JSON.parse(embeddedStore.outerParams) + const outerPramsParse = JSON.parse(embeddedStore.outerParams) + attachParam = outerPramsParse.attachParam + dvMainStore.setEmbeddedCallBack(outerPramsParse.callBackFlag || 'no') } catch (e) { console.error(e) ElMessage.error(t('visualization.outer_param_decode_error')) diff --git a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts index d584faf0a2..4367d1de5a 100644 --- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts +++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts @@ -32,6 +32,7 @@ export const dvMainStore = defineStore('dataVisualization', { chartAreaCollapse: false, datasetAreaCollapse: false }, + embeddedCallBack: 'no', // 嵌入模式是否允许反馈参数 editMode: 'edit', // 编辑器模式 edit preview mobileInPc: false, firstLoadMap: [], @@ -173,6 +174,9 @@ export const dvMainStore = defineStore('dataVisualization', { } }, actions: { + setEmbeddedCallBack(value) { + this.embeddedCallBack = value + }, setPublicLinkStatus(value) { this.publicLinkStatus = value }, diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue index 947620c2f5..8005f1125c 100644 --- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue +++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue @@ -19,7 +19,8 @@ import { trackBarStyleCheck } from '@/utils/canvasUtils' import { useEmitt } from '@/hooks/web/useEmitt' const dvMainStore = dvMainStoreWithOut() -const { nowPanelTrackInfo, nowPanelJumpInfo, mobileInPc } = storeToRefs(dvMainStore) +const { nowPanelTrackInfo, nowPanelJumpInfo, mobileInPc, embeddedCallBack } = + storeToRefs(dvMainStore) const { emitter } = useEmitt() const props = defineProps({ element: { @@ -54,7 +55,13 @@ const props = defineProps({ } }) -const emit = defineEmits(['onChartClick', 'onDrillFilters', 'onJumpClick', 'resetLoading']) +const emit = defineEmits([ + 'onPointClick', + 'onChartClick', + 'onDrillFilters', + 'onJumpClick', + 'resetLoading' +]) const { view, showPosition, scale, terminal } = toRefs(props) @@ -193,9 +200,17 @@ const renderL7Plot = async (chart: ChartObj, chartView: L7PlotChartView { + if (embeddedCallBack.value === 'yes') { + trackClick('pointClick') + } +} + const action = param => { - // 下钻 联动 跳转 state.pointParam = param.data + // 点击 + pointClickTrans() + // 下钻 联动 跳转 state.linkageActiveParam = { category: state.pointParam.data.category ? state.pointParam.data.category : 'NO_DATA', name: state.pointParam.data.name ? state.pointParam.data.name : 'NO_DATA' @@ -247,7 +262,18 @@ const trackClick = trackAction => { quotaList: quotaList } + const clickParams = { + option: 'pointClick', + name: checkName, + viewId: view.value.id, + dimensionList: state.pointParam.data.dimensionList, + quotaList: quotaList + } + switch (trackAction) { + case 'pointClick': + emit('onPointClick', clickParams) + break case 'linkageAndDrill': dvMainStore.addViewTrackFilter(linkageParam) emit('onChartClick', param) diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue index 6fc89da2db..b30ceff9e3 100644 --- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue +++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue @@ -29,7 +29,7 @@ import { useEmitt } from '@/hooks/web/useEmitt' import { trackBarStyleCheck } from '@/utils/canvasUtils' const dvMainStore = dvMainStoreWithOut() -const { nowPanelTrackInfo, nowPanelJumpInfo, mobileInPc, canvasStyleData } = +const { nowPanelTrackInfo, nowPanelJumpInfo, mobileInPc, canvasStyleData, embeddedCallBack } = storeToRefs(dvMainStore) const { emitter } = useEmitt() @@ -66,7 +66,7 @@ const props = defineProps({ } }) -const emit = defineEmits(['onChartClick', 'onDrillFilters', 'onJumpClick']) +const emit = defineEmits(['onPointClick', 'onChartClick', 'onDrillFilters', 'onJumpClick']) const { view, showPosition, scale, terminal } = toRefs(props) @@ -241,10 +241,17 @@ const handleCurrentChange = pageNum => { const chart = { ...view.value, chartExtRequest: extReq } calcData(chart, null, false) } +const pointClickTrans = () => { + if (embeddedCallBack.value === 'yes') { + trackClick('pointClick') + } +} const action = param => { - // 下钻 联动 跳转 state.pointParam = param + // 点击 + pointClickTrans() + // 下钻 联动 跳转 if (trackMenu.value.length < 2) { // 只有一个事件直接调用 trackClick(trackMenu.value[0]) @@ -284,7 +291,19 @@ const trackClick = trackAction => { quotaList: state.pointParam.data.quotaList, sourceType: state.pointParam.data.sourceType } + + const clickParams = { + option: 'pointClick', + name: state.pointParam.data.name, + viewId: view.value.id, + dimensionList: state.pointParam.data.dimensionList, + quotaList: state.pointParam.data.quotaList + } + switch (trackAction) { + case 'pointClick': + emit('onPointClick', clickParams) + break case 'linkageAndDrill': dvMainStore.addViewTrackFilter(linkageParam) emit('onChartClick', param) 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 2a4f42d3cf..faa80a1801 100644 --- a/core/core-frontend/src/views/chart/components/views/index.vue +++ b/core/core-frontend/src/views/chart/components/views/index.vue @@ -38,6 +38,7 @@ import { Base64 } from 'js-base64' import DeRichTextView from '@/custom-component/rich-text/DeRichTextView.vue' import ChartEmptyInfo from '@/views/chart/components/views/components/ChartEmptyInfo.vue' import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot' +import { useAppStoreWithOut } from '@/store/modules/app' const { wsCache } = useCache() const chartComponent = ref() @@ -45,6 +46,9 @@ const { t } = useI18n() const dvMainStore = dvMainStoreWithOut() let innerRefreshTimer = null +const appStore = useAppStoreWithOut() +const isDataEaseBi = computed(() => appStore.getIsDataEaseBi) +const isIframe = computed(() => appStore.getIsIframe) const { nowPanelJumpInfo, publicLinkStatus, dvInfo, curComponent, canvasStyleData, mobileInPc } = storeToRefs(dvMainStore) @@ -277,6 +281,21 @@ const drillJump = (index: number) => { calcData(view.value) } +const onPointClick = param => { + try { + console.info('de_inner_params send') + const msg = { + type: 'de_inner_params', + sourceDvId: dvInfo.value.id, + sourceViewId: view.value.id, + message: Base64.encode(param) + } + window.parent.postMessage(msg, '*') + } catch (e) { + console.warn('de_inner_params send error') + } +} + const chartClick = param => { // 下钻字段第一个没有在维度中不允许下钻 const xIds = view.value.xAxis.map(ele => ele.id) @@ -691,6 +710,7 @@ const titleIconStyle = computed(() => { v-else-if="showChartView(ChartLibraryType.G2_PLOT, ChartLibraryType.L7_PLOT)" ref="chartComponent" @onChartClick="chartClick" + @onPointClick="onPointClick" @onDrillFilters="onDrillFilters" @onJumpClick="jumpClick" @resetLoading="() => (loading = false)" @@ -702,6 +722,7 @@ const titleIconStyle = computed(() => { :element="element" v-else-if="showChartView(ChartLibraryType.S2)" ref="chartComponent" + @onPointClick="onPointClick" @onChartClick="chartClick" @onDrillFilters="onDrillFilters" @onJumpClick="jumpClick" diff --git a/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue b/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue index 6f74804593..34de144b89 100644 --- a/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue +++ b/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue @@ -105,11 +105,12 @@ let p = null const XpackLoaded = () => p(true) onMounted(async () => { await new Promise(r => (p = r)) - const { dvId, dvType } = router.currentRoute.value.query + const { dvId, dvType, callBackFlag } = router.currentRoute.value.query if (dvId) { loadCanvasDataAsync(dvId, dvType) return } + dvMainStore.setEmbeddedCallBack(callBackFlag || 'no') dvMainStore.setPublicLinkStatus(props.publicLinkStatus) }) From 8cc1aab59f1087b695a00de905d4f366a67cf5d8 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Wed, 22 May 2024 20:31:45 +0800 Subject: [PATCH 02/38] =?UTF-8?q?feat(=E5=9B=BE=E8=A1=A8):=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=B5=81=E5=90=91=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/assets/svg/bar-bidirectional-dark.svg | 11 + .../src/assets/svg/bar-bidirectional.svg | 11 + .../src/assets/svg/bar-progress-dark.svg | 11 + .../src/assets/svg/bar-progress.svg | 11 + .../src/assets/svg/flow-map-origin.svg | 69 +++++ .../core-frontend/src/assets/svg/flow-map.svg | 79 +++++ .../data-visualization/canvas/Shape.vue | 2 +- .../src/models/chart/chart-attr.d.ts | 6 +- .../editor/editor-style/ChartStyle.vue | 1 + .../components/BasicStyleSelector.vue | 273 ++++++++++++++++-- .../chart/components/editor/util/chart.ts | 11 +- .../js/panel/charts/map/flow-map.ts | 138 +++++++++ .../components/js/panel/common/common_antv.ts | 12 +- .../components/js/panel/types/impl/l7.ts | 95 ++++++ .../chart/components/js/panel/types/index.ts | 1 + .../views/components/ChartComponentG2Plot.vue | 25 +- .../views/chart/components/views/index.vue | 9 +- 17 files changed, 725 insertions(+), 40 deletions(-) create mode 100644 core/core-frontend/src/assets/svg/bar-bidirectional-dark.svg create mode 100644 core/core-frontend/src/assets/svg/bar-bidirectional.svg create mode 100644 core/core-frontend/src/assets/svg/bar-progress-dark.svg create mode 100644 core/core-frontend/src/assets/svg/bar-progress.svg create mode 100644 core/core-frontend/src/assets/svg/flow-map-origin.svg create mode 100644 core/core-frontend/src/assets/svg/flow-map.svg create mode 100644 core/core-frontend/src/views/chart/components/js/panel/charts/map/flow-map.ts create mode 100644 core/core-frontend/src/views/chart/components/js/panel/types/impl/l7.ts diff --git a/core/core-frontend/src/assets/svg/bar-bidirectional-dark.svg b/core/core-frontend/src/assets/svg/bar-bidirectional-dark.svg new file mode 100644 index 0000000000..f95fe09fb2 --- /dev/null +++ b/core/core-frontend/src/assets/svg/bar-bidirectional-dark.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/core/core-frontend/src/assets/svg/bar-bidirectional.svg b/core/core-frontend/src/assets/svg/bar-bidirectional.svg new file mode 100644 index 0000000000..31f5b63283 --- /dev/null +++ b/core/core-frontend/src/assets/svg/bar-bidirectional.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/core/core-frontend/src/assets/svg/bar-progress-dark.svg b/core/core-frontend/src/assets/svg/bar-progress-dark.svg new file mode 100644 index 0000000000..2f0ea808ae --- /dev/null +++ b/core/core-frontend/src/assets/svg/bar-progress-dark.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/core/core-frontend/src/assets/svg/bar-progress.svg b/core/core-frontend/src/assets/svg/bar-progress.svg new file mode 100644 index 0000000000..c75e98a48a --- /dev/null +++ b/core/core-frontend/src/assets/svg/bar-progress.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/core/core-frontend/src/assets/svg/flow-map-origin.svg b/core/core-frontend/src/assets/svg/flow-map-origin.svg new file mode 100644 index 0000000000..eaef7f8ea5 --- /dev/null +++ b/core/core-frontend/src/assets/svg/flow-map-origin.svg @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/core-frontend/src/assets/svg/flow-map.svg b/core/core-frontend/src/assets/svg/flow-map.svg new file mode 100644 index 0000000000..6c691c031b --- /dev/null +++ b/core/core-frontend/src/assets/svg/flow-map.svg @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 0f8e108d05..a8559c8291 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue @@ -294,7 +294,7 @@ const active = computed(() => { }) const boardMoveActive = computed(() => { - const CHARTS = ['map', 'bubble-map', 'table-info', 'table-normal', 'table-pivot'] + const CHARTS = ['flow-map', 'map', 'bubble-map', 'table-info', 'table-normal', 'table-pivot'] return CHARTS.includes(element.value.innerType) }) diff --git a/core/core-frontend/src/models/chart/chart-attr.d.ts b/core/core-frontend/src/models/chart/chart-attr.d.ts index 35ff617b66..63f6bb9e23 100644 --- a/core/core-frontend/src/models/chart/chart-attr.d.ts +++ b/core/core-frontend/src/models/chart/chart-attr.d.ts @@ -232,7 +232,7 @@ declare interface ChartBasicStyle { /** * 对称柱状图方向 */ - layout: 'horizontal' | 'vertical' + layout?: 'horizontal' | 'vertical' } /** * 表头属性 @@ -482,6 +482,10 @@ declare interface ChartMiscAttr { * 地图线条宽度 */ mapLineWidth: number + /** + * 流向地图动画 + */ + mapLineAnimate?: boolean /** * 流向地图动画间隔 */ 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 893bb3795f..eb18ae6c5d 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 @@ -221,6 +221,7 @@ watch( :themes="themes" :chart="chart" @onBasicStyleChange="onBasicStyleChange" + @onMiscChange="onMiscChange" /> import { onMounted, PropType, reactive, watch } from 'vue' -import { COLOR_PANEL, DEFAULT_BASIC_STYLE } from '@/views/chart/components/editor/util/chart' +import { + COLOR_PANEL, + DEFAULT_BASIC_STYLE, + DEFAULT_MISC +} from '@/views/chart/components/editor/util/chart' import { useI18n } from '@/hooks/web/useI18n' import CustomColorStyleSelect from '@/views/chart/components/editor/editor-style/components/CustomColorStyleSelect.vue' import { cloneDeep, defaultsDeep } from 'lodash-es' @@ -28,6 +32,7 @@ const showProperty = prop => props.propertyInner?.includes(prop) const predefineColors = COLOR_PANEL const state = reactive({ basicStyleForm: JSON.parse(JSON.stringify(DEFAULT_BASIC_STYLE)) as ChartBasicStyle, + miscForm: JSON.parse(JSON.stringify(DEFAULT_MISC)) as ChartMiscAttr, customColor: null, colorIndex: 0, fieldColumnWidth: { @@ -38,6 +43,7 @@ const state = reactive({ watch( [ () => props.chart.customAttr.basicStyle, + () => props.chart.customAttr.misc, () => props.chart.customAttr.tableHeader, () => props.chart.xAxis, () => props.chart.yAxis @@ -47,14 +53,19 @@ watch( }, { deep: true } ) -const emit = defineEmits(['onBasicStyleChange']) +const emit = defineEmits(['onBasicStyleChange', 'onMiscChange']) const changeBasicStyle = (prop?: string, requestData = false) => { emit('onBasicStyleChange', { data: state.basicStyleForm, requestData }, prop) } +const changeMisc = prop => { + emit('onMiscChange', { data: state.miscForm, requestData: true }, prop) +} const init = () => { const basicStyle = cloneDeep(props.chart.customAttr.basicStyle) + const miscStyle = cloneDeep(props.chart.customAttr.misc) configCompat(basicStyle) state.basicStyleForm = defaultsDeep(basicStyle, cloneDeep(DEFAULT_BASIC_STYLE)) as ChartBasicStyle + state.miscForm = defaultsDeep(miscStyle, cloneDeep(DEFAULT_MISC)) as ChartMiscAttr if (!state.customColor) { state.customColor = state.basicStyleForm.colors[0] state.colorIndex = 0 @@ -177,6 +188,12 @@ const mapStyleOptions = [ { name: t('chart.map_style_wine'), value: 'wine' } ] +const flowLineTypeOptions = [ + { name: t('chart.map_line_type_line'), value: 'line' }, + { name: t('chart.map_line_type_arc'), value: 'arc' }, + { name: t('chart.map_line_type_arc_3d'), value: 'arc3d' } +] + onMounted(() => { init() }) @@ -268,7 +285,236 @@ onMounted(() => { {{ t('chart.vertical') }} - + +
+
+ + + + + + + + + +
+ + + + + + + + +
+
+
+ + + + + + + + + +
+ + + + + + + + +
+ + + + + {{ t('chart.line') + t('chart.map_line_linear') }} + + + + +
+ + + + + + + + + + + + +
+
+ + + + + + + +
+
+ + + + + + + + + + + + + + + +
+ + + + + {{ t('chart.line') + t('chart.map_line_animate') }} + + + + +
+ + + + + + + + +
+
+
+ @@ -658,27 +904,6 @@ onMounted(() => { - - - - - - - { + properties: EditorProperty[] = [ + 'background-overall-component', + 'basic-style-selector', + 'title-selector' + ] + propertyInner: EditorPropertyInner = { + ...MAP_EDITOR_PROPERTY_INNER, + 'basic-style-selector': ['mapStyle', 'zoom'] + } + axis: AxisType[] = ['xAxis', 'xAxisExt', 'filter'] + axisConfig: AxisConfig = { + xAxis: { + name: `起点经纬度 / ${t('chart.dimension')}`, + type: 'd', + limit: 2 + }, + xAxisExt: { + name: `终点经纬度 / ${t('chart.dimension')}`, + type: 'd', + limit: 2 + } + } + constructor() { + super('flow-map', []) + } + + async drawChart(drawOption: L7DrawConfig) { + const { chart, container } = drawOption + const xAxis = deepCopy(chart.xAxis) + const xAxisExt = deepCopy(chart.xAxisExt) + let basicStyle + let miscStyle + if (chart.customAttr) { + basicStyle = parseJson(chart.customAttr).basicStyle + miscStyle = parseJson(chart.customAttr).misc + } + const flowLineStyle = { + type: miscStyle.mapLineType, + size: miscStyle.mapLineWidth, + animate: miscStyle.mapLineAnimate, + animateDuration: miscStyle.mapLineAnimateDuration, + gradient: miscStyle.mapLineGradient, + sourceColor: miscStyle.mapLineSourceColor, + targetColor: miscStyle.mapLineTargetColor, + alpha: basicStyle.alpha + } + const mapStyle = `amap://styles/${basicStyle.mapStyle ? basicStyle.mapStyle : 'normal'}` + const key = await this.getMapKey() + // 底层 + const scene = new Scene({ + id: container, + logoVisible: false, + map: new GaodeMap({ + token: key ?? undefined, + style: mapStyle, + pitch: miscStyle.mapPitch, + zoom: 2.5 + }) + }) + if (xAxis?.length < 2 || xAxisExt?.length < 2) { + return new L7Wrapper(scene, undefined) + } + const config: L7Config = new LineLayer({ + name: 'line', + blend: 'normal', + autoFit: true + }) + .source(chart.data?.tableRow ? chart.data.tableRow : [], { + parser: { + type: 'json', + x: xAxis[0].dataeaseName, + y: xAxis[1].dataeaseName, + x1: xAxisExt[0].dataeaseName, + y1: xAxisExt[1].dataeaseName + } + }) + .size(flowLineStyle.size) + .shape(flowLineStyle.type) + .animate({ + enable: flowLineStyle.animate, + duration: flowLineStyle.animateDuration, + interval: 1, + trailLength: 1 + }) + if (flowLineStyle.gradient) { + config.style({ + sourceColor: flowLineStyle.sourceColor, + targetColor: flowLineStyle.targetColor, + opacity: flowLineStyle.alpha / 100 + }) + } else { + config + .style({ + opacity: flowLineStyle.alpha / 100 + }) + .color(flowLineStyle.sourceColor) + } + this.configZoomButton(chart, scene) + return new L7Wrapper(scene, config) + } + + getMapKey = async () => { + const key = 'online-map-key' + if (!localStorage.getItem(key)) { + await queryMapKeyApi().then(res => localStorage.setItem(key, res.data)) + } + return localStorage.getItem(key) + } + + setupDefaultOptions(chart: ChartObj): ChartObj { + chart.customAttr.misc.mapLineAnimate = true + return chart + } + + protected setupOptions(chart: Chart, config: L7Config): L7Config { + return flow(this.configEmptyDataStrategy)(chart, config) + } +} diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts index c174ca9a86..a2e3f53e06 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts @@ -26,6 +26,7 @@ import type { Plot as L7Plot, PlotOptions } from '@antv/l7plot/dist/esm' import { Zoom } from '@antv/l7' import { createL7Icon } from '@antv/l7-component/es/utils/icon' import { DOM } from '@antv/l7-utils' +import { Scene } from '@antv/l7-scene' export function getPadding(chart: Chart): number[] { if (chart.drill) { @@ -1023,7 +1024,7 @@ class CustomZoom extends Zoom { this['updateDisabled']() } } -export function configL7Zoom(chart: Chart, plot: L7Plot) { +export function configL7Zoom(chart: Chart, plot: L7Plot | Scene) { const { basicStyle } = parseJson(chart.customAttr) if ( (basicStyle.suspension === false && basicStyle.showZoom === undefined) || @@ -1031,14 +1032,15 @@ export function configL7Zoom(chart: Chart, plot: L7Plot) { ) { return } - plot.once('loaded', () => { + const plotScene = plot instanceof Scene ? plot : plot.scene + plotScene.once('loaded', () => { const zoomOptions = { - initZoom: plot.scene.getZoom(), - center: plot.scene.getCenter(), + initZoom: plotScene.getZoom(), + center: plotScene.getCenter(), buttonColor: basicStyle.zoomButtonColor, buttonBackground: basicStyle.zoomBackground } as any - plot.scene.addControl(new CustomZoom(zoomOptions)) + plotScene.addControl(new CustomZoom(zoomOptions)) }) } diff --git a/core/core-frontend/src/views/chart/components/js/panel/types/impl/l7.ts b/core/core-frontend/src/views/chart/components/js/panel/types/impl/l7.ts new file mode 100644 index 0000000000..de31e95dfa --- /dev/null +++ b/core/core-frontend/src/views/chart/components/js/panel/types/impl/l7.ts @@ -0,0 +1,95 @@ +import { Scene } from '@antv/l7-scene' +import { + AntVAbstractChartView, + AntVDrawOptions, + ChartLibraryType, + ChartWrapper +} from '@/views/chart/components/js/panel/types' +import { cloneDeep } from 'lodash-es' +import { parseJson } from '@/views/chart/components/js/util' +import { ILayer } from '@antv/l7plot' +import { configL7Zoom } from '@/views/chart/components/js/panel/common/common_antv' + +export type L7DrawConfig

= AntVDrawOptions

+export interface L7Config extends ILayer { + handleConfig?: (arg0: Scene) => void + [key: string]: string | any +} +export class L7Wrapper< + O extends L7Config | Array, + S extends Scene +> extends ChartWrapper { + private readonly config: O | Array + private readonly scene: S | null = null + constructor(scene: S, l7config: O | Array | undefined) { + super() + this.chartInstance = scene + this.config = l7config + this.scene = scene + } + destroy = () => { + if (!this.chartInstance) { + return + } + this.chartInstance?.destroy() + } + render = () => { + if (this.scene && this.config) { + this.scene.on('loaded', () => { + if (Array.isArray(this.config)) { + this.config?.forEach(p => { + this.handleConfig(p) + }) + } else { + this.handleConfig(this.config) + } + }) + } + } + + handleConfig = (config: L7Config) => { + if (config.handleConfig) { + config.handleConfig?.(this.scene) + } else { + this.scene.addLayer(config) + } + } +} +export abstract class L7ChartView< + S extends Scene, + O extends L7Config +> extends AntVAbstractChartView { + public abstract drawChart(drawOption: L7DrawConfig): L7Wrapper | any + + protected configEmptyDataStrategy(chart: Chart, options: O): O { + const { functionCfg } = parseJson(chart.senior) + const emptyDataStrategy = functionCfg.emptyDataStrategy + if (!emptyDataStrategy || emptyDataStrategy === 'breakLine') { + return options + } + const data = cloneDeep(options.sourceOption.data) + if (emptyDataStrategy === 'setZero') { + data.forEach(item => { + item.value === null && (item.value = 0) + }) + } + if (emptyDataStrategy === 'ignoreData') { + for (let i = data.length - 1; i >= 0; i--) { + if (data[i].value === null) { + data.splice(i, 1) + } + } + } + options.sourceOption.data = data + return options + } + + protected configZoomButton(chart: Chart, plot: S) { + configL7Zoom(chart, plot) + } + + protected constructor(name: string, defaultData: any[]) { + super(ChartLibraryType.L7, name, defaultData) + } + protected abstract setupOptions(chart: Chart, options: O): O +} 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 8049fa54c6..b527c00c95 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 @@ -11,6 +11,7 @@ export enum ChartRenderType { export enum ChartLibraryType { G2_PLOT = 'g2plot', L7_PLOT = 'l7plot', + L7 = 'l7', ECHARTS = 'echarts', S2 = 's2', RICH_TEXT = 'rich-text', diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue index 2881b696e9..b953c53b94 100644 --- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue +++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue @@ -17,6 +17,7 @@ import { customAttrTrans, customStyleTrans, recursionTransObj } from '@/utils/ca import { deepCopy } from '@/utils/utils' import { trackBarStyleCheck } from '@/utils/canvasUtils' import { useEmitt } from '@/hooks/web/useEmitt' +import { L7ChartView } from '@/views/chart/components/js/panel/types/impl/l7' const dvMainStore = dvMainStoreWithOut() const { nowPanelTrackInfo, nowPanelJumpInfo, mobileInPc, embeddedCallBack } = @@ -116,7 +117,7 @@ const calcData = async (view, callback) => { callback?.() }) } else { - if (['bubble-map', 'map'].includes(view.type)) { + if (['bubble-map', 'map', 'flow-map'].includes(view.type)) { await renderChart(view, callback) } callback?.() @@ -141,6 +142,9 @@ const renderChart = async (view, callback?) => { case ChartLibraryType.L7_PLOT: await renderL7Plot(chart, chartView as L7PlotChartView, callback) break + case ChartLibraryType.L7: + await renderL7(chart, chartView as L7ChartView, callback) + break case ChartLibraryType.G2_PLOT: renderG2Plot(chart, chartView as G2PlotChartView) callback?.() @@ -199,6 +203,23 @@ const renderL7Plot = async (chart: ChartObj, chartView: L7PlotChartView, callback) => { + mapL7Timer && clearTimeout(mapL7Timer) + mapL7Timer = setTimeout(async () => { + myChart?.destroy() + myChart = await chartView.drawChart({ + chartObj: myChart, + container: containerId, + chart: chart, + action + }) + myChart?.render() + callback?.() + emit('resetLoading') + }, 500) +} + const pointClickTrans = () => { if (embeddedCallBack.value === 'yes') { trackClick('pointClick') @@ -333,7 +354,7 @@ defineExpose({ }) let resizeObserver const TOLERANCE = 0.01 -const RESIZE_MONITOR_CHARTS = ['map', 'bubble-map'] +const RESIZE_MONITOR_CHARTS = ['map', 'bubble-map', 'flow-map'] onMounted(() => { const containerDom = document.getElementById(containerId) const { offsetWidth, offsetHeight } = containerDom 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 ff4d63e4ca..242d8d19fe 100644 --- a/core/core-frontend/src/views/chart/components/views/index.vue +++ b/core/core-frontend/src/views/chart/components/views/index.vue @@ -40,7 +40,6 @@ import { Base64 } from 'js-base64' import DeRichTextView from '@/custom-component/rich-text/DeRichTextView.vue' import ChartEmptyInfo from '@/views/chart/components/views/components/ChartEmptyInfo.vue' import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot' -import { useAppStoreWithOut } from '@/store/modules/app' const { wsCache } = useCache() const chartComponent = ref() @@ -105,7 +104,6 @@ const props = defineProps({ }) const dynamicAreaId = ref('') const { view, showPosition, element, active, searchCount, scale } = toRefs(props) -const appStore = useAppStoreWithOut() const titleShow = computed( () => @@ -242,7 +240,6 @@ watch([() => curComponent.value], () => { }) } }) -const isDataEaseBi = computed(() => appStore.getIsDataEaseBi) const chartExtRequest = shallowRef(null) provide('chartExtRequest', chartExtRequest) @@ -568,7 +565,7 @@ const chartAreaShow = computed(() => { return true } if (view.value.customAttr.map.id) { - const MAP_CHARTS = ['map', 'bubble-map'] + const MAP_CHARTS = ['map', 'bubble-map', 'flow-map'] if (MAP_CHARTS.includes(view.value.type)) { return true } @@ -726,7 +723,9 @@ const titleIconStyle = computed(() => { :view="view" :show-position="showPosition" :element="element" - v-else-if="showChartView(ChartLibraryType.G2_PLOT, ChartLibraryType.L7_PLOT)" + v-else-if=" + showChartView(ChartLibraryType.G2_PLOT, ChartLibraryType.L7_PLOT, ChartLibraryType.L7) + " ref="chartComponent" @onChartClick="chartClick" @onPointClick="onPointClick" From cab32937f2772ae8196869a19e88a67858c3b9c2 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 22 May 2024 20:32:11 +0800 Subject: [PATCH 03/38] =?UTF-8?q?perf(X-Pack):=20=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- de-xpack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de-xpack b/de-xpack index eac4bdc0d3..cb5bf055a1 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit eac4bdc0d387c44088dbc7585a09f61b8e45ea12 +Subproject commit cb5bf055a1d173157fb1c291aba95710e47e6c10 From d8c7aee2b6e1d41d8d161cb78da0a2ef7a2e1e3d Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 23 May 2024 09:50:09 +0800 Subject: [PATCH 04/38] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F)?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=E5=A4=9A=E9=80=89=E5=9B=BE=E5=B1=82?= =?UTF-8?q?=E6=96=B9=E5=90=91=E9=94=AE=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20#9766?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/utils/DeShortcutKey.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/core-frontend/src/utils/DeShortcutKey.ts b/core/core-frontend/src/utils/DeShortcutKey.ts index f1bef64f21..a3465ded97 100644 --- a/core/core-frontend/src/utils/DeShortcutKey.ts +++ b/core/core-frontend/src/utils/DeShortcutKey.ts @@ -174,17 +174,30 @@ function move(keyCode) { if (curComponent.value) { if (keyCode === leftKey) { curComponent.value.style.left = --curComponent.value.style.left + groupAreaAdaptor(-1, 0) } else if (keyCode === rightKey) { curComponent.value.style.left = ++curComponent.value.style.left + groupAreaAdaptor(1, 0) } else if (keyCode === upKey) { curComponent.value.style.top = --curComponent.value.style.top + groupAreaAdaptor(0, -1) } else if (keyCode === downKey) { curComponent.value.style.top = ++curComponent.value.style.top + groupAreaAdaptor(0, 1) } snapshotStore.recordSnapshotCache('key-move') } } +function groupAreaAdaptor(leftOffset = 0, topOffset = 0) { + if (curComponent.value.component === 'GroupArea') { + composeStore.areaData.components.forEach(component => { + component.style.top = component.style.top + topOffset + component.style.left = component.style.left + leftOffset + }) + } +} + function cut() { copyStore.cut() } From 1cd8a977632e5f4ebbcec03d533986630123f86b Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 23 May 2024 10:18:39 +0800 Subject: [PATCH 05/38] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=88=AA=E5=9B=BE=E7=BB=84=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6=E6=88=AA?= =?UTF-8?q?=E5=9B=BE=E5=8F=AF=E8=83=BD=E4=B8=8D=E5=85=A8=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20#9641?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/utils/imgUtils.ts | 30 +++++++++++++++++++ .../views/dashboard/DashboardPreviewShow.vue | 4 +-- .../views/data-visualization/PreviewShow.vue | 4 +-- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/utils/imgUtils.ts b/core/core-frontend/src/utils/imgUtils.ts index ec043569a9..c9ef3f42d1 100644 --- a/core/core-frontend/src/utils/imgUtils.ts +++ b/core/core-frontend/src/utils/imgUtils.ts @@ -6,6 +6,7 @@ import { storeToRefs } from 'pinia' import { findResourceAsBase64 } from '@/api/staticResource' import FileSaver from 'file-saver' import { deepCopy } from '@/utils/utils' +import { toPng } from 'html-to-image' const embeddedStore = useEmbedded() const dvMainStore = dvMainStoreWithOut() const { canvasStyleData, componentData, canvasViewInfo, canvasViewDataInfo, dvInfo } = @@ -70,6 +71,35 @@ export function download2AppTemplate(downloadType, canvasDom, name, callBack?) { } } +export function downloadCanvas2(type, canvasDom, name, callBack?) { + toPng(canvasDom) + .then(dataUrl => { + const a = document.createElement('a') + a.setAttribute('download', name) + a.href = dataUrl + if (type === 'img') { + const a = document.createElement('a') + a.setAttribute('download', name) + a.href = dataUrl + a.click() + document.body.removeChild(a) + } else { + const contentWidth = canvasDom.offsetWidth + const contentHeight = canvasDom.offsetHeight + const lp = contentWidth > contentHeight ? 'l' : 'p' + const PDF = new JsPDF(lp, 'pt', [contentWidth, contentHeight]) + PDF.addImage(dataUrl, 'PNG', 0, 0, contentWidth, contentHeight) + PDF.save(name + '.pdf') + } + if (callBack) { + callBack() + } + }) + .catch(error => { + console.error('oops, something went wrong!', error) + }) +} + export function downloadCanvas(type, canvasDom, name, callBack?) { // const canvasDom = document.getElementById(canvasId) if (canvasDom) { diff --git a/core/core-frontend/src/views/dashboard/DashboardPreviewShow.vue b/core/core-frontend/src/views/dashboard/DashboardPreviewShow.vue index 5259079506..f71d5894d0 100644 --- a/core/core-frontend/src/views/dashboard/DashboardPreviewShow.vue +++ b/core/core-frontend/src/views/dashboard/DashboardPreviewShow.vue @@ -12,7 +12,7 @@ import { useRequestStoreWithOut } from '@/store/modules/request' import { usePermissionStoreWithOut } from '@/store/modules/permission' import { useMoveLine } from '@/hooks/web/useMoveLine' import { Icon } from '@/components/icon-custom' -import { download2AppTemplate, downloadCanvas } from '@/utils/imgUtils' +import { download2AppTemplate, downloadCanvas, downloadCanvas2 } from '@/utils/imgUtils' const dvMainStore = dvMainStoreWithOut() const previewCanvasContainer = ref(null) @@ -98,7 +98,7 @@ const downloadH2 = type => { downloadStatus.value = true nextTick(() => { const vueDom = previewCanvasContainer.value.querySelector('.canvas-container') - downloadCanvas(type, vueDom, state.dvInfo.name, () => { + downloadCanvas2(type, vueDom, state.dvInfo.name, () => { downloadStatus.value = false }) }) diff --git a/core/core-frontend/src/views/data-visualization/PreviewShow.vue b/core/core-frontend/src/views/data-visualization/PreviewShow.vue index 2f53041f58..e8ea380b2e 100644 --- a/core/core-frontend/src/views/data-visualization/PreviewShow.vue +++ b/core/core-frontend/src/views/data-visualization/PreviewShow.vue @@ -13,7 +13,7 @@ import { useRequestStoreWithOut } from '@/store/modules/request' import { usePermissionStoreWithOut } from '@/store/modules/permission' import { useMoveLine } from '@/hooks/web/useMoveLine' import { Icon } from '@/components/icon-custom' -import { download2AppTemplate, downloadCanvas } from '@/utils/imgUtils' +import { download2AppTemplate, downloadCanvas, downloadCanvas2 } from '@/utils/imgUtils' const dvMainStore = dvMainStoreWithOut() const { dvInfo } = storeToRefs(dvMainStore) @@ -86,7 +86,7 @@ const download = type => { downloadStatus.value = true setTimeout(() => { const vueDom = previewCanvasContainer.value.querySelector('.canvas-container') - downloadCanvas(type, vueDom, state.dvInfo.name, () => { + downloadCanvas2(type, vueDom, state.dvInfo.name, () => { downloadStatus.value = false }) }, 200) From 11e5acb8a0d878c0529d534c03a7b3c135177827 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 23 May 2024 10:18:48 +0800 Subject: [PATCH 06/38] =?UTF-8?q?perf(X-Pack):=20=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E8=AE=A4=E8=AF=81=E5=B9=B3=E5=8F=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-backend/src/main/resources/db/migration/V2.7__ddl.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core-backend/src/main/resources/db/migration/V2.7__ddl.sql b/core/core-backend/src/main/resources/db/migration/V2.7__ddl.sql index 303e400b80..fa4501db71 100644 --- a/core/core-backend/src/main/resources/db/migration/V2.7__ddl.sql +++ b/core/core-backend/src/main/resources/db/migration/V2.7__ddl.sql @@ -15,7 +15,7 @@ INSERT INTO `core_sys_startup_job` VALUES ('chartFilterMerge', 'chartFilterMerge', 'ready'); COMMIT; - +TRUNCATE TABLE `xpack_setting_authentication`; ALTER TABLE `xpack_setting_authentication` ADD COLUMN `plugin_json` longtext NULL COMMENT '插件配置' AFTER `relational_ids`; ALTER TABLE `xpack_setting_authentication` From 31e30236511db3ddd081c4d7e690aa570ba9ff31 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 23 May 2024 10:32:56 +0800 Subject: [PATCH 07/38] =?UTF-8?q?perf:=20http=E5=B7=A5=E5=85=B7=E7=B1=BB?= =?UTF-8?q?=E6=A0=A1=E9=AA=8Curl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/dataease/utils/HttpClientUtil.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sdk/common/src/main/java/io/dataease/utils/HttpClientUtil.java b/sdk/common/src/main/java/io/dataease/utils/HttpClientUtil.java index 6e71094297..00814e3e86 100755 --- a/sdk/common/src/main/java/io/dataease/utils/HttpClientUtil.java +++ b/sdk/common/src/main/java/io/dataease/utils/HttpClientUtil.java @@ -93,8 +93,14 @@ public class HttpClientUtil { httpGet.addHeader(key, header.get(key)); } HttpResponse response = httpClient.execute(httpGet); - int statusCode = response.getStatusLine().getStatusCode(); - return statusCode <= 400; + if (response.getStatusLine().getStatusCode() >= 400) { + String msg = EntityUtils.toString(response.getEntity(), config.getCharset()); + if (StringUtils.isEmpty(msg)) { + msg = "StatusCode: " + response.getStatusLine().getStatusCode(); + } + throw new Exception(msg); + } + return true; } catch (Exception e) { logger.error("HttpClient查询失败", e); throw new DEException(SYSTEM_INNER_ERROR.code(), "HttpClient查询失败: " + e.getMessage()); From 612600fef33a579a3695b60fabbc02fe10a3b8b2 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 23 May 2024 10:42:44 +0800 Subject: [PATCH 08/38] =?UTF-8?q?fix:=20=E5=88=86=E4=BA=AB=E5=BC=B9?= =?UTF-8?q?=E6=A1=86=E6=9C=AA=E5=BC=80=E5=90=AF=E5=88=86=E4=BA=AB=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/views/share/share/ShareHandler.vue | 4 ++++ core/core-frontend/src/views/share/share/ShareVisualHead.vue | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/core/core-frontend/src/views/share/share/ShareHandler.vue b/core/core-frontend/src/views/share/share/ShareHandler.vue index 9539e5795d..31d83fc2d2 100644 --- a/core/core-frontend/src/views/share/share/ShareHandler.vue +++ b/core/core-frontend/src/views/share/share/ShareHandler.vue @@ -327,6 +327,10 @@ const expChangeHandler = exp => { }) } const beforeClose = async done => { + if (!shareEnable.value) { + done() + return + } const pwdValid = validatePwdFormat() const uuidValid = await validateUuid() if (pwdValid && uuidValid) { diff --git a/core/core-frontend/src/views/share/share/ShareVisualHead.vue b/core/core-frontend/src/views/share/share/ShareVisualHead.vue index 405ffc30cc..5399827c96 100644 --- a/core/core-frontend/src/views/share/share/ShareVisualHead.vue +++ b/core/core-frontend/src/views/share/share/ShareVisualHead.vue @@ -167,6 +167,10 @@ watch( } ) const hideShare = async () => { + if (!shareEnable.value) { + popoverVisible.value = false + return + } const pwdValid = validatePwdFormat() const uuidValid = await validateUuid() if (pwdValid && uuidValid) { From b9146cc28a1c1e981d9301d9fb0c88c9e084ef40 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 23 May 2024 13:51:11 +0800 Subject: [PATCH 09/38] =?UTF-8?q?feat(X-Pack):=20=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E6=A0=8F=E5=8F=B3=E4=BE=A7=E9=83=A8=E5=88=86=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=8F=AF=E9=85=8D=E7=BD=AE=E6=98=BE=E9=9A=90=20#9483?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/layout/components/AccountOperator.vue | 5 +++- .../src/layout/components/Header.vue | 23 +++++++++++++++---- .../src/layout/components/SystemCfg.vue | 13 ++++++++++- .../src/store/modules/appearance.ts | 19 +++++++++++++++ core/core-frontend/src/utils/utils.ts | 17 ++++++++++++++ de-xpack | 2 +- 6 files changed, 71 insertions(+), 8 deletions(-) diff --git a/core/core-frontend/src/layout/components/AccountOperator.vue b/core/core-frontend/src/layout/components/AccountOperator.vue index 6a65a60fd9..8a5c1b069a 100644 --- a/core/core-frontend/src/layout/components/AccountOperator.vue +++ b/core/core-frontend/src/layout/components/AccountOperator.vue @@ -25,6 +25,9 @@ interface LinkItem { method?: string } const linkList = ref([{ id: 5, label: t('common.about'), method: 'toAbout' }] as LinkItem[]) +if (!appearanceStore.getShowAbout) { + linkList.value.splice(0, 1) +} const inPlatformClient = computed(() => !!wsCache.get('de-platform-client')) @@ -118,7 +121,7 @@ if (uid.value === '1') { { } return route.path }) + const permissionStore = usePermissionStore() const routers: any[] = formatRoute(permissionStore.getRoutersNotHidden as AppCustomRouteRecordRaw[]) @@ -109,16 +111,27 @@ onMounted(() => {

- + - + - + - -
+ +
diff --git a/core/core-frontend/src/layout/components/SystemCfg.vue b/core/core-frontend/src/layout/components/SystemCfg.vue index 3384a258cf..9e85e8a4f2 100644 --- a/core/core-frontend/src/layout/components/SystemCfg.vue +++ b/core/core-frontend/src/layout/components/SystemCfg.vue @@ -2,8 +2,10 @@ import { useRouter } from 'vue-router' import { useAppearanceStoreWithOut } from '@/store/modules/appearance' import { computed } from 'vue' + const appearanceStore = useAppearanceStoreWithOut() const navigateBg = computed(() => appearanceStore.getNavigateBg) +const showDoc = computed(() => appearanceStore.getShowDoc) const { push, resolve } = useRouter() const redirectUser = () => { const sysMenu = resolve('/system') @@ -14,7 +16,13 @@ const redirectUser = () => { + @@ -1209,8 +1278,8 @@ defineExpose({ :className="`field-icon-${fieldType[ele.deType]}`" > - - {{ ele.name }} + + {{ ele.name || ele.variableName }} @@ -1276,7 +1345,7 @@ defineExpose({
时间粒度
- diff --git a/core/core-frontend/src/custom-component/de-frame/FrameLinks.vue b/core/core-frontend/src/custom-component/de-frame/FrameLinks.vue index a7838f85af..09d3592197 100644 --- a/core/core-frontend/src/custom-component/de-frame/FrameLinks.vue +++ b/core/core-frontend/src/custom-component/de-frame/FrameLinks.vue @@ -19,7 +19,7 @@ - + From 510cce645077f002c9be71d39e9dc854756cc125 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Thu, 23 May 2024 16:46:57 +0800 Subject: [PATCH 18/38] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E6=BA=90):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE=E6=BA=90=E5=A4=84=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=95=B0=E6=8D=AE=E9=9B=86=E6=B2=A1=E6=9C=89=E8=BF=9B?= =?UTF-8?q?=E8=A1=8Ctable=E5=AE=9A=E4=BD=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/visualized/data/datasource/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core-frontend/src/views/visualized/data/datasource/index.vue b/core/core-frontend/src/views/visualized/data/datasource/index.vue index c62f2110a1..0b73b41847 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/index.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/index.vue @@ -1073,7 +1073,7 @@ const getMenuList = (val: boolean) => { placement="top" > From 41e9cbfd1a2e0362444463a6b75dd9e65b18b443 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 23 May 2024 16:52:15 +0800 Subject: [PATCH 19/38] =?UTF-8?q?refactor(=E6=95=B0=E6=8D=AE=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F):=20=E5=88=B7=E6=96=B0=E6=96=87=E6=A1=88=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../subject-setting/dashboard-style/OverallSetting.vue | 2 +- core/core-frontend/src/locales/zh-CN.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue b/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue index 253d01c4e5..5bd5f78327 100644 --- a/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue +++ b/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue @@ -91,7 +91,7 @@ diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 136e0a1d69..afb6e700d4 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -2139,7 +2139,7 @@ export default { link_add_tips_pre: '请在右侧配置网页信息..', web_add_tips_suf: '添加网页信息...', panel_view_result_show: '图表结果', - panel_view_result_tips: '选择仪表板会覆盖图表的结果展示数量,取值范围1~10000', + panel_view_result_tips: '选择{0}会覆盖图表的结果展示数量,取值范围1~10000', timeout_refresh: '请求超时,稍后刷新...', mobile_layout: '移动端布局', component_hidden: '隐藏的组件', From 38ac1d5c1b7f85f5a07d745d0d189a83508e1536 Mon Sep 17 00:00:00 2001 From: junjun Date: Thu, 23 May 2024 17:17:22 +0800 Subject: [PATCH 20/38] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E7=BB=84=E4=BB=B6=E6=8E=92=E5=BA=8F=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=8A=A0=E5=85=A5=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/dataset/manage/DatasetDataManage.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetDataManage.java b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetDataManage.java index 98e2410322..97ed061b71 100644 --- a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetDataManage.java +++ b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetDataManage.java @@ -532,6 +532,13 @@ public class DatasetDataManage { boolean crossDs = false; Map dsMap = null; + if (ObjectUtils.isNotEmpty(request.getSortId())) { + // 如果排序字段和查询字段显示字段不一致,则加入到查询列表中 + if (!request.getSortId().equals(request.getQueryId()) && !request.getSortId().equals(request.getDisplayId())) { + ids.add(request.getSortId()); + } + } + for (Long id : ids) { DatasetTableFieldDTO field = datasetTableFieldManage.selectById(id); if (field == null) { From f2ae1778abc99bd458c237fcc3e1e53094b8c4ff Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 23 May 2024 17:17:59 +0800 Subject: [PATCH 21/38] =?UTF-8?q?refactor(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A8=A1=E7=89=88=E6=9F=A5=E8=AF=A2=E9=98=B2?= =?UTF-8?q?=E6=AD=A2=E8=B6=85=E6=97=B6=E9=80=A0=E6=88=90=E5=86=85=E9=83=A8?= =?UTF-8?q?=E6=A8=A1=E7=89=88=E4=B9=9F=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/template/manage/TemplateCenterManage.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/core-backend/src/main/java/io/dataease/template/manage/TemplateCenterManage.java b/core/core-backend/src/main/java/io/dataease/template/manage/TemplateCenterManage.java index fe5eb2797e..4d9bebc9b7 100644 --- a/core/core-backend/src/main/java/io/dataease/template/manage/TemplateCenterManage.java +++ b/core/core-backend/src/main/java/io/dataease/template/manage/TemplateCenterManage.java @@ -71,6 +71,9 @@ public class TemplateCenterManage { public String marketGet(String url, String accessKey) { HttpClientConfig config = new HttpClientConfig(); config.addHeader("API-Authorization", accessKey); + config.setConnectTimeout(5000); + config.setSocketTimeout(10000); + config.setConnectionRequestTimeout(5000); return HttpClientUtil.get(url, config); } From 34e723d3ebf0118ebde6e87fdc0601ae90aba15d Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 23 May 2024 17:24:14 +0800 Subject: [PATCH 22/38] =?UTF-8?q?perf(X-Pack):=20=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E9=85=8D=E7=BD=AE-=E5=B9=B3=E5=8F=B0=E5=AF=B9=E6=8E=A5-?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E9=A3=9E=E4=B9=A6=E8=AE=BE=E7=BD=AE=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/db/migration/V2.7__ddl.sql | 13 ++++++++++++- de-xpack | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/core/core-backend/src/main/resources/db/migration/V2.7__ddl.sql b/core/core-backend/src/main/resources/db/migration/V2.7__ddl.sql index fa4501db71..1f79fe929a 100644 --- a/core/core-backend/src/main/resources/db/migration/V2.7__ddl.sql +++ b/core/core-backend/src/main/resources/db/migration/V2.7__ddl.sql @@ -21,4 +21,15 @@ ALTER TABLE `xpack_setting_authentication` ALTER TABLE `xpack_setting_authentication` ADD COLUMN `synced` tinyint(1) NOT NULL DEFAULT 0 COMMENT '已同步' AFTER `plugin_json`; ALTER TABLE `xpack_setting_authentication` - ADD COLUMN `valid` tinyint(1) NOT NULL DEFAULT 0 COMMENT '有效' AFTER `synced`; \ No newline at end of file + ADD COLUMN `valid` tinyint(1) NOT NULL DEFAULT 0 COMMENT '有效' AFTER `synced`; + + +DROP TABLE IF EXISTS `xpack_platform_token`; +CREATE TABLE `xpack_platform_token` +( + `id` int NOT NULL, + `token` varchar(255) NOT NULL, + `create_time` bigint NOT NULL, + `exp_time` bigint NOT NULL, + PRIMARY KEY (`id`) +); diff --git a/de-xpack b/de-xpack index 657f4c79e3..d56e031344 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 657f4c79e3ac50269fc9bd03b57f3a7f60475755 +Subproject commit d56e0313447b0c04983b5c660edd4c9ab3658ca1 From 90686cb53d79cfaa467b218d7f6b6de0be6c6f38 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Thu, 23 May 2024 17:38:35 +0800 Subject: [PATCH 23/38] =?UTF-8?q?style(=E5=9B=BE=E8=A1=A8):=20=E5=9B=BE?= =?UTF-8?q?=E4=BE=8B=E6=A0=B7=E5=BC=8F=E4=B8=AD=EF=BC=8C=E4=BB=85=E5=BD=93?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E8=AE=BE=E7=BD=AE=E5=9B=BE=E4=BE=8B=E6=96=B9?= =?UTF-8?q?=E5=90=91=E6=97=B6=E6=98=BE=E7=A4=BA=E7=AB=96=E7=BA=BF=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor/editor-style/components/LegendSelector.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/LegendSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/LegendSelector.vue index a468dc1f8d..571052fea3 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/LegendSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/LegendSelector.vue @@ -224,7 +224,11 @@ onMounted(() => { -
+
Date: Thu, 23 May 2024 17:45:54 +0800 Subject: [PATCH 24/38] =?UTF-8?q?feat(=E5=9B=BE=E8=A1=A8):=20=E6=B0=B4?= =?UTF-8?q?=E6=B3=A2=E5=9B=BE=E6=94=AF=E6=8C=81=E9=98=88=E5=80=BC=20#9370?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/models/chart/chart-senior.d.ts | 4 ++ .../core-frontend/src/models/chart/chart.d.ts | 8 ++++ .../editor-senior/components/Threshold.vue | 38 +++++++++++++++++-- .../chart/components/editor/util/chart.ts | 1 + .../js/panel/charts/liquid/liquid.ts | 38 +++++++++++++++++-- 5 files changed, 82 insertions(+), 7 deletions(-) diff --git a/core/core-frontend/src/models/chart/chart-senior.d.ts b/core/core-frontend/src/models/chart/chart-senior.d.ts index ab9d0cdceb..30747503dd 100644 --- a/core/core-frontend/src/models/chart/chart-senior.d.ts +++ b/core/core-frontend/src/models/chart/chart-senior.d.ts @@ -123,6 +123,10 @@ declare interface ChartThreshold { * 仪表盘阈值: x,y,z */ gaugeThreshold: string + /** + * 水波图阈值: x,y,z + */ + liquidThreshold: string /** * 指标卡阈值 */ diff --git a/core/core-frontend/src/models/chart/chart.d.ts b/core/core-frontend/src/models/chart/chart.d.ts index a39be37515..9de6ebdd0e 100644 --- a/core/core-frontend/src/models/chart/chart.d.ts +++ b/core/core-frontend/src/models/chart/chart.d.ts @@ -117,6 +117,14 @@ declare interface Axis extends ChartViewField { * 维度/指标分组类型 */ groupType: 'q' | 'd' + /** + * 排序规则 + */ + sort: 'asc' | 'desc' | 'none' | 'custom_sort' + /** + * 自定义排序项 + */ + customSort: string[] } declare interface ChartViewField { /** diff --git a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/Threshold.vue b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/Threshold.vue index f10de480e6..589eb39de0 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/Threshold.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/Threshold.vue @@ -61,10 +61,10 @@ const init = () => { const changeThreshold = () => { emit('onThresholdChange', state.thresholdForm) } -const gaugeThresholdChange = () => { +const changeSplitThreshold = (threshold: string) => { // check input - if (state.thresholdForm.gaugeThreshold) { - const arr = state.thresholdForm.gaugeThreshold.split(',') + if (threshold) { + const arr = threshold.split(',') for (let i = 0; i < arr.length; i++) { const ele = arr[i] if (parseFloat(ele).toString() === 'NaN' || parseFloat(ele) <= 0 || parseFloat(ele) >= 100) { @@ -246,7 +246,7 @@ init() style="width: 100px; margin: 0 10px" size="small" clearable - @change="gaugeThresholdChange" + @change="changeSplitThreshold" /> ,100 @@ -260,6 +260,36 @@ init() + + + + 0, + + ,100 + + + + + + + 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 29e38eebe1..4e7bd2fa6e 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 @@ -675,6 +675,7 @@ export const DEFAULT_ASSIST_LINE_CFG: ChartAssistLineCfg = { export const DEFAULT_THRESHOLD: ChartThreshold = { enable: false, gaugeThreshold: '', + liquidThreshold: '', labelThreshold: [], tableThreshold: [], textLabelThreshold: [] diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/liquid/liquid.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/liquid/liquid.ts index 40de8d9e64..bdbd824b2d 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/liquid/liquid.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/liquid/liquid.ts @@ -19,7 +19,8 @@ export class Liquid extends G2PlotChartView { 'basic-style-selector', 'label-selector', 'misc-selector', - 'title-selector' + 'title-selector', + 'threshold' ] propertyInner: EditorPropertyInner = { 'background-overall-component': ['all'], @@ -37,7 +38,8 @@ export class Liquid extends G2PlotChartView { 'fontFamily', 'letterSpace', 'fontShadow' - ] + ], + threshold: ['liquidThreshold'] } axis: AxisType[] = ['yAxis', 'filter'] axisConfig: AxisConfig = { @@ -147,6 +149,31 @@ export class Liquid extends G2PlotChartView { } } + protected configThreshold(chart: Chart, options: LiquidOptions): LiquidOptions { + const senior = parseJson(chart.senior) + if (senior?.threshold?.enable) { + const { liquidThreshold } = senior?.threshold + if (liquidThreshold) { + const { paletteQualitative10: colors } = (options.theme as any).styleSheet + const liquidStyle = () => { + const thresholdArr = liquidThreshold.split(',') + let index = 0 + thresholdArr.forEach((v, i) => { + if (options.percent > parseFloat(v) / 100) { + index = i + 1 + } + }) + return { + fill: colors[index % colors.length], + stroke: colors[index % colors.length] + } + } + return { ...options, liquidStyle } + } + } + return options + } + setupDefaultOptions(chart: ChartObj): ChartObj { chart.customAttr.label = { ...chart.customAttr.label, @@ -162,7 +189,12 @@ export class Liquid extends G2PlotChartView { } protected setupOptions(chart: Chart, options: LiquidOptions): LiquidOptions { - return flow(this.configTheme, this.configMisc, this.configLabel)(chart, options) + return flow( + this.configTheme, + this.configMisc, + this.configLabel, + this.configThreshold + )(chart, options) } constructor() { super('liquid', DEFAULT_LIQUID_DATA) From 904a96539a4d994b56759782b3c671fbc3d33490 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 23 May 2024 17:47:50 +0800 Subject: [PATCH 25/38] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=B0=E5=A4=8D=E5=88=B6=E7=9A=84=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E6=9D=BF=E6=9C=AA=E4=BF=9D=E5=AD=98=E6=98=AF=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=88=B0=E7=A7=BB=E5=8A=A8=E7=AB=AF=E4=BC=9A=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=E6=9D=83=E9=99=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/components/dashboard/DbToolbar.vue | 2 +- core/core-frontend/src/views/dashboard/index.vue | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/core-frontend/src/components/dashboard/DbToolbar.vue b/core/core-frontend/src/components/dashboard/DbToolbar.vue index a1a57a20a6..bf19c1b2d7 100644 --- a/core/core-frontend/src/components/dashboard/DbToolbar.vue +++ b/core/core-frontend/src/components/dashboard/DbToolbar.vue @@ -219,7 +219,7 @@ const openDataBoardSetting = () => { } const openMobileSetting = () => { - if (!dvInfo.value.id) { + if (!dvInfo.value.id || dvInfo.value.dataState === 'prepare') { ElMessage.warning('请先保存当前页面') return } diff --git a/core/core-frontend/src/views/dashboard/index.vue b/core/core-frontend/src/views/dashboard/index.vue index 8e3541c2b6..ac9d33590d 100644 --- a/core/core-frontend/src/views/dashboard/index.vue +++ b/core/core-frontend/src/views/dashboard/index.vue @@ -137,6 +137,13 @@ const initLocalCanvasData = () => { dvInfo.value.pid = sourcePid setTimeout(() => { snapshotStore.recordSnapshotCache() + // 复制时,初始化的保存按钮为激活状态 + if (opt === 'copy') { + // 使用缓存时,初始化的保存按钮为激活状态 + setTimeout(() => { + snapshotStore.recordSnapshotCache('renderChart') + }, 1000) + } }, 1500) } }) From 36c7b309960ca92faf9ce2ca2e3be05fc80447fa Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 23 May 2024 18:29:15 +0800 Subject: [PATCH 26/38] =?UTF-8?q?refactor(=E6=95=B0=E6=8D=AE=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F):=20=E6=96=87=E6=A1=88=E3=80=81=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=BC=96=E8=BE=91=E6=A1=86=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E7=AD=89=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/custom-component/component-list.ts | 8 +-- .../views/chart/components/editor/index.vue | 58 +++++++++++++++++++ 2 files changed, 62 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/custom-component/component-list.ts b/core/core-frontend/src/custom-component/component-list.ts index 33af3555eb..5593b26805 100644 --- a/core/core-frontend/src/custom-component/component-list.ts +++ b/core/core-frontend/src/custom-component/component-list.ts @@ -253,8 +253,8 @@ const list = [ }, { component: 'DeVideo', - name: '媒体', - label: '媒体', + name: '视频', + label: '视频', innerType: 'DeVideo', editing: false, canvasActive: false, @@ -272,8 +272,8 @@ const list = [ }, { component: 'DeStreamMedia', - name: '媒体', - label: '媒体', + name: '流媒体', + label: '流媒体', innerType: 'DeStreamMedia', editing: false, canvasActive: false, 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 69e2d17faf..b6084fc5fc 100644 --- a/core/core-frontend/src/views/chart/components/editor/index.vue +++ b/core/core-frontend/src/views/chart/components/editor/index.vue @@ -3044,6 +3044,35 @@ const drop = (ev: MouseEvent, type = 'xAxis') => { border-top: none !important; } + :deep(.ed-tabs__nav-wrap::after) { + background-color: rgba(31, 35, 41, 0.15); + } + :deep(.ed-tabs__nav-scroll) { + .ed-tabs__item { + height: 35px; + line-height: 35px; + color: var(--ed-color-primary, #3370ff); + font-family: '阿里巴巴普惠体 3.0 55 Regular L3'; + font-size: 12px; + font-style: normal; + font-weight: 500; + } + } + } + .query-style-tab { + width: 100%; + border-top: solid 1px @side-outline-border-color-light !important; + + .tab-container { + .border-bottom-tab(8px); + } + + margin-left: 0px !important; + + :deep(.ed-tabs__header) { + border-top: none !important; + } + :deep(.ed-tabs__nav-wrap::after) { background-color: rgba(31, 35, 41, 0.15); } @@ -3082,6 +3111,35 @@ const drop = (ev: MouseEvent, type = 'xAxis') => { box-shadow: 0 0 0 1px var(--ed-color-primary, #3370ff) inset !important; } } + .query-style-tab { + width: 100%; + border-top: solid 1px @main-collapse-border-dark !important; + + .tab-container { + .border-bottom-tab(8px); + } + + margin-left: 0px !important; + + :deep(.ed-tabs__header) { + border-top: none !important; + } + + :deep(.ed-tabs__nav-wrap::after) { + background-color: rgba(31, 35, 41, 0.15); + } + :deep(.ed-tabs__nav-scroll) { + .ed-tabs__item { + height: 35px; + line-height: 35px; + color: var(--ed-color-primary, #3370ff); + font-family: '阿里巴巴普惠体 3.0 55 Regular L3'; + font-size: 12px; + font-style: normal; + font-weight: 500; + } + } + } } .chart-edit { From 03680208ad2b02b46760f6b725e98d10ac3e412c Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Thu, 23 May 2024 18:31:18 +0800 Subject: [PATCH 27/38] =?UTF-8?q?feat(=E5=9B=BE=E8=A1=A8):=20=E6=8C=87?= =?UTF-8?q?=E6=A0=87=E5=8D=A1=E9=98=88=E5=80=BC=E6=94=AF=E6=8C=81=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=83=8C=E6=99=AF=E8=89=B2=20#9370?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indicator/DeIndicator.vue | 28 ++++++++++++------- .../src/models/chart/chart-attr.d.ts | 4 +++ .../editor-senior/components/Threshold.vue | 4 +-- .../components/dialog/TextThresholdEdit.vue | 5 ++-- .../components/table/TableHeaderSelector.vue | 7 +---- .../chart/components/editor/util/chart.ts | 1 + 6 files changed, 29 insertions(+), 20 deletions(-) diff --git a/core/core-frontend/src/custom-component/indicator/DeIndicator.vue b/core/core-frontend/src/custom-component/indicator/DeIndicator.vue index b5f3b5d031..4e5778548a 100644 --- a/core/core-frontend/src/custom-component/indicator/DeIndicator.vue +++ b/core/core-frontend/src/custom-component/indicator/DeIndicator.vue @@ -93,9 +93,10 @@ const result = computed(() => { const indicatorColor = ref(DEFAULT_INDICATOR_STYLE.color) const thresholdColor = computed(() => { - let color = indicatorColor.value + let color: string = indicatorColor.value + let backgroundColor: string = DEFAULT_INDICATOR_STYLE.backgroundColor if (result.value === '-') { - return color + return { color, backgroundColor } } const value = result.value if ( @@ -107,42 +108,47 @@ const thresholdColor = computed(() => { for (let i = 0; i < senior.threshold.labelThreshold.length; i++) { let flag = false const t = senior.threshold.labelThreshold[i] - const tv = parseFloat(t.value) + const tv = t.value if (t.term === 'eq') { if (value === tv) { color = t.color + backgroundColor = t.backgroundColor flag = true } } else if (t.term === 'not_eq') { if (value !== tv) { color = t.color + backgroundColor = t.backgroundColor flag = true } } else if (t.term === 'lt') { if (value < tv) { color = t.color + backgroundColor = t.backgroundColor flag = true } } else if (t.term === 'gt') { if (value > tv) { color = t.color + backgroundColor = t.backgroundColor flag = true } } else if (t.term === 'le') { if (value <= tv) { color = t.color + backgroundColor = t.backgroundColor flag = true } } else if (t.term === 'ge') { if (value >= tv) { color = t.color + backgroundColor = t.backgroundColor flag = true } } else if (t.term === 'between') { - const min = parseFloat(t.min) - const max = parseFloat(t.max) - if (min <= value && value <= max) { + if (t.min <= value && value <= t.max) { color = t.color + backgroundColor = t.backgroundColor flag = true } } @@ -151,7 +157,7 @@ const thresholdColor = computed(() => { } } } - return color + return { color, backgroundColor } }) const formattedResult = computed(() => { @@ -175,11 +181,12 @@ const contentStyle = ref({ 'flex-direction': 'column', 'align-items': 'center', 'justify-content': 'center', - height: '100%' + height: '100%', + 'background-color': thresholdColor.value.backgroundColor }) const indicatorClass = ref({ - color: thresholdColor.value, + color: thresholdColor.value.color, 'font-size': DEFAULT_INDICATOR_STYLE.fontSize + 'px', 'font-family': defaultTo( CHART_FONT_FAMILY_MAP[DEFAULT_INDICATOR_STYLE.fontFamily], @@ -280,7 +287,7 @@ const renderChart = async view => { } indicatorClass.value = { - color: thresholdColor.value, + color: thresholdColor.value.color, 'font-size': indicator.fontSize + 'px', 'font-family': defaultTo( CHART_FONT_FAMILY_MAP[indicator.fontFamily], @@ -292,6 +299,7 @@ const renderChart = async view => { 'text-shadow': indicator.fontShadow ? '2px 2px 4px' : 'none', 'font-synthesis': 'weight style' } + contentStyle.value['background-color'] = thresholdColor.value.backgroundColor indicatorSuffixClass.value = { color: suffixColor, diff --git a/core/core-frontend/src/models/chart/chart-attr.d.ts b/core/core-frontend/src/models/chart/chart-attr.d.ts index 63f6bb9e23..1a86f4292e 100644 --- a/core/core-frontend/src/models/chart/chart-attr.d.ts +++ b/core/core-frontend/src/models/chart/chart-attr.d.ts @@ -790,6 +790,10 @@ declare interface ChartIndicatorStyle { * 字体颜色 */ color: string + /** + * 背景颜色 + */ + backgroundColor: string /** * 水平位置 */ diff --git a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/Threshold.vue b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/Threshold.vue index 589eb39de0..8b92b9b891 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/Threshold.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/Threshold.vue @@ -439,14 +439,14 @@ init() class="color-div" :class="{ 'color-div-dark': themes === 'dark' }" >
- + >
diff --git a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TextThresholdEdit.vue b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TextThresholdEdit.vue index ae75a0f9a5..101f8b1b2b 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TextThresholdEdit.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TextThresholdEdit.vue @@ -24,6 +24,7 @@ const thresholdObj = { field: '0', value: '0', color: '#ff0000ff', + backgroundColor: '#fff', min: '0', max: '1' } @@ -175,7 +176,7 @@ init() @change="changeThreshold" /> - +
{ - + Date: Thu, 23 May 2024 22:06:49 +0800 Subject: [PATCH 28/38] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8-=E8=B1=A1=E9=99=90?= =?UTF-8?q?=E5=9B=BE):=20=E4=BF=AE=E5=A4=8D=E8=AE=A1=E7=AE=97=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E4=BD=9C=E4=B8=BA=E6=A8=AA=E7=BA=B5=E8=BD=B4=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=E5=8F=8A=E9=85=8D=E7=BD=AE=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/manage/ChartDataManage.java | 14 +- .../components/QuadrantSelector.vue | 27 ++-- .../editor-style/components/XAxisSelector.vue | 6 +- .../editor-style/components/YAxisSelector.vue | 5 +- .../js/panel/charts/others/quadrant.ts | 150 +++++++++--------- 5 files changed, 99 insertions(+), 103 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java b/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java index 97b9343ee9..d37ef830d2 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java +++ b/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java @@ -557,17 +557,11 @@ public class ChartDataManage { } else if (StringUtils.containsIgnoreCase(view.getType(), "quadrant")) { Dimension2SQLObj.dimension2sqlObj(sqlMeta, xAxis, transFields(allFields), crossDs, dsMap); yAxis.addAll(extBubble); + if(ObjectUtils.isNotEmpty(view.getExtTooltip())){ + yAxis.addAll(new ArrayList<>(view.getExtTooltip())); + } Quota2SQLObj.quota2sqlObj(sqlMeta, yAxis, transFields(allFields), crossDs, dsMap); querySql = SQLProvider.createQuerySQL(sqlMeta, true, needOrder, view); - if (containDetailField(view) && ObjectUtils.isNotEmpty(viewFields)) { - detailFieldList.addAll(xAxis); - detailFieldList.addAll(viewFields); - - Dimension2SQLObj.dimension2sqlObj(sqlMeta, detailFieldList, transFields(allFields), crossDs, dsMap); - String originSql = SQLProvider.createQuerySQL(sqlMeta, false, needOrder, view); - String limit = ((pageInfo.getGoPage() != null && pageInfo.getPageSize() != null) ? " LIMIT " + pageInfo.getPageSize() + " OFFSET " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() : ""); - detailFieldSql = originSql + limit; - } } else if (StringUtils.equalsIgnoreCase("bar-range", view.getType())) { sqlMeta.setChartType(view.getType()); Dimension2SQLObj.dimension2sqlObj(sqlMeta, xAxis, transFields(allFields), crossDs, dsMap); @@ -791,7 +785,7 @@ public class ChartDataManage { } else if (StringUtils.containsIgnoreCase(view.getType(), "label")) { mapChart = ChartDataBuild.transLabelChartData(xAxis, yAxis, view, data, isDrill); } else if (StringUtils.containsIgnoreCase(view.getType(), "quadrant")) { - mapChart = ChartDataBuild.transQuadrantDataAntV(xAxis, yAxis, view, data, extBubble, isDrill); + mapChart = ChartDataBuild.transMixChartDataAntV(xAxis, yAxis, view, data, isDrill); } else if (StringUtils.equalsIgnoreCase(view.getType(), "bar-range")) { mapChart = ChartDataBuild.transBarRangeDataAntV(skipBarRange, barRangeDate, xAxisBase, xAxis, yAxis, view, data, isDrill); } else { diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/QuadrantSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/QuadrantSelector.vue index d232b27b64..2c839f1ea4 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/QuadrantSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/QuadrantSelector.vue @@ -137,11 +137,13 @@ onMounted(() => { label-position="top" >