From 0977598cb6df3d9e488f7eb7c6cde5aa4fe73f66 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 8 Mar 2023 14:38:51 +0800 Subject: [PATCH 1/7] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AB=99=E5=86=85=E5=88=86=E4=BA=AB=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E6=98=8E=E7=BB=86=E8=A1=A8=E9=83=A8=E5=88=86=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=97=A0=E6=9D=83=E9=99=90=E9=97=AE=E9=A2=98=20#4697?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/controller/panel/PanelGroupController.java | 1 + .../controller/request/panel/PanelViewDetailsRequest.java | 5 +++++ .../components/canvas/customComponent/UserViewDialog.vue | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/backend/src/main/java/io/dataease/controller/panel/PanelGroupController.java b/backend/src/main/java/io/dataease/controller/panel/PanelGroupController.java index 2e46bab9ef..4b5164b44e 100644 --- a/backend/src/main/java/io/dataease/controller/panel/PanelGroupController.java +++ b/backend/src/main/java/io/dataease/controller/panel/PanelGroupController.java @@ -146,6 +146,7 @@ public class PanelGroupController { @ApiOperation("站内导出仪表板视图明细") @PostMapping("/innerExportDetails") + @DePermissionProxy(value = "proxy") @I18n public void innerExportDetails(@RequestBody PanelViewDetailsRequest request, HttpServletResponse response) throws IOException { panelGroupService.exportPanelViewDetails(request, response); diff --git a/backend/src/main/java/io/dataease/controller/request/panel/PanelViewDetailsRequest.java b/backend/src/main/java/io/dataease/controller/request/panel/PanelViewDetailsRequest.java index 41e3c09e0b..ec9650c909 100644 --- a/backend/src/main/java/io/dataease/controller/request/panel/PanelViewDetailsRequest.java +++ b/backend/src/main/java/io/dataease/controller/request/panel/PanelViewDetailsRequest.java @@ -1,6 +1,8 @@ package io.dataease.controller.request.panel; import io.dataease.controller.request.chart.ChartExtRequest; +import io.dataease.dto.PermissionProxy; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; @@ -35,4 +37,7 @@ public class PanelViewDetailsRequest { private List excelHeaderKeys; + @ApiModelProperty(hidden = true) + private PermissionProxy proxy; + } diff --git a/frontend/src/components/canvas/customComponent/UserViewDialog.vue b/frontend/src/components/canvas/customComponent/UserViewDialog.vue index 58a4e5fee1..cd958b81aa 100644 --- a/frontend/src/components/canvas/customComponent/UserViewDialog.vue +++ b/frontend/src/components/canvas/customComponent/UserViewDialog.vue @@ -124,6 +124,9 @@ export default { } }, computed: { + panelInfo() { + return this.$store.state.panel.panelInfo + }, isAbsoluteContainer() { return this.showChartCanvas && this.chart.type === 'symbol-map' }, @@ -288,6 +291,7 @@ export default { }) } const request = { + proxy:null, viewId: this.chart.id, viewName: excelName, header: excelHeader, @@ -306,6 +310,10 @@ export default { if (!token && linkToken) { method = exportDetails } + + if (this.panelInfo.proxy) { + request.proxy = { userId: this.panelInfo.proxy } + } method(request).then((res) => { const blob = new Blob([res], { type: 'application/vnd.ms-excel' }) const link = document.createElement('a') From d9a32cb40f68ca0853e4eb27028b1f7d762a42a5 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Wed, 8 Mar 2023 16:18:16 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fix:=20ES=E6=96=B0=E5=BB=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E6=95=B0=E6=8D=AE=E9=9B=86,=E8=A1=A8?= =?UTF-8?q?=E5=90=8D=E5=90=AB=E6=9C=89-,=E5=87=BA=E7=8E=B0=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E6=95=B0=E6=8D=AE=E5=A4=B1=E8=B4=A5=20#4315?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/provider/query/es/EsQueryProvider.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/src/main/java/io/dataease/provider/query/es/EsQueryProvider.java b/backend/src/main/java/io/dataease/provider/query/es/EsQueryProvider.java index ac2852a74b..019b09e61a 100644 --- a/backend/src/main/java/io/dataease/provider/query/es/EsQueryProvider.java +++ b/backend/src/main/java/io/dataease/provider/query/es/EsQueryProvider.java @@ -1328,4 +1328,9 @@ public class EsQueryProvider extends QueryProvider { public String getResultCount(boolean isTable, String sql, List xAxis, List fieldCustomFilter, List rowPermissionsTree, List extFilterRequestList, Datasource ds, ChartViewWithBLOBs view) { return null; } + + @Override + public String sqlForPreview(String table, Datasource ds) { + return "SELECT * FROM " + String.format(EsSqlLConstants.KEYWORD_TABLE, table); + } } From 923ab6034bc1ae1d5782891057fcd70882110f2c Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 8 Mar 2023 16:57:29 +0800 Subject: [PATCH 3/7] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E5=85=AC=E5=85=B1=E9=93=BE=E6=8E=A5=E8=A7=86=E5=9B=BE=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E5=AF=BC=E5=87=BA=E6=9D=83=E9=99=90=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E5=87=BA=E6=9D=83=E9=99=90=E8=B7=9F=E9=9A=8F?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E4=BA=BA=20#4649?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/panel/api/LinkApi.java | 4 +- .../controller/panel/server/LinkServer.java | 6 +-- .../service/panel/PanelLinkService.java | 13 ++--- .../resources/db/migration/V52__1.18.5.sql | 51 +++++++++++++++++++ frontend/src/api/link/index.js | 4 +- frontend/src/main.js | 2 +- frontend/src/utils/permission.js | 2 +- frontend/src/views/link/view/index.vue | 2 +- 8 files changed, 68 insertions(+), 16 deletions(-) diff --git a/backend/src/main/java/io/dataease/controller/panel/api/LinkApi.java b/backend/src/main/java/io/dataease/controller/panel/api/LinkApi.java index a27b37eae3..a984e4c23d 100644 --- a/backend/src/main/java/io/dataease/controller/panel/api/LinkApi.java +++ b/backend/src/main/java/io/dataease/controller/panel/api/LinkApi.java @@ -54,8 +54,8 @@ public interface LinkApi { boolean validatePwd(PasswordRequest request) throws Exception; @ApiOperation("资源详细信息") - @GetMapping("/resourceDetail/{resourceId}") - Object resourceDetail(@PathVariable String resourceId); + @GetMapping("/resourceDetail/{resourceId}/{userId}") + Object resourceDetail(@PathVariable String resourceId,@PathVariable String userId); @ApiOperation("视图详细信息") @PostMapping("/viewDetail/{viewId}/{panelId}") diff --git a/backend/src/main/java/io/dataease/controller/panel/server/LinkServer.java b/backend/src/main/java/io/dataease/controller/panel/server/LinkServer.java index 2e0be45aec..e23d9981bf 100644 --- a/backend/src/main/java/io/dataease/controller/panel/server/LinkServer.java +++ b/backend/src/main/java/io/dataease/controller/panel/server/LinkServer.java @@ -94,8 +94,8 @@ public class LinkServer implements LinkApi { } @Override - public Object resourceDetail(@PathVariable String resourceId) { - return panelLinkService.resourceInfo(resourceId); + public Object resourceDetail(@PathVariable String resourceId,@PathVariable String userId) { + return panelLinkService.resourceInfo(resourceId,userId); } @Override @@ -125,7 +125,7 @@ public class LinkServer implements LinkApi { operateType = SysLogConstants.OPERATE_TYPE.MB_VIEW; } if (ObjectUtils.isEmpty(userId)) return; - PanelGroupWithBLOBs panelGroupWithBLOBs = panelLinkService.resourceInfo(panelId); + PanelGroupWithBLOBs panelGroupWithBLOBs = panelLinkService.resourceInfo(panelId,String.valueOf(userId)); String pid = panelGroupWithBLOBs.getPid(); DeLogUtils.save(operateType, SysLogConstants.SOURCE_TYPE.LINK, panelId, pid, userId, SysLogConstants.SOURCE_TYPE.USER); } diff --git a/backend/src/main/java/io/dataease/service/panel/PanelLinkService.java b/backend/src/main/java/io/dataease/service/panel/PanelLinkService.java index 6caf7c6e57..d9baa4281c 100644 --- a/backend/src/main/java/io/dataease/service/panel/PanelLinkService.java +++ b/backend/src/main/java/io/dataease/service/panel/PanelLinkService.java @@ -11,6 +11,7 @@ import io.dataease.controller.request.panel.link.OverTimeRequest; import io.dataease.controller.request.panel.link.PasswordRequest; import io.dataease.dto.panel.PanelGroupDTO; import io.dataease.dto.panel.link.GenerateDto; +import io.dataease.ext.ExtPanelGroupMapper; import io.dataease.ext.ExtPanelLinkMapper; import io.dataease.plugins.common.base.domain.*; import io.dataease.plugins.common.base.mapper.PanelGroupMapper; @@ -49,6 +50,8 @@ public class PanelLinkService { private PanelLinkMappingMapper panelLinkMappingMapper; @Resource private PanelWatermarkMapper panelWatermarkMapper; + @Resource + private ExtPanelGroupMapper extPanelGroupMapper; @Transactional public void changeValid(LinkRequest request) { @@ -234,12 +237,10 @@ public class PanelLinkService { return pass; } - public PanelGroupDTO resourceInfo(String resourceId) { - PanelGroupWithBLOBs result = panelGroupMapper.selectByPrimaryKey(resourceId); - PanelGroupDTO panelGroupDTO = new PanelGroupDTO(); - BeanUtils.copyBean(panelGroupDTO, result); - panelGroupDTO.setWatermarkInfo(panelWatermarkMapper.selectByPrimaryKey("system_default")); - return panelGroupDTO; + public PanelGroupDTO resourceInfo(String resourceId,String userId) { + PanelGroupDTO result = extPanelGroupMapper.findOneWithPrivileges(resourceId,userId); + result.setWatermarkInfo(panelWatermarkMapper.selectByPrimaryKey("system_default")); + return result; } public String getShortUrl(String resourceId) { diff --git a/backend/src/main/resources/db/migration/V52__1.18.5.sql b/backend/src/main/resources/db/migration/V52__1.18.5.sql index 388bf70ea5..6367a06935 100644 --- a/backend/src/main/resources/db/migration/V52__1.18.5.sql +++ b/backend/src/main/resources/db/migration/V52__1.18.5.sql @@ -2,3 +2,54 @@ UPDATE `my_plugin` SET `version` = '1.18.5' where `plugin_id` > 0 and `version` = '1.18.4'; + + +DROP FUNCTION IF EXISTS `get_auths`; +delimiter ;; +CREATE FUNCTION `get_auths`(authSource varchar(255),modelType varchar(255),userId varchar(255)) + RETURNS longtext CHARSET utf8mb4 + READS SQL DATA +BEGIN + +DECLARE oTemp longtext; + +DECLARE isAdmin int; + +select sys_user.is_admin INTO isAdmin from sys_user where user_id =userId; +IF isAdmin = 1 THEN + return 'ignore'; +ELSE +SELECT + group_concat( DISTINCT sys_auth_detail.privilege_extend) into oTemp +FROM + ( + `sys_auth` + LEFT JOIN `sys_auth_detail` ON (( + `sys_auth`.`id` = `sys_auth_detail`.`auth_id` + ))) +where sys_auth_detail.privilege_value =1 + and sys_auth.auth_source=authSource + AND ( + ( + sys_auth.auth_target_type = 'dept' + AND sys_auth.auth_target in ( SELECT dept_id FROM sys_user WHERE user_id = userId ) + ) + OR ( + sys_auth.auth_target_type = 'user' + AND sys_auth.auth_target = userId + ) + OR ( + sys_auth.auth_target_type = 'role' + AND sys_auth.auth_target in ( SELECT role_id FROM sys_users_roles WHERE user_id = userId ) + ) + ) +GROUP BY + `sys_auth`.`auth_source`, + `sys_auth`.`auth_source_type`; +RETURN oTemp; + +END if; + +END +;; +delimiter ; \ No newline at end of file diff --git a/frontend/src/api/link/index.js b/frontend/src/api/link/index.js index 1b25ae6822..52d1481148 100644 --- a/frontend/src/api/link/index.js +++ b/frontend/src/api/link/index.js @@ -66,9 +66,9 @@ export function loadGenerate(resourceId) { }) } -export function loadResource(resourceId) { +export function loadResource(resourceId,userId) { return request({ - url: 'api/link/resourceDetail/' + resourceId, + url: 'api/link/resourceDetail/' + resourceId+'/'+ userId, method: 'get' }) } diff --git a/frontend/src/main.js b/frontend/src/main.js index 673cf928ec..8081fd0d2b 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -113,7 +113,7 @@ Vue.use(VueVideoPlayer) Vue.use(proportion) Vue.prototype.hasDataPermission = function(pTarget, pSource) { - if (this.$store.state.user.user.isAdmin) { + if (this.$store.state.user.user.isAdmin || pSource === 'ignore') { return true } if (pSource && pTarget) { diff --git a/frontend/src/utils/permission.js b/frontend/src/utils/permission.js index 13677e4877..030767a630 100644 --- a/frontend/src/utils/permission.js +++ b/frontend/src/utils/permission.js @@ -9,7 +9,7 @@ export function checkPermission(pers) { } export function hasDataPermission(pTarget, pSource) { - if (store.state.user.user.isAdmin) { + if (store.state.user.user.isAdmin || pSource === 'ignore') { return true } if (pSource && pTarget) { diff --git a/frontend/src/views/link/view/index.vue b/frontend/src/views/link/view/index.vue index 733a0b103b..fa18d5e76e 100644 --- a/frontend/src/views/link/view/index.vue +++ b/frontend/src/views/link/view/index.vue @@ -77,7 +77,7 @@ export default { }) }, setPanelInfo() { - loadResource(this.resourceId).then(res => { + loadResource(this.resourceId,this.user).then(res => { this.show = false let loadingCount = 0 const watermarkInfo = { From 461eb1ee6e02380f6f20bce5eefcdf23eb74d27c Mon Sep 17 00:00:00 2001 From: taojinlong Date: Wed, 8 Mar 2023 17:14:26 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix:=20=E6=A0=A1=E9=AA=8C=20redshift=20data?= =?UTF-8?q?base=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/dataease/provider/datasource/JdbcProvider.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/src/main/java/io/dataease/provider/datasource/JdbcProvider.java b/backend/src/main/java/io/dataease/provider/datasource/JdbcProvider.java index beb65cab8a..18a6d5ae2d 100644 --- a/backend/src/main/java/io/dataease/provider/datasource/JdbcProvider.java +++ b/backend/src/main/java/io/dataease/provider/datasource/JdbcProvider.java @@ -777,6 +777,14 @@ public class JdbcProvider extends DefaultJdbcProvider { case StarRocks: MysqlConfiguration mysqlConfiguration = new Gson().fromJson(datasource.getConfiguration(), MysqlConfiguration.class); mysqlConfiguration.getJdbc(); + case redshift: + RedshiftConfiguration redshiftConfiguration = new Gson().fromJson(datasource.getConfiguration(), RedshiftConfiguration.class); + if(redshiftConfiguration.getDataBase().length() > 64 || redshiftConfiguration.getDataBase().length() < 1){ + throw new Exception("Invalid database name"); + } + if(!redshiftConfiguration.getDataBase().matches("\"^[a-z][a-z0-9_+.@-]*$\"")){ + throw new Exception("Invalid database name"); + } default: break; } From 0c075e61967a2a06d5eb6c797a18e5d1172c65ea Mon Sep 17 00:00:00 2001 From: junjun Date: Thu, 9 Mar 2023 12:45:08 +0800 Subject: [PATCH 5/7] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20echarts?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E6=94=AF=E6=8C=81=E8=AE=BE=E7=BD=AE=E8=BE=B9?= =?UTF-8?q?=E6=A1=86=E9=A2=9C=E8=89=B2=E3=80=81=E8=87=AA=E5=8A=A8=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C?= 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 | 4 +- frontend/src/views/chart/chart/util.js | 8 +- .../chart/components/senior/ScrollCfg.vue | 36 ++++++- .../components/shapeAttr/SizeSelector.vue | 27 +++++ .../chart/components/table/TableNormal.vue | 98 +++++++++++++++++-- 8 files changed, 170 insertions(+), 18 deletions(-) diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 86623f3306..1da7852bc2 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1516,7 +1516,10 @@ export default { p_right: 'Right', p_top: 'Top', p_bottom: 'Bottom', - p_center: 'Center' + p_center: 'Center', + table_auto_break_line: 'Auto Line Feed', + table_break_line_tip: 'If open this option,the table item height will disabled.', + step: 'Step(px)' }, dataset: { scope_edit: 'Effective only when editing', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 83d8445394..b5a32ea57c 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1510,7 +1510,10 @@ export default { p_right: '右對齊', p_top: '上對齊', p_bottom: '下對齊', - p_center: '居中' + p_center: '居中', + table_auto_break_line: '自動換行', + table_break_line_tip: '開啟自動換行,表格行高設置將失效', + step: '步長(px)' }, dataset: { scope_edit: '僅編輯時生效', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index d4851c1e17..033438144b 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1509,7 +1509,10 @@ export default { p_right: '右对齐', p_top: '上对齐', p_bottom: '下对齐', - p_center: '居中' + p_center: '居中', + table_auto_break_line: '自动换行', + table_break_line_tip: '开启自动换行,表格行高设置将失效', + step: '步长(px)' }, dataset: { scope_edit: '仅编辑时生效', diff --git a/frontend/src/views/chart/chart/chart.js b/frontend/src/views/chart/chart/chart.js index 86a5087fc5..5fc2fe9008 100644 --- a/frontend/src/views/chart/chart/chart.js +++ b/frontend/src/views/chart/chart/chart.js @@ -77,6 +77,7 @@ export const DEFAULT_SIZE = { tableColumnWidth: 100, tableHeaderAlign: 'left', tableItemAlign: 'right', + tableAutoBreakLine: false, gaugeMinType: 'fix', // fix or dynamic gaugeMinField: { id: '', @@ -462,7 +463,8 @@ export const DEFAULT_THRESHOLD = { export const DEFAULT_SCROLL = { open: false, row: 1, - interval: 2000 + interval: 2000, + step: 50 } // chart config export const BASE_BAR = { diff --git a/frontend/src/views/chart/chart/util.js b/frontend/src/views/chart/chart/util.js index 972c25c602..ce0b9696d0 100644 --- a/frontend/src/views/chart/chart/util.js +++ b/frontend/src/views/chart/chart/util.js @@ -1847,6 +1847,7 @@ export const TYPE_CONFIGS = [ 'tableItemBgColor', 'tableHeaderFontColor', 'tableFontColor', + 'tableBorderColor', 'tableScrollBarColor', 'alpha' ], @@ -1857,7 +1858,8 @@ export const TYPE_CONFIGS = [ 'tableItemHeight', 'tableColumnWidth', 'showIndex', - 'indexLabel' + 'indexLabel', + 'tableAutoBreakLine' ], 'title-selector': [ 'show', @@ -1887,6 +1889,7 @@ export const TYPE_CONFIGS = [ 'tableItemBgColor', 'tableHeaderFontColor', 'tableFontColor', + 'tableBorderColor', 'tableScrollBarColor', 'alpha' ], @@ -1899,7 +1902,8 @@ export const TYPE_CONFIGS = [ 'tableItemHeight', 'tableColumnWidth', 'showIndex', - 'indexLabel' + 'indexLabel', + 'tableAutoBreakLine' ], 'title-selector': [ 'show', diff --git a/frontend/src/views/chart/components/senior/ScrollCfg.vue b/frontend/src/views/chart/components/senior/ScrollCfg.vue index 1fc74415b3..90788f5609 100644 --- a/frontend/src/views/chart/components/senior/ScrollCfg.vue +++ b/frontend/src/views/chart/components/senior/ScrollCfg.vue @@ -31,6 +31,7 @@ @@ -43,6 +44,20 @@ @change="changeScrollCfg" /> + + +