From 667185689031b0eb0b6189c516bb6cbb1ed98398 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 22 Sep 2022 11:26:31 +0800 Subject: [PATCH 1/4] =?UTF-8?q?refactor:=20=E5=BA=94=E7=94=A8=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E5=AE=9A=E6=97=B6=E6=95=B0=E6=8D=AE=E9=9B=86=E7=AB=8B?= =?UTF-8?q?=E5=8D=B3=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/service/panel/PanelAppTemplateService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/main/java/io/dataease/service/panel/PanelAppTemplateService.java b/backend/src/main/java/io/dataease/service/panel/PanelAppTemplateService.java index 88799a76a6..bc06e7a6e8 100644 --- a/backend/src/main/java/io/dataease/service/panel/PanelAppTemplateService.java +++ b/backend/src/main/java/io/dataease/service/panel/PanelAppTemplateService.java @@ -168,6 +168,7 @@ public class PanelAppTemplateService { DataSetTableRequest datasetRequest = new DataSetTableRequest(); BeanUtils.copyBean(datasetRequest, datasetTable); datasetRequest.setOptFrom("appApply"); + datasetRequest.setSyncType("sync_now"); DatasetTable newDataset = dataSetTableService.save(datasetRequest); datasetsRelaMap.put(oldId, newDataset.getId()); } From 8859f4c017a4035c7f23be8bf3c31d649339cd08 Mon Sep 17 00:00:00 2001 From: junjun Date: Thu, 22 Sep 2022 11:46:26 +0800 Subject: [PATCH 2/4] =?UTF-8?q?refactor(=E8=A7=86=E5=9B=BE):=20=E9=98=88?= =?UTF-8?q?=E5=80=BC=E9=BB=98=E8=AE=A4=E8=83=8C=E6=99=AF=E8=89=B2=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/chart/components/senior/dialog/TableThresholdEdit.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/chart/components/senior/dialog/TableThresholdEdit.vue b/frontend/src/views/chart/components/senior/dialog/TableThresholdEdit.vue index 84ff33682a..c06b317fdb 100644 --- a/frontend/src/views/chart/components/senior/dialog/TableThresholdEdit.vue +++ b/frontend/src/views/chart/components/senior/dialog/TableThresholdEdit.vue @@ -139,7 +139,7 @@ export default { field: '0', value: '', color: '#ff0000ff', - backgroundColor: '#ffffffff', + backgroundColor: '#ffffff00', min: '0', max: '1' }, From 067e1facb2e7e506480f85cf3501e9a6d82c5527 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Thu, 22 Sep 2022 11:50:29 +0800 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20=E5=8C=BA=E5=88=86=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/java/io/dataease/provider/ProviderFactory.java | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/main/java/io/dataease/provider/ProviderFactory.java b/backend/src/main/java/io/dataease/provider/ProviderFactory.java index f40d9109bf..76b38d89dd 100644 --- a/backend/src/main/java/io/dataease/provider/ProviderFactory.java +++ b/backend/src/main/java/io/dataease/provider/ProviderFactory.java @@ -30,6 +30,7 @@ public class ProviderFactory implements ApplicationContextAware { dataSourceType.setTargetCharset(d.getTargetCharset()); } dataSourceType.setKeywordSuffix(d.getKeywordSuffix()); + dataSourceType.setDatabaseClassification(d.getDatabaseClassification()); dataSourceType.setKeywordPrefix(d.getKeywordPrefix()); dataSourceType.setAliasSuffix(d.getAliasSuffix()); dataSourceType.setAliasPrefix(d.getAliasPrefix()); From aa2cb5eb7790924b88f2da3bf3c7d353338b989e Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 22 Sep 2022 14:20:24 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20echarts?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E5=A4=96=E8=BE=B9=E8=B7=9D=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lang/en.js | 5 + frontend/src/lang/tw.js | 5 + frontend/src/lang/zh.js | 5 + frontend/src/views/chart/chart/chart.js | 9 + .../src/views/chart/chart/common/common.js | 27 +++ frontend/src/views/chart/chart/util.js | 170 +++++++++++++++-- .../component-style/MarginSelector.vue | 171 ++++++++++++++++++ frontend/src/views/chart/view/ChartEdit.vue | 5 + frontend/src/views/chart/view/ChartStyle.vue | 21 +++ 9 files changed, 401 insertions(+), 17 deletions(-) create mode 100644 frontend/src/views/chart/components/component-style/MarginSelector.vue diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index a46b9dd1be..60c2aa8c91 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -910,6 +910,11 @@ export default { password_input_error: 'Original password input error' }, chart: { + margin_model: 'Model', + margin_model_auto: 'Auto', + margin_model_absolute: 'Absolute', + margin_model_relative: 'Relative', + margin_placeholder: 'Please enter a number from 0-100', rich_text_view_result_tips: 'The rich text view selects only the first result', rich_text_view: 'Rich Text View', view_reset: 'View Reset', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 5df944cb3b..9eaefd1367 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -910,6 +910,11 @@ export default { password_input_error: '原始密碼輸入錯誤' }, chart: { + margin_model: '模式', + margin_model_auto: '自動', + margin_model_absolute: '絕對', + margin_model_relative: '相對', + margin_placeholder: '請輸入0-100數字', rich_text_view_result_tips: '富文本只选取第一条结果', rich_text_view: '富文本视图', view_reset: '視圖重置', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 5a2bf46a75..0cf66591bf 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -909,6 +909,11 @@ export default { password_input_error: '原始密码输入错误' }, chart: { + margin_model: '模式', + margin_model_auto: '自动', + margin_model_absolute: '绝对', + margin_model_relative: '相对', + margin_placeholder: '请输入0-100数字', rich_text_view_result_tips: '富文本只选取第一条结果', rich_text_view: '富文本视图', view_reset: '视图重置', diff --git a/frontend/src/views/chart/chart/chart.js b/frontend/src/views/chart/chart/chart.js index 43548d3e71..5849768991 100644 --- a/frontend/src/views/chart/chart/chart.js +++ b/frontend/src/views/chart/chart/chart.js @@ -217,6 +217,15 @@ export const DEFAULT_LEGEND_STYLE = { fontSize: '12' } } + +export const DEFAULT_MARGIN_STYLE = { + marginModel: 'auto', + marginTop: 40, + marginBottom: 44, + marginLeft: 15, + marginRight: 10 +} + export const DEFAULT_XAXIS_STYLE = { show: true, position: 'bottom', diff --git a/frontend/src/views/chart/chart/common/common.js b/frontend/src/views/chart/chart/common/common.js index 38a601ce2a..321c238bc0 100644 --- a/frontend/src/views/chart/chart/common/common.js +++ b/frontend/src/views/chart/chart/common/common.js @@ -186,11 +186,38 @@ export function componentStyle(chart_option, chart) { chart_option.radar.splitLine = customStyle.split.splitLine chart_option.radar.splitArea = customStyle.split.splitArea } + if (customStyle.margin && customStyle.margin.marginModel && customStyle.margin.marginModel !== 'auto') { + const unit = getMarginUnit(customStyle.margin) + const result = { containLabel: true } + const realUnit = (unit === '%' ? unit : '') + if (customStyle.margin.marginTop != null) { + result.top = customStyle.margin.marginTop + realUnit + } + if (customStyle.margin.marginBottom != null) { + result.bottom = customStyle.margin.marginBottom + realUnit + } + if (customStyle.margin.marginLeft != null) { + result.left = customStyle.margin.marginLeft + realUnit + } + if (customStyle.margin.marginRight != null) { + result.right = customStyle.margin.marginRight + realUnit + } + if (!chart_option.grid) { + chart_option.grid = {} + } + Object.assign(chart_option.grid, JSON.parse(JSON.stringify(result))) + } if (customStyle.background) { chart_option.backgroundColor = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha) } } } +export const getMarginUnit = marginForm => { + if (!marginForm.marginModel || marginForm.marginModel === 'auto') return null + if (marginForm.marginModel === 'absolute') return 'px' + if (marginForm.marginModel === 'relative') return '%' + return null +} const hexToRgba = (hex, opacity) => { let rgbaColor = '' diff --git a/frontend/src/views/chart/chart/util.js b/frontend/src/views/chart/chart/util.js index e595f0e5a9..006a267362 100644 --- a/frontend/src/views/chart/chart/util.js +++ b/frontend/src/views/chart/chart/util.js @@ -1538,9 +1538,17 @@ export const TYPE_CONFIGS = [ properties: [ 'color-selector', 'size-selector', - 'title-selector' + 'title-selector', + 'margin-selector' ], propertyInner: { + 'margin-selector': [ + 'marginModel', + 'marginTop', + 'marginBottom', + 'marginLeft', + 'marginRight' + ], 'color-selector': [ 'quotaColor', 'dimensionColor' @@ -1582,9 +1590,17 @@ export const TYPE_CONFIGS = [ properties: [ 'color-selector', 'size-selector', - 'title-selector' + 'title-selector', + 'margin-selector' ], propertyInner: { + 'margin-selector': [ + 'marginModel', + 'marginTop', + 'marginBottom', + 'marginLeft', + 'marginRight' + ], 'color-selector': [ 'quotaColor', 'dimensionColor' @@ -1627,9 +1643,17 @@ export const TYPE_CONFIGS = [ 'color-selector', 'size-selector', 'label-selector', - 'title-selector' + 'title-selector', + 'margin-selector' ], propertyInner: { + 'margin-selector': [ + 'marginModel', + 'marginTop', + 'marginBottom', + 'marginLeft', + 'marginRight' + ], 'color-selector': [ 'value', 'custom', @@ -1674,9 +1698,17 @@ export const TYPE_CONFIGS = [ 'x-axis-selector', 'y-axis-selector', 'title-selector', - 'legend-selector' + 'legend-selector', + 'margin-selector' ], propertyInner: { + 'margin-selector': [ + 'marginModel', + 'marginTop', + 'marginBottom', + 'marginLeft', + 'marginRight' + ], 'color-selector': [ 'value', 'custom', @@ -1754,9 +1786,17 @@ export const TYPE_CONFIGS = [ 'x-axis-selector', 'y-axis-selector', 'title-selector', - 'legend-selector' + 'legend-selector', + 'margin-selector' ], propertyInner: { + 'margin-selector': [ + 'marginModel', + 'marginTop', + 'marginBottom', + 'marginLeft', + 'marginRight' + ], 'color-selector': [ 'value', 'custom', @@ -1835,9 +1875,17 @@ export const TYPE_CONFIGS = [ 'y-axis-selector', 'y-axis-ext-selector', 'title-selector', - 'legend-selector' + 'legend-selector', + 'margin-selector' ], propertyInner: { + 'margin-selector': [ + 'marginModel', + 'marginTop', + 'marginBottom', + 'marginLeft', + 'marginRight' + ], 'color-selector': [ 'value', 'custom', @@ -1920,9 +1968,17 @@ export const TYPE_CONFIGS = [ 'x-axis-selector', 'y-axis-selector', 'title-selector', - 'legend-selector' + 'legend-selector', + 'margin-selector' ], propertyInner: { + 'margin-selector': [ + 'marginModel', + 'marginTop', + 'marginBottom', + 'marginLeft', + 'marginRight' + ], 'color-selector': [ 'value', 'custom', @@ -1999,9 +2055,17 @@ export const TYPE_CONFIGS = [ 'x-axis-selector', 'y-axis-selector', 'title-selector', - 'legend-selector' + 'legend-selector', + 'margin-selector' ], propertyInner: { + 'margin-selector': [ + 'marginModel', + 'marginTop', + 'marginBottom', + 'marginLeft', + 'marginRight' + ], 'color-selector': [ 'value', 'custom', @@ -2078,9 +2142,17 @@ export const TYPE_CONFIGS = [ 'x-axis-selector', 'y-axis-selector', 'title-selector', - 'legend-selector' + 'legend-selector', + 'margin-selector' ], propertyInner: { + 'margin-selector': [ + 'marginModel', + 'marginTop', + 'marginBottom', + 'marginLeft', + 'marginRight' + ], 'color-selector': [ 'value', 'custom', @@ -2157,9 +2229,17 @@ export const TYPE_CONFIGS = [ 'x-axis-selector', 'y-axis-selector', 'title-selector', - 'legend-selector' + 'legend-selector', + 'margin-selector' ], propertyInner: { + 'margin-selector': [ + 'marginModel', + 'marginTop', + 'marginBottom', + 'marginLeft', + 'marginRight' + ], 'color-selector': [ 'value', 'custom', @@ -2236,9 +2316,17 @@ export const TYPE_CONFIGS = [ 'label-selector', 'tooltip-selector', 'title-selector', - 'legend-selector' + 'legend-selector', + 'margin-selector' ], propertyInner: { + 'margin-selector': [ + 'marginModel', + 'marginTop', + 'marginBottom', + 'marginLeft', + 'marginRight' + ], 'color-selector': [ 'value', 'custom', @@ -2294,9 +2382,17 @@ export const TYPE_CONFIGS = [ 'label-selector', 'tooltip-selector', 'title-selector', - 'legend-selector' + 'legend-selector', + 'margin-selector' ], propertyInner: { + 'margin-selector': [ + 'marginModel', + 'marginTop', + 'marginBottom', + 'marginLeft', + 'marginRight' + ], 'color-selector': [ 'value', 'custom', @@ -2354,9 +2450,17 @@ export const TYPE_CONFIGS = [ 'tooltip-selector', 'split-selector', 'title-selector', - 'legend-selector' + 'legend-selector', + 'margin-selector' ], propertyInner: { + 'margin-selector': [ + 'marginModel', + 'marginTop', + 'marginBottom', + 'marginLeft', + 'marginRight' + ], 'color-selector': [ 'value', 'custom', @@ -2417,9 +2521,17 @@ export const TYPE_CONFIGS = [ 'size-selector', 'label-selector', 'tooltip-selector', - 'title-selector' + 'title-selector', + 'margin-selector' ], propertyInner: { + 'margin-selector': [ + 'marginModel', + 'marginTop', + 'marginBottom', + 'marginLeft', + 'marginRight' + ], 'color-selector': [ 'value', 'custom', @@ -2468,9 +2580,17 @@ export const TYPE_CONFIGS = [ 'x-axis-selector', 'y-axis-selector', 'title-selector', - 'legend-selector' + 'legend-selector', + 'margin-selector' ], propertyInner: { + 'margin-selector': [ + 'marginModel', + 'marginTop', + 'marginBottom', + 'marginLeft', + 'marginRight' + ], 'color-selector': [ 'value', 'custom', @@ -2544,9 +2664,17 @@ export const TYPE_CONFIGS = [ 'label-selector', 'tooltip-selector', 'title-selector', - 'legend-selector' + 'legend-selector', + 'margin-selector' ], propertyInner: { + 'margin-selector': [ + 'marginModel', + 'marginTop', + 'marginBottom', + 'marginLeft', + 'marginRight' + ], 'color-selector': [ 'value', 'custom', @@ -2599,9 +2727,17 @@ export const TYPE_CONFIGS = [ 'color-selector', 'label-selector', 'tooltip-selector', - 'title-selector' + 'title-selector', + 'margin-selector' ], propertyInner: { + 'margin-selector': [ + 'marginModel', + 'marginTop', + 'marginBottom', + 'marginLeft', + 'marginRight' + ], 'color-selector': [ 'value', 'custom', diff --git a/frontend/src/views/chart/components/component-style/MarginSelector.vue b/frontend/src/views/chart/components/component-style/MarginSelector.vue new file mode 100644 index 0000000000..fc7d8ee65b --- /dev/null +++ b/frontend/src/views/chart/components/component-style/MarginSelector.vue @@ -0,0 +1,171 @@ + + + + + diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index e44b1daa2b..61dd8a8ca0 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -757,6 +757,7 @@ @onChangeSplitForm="onChangeSplitForm" @onTextChange="onTextChange" @onLegendChange="onLegendChange" + @onMarginChange="onMarginChange" @onChangeBackgroundForm="onChangeBackgroundForm" /> @@ -1999,6 +2000,10 @@ export default { this.view.customStyle.legend = val this.calcStyle() }, + onMarginChange(val) { + this.view.customStyle.margin = val + this.calcStyle() + }, onLabelChange(val) { this.view.customAttr.label = val diff --git a/frontend/src/views/chart/view/ChartStyle.vue b/frontend/src/views/chart/view/ChartStyle.vue index 77894e2236..8e41267a75 100644 --- a/frontend/src/views/chart/view/ChartStyle.vue +++ b/frontend/src/views/chart/view/ChartStyle.vue @@ -260,6 +260,21 @@ @onChangeBackgroundForm="onChangeBackgroundForm($event,'background-color-selector')" /> + + + + @@ -284,6 +299,7 @@ import YAxisExtSelectorAntV from '@/views/chart/components/component-style/YAxis import TitleSelector from '@/views/chart/components/component-style/TitleSelector' import TitleSelectorAntV from '@/views/chart/components/component-style/TitleSelectorAntV' import LegendSelector from '@/views/chart/components/component-style/LegendSelector' +import MarginSelector from '@/views/chart/components/component-style/MarginSelector' import LegendSelectorAntV from '@/views/chart/components/component-style/LegendSelectorAntV' import BackgroundColorSelector from '@/views/chart/components/component-style/BackgroundColorSelector' import SplitSelector from '@/views/chart/components/component-style/SplitSelector' @@ -314,6 +330,7 @@ export default { SizeSelectorAntV, SizeSelector, ColorSelector, + MarginSelector, PluginCom }, props: { @@ -432,6 +449,10 @@ export default { val['propertyName'] = propertyName this.$emit('onLegendChange', val) }, + onMarginChange(val, propertyName) { + val['propertyName'] = propertyName + this.$emit('onMarginChange', val) + }, onChangeBackgroundForm(val, propertyName) { val['propertyName'] = propertyName this.$emit('onChangeBackgroundForm', val)