From 2fbed9fdece4f168a4ab4036af4c93342ff44a27 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 17 Aug 2021 12:25:22 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20=E5=AE=9A=E6=97=B6=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9C=AA=E8=AF=BB=E6=B6=88=E6=81=AF=E6=9D=A1=E6=95=B0=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/service/impl/ShiroServiceImpl.java | 2 + .../controller/sys/MsgController.java | 12 ++++ .../service/message/SysMsgService.java | 7 +++ frontend/src/api/system/msg.js | 9 +++ .../src/components/Notification/index.vue | 58 ++++++++++++++----- frontend/src/utils/request.js | 5 +- 6 files changed, 75 insertions(+), 18 deletions(-) diff --git a/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java b/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java index 68c20a92f2..8ebf604a00 100644 --- a/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java +++ b/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java @@ -45,6 +45,8 @@ public class ShiroServiceImpl implements ShiroService { //验证链接 filterChainDefinitionMap.put("/api/link/validate**", ANON); filterChainDefinitionMap.put("/api/map/areaEntitys/**", ANON); + //未读消息数量 + filterChainDefinitionMap.put("/api/sys_msg/unReadCount", ANON); filterChainDefinitionMap.put("/**/*.json", ANON); filterChainDefinitionMap.put("/system/ui/**", ANON); diff --git a/backend/src/main/java/io/dataease/controller/sys/MsgController.java b/backend/src/main/java/io/dataease/controller/sys/MsgController.java index 1b4ce8bc8f..729edbae37 100644 --- a/backend/src/main/java/io/dataease/controller/sys/MsgController.java +++ b/backend/src/main/java/io/dataease/controller/sys/MsgController.java @@ -6,6 +6,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiSupport; import io.dataease.base.domain.SysMsgChannel; import io.dataease.base.domain.SysMsgSetting; import io.dataease.base.domain.SysMsgType; +import io.dataease.commons.exception.DEException; import io.dataease.commons.utils.AuthUtils; import io.dataease.commons.utils.PageUtils; import io.dataease.commons.utils.Pager; @@ -21,6 +22,7 @@ import org.apache.commons.lang3.ObjectUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; @Api(tags = "系统:消息管理") @@ -46,6 +48,16 @@ public class MsgController { return listPager; } + @ApiOperation("查询未读数量") + @PostMapping("/unReadCount") + public Long unReadCount(@RequestBody Map request) { + if(null == request || null == request.get("userId")) { + throw new RuntimeException("缺少用户ID"); + } + Long userId = request.get("userId"); + return sysMsgService.queryCount(userId); + } + @ApiOperation("设置已读") @PostMapping("/setReaded/{msgId}") public void setReaded(@PathVariable Long msgId) { diff --git a/backend/src/main/java/io/dataease/service/message/SysMsgService.java b/backend/src/main/java/io/dataease/service/message/SysMsgService.java index 0bfa10c343..798e0b42a2 100644 --- a/backend/src/main/java/io/dataease/service/message/SysMsgService.java +++ b/backend/src/main/java/io/dataease/service/message/SysMsgService.java @@ -105,6 +105,13 @@ public class SysMsgService { return msgGridDtos; } + public Long queryCount(Long userId) { + SysMsgExample example = new SysMsgExample(); + SysMsgExample.Criteria criteria = example.createCriteria(); + criteria.andUserIdEqualTo(userId).andStatusEqualTo(false); + return sysMsgMapper.countByExample(example); + } + public void setReaded(Long msgId) { SysMsg sysMsg = new SysMsg(); sysMsg.setMsgId(msgId); diff --git a/frontend/src/api/system/msg.js b/frontend/src/api/system/msg.js index 83accc340f..45ac7c687b 100644 --- a/frontend/src/api/system/msg.js +++ b/frontend/src/api/system/msg.js @@ -9,6 +9,15 @@ export function query(pageIndex, pageSize, data) { }) } +export function unReadCount(data) { + return request({ + url: '/api/sys_msg/unReadCount', + method: 'post', + loading: false, + data + }) +} + export function updateStatus(msgId) { return request({ url: '/api/sys_msg/setReaded/' + msgId, diff --git a/frontend/src/components/Notification/index.vue b/frontend/src/components/Notification/index.vue index 6e0d6cae1a..fa07c8e79d 100644 --- a/frontend/src/components/Notification/index.vue +++ b/frontend/src/components/Notification/index.vue @@ -53,14 +53,14 @@ class-name="notification" icon-class="notification" /> - {{ paginationConfig.total }} + {{ count || paginationConfig.total }} - - From 09667df67ea23b3e68419c8eb818f4650a4b9b1d Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 17 Aug 2021 15:19:36 +0800 Subject: [PATCH 4/6] =?UTF-8?q?feat:=20=E8=A7=86=E5=9B=BE=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=BE=B9=E6=A1=86=E5=9C=86=E8=A7=92=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lang/en.js | 4 ++++ frontend/src/lang/tw.js | 3 +++ frontend/src/lang/zh.js | 3 +++ .../src/views/chart/components/ChartComponent.vue | 14 ++++++++++++-- .../component-style/BackgroundColorSelector.vue | 4 ++++ 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 033b0da0bf..5c5298814b 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -696,6 +696,10 @@ export default { filter: 'Filter', none: 'None', background: 'Background', + + border: 'Corner', + border_width: 'Border width', + border_radius: 'Border radius', alpha: 'Transparency', add_filter: 'Add Filter', no_limit: 'No limit', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index a973e69f36..1a99572f77 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -696,6 +696,9 @@ export default { filter: '過濾', none: '無', background: '背景', + border: '邊角', + border_width: '邊框寬度', + border_radius: '邊框半徑', alpha: '透明度', add_filter: '添加過濾', no_limit: '無顯示', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 285de2d1d8..d19e349de2 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -696,6 +696,9 @@ export default { filter: '过滤', none: '无', background: '背景', + border: '边角', + border_width: '边框宽度', + border_radius: '边框半径', alpha: '透明度', add_filter: '添加过滤', no_limit: '无限制', diff --git a/frontend/src/views/chart/components/ChartComponent.vue b/frontend/src/views/chart/components/ChartComponent.vue index 9368cb3129..5e673dc7ea 100644 --- a/frontend/src/views/chart/components/ChartComponent.vue +++ b/frontend/src/views/chart/components/ChartComponent.vue @@ -1,7 +1,7 @@ @@ -56,7 +56,8 @@ export default { }, pointParam: null, - dynamicAreaCode: null + dynamicAreaCode: null, + borderRadius: '0px' } }, @@ -195,11 +196,20 @@ export default { myEcharts(option) { // 指定图表的配置项和数据 const chart = this.myChart + this.setBackGroundBorder() setTimeout(chart.setOption(option, true), 500) window.onresize = function() { chart.resize() } }, + setBackGroundBorder() { + if (this.chart.customStyle) { + const customStyle = JSON.parse(this.chart.customStyle) + if (customStyle.background) { + this.borderRadius = (customStyle.background.borderRadius || 0) + 'px' + } + } + }, chartResize() { // 指定图表的配置项和数据 const chart = this.myChart diff --git a/frontend/src/views/chart/components/component-style/BackgroundColorSelector.vue b/frontend/src/views/chart/components/component-style/BackgroundColorSelector.vue index d2a2f566f8..294b9c7629 100644 --- a/frontend/src/views/chart/components/component-style/BackgroundColorSelector.vue +++ b/frontend/src/views/chart/components/component-style/BackgroundColorSelector.vue @@ -8,6 +8,10 @@ + + + + From effcab3ec46a3548e5e8050b39f96fd72eb78b18 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 17 Aug 2021 15:26:05 +0800 Subject: [PATCH 5/6] =?UTF-8?q?refactor:=E4=B8=8B=E9=92=BB=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E5=90=8E=E4=B8=80=E7=BA=A7=E6=8F=90=E7=A4=BA=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/canvas/custom-component/UserView.vue | 6 ++++++ frontend/src/lang/en.js | 3 ++- frontend/src/lang/tw.js | 3 ++- frontend/src/lang/zh.js | 3 ++- frontend/src/views/chart/view/ChartEdit.vue | 6 ++++++ 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index 153100e9c1..5c6210b454 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -309,6 +309,12 @@ export default { this.chart.type === 'map' && this.sendToChildren(param) this.drillClickDimensionList.push({ dimensionList: param.data.dimensionList }) this.getData(this.element.propValue.viewId) + } else if (this.chart.drillFields.length > 0) { + this.$message({ + type: 'error', + message: this.$t('chart.last_layer'), + showClose: true + }) } }, diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index dd94163107..2332d6a427 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -842,7 +842,8 @@ export default { width: 'Width', height: 'Height', system_case: 'System', - custom_case: 'Custom' + custom_case: 'Custom', + last_layer: 'This Is The Last Layer' }, dataset: { sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 5a34132bcf..4a0b9a256b 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -842,7 +842,8 @@ export default { width: '寬度', height: '高度', system_case: '系統方案', - custom_case: '自定義' + custom_case: '自定義', + last_layer: '当前已经是最后一级' }, dataset: { sheet_warn: '有多個sheet頁面,默認抽取第一個', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 57126190ef..66691bb5fd 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -842,7 +842,8 @@ export default { width: '宽度', height: '高度', system_case: '系统方案', - custom_case: '自定义' + custom_case: '自定义', + last_layer: '当前已经是最后一级' }, dataset: { sheet_warn: '有多个 Sheet 页,默认抽取第一个', diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 387e47457d..92b5f6fbac 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -1416,6 +1416,12 @@ export default { this.drillClickDimensionList.push({ dimensionList: param.data.dimensionList }) this.getData(this.param.id) } + } else if (this.view.drillFields.length > 0) { + this.$message({ + type: 'error', + message: this.$t('chart.last_layer'), + showClose: true + }) } }, From 13c7c5c8be7eda3f09203fde28218f882ab9a1b0 Mon Sep 17 00:00:00 2001 From: junjie Date: Tue, 17 Aug 2021 16:02:33 +0800 Subject: [PATCH 6/6] =?UTF-8?q?feat:=20=E6=95=A3=E7=82=B9=E6=B0=94?= =?UTF-8?q?=E6=B3=A1=E5=9B=BE=E8=BD=B4=E7=BA=BF=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/chart/common/common.js | 4 ++-- frontend/src/views/chart/view/ChartEdit.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/chart/chart/common/common.js b/frontend/src/views/chart/chart/common/common.js index a1ce01bbe2..3235e7a429 100644 --- a/frontend/src/views/chart/chart/common/common.js +++ b/frontend/src/views/chart/chart/common/common.js @@ -51,7 +51,7 @@ export function componentStyle(chart_option, chart) { chart_option.legend.icon = customStyle.legend.icon chart_option.legend.textStyle = customStyle.legend.textStyle } - if (customStyle.xAxis && (chart.type.includes('bar') || chart.type.includes('line'))) { + if (customStyle.xAxis && (chart.type.includes('bar') || chart.type.includes('line') || chart.type.includes('scatter'))) { chart_option.xAxis.show = customStyle.xAxis.show chart_option.xAxis.position = customStyle.xAxis.position chart_option.xAxis.name = customStyle.xAxis.name @@ -59,7 +59,7 @@ export function componentStyle(chart_option, chart) { chart_option.xAxis.splitLine = customStyle.xAxis.splitLine chart_option.xAxis.nameTextStyle = customStyle.xAxis.nameTextStyle } - if (customStyle.yAxis && (chart.type.includes('bar') || chart.type.includes('line'))) { + if (customStyle.yAxis && (chart.type.includes('bar') || chart.type.includes('line') || chart.type.includes('scatter'))) { chart_option.yAxis.show = customStyle.yAxis.show chart_option.yAxis.position = customStyle.yAxis.position chart_option.yAxis.name = customStyle.yAxis.name diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 92b5f6fbac..d6192b8414 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -447,10 +447,10 @@ {{ $t('chart.module_style') }} - + - +