From 7fd3488bfc9bb0f29772a80b0605bd49ce77e3b0 Mon Sep 17 00:00:00 2001 From: xuwei-fit2cloud Date: Mon, 28 Oct 2024 10:30:53 +0800 Subject: [PATCH 01/33] =?UTF-8?q?refactor:=20=E6=B7=BB=E5=8A=A0docker=20da?= =?UTF-8?q?emon.json=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- installer/install.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/installer/install.sh b/installer/install.sh index 610470def4..eca2e821f7 100644 --- a/installer/install.sh +++ b/installer/install.sh @@ -176,8 +176,6 @@ function install_docker() { cp docker/service/docker.service /etc/systemd/system/ chmod +x /usr/bin/docker* chmod 644 /etc/systemd/system/docker.service - log_content "启动 docker" - systemctl enable docker >/dev/null 2>&1; systemctl daemon-reload; systemctl start docker 2>&1 | tee -a ${CURRENT_DIR}/install.log else log_content "在线安装 docker" curl -fsSL https://resource.fit2cloud.com/get-docker-linux.sh -o get-docker.sh 2>&1 | tee -a ${CURRENT_DIR}/install.log @@ -186,13 +184,20 @@ function install_docker() { exit 1 fi sudo sh get-docker.sh 2>&1 | tee -a ${CURRENT_DIR}/install.log - log_content "启动 docker" - systemctl enable docker >/dev/null 2>&1; systemctl daemon-reload; systemctl start docker 2>&1 | tee -a ${CURRENT_DIR}/install.log fi docker_config_folder="/etc/docker" if [ ! -d "$docker_config_folder" ];then mkdir -p "$docker_config_folder" + cat < $docker_config_folder/daemon.json + { + "log-driver": "json-file", + "log-opts": { + "max-file": "3", + "max-size": "10m" + } + } +EOF fi docker version >/dev/null 2>&1 @@ -201,6 +206,8 @@ function install_docker() { exit 1 else log_content "docker 安装成功" + log_content "启动 docker" + systemctl enable docker >/dev/null 2>&1; systemctl daemon-reload; systemctl start docker 2>&1 | tee -a ${CURRENT_DIR}/install.log fi fi } From c652f91b67754e7669a9fd6d5100b85363793ac0 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Mon, 28 Oct 2024 10:59:01 +0800 Subject: [PATCH 02/33] =?UTF-8?q?fix(=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6)?= =?UTF-8?q?:=20=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6=E7=BA=A7=E8=81=94?= =?UTF-8?q?=E7=9A=84=E7=BA=A7=E8=81=94=E7=8A=B6=E6=80=81=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=20#12885?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom-component/v-query/Component.vue | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/core/core-frontend/src/custom-component/v-query/Component.vue b/core/core-frontend/src/custom-component/v-query/Component.vue index 2ec329205c..f16f007655 100644 --- a/core/core-frontend/src/custom-component/v-query/Component.vue +++ b/core/core-frontend/src/custom-component/v-query/Component.vue @@ -441,6 +441,11 @@ const resetData = () => { next.conditionValueS = next.defaultConditionValueS next.conditionValueOperatorS = next.defaultConditionValueOperatorS + if (next.displayType === '22') { + next.numValueEnd = next.defaultNumValueEnd + next.numValueStart = next.defaultNumValueStart + } + if (!next.defaultValueCheck) { next.defaultValue = next.multiple || +next.displayType === 7 ? [] : undefined } @@ -450,6 +455,21 @@ const resetData = () => { ? [...next.defaultMapValue] : next.defaultMapValue } + + ;(props.element.cascade || []).forEach(ele => { + ele.forEach(item => { + const comId = item.datasetId.split('--')[1] + console.log('comId', comId) + + if (next.id === comId) { + item.currentSelectValue = Array.isArray(next.selectValue) + ? next.selectValue + : [next.selectValue] + useEmitt().emitter.emit(`${item.datasetId.split('--')[1]}-select`) + } + }) + }) + const keyList = Object.entries(next.checkedFieldsMap) .filter(ele => next.checkedFields.includes(ele[0])) .filter(ele => !!ele[1]) @@ -461,6 +481,14 @@ const resetData = () => { } const clearData = () => { + ;(props.element.cascade || []).forEach(ele => { + ele.forEach(item => { + if (item.currentSelectValue?.length) { + useEmitt().emitter.emit(`${item.datasetId.split('--')[1]}-select`) + item.currentSelectValue = [] + } + }) + }) ;(list.value || []).reduce((pre, next) => { next.selectValue = next.multiple || +next.displayType === 7 ? [] : undefined if (next.optionValueSource === 1 && next.defaultMapValue?.length) { @@ -468,6 +496,11 @@ const clearData = () => { } next.conditionValueF = '' next.conditionValueS = '' + + if (next.displayType === '22') { + next.numValueEnd = undefined + next.numValueStart = undefined + } const keyList = Object.entries(next.checkedFieldsMap) .filter(ele => next.checkedFields.includes(ele[0])) .filter(ele => !!ele[1]) From f7bb999f2e6540a31f14e59321cd131a18c294d7 Mon Sep 17 00:00:00 2001 From: wisonic Date: Mon, 28 Oct 2024 11:30:27 +0800 Subject: [PATCH 03/33] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=8F=92=E4=BB=B6=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=BB=B4?= =?UTF-8?q?=E5=BA=A6=E5=92=8C=E6=8C=87=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/views/chart/components/views/index.vue | 4 ++++ 1 file changed, 4 insertions(+) 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 7882df7cc5..38af35edc2 100644 --- a/core/core-frontend/src/views/chart/components/views/index.vue +++ b/core/core-frontend/src/views/chart/components/views/index.vue @@ -583,6 +583,10 @@ const checkFieldIsAllowEmpty = (allField?) => { showEmpty.value = false if (view.value?.render && view.value?.type) { const chartView = chartViewManager.getChartView(view.value.render, view.value.type) + // 插件 + if (!chartView) { + return + } const map = parseJson(view.value.customAttr).map if (['bubble-map', 'map'].includes(view.value?.type) && !map?.id) { showEmpty.value = true From 65565832a66a52d07656571aa901515dc481311b Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Mon, 28 Oct 2024 11:30:34 +0800 Subject: [PATCH 04/33] =?UTF-8?q?fix(=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6)?= =?UTF-8?q?:=20=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6=E7=BA=A7=E8=81=94?= =?UTF-8?q?=E7=9A=84=E7=BA=A7=E8=81=94=E7=8A=B6=E6=80=81=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=20#12885?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/custom-component/v-query/Component.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/core-frontend/src/custom-component/v-query/Component.vue b/core/core-frontend/src/custom-component/v-query/Component.vue index f16f007655..15154a9894 100644 --- a/core/core-frontend/src/custom-component/v-query/Component.vue +++ b/core/core-frontend/src/custom-component/v-query/Component.vue @@ -459,9 +459,7 @@ const resetData = () => { ;(props.element.cascade || []).forEach(ele => { ele.forEach(item => { const comId = item.datasetId.split('--')[1] - console.log('comId', comId) - - if (next.id === comId) { + if (next.id === comId && ![null, undefined].includes(next.selectValue)) { item.currentSelectValue = Array.isArray(next.selectValue) ? next.selectValue : [next.selectValue] From 3a4d2d06203be922005c85763eeb887855796a4e Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Mon, 28 Oct 2024 11:58:13 +0800 Subject: [PATCH 05/33] =?UTF-8?q?fix(=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6)?= =?UTF-8?q?:=20=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6=E7=BA=A7=E8=81=94?= =?UTF-8?q?=E7=9A=84=E7=BA=A7=E8=81=94=E7=8A=B6=E6=80=81=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=20#12885?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/custom-component/v-query/Component.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/custom-component/v-query/Component.vue b/core/core-frontend/src/custom-component/v-query/Component.vue index 15154a9894..a7495f583a 100644 --- a/core/core-frontend/src/custom-component/v-query/Component.vue +++ b/core/core-frontend/src/custom-component/v-query/Component.vue @@ -459,10 +459,10 @@ const resetData = () => { ;(props.element.cascade || []).forEach(ele => { ele.forEach(item => { const comId = item.datasetId.split('--')[1] - if (next.id === comId && ![null, undefined].includes(next.selectValue)) { + if (next.id === comId) { item.currentSelectValue = Array.isArray(next.selectValue) ? next.selectValue - : [next.selectValue] + : [next.selectValue].map(itx => ![null, undefined].includes(itx)) useEmitt().emitter.emit(`${item.datasetId.split('--')[1]}-select`) } }) From 98eea8897456e03addb25a85b4227e83cc9bb89e Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Mon, 28 Oct 2024 14:41:39 +0800 Subject: [PATCH 06/33] =?UTF-8?q?fix(=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6)?= =?UTF-8?q?:=20=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6=E7=BA=A7=E8=81=94?= =?UTF-8?q?=E7=9A=84=E7=BA=A7=E8=81=94=E7=8A=B6=E6=80=81=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=20#12885?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/custom-component/v-query/Component.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core-frontend/src/custom-component/v-query/Component.vue b/core/core-frontend/src/custom-component/v-query/Component.vue index a7495f583a..1c4c893f33 100644 --- a/core/core-frontend/src/custom-component/v-query/Component.vue +++ b/core/core-frontend/src/custom-component/v-query/Component.vue @@ -462,7 +462,7 @@ const resetData = () => { if (next.id === comId) { item.currentSelectValue = Array.isArray(next.selectValue) ? next.selectValue - : [next.selectValue].map(itx => ![null, undefined].includes(itx)) + : [next.selectValue].filter(itx => ![null, undefined].includes(itx)) useEmitt().emitter.emit(`${item.datasetId.split('--')[1]}-select`) } }) From 86e841f3240c14359b388f1a5874c67983285dd4 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Mon, 28 Oct 2024 15:16:55 +0800 Subject: [PATCH 07/33] =?UTF-8?q?feat(=E5=9B=BE=E8=A1=A8):=20=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E7=9B=98=E3=80=81=E6=B0=B4=E6=B3=A2=E5=9B=BE=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor-style/components/MiscSelector.vue | 160 ++++++++++++++++-- .../chart/components/editor/util/chart.ts | 8 +- .../js/panel/charts/liquid/liquid.ts | 22 ++- .../js/panel/charts/others/gauge.ts | 20 ++- .../views/components/ChartComponentG2Plot.vue | 15 +- 5 files changed, 194 insertions(+), 31 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue index 9840040bf5..2002ed3146 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue @@ -3,7 +3,7 @@ import icon_info_outlined from '@/assets/svg/icon_info_outlined.svg' import { computed, onMounted, reactive, watch } from 'vue' import { useI18n } from '@/hooks/web/useI18n' import { DEFAULT_MISC } from '@/views/chart/components/editor/util/chart' -import { ElMessage, ElRow } from 'element-plus-secondary' +import { ElRow } from 'element-plus-secondary' import { fieldType } from '@/utils/attr' import { cloneDeep, defaultsDeep } from 'lodash-es' import { useEmitt } from '@/hooks/web/useEmitt' @@ -25,6 +25,14 @@ useEmitt({ name: 'word-cloud-default-data-range', callback: args => wordCloudDefaultDataRange(args) }) +useEmitt({ + name: 'gauge-default-data', + callback: args => gaugeDefaultDataRange(args) +}) +useEmitt({ + name: 'liquid-default-data', + callback: args => gaugeDefaultDataRange(args) +}) const emit = defineEmits(['onMiscChange']) watch( @@ -59,7 +67,10 @@ const state = reactive({ minField: {}, maxField: {}, liquidMaxField: {}, - quotaData: [] + quotaData: [], + // 是否已处理没有 y 轴字段的情况 + liquidProcessedNoYAxis: false, + gaugeProcessedNoYAxis: false }) const liquidShapeOptions = [ @@ -71,9 +82,6 @@ const liquidShapeOptions = [ ] const changeMisc = (prop = '', refresh = false) => { - if (state.miscForm.gaugeMax <= state.miscForm.gaugeMin) { - ElMessage.error(t('chart.max_more_than_mix')) - } emit('onMiscChange', { data: state.miscForm, requestData: refresh }, prop) } @@ -93,13 +101,93 @@ const initField = () => { if (state.miscForm.liquidMaxField.id) { state.liquidMaxField = getQuotaField(state.miscForm.liquidMaxField.id) } + initDynamicDefaultField() +} + +const initDynamicDefaultField = () => { + if (state.quotaData.length > 0) { + // 查找 quotaData 中是否存在 chart.yAxis[0].id + const yAxisId = props.chart.yAxis?.[0]?.id + const yAxisExists = state.quotaData.find(ele => ele.id === yAxisId) + // 如果不存在 + if (!yAxisExists && (state.miscForm.liquidMaxField.id || state.miscForm.gaugeMaxField.id)) { + if (props.chart.type === 'liquid' && !state.liquidProcessedNoYAxis) { + state.liquidProcessedNoYAxis = true + state.miscForm.liquidMaxField.id = '' + state.miscForm.liquidMaxField.summary = '' + state.liquidMaxField = getQuotaField(state.miscForm.liquidMaxField.id) + changeMisc('liquidMaxField', false) + } else { + if (!state.gaugeProcessedNoYAxis) { + state.gaugeProcessedNoYAxis = true + state.miscForm.gaugeMaxField.id = '' + state.miscForm.gaugeMaxField.summary = '' + state.maxField = {} + changeMisc('gaugeMaxField', false) + } + } + } else { + if (props.chart.type === 'liquid') { + if (state.miscForm.liquidMaxType === 'dynamic') { + state.miscForm.liquidMax = undefined + // 查找 quotaData 中是否存在 liquidMaxField.id + const liquidMaxFieldExists = state.quotaData.find( + ele => ele.id === state.miscForm.liquidMaxField.id + ) + if (!liquidMaxFieldExists) { + if (yAxisId) { + state.liquidProcessedNoYAxis = false + // 根据查找结果设置 liquidMaxField.id + state.miscForm.liquidMaxField.id = yAxisExists ? yAxisId : state.quotaData[0]?.id + // 设置 summary 和 maxField + state.miscForm.liquidMaxField.summary = 'sum' + state.maxField = getQuotaField(state.miscForm.liquidMaxField.id) + // 触发 changeMisc 事件 + if (yAxisExists) { + changeMisc('liquidMaxField', true) + } + } + } + } + if (!state.miscForm.liquidMax && state.miscForm.liquidMaxType === 'fix') { + state.miscForm.liquidMax = cloneDeep(defaultMaxValue.liquidMax) + } + } else { + if (state.miscForm.gaugeMaxType === 'dynamic') { + state.miscForm.gaugeMax = undefined + + // 查找 quotaData 中是否存在 gaugeMaxField.id + const gaugeMaxFieldExists = state.quotaData.find( + ele => ele.id === state.miscForm.gaugeMaxField.id + ) + if (!gaugeMaxFieldExists) { + if (yAxisId) { + state.gaugeProcessedNoYAxis = false + // 根据查找结果设置 gaugeMaxField.id + state.miscForm.gaugeMaxField.id = yAxisExists ? yAxisId : state.quotaData[0]?.id + // 设置 summary 和 maxField + state.miscForm.gaugeMaxField.summary = 'sum' + state.maxField = getQuotaField(state.miscForm.gaugeMaxField.id) + if (yAxisExists) { + // 触发 changeMisc 事件 + changeMisc('gaugeMaxField', true) + } + } + } + } + if (!state.miscForm.gaugeMax && state.miscForm.gaugeMaxType === 'fix') { + state.miscForm.gaugeMax = cloneDeep(defaultMaxValue.gaugeMax) + } + } + } + } } const changeQuotaField = (type: string, resetSummary?: boolean) => { if (type === 'min') { if (state.miscForm.gaugeMinType === 'dynamic') { if (!state.miscForm.gaugeMinField.id) { - state.miscForm.gaugeMinField.id = state.quotaData[0]?.id + state.miscForm.gaugeMinField.id = props.chart.yAxis?.[0]?.id } if (!state.miscForm.gaugeMinField.summary) { state.miscForm.gaugeMinField.summary = 'count' @@ -122,14 +210,21 @@ const changeQuotaField = (type: string, resetSummary?: boolean) => { } } else if (type === 'max') { if (props.chart.type === 'liquid') { + if (state.miscForm.liquidMaxType === 'dynamic') { + state.miscForm.liquidMax = undefined + } else { + if (!state.miscForm.liquidMax) { + state.miscForm.liquidMax = cloneDeep(defaultMaxValue.liquidMax) + } + } if (!state.miscForm.liquidMaxField.id) { - state.miscForm.liquidMaxField.id = state.quotaData[0]?.id + state.miscForm.liquidMaxField.id = props.chart.yAxis?.[0]?.id } if (!state.miscForm.liquidMaxField.summary) { - state.miscForm.liquidMaxField.summary = 'count' + state.miscForm.liquidMaxField.summary = 'sum' } if (resetSummary) { - state.miscForm.liquidMaxField.summary = 'count' + state.miscForm.liquidMaxField.summary = 'sum' } if (state.miscForm.liquidMaxField.id && state.miscForm.liquidMaxField.summary) { state.maxField = getQuotaField(state.miscForm.liquidMaxField.id) @@ -137,20 +232,24 @@ const changeQuotaField = (type: string, resetSummary?: boolean) => { } } else { if (state.miscForm.gaugeMaxType === 'dynamic') { + state.miscForm.gaugeMax = undefined if (!state.miscForm.gaugeMaxField.id) { - state.miscForm.gaugeMaxField.id = state.quotaData[0]?.id + state.miscForm.gaugeMaxField.id = props.chart.yAxis?.[0]?.id } if (!state.miscForm.gaugeMaxField.summary) { - state.miscForm.gaugeMaxField.summary = 'count' + state.miscForm.gaugeMaxField.summary = 'sum' } if (resetSummary) { - state.miscForm.gaugeMaxField.summary = 'count' + state.miscForm.gaugeMaxField.summary = 'sum' } if (state.miscForm.gaugeMaxField.id && state.miscForm.gaugeMaxField.summary) { state.maxField = getQuotaField(state.miscForm.gaugeMaxField.id) changeMisc('gaugeMaxField', true) } } else { + if (!state.miscForm.gaugeMax) { + state.miscForm.gaugeMax = cloneDeep(defaultMaxValue.gaugeMax) + } if (state.miscForm.gaugeMinType === 'dynamic') { if (state.miscForm.gaugeMinField.id && state.miscForm.gaugeMinField.summary) { changeMisc('gaugeMaxField', true) @@ -187,6 +286,39 @@ const wordCloudDefaultDataRange = args => { state.miscForm.wordCloudAxisValueRange.min = args.data.min state.miscForm.wordCloudAxisValueRange.fieldId = props.chart.yAxis?.[0]?.id } +const defaultMaxValue = { + gaugeMax: undefined, + liquidMax: undefined +} +const gaugeDefaultDataRange = args => { + if (args.data.type === 'gauge') { + defaultMaxValue.gaugeMax = cloneDeep(args.data.max) + if (!state.miscForm.gaugeMax) { + state.miscForm.gaugeMax = cloneDeep(defaultMaxValue.gaugeMax) + } + } + if (args.data.type === 'liquid') { + defaultMaxValue.liquidMax = cloneDeep(args.data.max) + if (!state.miscForm.liquidMax) { + state.miscForm.liquidMax = cloneDeep(defaultMaxValue.liquidMax) + } + } +} +/** + * 校验最大值的输入 + */ +const changeMaxValidate = prop => { + if (prop === 'gaugeMax') { + if (!state.miscForm.gaugeMax) { + state.miscForm.gaugeMax = cloneDeep(defaultMaxValue.gaugeMax) + } + } else { + if (!state.miscForm.liquidMax) { + state.miscForm.liquidMax = cloneDeep(defaultMaxValue.liquidMax) + } + } + changeMisc(prop) +} onMounted(() => { initField() init() @@ -357,7 +489,7 @@ onMounted(() => { v-model="state.miscForm.gaugeMax" size="small" controls-position="right" - @change="changeMisc('gaugeMax')" + @blur="changeMaxValidate('gaugeMax')" /> { :min="1" size="small" controls-position="right" - @change="changeMisc('liquidMax')" + @blur="changeMaxValidate('liquidMax')" /> 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 e05d565426..650bb1058e 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 @@ -232,12 +232,12 @@ export const DEFAULT_MISC: ChartMiscAttr = { summary: '' }, gaugeMin: 0, - gaugeMaxType: 'fix', + gaugeMaxType: 'dynamic', gaugeMaxField: { id: '', summary: '' }, - gaugeMax: 1, + gaugeMax: undefined, gaugeStartAngle: 225, gaugeEndAngle: -45, nameFontSize: 18, @@ -258,8 +258,8 @@ export const DEFAULT_MISC: ChartMiscAttr = { nameFontShadow: false, treemapWidth: 80, treemapHeight: 80, - liquidMax: 1, - liquidMaxType: 'fix', + liquidMax: undefined, + liquidMaxType: 'dynamic', liquidMaxField: { id: '', summary: '' 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 53524a18ee..2525383284 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 @@ -53,8 +53,8 @@ export class Liquid extends G2PlotChartView { } async drawChart(drawOptions: G2PlotDrawOptions): Promise { - const { chart, container } = drawOptions - if (!chart.data?.series) { + const { chart, container, action } = drawOptions + if (!chart.data?.series || !chart.yAxis.length) { return } const initOptions: LiquidOptions = { @@ -62,8 +62,17 @@ export class Liquid extends G2PlotChartView { } const options = this.setupOptions(chart, initOptions) const { Liquid: G2Liquid } = await import('@antv/g2plot/esm/plots/liquid') - // 开始渲染 - return new G2Liquid(container, options) + const newChart = new G2Liquid(container, options) + newChart.on('afterrender', () => { + action({ + from: 'liquid', + data: { + type: 'liquid', + max: chart.data?.series[chart.data?.series.length - 1]?.data[0] + } + }) + }) + return newChart } protected configTheme(chart: Chart, options: LiquidOptions): LiquidOptions { @@ -100,10 +109,11 @@ export class Liquid extends G2PlotChartView { let max, radius, shape if (customAttr.misc) { const misc = customAttr.misc + const defaultLiquidMax = chart.data?.series[chart.data?.series.length - 1]?.data[0] if (misc.liquidMaxType === 'dynamic') { - max = chart.data?.series[chart.data?.series.length - 1]?.data[0] + max = defaultLiquidMax } else { - max = misc.liquidMax ? misc.liquidMax : DEFAULT_MISC.liquidMax + max = misc.liquidMax ? misc.liquidMax : defaultLiquidMax } radius = (misc.liquidSize ? misc.liquidSize : DEFAULT_MISC.liquidSize) / 100 shape = misc.liquidShape ?? DEFAULT_MISC.liquidShape diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/gauge.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/gauge.ts index 36cd77b799..ec6f35f207 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/gauge.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/gauge.ts @@ -67,8 +67,8 @@ export class Gauge extends G2PlotChartView { } async drawChart(drawOptions: G2PlotDrawOptions): Promise { - const { chart, container, scale } = drawOptions - if (!chart.data?.series) { + const { chart, container, scale, action } = drawOptions + if (!chart.data?.series || !chart.yAxis.length) { return } // options @@ -99,7 +99,17 @@ export class Gauge extends G2PlotChartView { } const options = this.setupOptions(chart, initOptions, { scale }) const { Gauge: G2Gauge } = await import('@antv/g2plot/esm/plots/gauge') - return new G2Gauge(container, options) + const newChart = new G2Gauge(container, options) + newChart.on('afterrender', () => { + action({ + from: 'gauge', + data: { + type: 'gauge', + max: chart.data?.series[chart.data?.series.length - 1]?.data[0] + } + }) + }) + return newChart } protected configMisc( @@ -116,13 +126,13 @@ export class Gauge extends G2PlotChartView { min = chart.data?.series[chart.data?.series.length - 2]?.data[0] max = chart.data?.series[chart.data?.series.length - 1]?.data[0] } else if (misc.gaugeMinType !== 'dynamic' && misc.gaugeMaxType === 'dynamic') { - min = misc.gaugeMin ? misc.gaugeMin : DEFAULT_MISC.gaugeMin + min = misc.gaugeMin || misc.gaugeMin === 0 ? misc.gaugeMin : DEFAULT_MISC.gaugeMin max = chart.data?.series[chart.data?.series.length - 1]?.data[0] } else if (misc.gaugeMinType === 'dynamic' && misc.gaugeMaxType !== 'dynamic') { min = chart.data?.series[chart.data?.series.length - 1]?.data[0] max = misc.gaugeMax ? misc.gaugeMax : DEFAULT_MISC.gaugeMax } else { - min = misc.gaugeMin ? misc.gaugeMin : DEFAULT_MISC.gaugeMin + min = misc.gaugeMin || misc.gaugeMin === 0 ? misc.gaugeMin : DEFAULT_MISC.gaugeMin max = misc.gaugeMax ? misc.gaugeMax : DEFAULT_MISC.gaugeMax } startAngle = (misc.gaugeStartAngle * Math.PI) / 180 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 dfb4f1650e..35174072d9 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 @@ -317,13 +317,24 @@ const pointClickTrans = () => { } } -const action = param => { +const actionDefault = param => { if (param.from === 'map') { emitter.emit('map-default-range', param) - return } if (param.from === 'word-cloud') { emitter.emit('word-cloud-default-data-range', param) + } + if (param.from === 'gauge') { + emitter.emit('gauge-default-data', param) + } + if (param.from === 'liquid') { + emitter.emit('liquid-default-data', param) + } +} + +const action = param => { + if (param.from) { + actionDefault(param) return } state.pointParam = param.data From 36d10a8fac7820b68fcec66c0161685ee4e3998b Mon Sep 17 00:00:00 2001 From: ulleo Date: Mon, 28 Oct 2024 15:28:00 +0800 Subject: [PATCH 08/33] =?UTF-8?q?fix(X-Pack):=20=E3=80=90=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=A1=AB=E6=8A=A5=E3=80=91=E4=BF=AE=E5=A4=8D=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=A0=A1=E9=AA=8C=E6=95=B0=E6=8D=AE=E6=BA=90=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=9D=83=E9=99=90=E7=9A=84=E9=97=AE=E9=A2=98?= 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 1087f588ed..30eb8e165b 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 1087f588ed77a9fa2630c4bd92d71df65559793b +Subproject commit 30eb8e165b435713dfc6503559ec8cfbcb03b726 From 6820479e281ba3abf921fbfe6007fb5236f1b6bc Mon Sep 17 00:00:00 2001 From: ulleo Date: Mon, 28 Oct 2024 15:37:25 +0800 Subject: [PATCH 09/33] =?UTF-8?q?fix(X-Pack):=20=E3=80=90=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=A1=AB=E6=8A=A5=E3=80=91=E4=BF=AE=E5=A4=8D=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=A0=A1=E9=AA=8C=E6=95=B0=E6=8D=AE=E6=BA=90=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=9D=83=E9=99=90=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/main/resources/i18n/core_en_US.properties | 2 ++ .../src/main/resources/i18n/core_zh_CN.properties | 2 ++ .../src/main/resources/i18n/core_zh_TW.properties | 4 +++- de-xpack | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/core-backend/src/main/resources/i18n/core_en_US.properties b/core/core-backend/src/main/resources/i18n/core_en_US.properties index 754ac8068e..97331f645a 100644 --- a/core/core-backend/src/main/resources/i18n/core_en_US.properties +++ b/core/core-backend/src/main/resources/i18n/core_en_US.properties @@ -62,3 +62,5 @@ i18n_day=Day i18n_hour=Hour i18n_minute=Minute i18n_second=Second + +i18n_no_datasource_permission_to_create_column=No datasource permission, cannot create column diff --git a/core/core-backend/src/main/resources/i18n/core_zh_CN.properties b/core/core-backend/src/main/resources/i18n/core_zh_CN.properties index b63511eede..ddecfc35af 100644 --- a/core/core-backend/src/main/resources/i18n/core_zh_CN.properties +++ b/core/core-backend/src/main/resources/i18n/core_zh_CN.properties @@ -81,3 +81,5 @@ i18n_day=\u5929 i18n_hour=\u5C0F\u65F6 i18n_minute=\u5206\u949F i18n_second=\u79D2 + +i18n_no_datasource_permission_to_create_column=\u65E0\u6570\u636E\u6E90\u8BBF\u95EE\u6743\u9650\uFF0C\u65E0\u6CD5\u521B\u5EFA\u8868\u5B57\u6BB5 diff --git a/core/core-backend/src/main/resources/i18n/core_zh_TW.properties b/core/core-backend/src/main/resources/i18n/core_zh_TW.properties index afbff7d637..fbb59f22a8 100644 --- a/core/core-backend/src/main/resources/i18n/core_zh_TW.properties +++ b/core/core-backend/src/main/resources/i18n/core_zh_TW.properties @@ -33,7 +33,7 @@ i18n_table_duplicate=\u76F8\u540C\u7BC0\u9EDE\u9700\u91CD\u65B0\u62D6\u5165\u624 i18n_no_column_permission=\u6C92\u6709\u5217\u6B0A\u9650 i18n_fetch_error=SQL\u57F7\u884C\u5931\u6557\uFF0C\u8ACB\u6AA2\u67E5\u8868\u3001\u5B57\u6BB5\u3001\u95DC\u806F\u95DC\u7CFB\u7B49\u4FE1\u606F\u662F\u5426\u6B63\u78BA\u4E26\u91CD\u65B0\u7DE8\u8F2F\u3002 i18n_no_datasource_permission=\u65E0\u6570\u636E\u6E90\u8BBF\u95EE\u6743\u9650 -i18n_no_dataset_permission=\u65e0\u6570\u636e\u96c6\u8bbf\u95ee\u6743\u9650 +i18n_no_dataset_permission=\u65E0\u6570\u636E\u96C6\u8BBF\u95EE\u6743\u9650 i18n_not_full=\u7576\u524D\u6578\u64DA\u6E90\u4E0D\u652F\u6301\u5168\u9023\u63A5 i18n_field_circular_ref=\u5B57\u6BB5\u5B58\u5728\u5FAA\u74B0\u5F15\u7528 @@ -63,3 +63,5 @@ i18n_day=\u5929 i18n_hour=\u5C0F\u6642 i18n_minute=\u5206\u9418 i18n_second=\u79D2 + +i18n_no_datasource_permission_to_create_column=\u7121\u6578\u64DA\u6E90\u8A2A\u554F\u6B0A\u9650\uFF0C\u7121\u6CD5\u5275\u5EFA\u8868\u5B57\u6BB5 diff --git a/de-xpack b/de-xpack index 30eb8e165b..85af789a82 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 30eb8e165b435713dfc6503559ec8cfbcb03b726 +Subproject commit 85af789a82861f38e22202f01ce6aee3c7beefbb From 5681680fbd71ec628d915a49c3d6010848f813b9 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Mon, 28 Oct 2024 15:49:38 +0800 Subject: [PATCH 10/33] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=AC=A6=E5=8F=B7=E5=9C=B0=E5=9B=BE=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=9B=BE=E5=BD=A2=E6=A0=B7=E5=BC=8F=E6=97=A0=E6=95=88=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/chart/components/js/panel/charts/map/symbolic-map.ts | 1 + 1 file changed, 1 insertion(+) 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 7c46c272fe..141934af88 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 @@ -276,6 +276,7 @@ export class SymbolicMap extends L7ChartView { await scene.addImage(`customIcon`, svgStrToUrl(svgEle.outerHTML)) pointLayer.shape('customIcon') } else { + pointLayer.shape(mapSymbol) pointLayer.color(colorsWithAlpha[0]) pointLayer.style({ stroke: colorsWithAlpha[0], From b565414c0ddd5e96a5e1fda078b9cf0ea06d9788 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Mon, 28 Oct 2024 15:53:39 +0800 Subject: [PATCH 11/33] =?UTF-8?q?fix:=E3=80=90=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E3=80=91=E6=95=B0=E6=8D=AE=E6=BA=90=E5=88=97=E8=A1=A8=E7=BC=BA?= =?UTF-8?q?=E5=B0=91=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datasource/server/DatasourceServer.java | 5 ++++- .../views/visualized/data/datasource/index.vue | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java index 2f789541d9..3e5a9c76cd 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java @@ -1155,8 +1155,11 @@ public class DatasourceServer implements DatasourceApi { if (!Arrays.asList("API", "Excel", "folder").contains(coreDatasource.getType())) { calciteProvider.updateDsPoolAfterCheckStatus(datasourceDTO); } + } catch (DEException e) { + datasourceDTO.setStatus("Error"); + DEException.throwException(e.getMessage()); } catch (Exception e) { - coreDatasource.setStatus("Error"); + datasourceDTO.setStatus("Error"); DEException.throwException(e.getMessage()); } finally { coreDatasource.setStatus(datasourceDTO.getStatus()); 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 9e9085ad50..6fc1407f2d 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/index.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/index.vue @@ -380,7 +380,6 @@ const initSearch = () => { state.filterTable = tableData.value.filter(ele => ele.tableName.toLowerCase().includes(nickName.value.toLowerCase()) ) - console.log(tableData.value) state.paginationConfig.total = state.filterTable.length } @@ -867,7 +866,6 @@ const operation = (cmd: string, data: Tree, nodeType: string) => { } const handleClick = (tabName: TabPaneName) => { - console.log(tabName) switch (tabName) { case 'config': listDatasourceTables({ datasourceId: nodeInfo.id }).then(res => { @@ -1091,8 +1089,22 @@ const getMenuList = (val: boolean) => { :title="node.label" class="label-tooltip ellipsis" :class="data.type === 'Excel' && 'excel'" + v-if="data.extraFlag > -1" >{{ node.label }} + + {{ node.label }} +
Date: Mon, 28 Oct 2024 16:18:39 +0800 Subject: [PATCH 12/33] =?UTF-8?q?feat(=E5=9B=BE=E8=A1=A8):=20=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E5=8D=95=E5=85=83=E6=A0=BC=E6=94=AF=E6=8C=81=E5=A4=9A?= =?UTF-8?q?=E9=80=89=E5=A4=8D=E5=88=B6=20#11368?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/panel/common/common_table.ts | 76 ++++++++++++++++++- 1 file changed, 73 insertions(+), 3 deletions(-) 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 92c72a5a71..c53fd02f05 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 @@ -23,7 +23,12 @@ import { type PivotSheet, type Node, type Meta, - S2DataConfig + S2DataConfig, + SpreadSheet, + InteractionStateName, + InteractionName, + DataCellBrushSelection, + TableDataCell } from '@antv/s2' import { keys, intersection, filter, cloneDeep, merge, find, repeat } from 'lodash-es' import { createVNode, render } from 'vue' @@ -31,6 +36,7 @@ import TableTooltip from '@/views/chart/components/editor/common/TableTooltip.vu import Exceljs from 'exceljs' import { saveAs } from 'file-saver' import { ElMessage } from 'element-plus-secondary' +import { matrix } from 'mathjs' export function getCustomTheme(chart: Chart): S2Theme { const headerColor = hexColorToRGBA( @@ -971,12 +977,76 @@ export function configTooltip(chart: Chart, option: S2Options) { } } -export function copyContent(s2Instance, event, fieldMeta) { +export function copyContent(s2Instance: SpreadSheet, event, fieldMeta) { event.preventDefault() const cell = s2Instance.getCell(event.target) const valueField = cell.getMeta().valueField const cellMeta = cell.getMeta() - let content + const selectState = s2Instance.interaction.getState() + let content = '' + // 多选 + if (selectState.stateName === InteractionStateName.SELECTED) { + const { cells } = selectState + if (!cells?.length) { + return + } + const brushSelection = s2Instance.interaction.interactions.get( + InteractionName.BRUSH_SELECTION + ) as DataCellBrushSelection + const selectedCells: TableDataCell[] = brushSelection.getScrollBrushRangeCells(cells) + selectedCells.sort((a, b) => { + const aMeta = a.getMeta() + const bMeta = b.getMeta() + if (aMeta.rowIndex !== bMeta.rowIndex) { + return aMeta.rowIndex - bMeta.rowIndex + } + return aMeta.colIndex - bMeta.colIndex + }) + // 点击已选的就复制,未选的就忽略 + let validClick = false + const matrix = selectedCells.reduce((p, n) => { + if ( + n.getMeta().colIndex === cellMeta.colIndex && + n.getMeta().rowIndex === cellMeta.rowIndex + ) { + validClick = true + } + const arr = p[n.getMeta().rowIndex] + if (!arr) { + p[n.getMeta().rowIndex] = [n] + } else { + arr.push(n) + } + return p + }, {}) as Record + if (validClick) { + keys(matrix).forEach(k => { + const arr = matrix[k] as TableDataCell[] + arr.forEach((cell, index) => { + const cellMeta = cell.getMeta() + const value = cellMeta.data?.[cellMeta.valueField] + const metaObj = find(fieldMeta, m => m.field === valueField) + let fieldVal = value?.toString() + if (metaObj) { + fieldVal = metaObj.formatter(value) + } + if (fieldVal === undefined) { + fieldVal = '' + } + if (index !== arr.length - 1) { + fieldVal += '\t' + } + content += fieldVal + }) + content = content + '\n' + }) + if (content) { + copyString(content, true) + } + } + s2Instance.interaction.clearState() + return + } // 单元格 if (cellMeta?.data) { const value = cellMeta.data[valueField] From b99fbb0a8b99bbc568594cf85ea26c2ac4d4ac09 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Mon, 28 Oct 2024 17:20:18 +0800 Subject: [PATCH 13/33] =?UTF-8?q?feat(=E5=9B=BE=E8=A1=A8):=20=E9=9B=B7?= =?UTF-8?q?=E8=BE=BE=E5=9B=BE=E5=9D=90=E6=A0=87=E8=BD=B4=E8=BD=B4=E5=80=BC?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A=E4=B9=89=20#12637?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/models/chart/chart-style.d.ts | 4 + .../components/MiscStyleSelector.vue | 104 ++++++++++++++++++ .../chart/components/editor/util/chart.ts | 7 ++ .../js/panel/charts/others/radar.ts | 18 ++- 4 files changed, 132 insertions(+), 1 deletion(-) diff --git a/core/core-frontend/src/models/chart/chart-style.d.ts b/core/core-frontend/src/models/chart/chart-style.d.ts index 46bdef3ab5..44aca1b55f 100644 --- a/core/core-frontend/src/models/chart/chart-style.d.ts +++ b/core/core-frontend/src/models/chart/chart-style.d.ts @@ -272,6 +272,10 @@ declare interface ChartMiscStyle { axisLabel: SplitAxisLabel splitLine: SplitAxisLine splitArea: SplitSplitArea + /** + * 轴值设置 + */ + axisValue: AxisValue } declare interface SplitLineStyle { color: string diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscStyleSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscStyleSelector.vue index ac1fa34151..7bc14cd5c1 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscStyleSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscStyleSelector.vue @@ -2,6 +2,7 @@ import { computed, onMounted, reactive, watch } from 'vue' import { useI18n } from '@/hooks/web/useI18n' import { COLOR_PANEL, DEFAULT_MISC_STYLE } from '@/views/chart/components/editor/util/chart' +import icon_info_outlined from '@/assets/svg/icon_info_outlined.svg' const { t } = useI18n() @@ -14,6 +15,10 @@ const props = withDefaults( { themes: 'dark' } ) +const toolTip = computed(() => { + return props.themes === 'dark' ? 'ndark' : 'dark' +}) + const predefineColors = COLOR_PANEL const state = reactive({ @@ -57,6 +62,9 @@ const init = () => { } if (customStyle.xAxis) { state.miscForm = customStyle.misc + if (!state.miscForm.axisValue) { + state.miscForm.axisValue = JSON.parse(JSON.stringify(DEFAULT_MISC_STYLE)).axisValue + } } } } @@ -138,6 +146,89 @@ onMounted(() => { @change="changeMiscStyle('axisColor')" /> + @@ -145,4 +236,17 @@ onMounted(() => { .form-item-checkbox { margin-bottom: 0 !important; } +.custom-form-item-label { + margin-bottom: 4px; + line-height: 20px; + color: #646a73; + font-size: 12px; + font-style: normal; + font-weight: 400; + padding: 2px 12px 0 0; + + &.custom-form-item-label--dark { + color: #a6a6a6; + } +} 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 650bb1058e..f1fe0469d2 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 @@ -731,6 +731,13 @@ export const DEFAULT_MISC_STYLE: ChartMiscStyle = { }, splitArea: { show: true + }, + axisValue: { + auto: true, + min: 10, + max: 100, + split: 10, + splitCount: 10 } } export const DEFAULT_FUNCTION_CFG: ChartFunctionCfg = { diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/others/radar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/others/radar.ts index 097c97d8e4..3e2571bc42 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/others/radar.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/others/radar.ts @@ -27,7 +27,7 @@ export class Radar extends G2PlotChartView { 'basic-style-selector': ['colors', 'alpha', 'radarShape', 'seriesColor'], 'label-selector': ['seriesLabelFormatter'], 'tooltip-selector': ['color', 'fontSize', 'backgroundColor', 'seriesTooltipFormatter', 'show'], - 'misc-style-selector': ['showName', 'color', 'fontSize', 'axisColor'], + 'misc-style-selector': ['showName', 'color', 'fontSize', 'axisColor', 'axisValue'], 'title-selector': [ 'show', 'title', @@ -213,6 +213,22 @@ export class Radar extends G2PlotChartView { } } } + const axisValue = misc.axisValue + if (!axisValue?.auto) { + const axisYAxis = { + ...yAxis, + min: axisValue.min, + max: axisValue.max, + minLimit: axisValue.min, + maxLimit: axisValue.max, + tickCount: axisValue.splitCount + } + return { + ...options, + xAxis, + yAxis: axisYAxis + } + } return { ...options, xAxis, From be205ce43b9f8edc9ccc1c5a1aaebd687675624b Mon Sep 17 00:00:00 2001 From: taojinlong Date: Mon, 28 Oct 2024 17:24:01 +0800 Subject: [PATCH 14/33] =?UTF-8?q?fix:=E3=80=90=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E3=80=91excel=20=E6=95=B0=E6=8D=AE=E6=BA=90=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=20excel=20=E5=A4=9A=E4=B8=AA=20sheet=20=E9=83=BD=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=8A=A0=E8=BD=BD=20#12329?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datasource/provider/ExcelUtils.java | 16 +++++++++++ .../datasource/server/DatasourceServer.java | 27 +++++++++++++++---- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java b/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java index f41ac59953..b8ae99d1ea 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java @@ -15,6 +15,7 @@ import io.dataease.api.ds.vo.ExcelSheetData; import io.dataease.datasource.dao.auto.entity.CoreDatasource; import io.dataease.exception.DEException; import io.dataease.extensions.datasource.dto.DatasetTableDTO; +import io.dataease.extensions.datasource.dto.DatasourceDTO; import io.dataease.extensions.datasource.dto.DatasourceRequest; import io.dataease.extensions.datasource.dto.TableField; import io.dataease.utils.AuthUtils; @@ -40,6 +41,21 @@ public class ExcelUtils { private static TypeReference> TableFieldListTypeReference = new TypeReference>() { }; + private static TypeReference> sheets = new TypeReference>() { + }; + + public static void mergeSheets(CoreDatasource requestDatasource, DatasourceDTO sourceData) { + List newSheets = JsonUtil.parseList(requestDatasource.getConfiguration(), sheets); + List tableNames = newSheets.stream().map(ExcelSheetData::getDeTableName).collect(Collectors.toList()); + List oldSheets = JsonUtil.parseList(sourceData.getConfiguration(), sheets); + for (ExcelSheetData oldSheet : oldSheets) { + if (!tableNames.contains(oldSheet.getDeTableName())) { + newSheets.add(oldSheet); + } + } + requestDatasource.setConfiguration(JsonUtil.toJSONString(newSheets).toString()); + } + public static List getTables(DatasourceRequest datasourceRequest) throws DEException { List tableDescs = new ArrayList<>(); try { diff --git a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java index 3e5a9c76cd..a94d55fe6f 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/server/DatasourceServer.java @@ -404,7 +404,7 @@ public class DatasourceServer implements DatasourceApi { List tables = ExcelUtils.getTables(datasourceRequest).stream().map(DatasetTableDTO::getTableName).collect(Collectors.toList()); if (dataSourceDTO.getEditType() == 0) { toCreateTables = tables; - toDeleteTables = sourceTables; + toDeleteTables = sourceTables.stream().filter(s -> tables.contains(s)).collect(Collectors.toList()); for (String deleteTable : toDeleteTables) { try { datasourceSyncManage.dropEngineTable(deleteTable); @@ -422,6 +422,7 @@ public class DatasourceServer implements DatasourceApi { } datasourceSyncManage.extractExcelData(requestDatasource, "all_scope"); dataSourceManage.checkName(dataSourceDTO); + ExcelUtils.mergeSheets(requestDatasource, sourceData); dataSourceManage.innerEdit(requestDatasource); } else { datasourceSyncManage.extractExcelData(requestDatasource, "add_scope"); @@ -735,11 +736,15 @@ public class DatasourceServer implements DatasourceApi { } } + private static final Integer replace = 0; + private static final Integer append = 1; + public ExcelFileData excelUpload(@RequestParam("file") MultipartFile file, @RequestParam("id") long datasourceId, @RequestParam("editType") Integer editType) throws DEException { + CoreDatasource coreDatasource = datasourceMapper.selectById(datasourceId); + ExcelUtils excelUtils = new ExcelUtils(); ExcelFileData excelFileData = excelUtils.excelSaveAndParse(file); - if (editType == 1 || editType == 0) { //按照excel sheet 名称匹配 - CoreDatasource coreDatasource = datasourceMapper.selectById(datasourceId); + if (Objects.equals(editType, append)) { //按照excel sheet 名称匹配,替换:0;追加:1 if (coreDatasource != null) { DatasourceRequest datasourceRequest = new DatasourceRequest(); datasourceRequest.setDatasource(transDTO(coreDatasource)); @@ -757,7 +762,6 @@ public class DatasourceServer implements DatasourceApi { oldTableFields.sort((o1, o2) -> { return o1.getName().compareTo(o2.getName()); }); - if (isEqual(newTableFields, oldTableFields)) { sheet.setDeTableName(datasetTableDTO.getTableName()); excelSheetDataList.add(sheet); @@ -770,8 +774,21 @@ public class DatasourceServer implements DatasourceApi { } excelFileData.setSheets(excelSheetDataList); } - } + } else { + if (coreDatasource != null) { + DatasourceRequest datasourceRequest = new DatasourceRequest(); + datasourceRequest.setDatasource(transDTO(coreDatasource)); + List datasetTableDTOS = ExcelUtils.getTables(datasourceRequest); + for (ExcelSheetData sheet : excelFileData.getSheets()) { + for (DatasetTableDTO datasetTableDTO : datasetTableDTOS) { + if (excelDataTableName(datasetTableDTO.getTableName()).equals(sheet.getTableName()) || isCsv(file.getOriginalFilename())) { + sheet.setDeTableName(datasetTableDTO.getTableName()); + } + } + } + } + } for (ExcelSheetData sheet : excelFileData.getSheets()) { for (int i = 0; i < sheet.getFields().size() - 1; i++) { for (int j = i + 1; j < sheet.getFields().size(); j++) { From 91a75653b80e37fd0188ba42ef7ef44b74ce04f4 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Mon, 28 Oct 2024 17:44:41 +0800 Subject: [PATCH 15/33] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E6=BA=90):=20?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=BA=90=E5=88=97=E8=A1=A8=E7=BC=BA=E5=B0=91?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/assets/svg/icon_warning_colorful_red.svg | 12 ++++++++++++ .../src/views/visualized/data/datasource/index.vue | 7 +++++++ 2 files changed, 19 insertions(+) create mode 100644 core/core-frontend/src/assets/svg/icon_warning_colorful_red.svg diff --git a/core/core-frontend/src/assets/svg/icon_warning_colorful_red.svg b/core/core-frontend/src/assets/svg/icon_warning_colorful_red.svg new file mode 100644 index 0000000000..a0ffc79110 --- /dev/null +++ b/core/core-frontend/src/assets/svg/icon_warning_colorful_red.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + 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 6fc1407f2d..9f27fd43ae 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/index.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/index.vue @@ -6,6 +6,7 @@ import icon_dataset from '@/assets/svg/icon_dataset.svg' import icon_deleteTrash_outlined from '@/assets/svg/icon_delete-trash_outlined.svg' import icon_intoItem_outlined from '@/assets/svg/icon_into-item_outlined.svg' import icon_rename_outlined from '@/assets/svg/icon_rename_outlined.svg' +import icon_warning_colorful_red from '@/assets/svg/icon_warning_colorful_red.svg' import dvFolder from '@/assets/svg/dv-folder.svg' import dvNewFolder from '@/assets/svg/dv-new-folder.svg' import icon_fileAdd_outlined from '@/assets/svg/icon_file-add_outlined.svg' @@ -1085,6 +1086,12 @@ const getMenuList = (val: boolean) => { > + + + Date: Mon, 28 Oct 2024 18:13:19 +0800 Subject: [PATCH 16/33] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E6=BA=90):=20?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=BA=90=E5=88=97=E8=A1=A8=E7=BC=BA=E5=B0=91?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/visualized/data/datasource/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 9f27fd43ae..96b5e2f179 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/index.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/index.vue @@ -1080,14 +1080,14 @@ const getMenuList = (val: boolean) => { @node-click="handleNodeClick" >