From 6508673054c91d7205954c5b70743838f800b806 Mon Sep 17 00:00:00 2001 From: junjun Date: Thu, 12 Jan 2023 10:35:14 +0800 Subject: [PATCH 01/22] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20=E6=8C=87?= =?UTF-8?q?=E6=A0=87=E5=8D=A1=E3=80=81=E6=96=87=E6=9C=AC=E5=8D=A1=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E8=B0=83=E6=95=B4=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lang/en.js | 9 +++- frontend/src/lang/tw.js | 9 +++- frontend/src/lang/zh.js | 9 +++- frontend/src/views/chart/chart/chart.js | 4 +- frontend/src/views/chart/chart/util.js | 16 ++++-- .../chart/components/normal/LabelNormal.vue | 3 ++ .../components/normal/LabelNormalText.vue | 3 ++ .../components/shapeAttr/SizeSelector.vue | 51 +++++++++++++++++++ .../components/shapeAttr/SizeSelectorAntV.vue | 51 +++++++++++++++++++ 9 files changed, 147 insertions(+), 8 deletions(-) diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 0be62dda0c..d2c846c212 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1509,7 +1509,14 @@ export default { Line (area) chart, Column (Bar) chart, Dashboard: {a} is series name, {b} is category value, {c} is value
Pie chart, Funnel chart: {a} is series name, {b} is data item name, {c} is value, {d} is percentage
Map : {a} (series name), {b} is area name, {c} is merged values, {d} is none
- Scatter (Bubble) plot: {a} is series name, {b} is data name, {c} is numeric array, {d} is none` + Scatter (Bubble) plot: {a} is series name, {b} is data name, {c} is numeric array, {d} is none`, + h_position: 'Horizontal Position', + v_position: 'Vertical Position', + p_left: 'Left', + p_right: 'Right', + p_top: 'Top', + p_bottom: 'Bottom', + p_center: 'Center' }, dataset: { spend_time: 'Spend', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 934ee002fd..53ca7ddf3e 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1503,7 +1503,14 @@ export default { 折線(區域)圖、柱狀(條形)圖、儀表盤 : {a}(系列名稱),{b}(類目值),{c}(數值)
餅圖、漏鬥圖: {a}(系列名稱),{b}(數據項名稱),{c}(數值), {d}(百分比)
地圖 : {a}(系列名稱),{b}(區域名稱),{c}(合並數值), {d}(無)
- 散點圖(氣泡)圖 : {a}(系列名稱),{b}(數據名稱),{c}(數值數組), {d}(無)` + 散點圖(氣泡)圖 : {a}(系列名稱),{b}(數據名稱),{c}(數值數組), {d}(無)`, + h_position: '水平位置', + v_position: '垂直位置', + p_left: '左對齊', + p_right: '右對齊', + p_top: '上對齊', + p_bottom: '下對齊', + p_center: '居中' }, dataset: { spend_time: '耗時', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index e82257b21a..d9c5e884d8 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1502,7 +1502,14 @@ export default { 折线(区域)图、柱状(条形)图、仪表盘 : {a}(系列名称),{b}(类目值),{c}(数值)
饼图、漏斗图: {a}(系列名称),{b}(数据项名称),{c}(数值), {d}(百分比)
地图 : {a}(系列名称),{b}(区域名称),{c}(合并数值), {d}(无)
- 散点图(气泡)图 : {a}(系列名称),{b}(数据名称),{c}(数值数组), {d}(无)` + 散点图(气泡)图 : {a}(系列名称),{b}(数据名称),{c}(数值数组), {d}(无)`, + h_position: '水平位置', + v_position: '垂直位置', + p_left: '左对齐', + p_right: '右对齐', + p_top: '上对齐', + p_bottom: '下对齐', + p_center: '居中' }, dataset: { spend_time: '耗时', diff --git a/frontend/src/views/chart/chart/chart.js b/frontend/src/views/chart/chart/chart.js index a2bf9a20e2..86a5087fc5 100644 --- a/frontend/src/views/chart/chart/chart.js +++ b/frontend/src/views/chart/chart/chart.js @@ -127,7 +127,9 @@ export const DEFAULT_SIZE = { symbolOpacity: 0.7, symbolStrokeWidth: 2, showIndex: false, - indexLabel: '序号' + indexLabel: '序号', + hPosition: 'center', + vPosition: 'center' } export const DEFAULT_SUSPENSION = { show: true diff --git a/frontend/src/views/chart/chart/util.js b/frontend/src/views/chart/chart/util.js index cec78c5011..972c25c602 100644 --- a/frontend/src/views/chart/chart/util.js +++ b/frontend/src/views/chart/chart/util.js @@ -206,7 +206,9 @@ export const TYPE_CONFIGS = [ 'dimensionFontStyle', 'dimensionLetterSpace', 'dimensionFontShadow', - 'spaceSplit' + 'spaceSplit', + 'hPosition', + 'vPosition' ], 'title-selector-ant-v': [ 'show', @@ -251,7 +253,9 @@ export const TYPE_CONFIGS = [ 'dimensionFontStyle', 'dimensionLetterSpace', 'dimensionFontShadow', - 'spaceSplit' + 'spaceSplit', + 'hPosition', + 'vPosition' ], 'title-selector-ant-v': [ 'show', @@ -1939,7 +1943,9 @@ export const TYPE_CONFIGS = [ 'dimensionFontStyle', 'dimensionLetterSpace', 'dimensionFontShadow', - 'spaceSplit' + 'spaceSplit', + 'hPosition', + 'vPosition' ], 'title-selector': [ 'show', @@ -1984,7 +1990,9 @@ export const TYPE_CONFIGS = [ 'dimensionFontStyle', 'dimensionLetterSpace', 'dimensionFontShadow', - 'spaceSplit' + 'spaceSplit', + 'hPosition', + 'vPosition' ], 'title-selector': [ 'show', diff --git a/frontend/src/views/chart/components/normal/LabelNormal.vue b/frontend/src/views/chart/components/normal/LabelNormal.vue index 52aab307f2..c874c21a4d 100644 --- a/frontend/src/views/chart/components/normal/LabelNormal.vue +++ b/frontend/src/views/chart/components/normal/LabelNormal.vue @@ -189,6 +189,9 @@ export default { this.label_content_class.letterSpacing = (customAttr.size.quotaLetterSpace ? customAttr.size.quotaLetterSpace : DEFAULT_SIZE.quotaLetterSpace) + 'px' this.label_content_class.textShadow = customAttr.size.quotaFontShadow ? '2px 2px 4px' : 'none' + this.content_class.alignItems = customAttr.size.hPosition ? customAttr.size.hPosition : DEFAULT_SIZE.hPosition + this.content_class.justifyContent = customAttr.size.vPosition ? customAttr.size.vPosition : DEFAULT_SIZE.vPosition + if (!this.dimensionShow) { this.label_space.marginTop = '0px' } else { diff --git a/frontend/src/views/chart/components/normal/LabelNormalText.vue b/frontend/src/views/chart/components/normal/LabelNormalText.vue index eb9a6967b4..c31a4dba2b 100644 --- a/frontend/src/views/chart/components/normal/LabelNormalText.vue +++ b/frontend/src/views/chart/components/normal/LabelNormalText.vue @@ -216,6 +216,9 @@ export default { this.label_content_class.letterSpacing = (customAttr.size.quotaLetterSpace ? customAttr.size.quotaLetterSpace : DEFAULT_SIZE.quotaLetterSpace) + 'px' this.label_content_class.textShadow = customAttr.size.quotaFontShadow ? '2px 2px 4px' : 'none' + this.content_class.alignItems = customAttr.size.hPosition ? customAttr.size.hPosition : DEFAULT_SIZE.hPosition + this.content_class.justifyContent = customAttr.size.vPosition ? customAttr.size.vPosition : DEFAULT_SIZE.vPosition + if (!this.dimensionShow) { this.label_space.marginTop = '0px' } else { diff --git a/frontend/src/views/chart/components/shapeAttr/SizeSelector.vue b/frontend/src/views/chart/components/shapeAttr/SizeSelector.vue index 810a25c0ea..5a1e9b38b6 100644 --- a/frontend/src/views/chart/components/shapeAttr/SizeSelector.vue +++ b/frontend/src/views/chart/components/shapeAttr/SizeSelector.vue @@ -634,6 +634,54 @@ @change="changeBarSizeCase('spaceSplit')" /> + + + {{ $t('chart.p_left') }} + {{ $t('chart.p_center') }} + {{ $t('chart.p_right') }} + + + + + {{ $t('chart.p_top') }} + {{ $t('chart.p_center') }} + {{ $t('chart.p_bottom') }} + + @@ -1076,6 +1124,9 @@ export default { this.sizeForm.dimensionFontIsItalic = this.sizeForm.dimensionFontIsItalic ? this.sizeForm.dimensionFontIsItalic : DEFAULT_SIZE.dimensionFontIsItalic this.sizeForm.dimensionLetterSpace = this.sizeForm.dimensionLetterSpace ? this.sizeForm.dimensionLetterSpace : DEFAULT_SIZE.dimensionLetterSpace this.sizeForm.dimensionFontShadow = this.sizeForm.dimensionFontShadow ? this.sizeForm.dimensionFontShadow : DEFAULT_SIZE.dimensionFontShadow + + this.sizeForm.hPosition = this.sizeForm.hPosition ? this.sizeForm.hPosition : DEFAULT_SIZE.hPosition + this.sizeForm.vPosition = this.sizeForm.vPosition ? this.sizeForm.vPosition : DEFAULT_SIZE.vPosition } } }, diff --git a/frontend/src/views/chart/components/shapeAttr/SizeSelectorAntV.vue b/frontend/src/views/chart/components/shapeAttr/SizeSelectorAntV.vue index 4fab822eb7..4bf8dab6bc 100644 --- a/frontend/src/views/chart/components/shapeAttr/SizeSelectorAntV.vue +++ b/frontend/src/views/chart/components/shapeAttr/SizeSelectorAntV.vue @@ -984,6 +984,54 @@ @change="changeBarSizeCase('spaceSplit')" /> + + + {{ $t('chart.p_left') }} + {{ $t('chart.p_center') }} + {{ $t('chart.p_right') }} + + + + + {{ $t('chart.p_top') }} + {{ $t('chart.p_center') }} + {{ $t('chart.p_bottom') }} + + @@ -1384,6 +1432,9 @@ export default { this.sizeForm.dimensionFontIsItalic = this.sizeForm.dimensionFontIsItalic ? this.sizeForm.dimensionFontIsItalic : DEFAULT_SIZE.dimensionFontIsItalic this.sizeForm.dimensionLetterSpace = this.sizeForm.dimensionLetterSpace ? this.sizeForm.dimensionLetterSpace : DEFAULT_SIZE.dimensionLetterSpace this.sizeForm.dimensionFontShadow = this.sizeForm.dimensionFontShadow ? this.sizeForm.dimensionFontShadow : DEFAULT_SIZE.dimensionFontShadow + + this.sizeForm.hPosition = this.sizeForm.hPosition ? this.sizeForm.hPosition : DEFAULT_SIZE.hPosition + this.sizeForm.vPosition = this.sizeForm.vPosition ? this.sizeForm.vPosition : DEFAULT_SIZE.vPosition } } }, From 2abcc4502791fc1ba0937103cbe49d3256059865 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Thu, 12 Jan 2023 10:55:13 +0800 Subject: [PATCH 02/22] =?UTF-8?q?fix(=E8=A1=80=E6=BA=90=E5=85=B3=E7=B3=BB)?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=E5=90=8D=E7=A7=B0=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A0=91=E5=BD=A2=E7=BB=84=E4=BB=B6=E5=8F=AF=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E8=BF=87=E5=A4=9A=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/relationship/index.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/views/system/relationship/index.vue b/frontend/src/views/system/relationship/index.vue index 2394ecf622..18e3431270 100644 --- a/frontend/src/views/system/relationship/index.vue +++ b/frontend/src/views/system/relationship/index.vue @@ -39,6 +39,7 @@ placement="bottom" trigger="manual" :width="popoverSize" + popper-class="relation-popover" > From 1df6e4b3e259cfaf15bb1296a9406ef99c735094 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Thu, 12 Jan 2023 10:56:26 +0800 Subject: [PATCH 03/22] =?UTF-8?q?fix(=E8=A1=80=E7=BC=98=E5=85=B3-=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=BA=90=E5=88=97=E8=A1=A8):=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=BA=90=E5=88=97=E8=A1=A8=E6=8C=89=E7=85=A7=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=92=8C=E5=90=8D=E7=A7=B0=E5=8D=87=E5=BA=8F=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/io/dataease/ext/ExtDataSourceMapper.xml | 2 +- .../io/dataease/service/datasource/DatasourceService.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.xml b/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.xml index 2e572d0578..f78b38b852 100644 --- a/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.xml +++ b/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.xml @@ -124,7 +124,7 @@ and configuration = #{configuration,jdbcType=LONGVARCHAR} - + order by ${sort} diff --git a/backend/src/main/java/io/dataease/service/datasource/DatasourceService.java b/backend/src/main/java/io/dataease/service/datasource/DatasourceService.java index b867ebed3c..c575345cf7 100644 --- a/backend/src/main/java/io/dataease/service/datasource/DatasourceService.java +++ b/backend/src/main/java/io/dataease/service/datasource/DatasourceService.java @@ -158,11 +158,9 @@ public class DatasourceService { } public List getDatasourceList(DatasourceUnionRequest request) throws Exception { - request.setSort("update_time desc"); + request.setSort("type,name"); List datasourceDTOS = extDataSourceMapper.queryUnion(request); - datasourceDTOS.forEach(datasourceDTO -> { - datasourceTrans(datasourceDTO); - }); + datasourceDTOS.forEach(this::datasourceTrans); return datasourceDTOS; } From 18d8d693a42e561f29c5857a1849e0fdff6ae051 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 12 Jan 2023 11:35:21 +0800 Subject: [PATCH 04/22] =?UTF-8?q?style(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E6=9D=BF=E8=A7=86=E5=9B=BE=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/editor/SettingMenu.vue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/canvas/components/editor/SettingMenu.vue b/frontend/src/components/canvas/components/editor/SettingMenu.vue index c7b85a1cfe..89f330fbd3 100644 --- a/frontend/src/components/canvas/components/editor/SettingMenu.vue +++ b/frontend/src/components/canvas/components/editor/SettingMenu.vue @@ -5,7 +5,7 @@ trigger="click" @mouseup="handleMouseUp" > - + {{ $t('panel.copy') }}(+ D Control + D) + >{{ $t('panel.copy') }} (+ D Control + D) - {{ $t('panel.level') }} + {{ $t('panel.level') }} - - {{ $t('panel.hyperlinks') }} + >{{ $t('panel.hyperlinks') }} - + {{ $t('panel.position_adjust') }} From 209f195e7323f0c88edf72cffb41f56b36d2309c Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 12 Jan 2023 12:01:55 +0800 Subject: [PATCH 05/22] =?UTF-8?q?style:=20=E5=BA=94=E7=94=A8=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E7=AE=A1=E7=90=86=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/panel/appTemplate/component/TemplateList.vue | 4 ++-- .../views/panel/appTemplate/component/TemplateMoveList.vue | 4 ++-- frontend/src/views/panel/template/component/TemplateList.vue | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/panel/appTemplate/component/TemplateList.vue b/frontend/src/views/panel/appTemplate/component/TemplateList.vue index cc502c0606..ca5ba0777d 100644 --- a/frontend/src/views/panel/appTemplate/component/TemplateList.vue +++ b/frontend/src/views/panel/appTemplate/component/TemplateList.vue @@ -250,8 +250,8 @@ export default { } li.select { - background: var(--deWhiteHover, #3370ff); - color: var(--TextActive, #f4f4f5); + background: var(--deWhiteHover, #ecf5ff) !important; + color: var(--TextActive, #3370ff) !important; } .de-btn-fix { diff --git a/frontend/src/views/panel/appTemplate/component/TemplateMoveList.vue b/frontend/src/views/panel/appTemplate/component/TemplateMoveList.vue index 56aaeb324d..952556810a 100644 --- a/frontend/src/views/panel/appTemplate/component/TemplateMoveList.vue +++ b/frontend/src/views/panel/appTemplate/component/TemplateMoveList.vue @@ -201,8 +201,8 @@ export default { } li.select { - background: var(--deWhiteHover, #3370ff); - color: var(--TextActive, #f4f4f5); + background: var(--deWhiteHover, #ecf5ff) !important; + color: var(--TextActive, #3370ff) !important; } .de-btn-fix { diff --git a/frontend/src/views/panel/template/component/TemplateList.vue b/frontend/src/views/panel/template/component/TemplateList.vue index b52312dde6..88f7af9ae8 100644 --- a/frontend/src/views/panel/template/component/TemplateList.vue +++ b/frontend/src/views/panel/template/component/TemplateList.vue @@ -253,8 +253,8 @@ export default { } li.select { - background: var(--deWhiteHover, #3370ff); - color: var(--TextActive, #f4f4f5); + background: var(--deWhiteHover, #ecf5ff) !important; + color: var(--TextActive, #3370ff) !important; } .de-btn-fix { From cffa7b139b568990ef465f6756168d8fc1f7decd Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 12 Jan 2023 12:23:53 +0800 Subject: [PATCH 06/22] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A8=A1=E6=9D=BF=E7=8A=B6=E6=80=81=E7=9A=84?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E6=9D=BF=E4=B8=8B=E6=8B=89=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=8F=AF=E8=83=BD=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/dataease/service/dataset/DataSetTableService.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java index c7244f0ed6..d91485d152 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java @@ -972,7 +972,11 @@ public class DataSetTableService { return new ArrayList<>(); } DatasetTable datasetTable = datasetTableMapper.selectByPrimaryKey(id); - return getSqlVariableDetails(type, Arrays.asList(datasetTable)); + if (datasetTable != null) { + return getSqlVariableDetails(type, Arrays.asList(datasetTable)); + } else { + return null; + } } private List getSqlVariableDetails(String type, List datasetTables) { @@ -2861,7 +2865,8 @@ public class DataSetTableService { hasSubBinaryExpression = false; try { BinaryExpression rightBinaryExpression = (BinaryExpression) expr.getRightExpression(); - hasSubBinaryExpression = rightBinaryExpression instanceof AndExpression || rightBinaryExpression instanceof OrExpression;; + hasSubBinaryExpression = rightBinaryExpression instanceof AndExpression || rightBinaryExpression instanceof OrExpression; + ; } catch (Exception e) { } if (expr.getRightExpression() instanceof BinaryExpression && !hasSubBinaryExpression && hasVariable(expr.getRightExpression().toString())) { From 4ed513c7984b94e146f636c2616649dfccc6ea96 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Thu, 12 Jan 2023 15:55:47 +0800 Subject: [PATCH 07/22] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E6=BA=90=E5=88=97?= =?UTF-8?q?=E8=A1=A8):=20=E6=95=B0=E6=8D=AE=E6=BA=90=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8C=89=E7=85=A7=E7=B1=BB=E5=9E=8B=E5=90=8D=E7=A7=B0=E5=92=8C?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=BA=90=E5=90=8D=E7=A7=B0=E5=8D=87=E5=BA=8F?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=EF=BC=8C=E5=BF=BD=E7=95=A5=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/dataease/ext/ExtDataSourceMapper.xml | 2 +- .../dataease/service/datasource/DatasourceService.java | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.xml b/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.xml index f78b38b852..abb27c3635 100644 --- a/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.xml +++ b/backend/src/main/java/io/dataease/ext/ExtDataSourceMapper.xml @@ -125,7 +125,7 @@ - order by ${sort} + order by #{sort} diff --git a/backend/src/main/java/io/dataease/service/datasource/DatasourceService.java b/backend/src/main/java/io/dataease/service/datasource/DatasourceService.java index c575345cf7..900c9ef98d 100644 --- a/backend/src/main/java/io/dataease/service/datasource/DatasourceService.java +++ b/backend/src/main/java/io/dataease/service/datasource/DatasourceService.java @@ -158,9 +158,17 @@ public class DatasourceService { } public List getDatasourceList(DatasourceUnionRequest request) throws Exception { - request.setSort("type,name"); List datasourceDTOS = extDataSourceMapper.queryUnion(request); datasourceDTOS.forEach(this::datasourceTrans); + if (StringUtils.isBlank(request.getSort())) { + datasourceDTOS.sort((o1,o2) -> { + int tmp = StringUtils.compareIgnoreCase(o1.getTypeDesc(), o2.getTypeDesc()); + if (tmp == 0) { + tmp = StringUtils.compareIgnoreCase(o1.getName(), o2.getName()); + } + return tmp; + }); + } return datasourceDTOS; } From 84ae4dbb788829df89cfd4dce441ff102d31c41d Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 12 Jan 2023 18:52:06 +0800 Subject: [PATCH 08/22] =?UTF-8?q?feat(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=A2=9E=E5=8A=A0=E5=AF=BC=E5=87=BA=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/server/XEmailTaskServer.java | 38 +++++ frontend/src/components/canvas/DeCanvas.vue | 3 + .../components/canvas/components/Toolbar.vue | 26 ++++ .../canvas/components/editor/DeEditor.vue | 49 ++++++- .../components/editor/PageLineEditor.vue | 136 ++++++++++++++++++ frontend/src/components/canvas/utils/utils.js | 3 +- frontend/src/lang/en.js | 2 + frontend/src/lang/tw.js | 2 + frontend/src/lang/zh.js | 2 + frontend/src/views/panel/panel.js | 9 ++ 10 files changed, 267 insertions(+), 3 deletions(-) create mode 100644 frontend/src/components/canvas/components/editor/PageLineEditor.vue diff --git a/backend/src/main/java/io/dataease/plugins/server/XEmailTaskServer.java b/backend/src/main/java/io/dataease/plugins/server/XEmailTaskServer.java index 965889d66a..07d0736209 100644 --- a/backend/src/main/java/io/dataease/plugins/server/XEmailTaskServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/XEmailTaskServer.java @@ -165,6 +165,44 @@ public class XEmailTaskServer { return xpackEmailCreate; } + @DeRateLimiter + @PostMapping(value = "/screenpdf", produces = {MediaType.APPLICATION_PDF_VALUE}) + public ResponseEntity screenpdf(@RequestBody XpackEmailViewRequest request) { + EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class); + String url = ServletUtils.domain() + "/#/previewScreenShot/" + request.getPanelId() + "/true"; + byte[] bytes = null; + try { + String currentToken = ServletUtils.getToken(); + Future future = priorityExecutor.submit(() -> { + try { + return emailXpackService.printPdf(url, currentToken, buildPixel(request.getPixel())); + } catch (Exception e) { + LogUtil.error(e.getMessage(), e); + DEException.throwException("预览失败,请联系管理员"); + } + return null; + }, 0); + Object object = future.get(); + if (ObjectUtils.isNotEmpty(object)) { + bytes = (byte[]) object; + if (ArrayUtil.isNotEmpty(bytes)) { + String fileName = request.getPanelId() + ".pdf"; + ByteArrayResource bar = new ByteArrayResource(bytes); + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_PDF); + ContentDisposition contentDisposition = ContentDisposition.parse("attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); + headers.setContentDisposition(contentDisposition); + return new ResponseEntity(bar, headers, HttpStatus.OK); + } + } + } catch (Exception e) { + LogUtil.error(e.getMessage(), e); + DEException.throwException("预览失败,请联系管理员"); + } + + return null; + } + @DeRateLimiter @PostMapping(value = "/screenshot", produces = {MediaType.IMAGE_JPEG_VALUE, MediaType.IMAGE_PNG_VALUE}) public ResponseEntity screenshot(@RequestBody XpackEmailViewRequest request) { diff --git a/frontend/src/components/canvas/DeCanvas.vue b/frontend/src/components/canvas/DeCanvas.vue index 797273c3f3..959a1379aa 100644 --- a/frontend/src/components/canvas/DeCanvas.vue +++ b/frontend/src/components/canvas/DeCanvas.vue @@ -297,6 +297,9 @@ export default { // this.$emit('handleDrop', e) // } handleDrop(e) { + if (!this.dragComponentInfo) { + return + } this.dragComponentInfo.moveStatus = 'drop' // 记录拖拽信息 this.dropComponentInfo = deepCopy(this.dragComponentInfo) diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index 2900b4b022..cba329b39b 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -153,6 +153,25 @@ @change="styleChange" /> + + + + + + {{ $t('panel.export_pdf_page') }} + + + + @@ -247,6 +266,7 @@ export default { }, data() { return { + showPageLine: false, showGridSwitch: false, mobileLayoutInitStatus: false, isShowPreview: false, @@ -305,6 +325,7 @@ export default { this.scale = this.canvasStyleData.scale this.mobileLayoutInitStatus = this.mobileLayoutStatus this.showGridSwitch = this.canvasStyleData.aidedDesign.showGrid + this.showPageLine = this.canvasStyleData.pdfPageLine?.showPageLine this.autoCache() }, beforeDestroy() { @@ -323,6 +344,7 @@ export default { }, editPanelInit() { this.showGridSwitch = this.canvasStyleData.aidedDesign.showGrid + this.showPageLine = this.canvasStyleData.pdfPageLine?.showPageLine }, close() { // 关闭页面清理缓存 @@ -589,6 +611,10 @@ export default { this.$store.commit('canvasChange') this.canvasStyleData.aidedDesign.showGrid = !this.canvasStyleData.aidedDesign.showGrid }, + showPageLineChange() { + this.$store.commit('canvasChange') + this.canvasStyleData.pdfPageLine.showPageLine = !this.canvasStyleData.pdfPageLine.showPageLine + }, // batch option batchOption() { bus.$emit('change_panel_right_draw', !this.batchOptStatus) diff --git a/frontend/src/components/canvas/components/editor/DeEditor.vue b/frontend/src/components/canvas/components/editor/DeEditor.vue index 31234920ae..64ee36fd7f 100644 --- a/frontend/src/components/canvas/components/editor/DeEditor.vue +++ b/frontend/src/components/canvas/components/editor/DeEditor.vue @@ -12,6 +12,11 @@ @mousedown="handleMouseDown" @scroll="canvasScroll" > + - + { + const top = this.getShapeStyleIntDeDrag(item.style, 'top') + const height = this.getShapeStyleIntDeDrag(item.style, 'height') + baseHeight = Math.max(baseHeight, top + height) + }) + return baseHeight + }, customStyle() { let style = { width: '100%', @@ -1024,6 +1046,20 @@ export default { }, deep: true }, + scrollHeight: { + handler(newVal, oldVla) { + this.$nextTick(() => { + if (newVal !== oldVla && this.showPageLine) { + const lineRef = this.$refs['main-page-line'] + if (lineRef?.init) { + lineRef.init(newVal) + } + } + console.log(newVal) + }) + }, + deep: true + }, outStyle: { handler(newVal, oldVla) { this.resizeParentBoundsRef() @@ -1251,6 +1287,9 @@ export default { }, changeStyleWithScale, handleMouseDown(e) { + if (this.isPageLineTarget(e)) { + return + } // 如果没有选中组件 在画布上点击时需要调用 e.preventDefault() 防止触发 drop 事件 if (!this.curComponent || (this.curComponent.component !== 'v-text' && this.curComponent.component !== 'rect-shape')) { e.preventDefault() @@ -1259,6 +1298,9 @@ export default { // 挤占式画布设计 this.containerMouseDown(e) }, + isPageLineTarget(e) { + return e.target.classList && [...e.target.classList].includes('page-line-item') + }, hideArea() { this.isShowArea = 0 @@ -1517,6 +1559,9 @@ export default { } }, handleDragOver(e) { + if (!this.dragComponentInfo?.shadowStyle) { + return + } this.dragComponentInfo.shadowStyle.x = e.pageX - 220 this.dragComponentInfo.shadowStyle.y = e.pageY - 90 + this.scrollTop this.dragComponentInfo.style.left = this.dragComponentInfo.shadowStyle.x / this.scalePointWidth diff --git a/frontend/src/components/canvas/components/editor/PageLineEditor.vue b/frontend/src/components/canvas/components/editor/PageLineEditor.vue new file mode 100644 index 0000000000..b31c82cde0 --- /dev/null +++ b/frontend/src/components/canvas/components/editor/PageLineEditor.vue @@ -0,0 +1,136 @@ + + + + + diff --git a/frontend/src/components/canvas/utils/utils.js b/frontend/src/components/canvas/utils/utils.js index 3105ab5341..220e083b0f 100644 --- a/frontend/src/components/canvas/utils/utils.js +++ b/frontend/src/components/canvas/utils/utils.js @@ -8,7 +8,7 @@ import { import { ApplicationContext } from '@/utils/ApplicationContext' import { uuid } from 'vue-uuid' import store from '@/store' -import { AIDED_DESIGN, MOBILE_SETTING, PANEL_CHART_INFO, TAB_COMMON_STYLE } from '@/views/panel/panel' +import { AIDED_DESIGN, MOBILE_SETTING, PANEL_CHART_INFO, TAB_COMMON_STYLE, PAGE_LINE_DESIGN } from '@/views/panel/panel' import html2canvas from 'html2canvasde' export function deepCopy(target) { @@ -83,6 +83,7 @@ export function panelDataPrepare(componentData, componentStyle, callback) { componentStyle.refreshUnit = (componentStyle.refreshUnit || 'minute') componentStyle.refreshViewEnable = (componentStyle.refreshViewEnable === undefined ? true : componentStyle.refreshViewEnable) componentStyle.aidedDesign = (componentStyle.aidedDesign || deepCopy(AIDED_DESIGN)) + componentStyle.pdfPageLine = (componentStyle.pdfPageLine || deepCopy(PAGE_LINE_DESIGN)) componentStyle.chartInfo = (componentStyle.chartInfo || deepCopy(PANEL_CHART_INFO)) componentStyle.chartInfo.tabStyle = (componentStyle.chartInfo.tabStyle || deepCopy(TAB_COMMON_STYLE)) componentStyle.themeId = (componentStyle.themeId || 'NO_THEME') diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 0be62dda0c..7c50fbf6c2 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -2244,6 +2244,8 @@ export default { aided_grid: 'Aided Grid', aided_grid_open: 'Open', aided_grid_close: 'Close', + export_pdf_page: 'Pagination Line', + export_pdf_page_remark: 'Only valid for API export dashboard PDF pagination', subject_no_edit: 'System Subject Can Not Edit', subject_name_not_null: 'Subject Name Can Not Be Null And Less Than 20 charts', is_enable: 'Enable', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 934ee002fd..4fa66c6537 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -2238,6 +2238,8 @@ export default { aided_grid: '輔助設計網格', aided_grid_open: '打開', aided_grid_close: '關閉', + export_pdf_page: '分頁線', + export_pdf_page_remark: '僅對API導出儀表板PDF分頁有效', subject_no_edit: '繫統主題不能修改', subject_name_not_null: '主題名稱需要1~20字符', is_enable: '是否啟用', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index e82257b21a..2462a07cff 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -2238,6 +2238,8 @@ export default { aided_grid: '辅助设计网格', aided_grid_open: '打开', aided_grid_close: '关闭', + export_pdf_page: '分页线', + export_pdf_page_remark: '仅对API导出仪表板PDF分页有效', subject_no_edit: '系统主题不能修改', subject_name_not_null: '主题名称需要1~20字符', is_enable: '是否启用', diff --git a/frontend/src/views/panel/panel.js b/frontend/src/views/panel/panel.js index d9d4c94fff..84dd3c7b52 100644 --- a/frontend/src/views/panel/panel.js +++ b/frontend/src/views/panel/panel.js @@ -69,6 +69,10 @@ export const CANVAS_STYLE = { showGrid: false, matrixBase: 4 // 当前matrix的基数 (是pcMatrixCount的几倍) }, // 辅助设计 + pdfPageLine: { + showPageLine: false, + proportion: null + }, refreshViewEnable: true, // 开启视图刷新(默认开启) refreshViewLoading: true, // 仪表板视图loading提示 refreshUnit: 'minute', // 仪表板刷新时间带外 默认 分钟 @@ -82,6 +86,11 @@ export const AIDED_DESIGN = { matrixBase: 1 // 当前matrix的基数 (是pcMatrixCount的几倍) } +export const PAGE_LINE_DESIGN = { + showPageLine: false, + proportion: null +} + export const DEFAULT_COMMON_CANVAS_STYLE_STRING = { ...CANVAS_STYLE } From bde776ef401792dfc43c84a18a66e1d6e19e8c66 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 12 Jan 2023 18:56:02 +0800 Subject: [PATCH 09/22] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E7=BA=BF=E5=8A=9F=E8=83=BD=E6=8B=BC=E5=86=99?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/editor/PageLineEditor.vue | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/canvas/components/editor/PageLineEditor.vue b/frontend/src/components/canvas/components/editor/PageLineEditor.vue index b31c82cde0..fe582606eb 100644 --- a/frontend/src/components/canvas/components/editor/PageLineEditor.vue +++ b/frontend/src/components/canvas/components/editor/PageLineEditor.vue @@ -29,7 +29,7 @@ export default { return { baseLineKey: 'page-line-', lineLocations: [], - curLineHieght: 0, + curLineHeight: 0, clientStartY: 0, startTop: 0, movingLineHeight: 0, @@ -71,15 +71,15 @@ export default { this.scrollHeight = scrollHeight || document.getElementById('canvas-id-canvas-main').scrollHeight if (this.pdfPageLine?.proportion) { - this.curLineHieght = this.pdfPageLine.proportion * this.scrollHeight + this.curLineHeight = this.pdfPageLine.proportion * this.scrollHeight } else { - this.curLineHieght = this.windowHeight + this.curLineHeight = this.windowHeight this.saveLineHeight() } - let curLineLocation = this.curLineHieght + let curLineLocation = this.curLineHeight while (curLineLocation < this.scrollHeight) { this.lineLocations.push(curLineLocation) - curLineLocation += this.curLineHieght + curLineLocation += this.curLineHeight } }, handleMouseDown(e) { @@ -87,7 +87,7 @@ export default { this.startTop = parseInt(e.target.style.top) document.onmousemove = ev => this.handleMouseMove(e, ev) document.onmouseup = () => { - this.curLineHieght = this.movingLineHeight + this.curLineHeight = this.movingLineHeight this.saveLineHeight() this.init() document.onmousemove = document.onmouseup = null @@ -95,13 +95,13 @@ export default { }, handleMouseMove(e, ev) { const moveInstance = ev.clientY - this.clientStartY - this.movingLineHeight = this.curLineHieght + moveInstance + this.movingLineHeight = this.curLineHeight + moveInstance e.target.style.top = this.startTop + moveInstance + 'px' }, saveLineHeight() { this.$store.commit('canvasChange') - this.canvasStyleData.pdfPageLine.proportion = this.curLineHieght / this.scrollHeight - this.pdfPageLine.proportion = this.curLineHieght / this.scrollHeight + this.canvasStyleData.pdfPageLine.proportion = this.curLineHeight / this.scrollHeight + this.pdfPageLine.proportion = this.curLineHeight / this.scrollHeight } } } From 5f4d1c416c1c133c994ddc4c15c774b75c970ab0 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 13 Jan 2023 16:25:56 +0800 Subject: [PATCH 10/22] =?UTF-8?q?style(=E5=85=B3=E4=BA=8E=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2):=20=E8=AE=B8=E5=8F=AF=E8=AF=81=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/about/index.vue | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/system/about/index.vue b/frontend/src/views/system/about/index.vue index 2afacfda47..972a41aed9 100644 --- a/frontend/src/views/system/about/index.vue +++ b/frontend/src/views/system/about/index.vue @@ -1,6 +1,9 @@