From 195fd7c21e9a4032ad5685dad97ac41ab74bb5d7 Mon Sep 17 00:00:00 2001 From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:46:46 +0800 Subject: [PATCH 01/16] =?UTF-8?q?feat:=20=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E7=9A=84=E6=94=B9=E8=BF=9B=20#3983?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/editor/ComponentWrapper.vue | 2 +- .../canvas/customComponent/UserView.vue | 3 +- .../deIconPicker/deIconGroupPicker/index.vue | 5 ++- .../src/components/deIconPicker/index.vue | 5 ++- frontend/src/lang/en.js | 1 + frontend/src/lang/tw.js | 1 + frontend/src/lang/zh.js | 1 + .../views/background/BackgroundOverall.vue | 17 +++++++--- frontend/src/views/dataset/add/AddDB.vue | 2 +- frontend/src/views/dataset/add/AddSQL.vue | 2 +- .../panel/filter/filterMain/FilterControl.vue | 2 +- .../src/views/panel/list/PanelViewShow.vue | 5 ++- .../src/views/panel/subjectSetting/index.vue | 16 +++++---- .../views/system/datasource/DsFormContent.vue | 34 +++++++++---------- .../src/views/system/datasource/DsTree.vue | 27 +++++++++------ frontend/src/views/wizard/index.vue | 20 +++++------ 16 files changed, 82 insertions(+), 61 deletions(-) diff --git a/frontend/src/components/canvas/components/editor/ComponentWrapper.vue b/frontend/src/components/canvas/components/editor/ComponentWrapper.vue index b12a130c2e..bba9a44403 100644 --- a/frontend/src/components/canvas/components/editor/ComponentWrapper.vue +++ b/frontend/src/components/canvas/components/editor/ComponentWrapper.vue @@ -279,7 +279,7 @@ export default { } else { return { ... - getStyle(style, ['top', 'left', 'width', 'height', 'rotate']), + getStyle(style, ['top', 'left', 'width', 'height', 'rotate']), position: 'relative' } } diff --git a/frontend/src/components/canvas/customComponent/UserView.vue b/frontend/src/components/canvas/customComponent/UserView.vue index eab9fd0802..043b0d80fe 100644 --- a/frontend/src/components/canvas/customComponent/UserView.vue +++ b/frontend/src/components/canvas/customComponent/UserView.vue @@ -350,7 +350,7 @@ export default { }, computed: { - //首次加载且非编辑状态新复制的视图,使用外部filter + // 首次加载且非编辑状态新复制的视图,使用外部filter initLoad() { return !(this.isEdit && this.currentCanvasNewId.includes(this.element.id)) && this.isFirstLoad }, @@ -1269,7 +1269,6 @@ export default { display: block !important; } - .mobile-dialog-css ::v-deep .el-dialog__headerbtn { top: 7px } diff --git a/frontend/src/components/deIconPicker/deIconGroupPicker/index.vue b/frontend/src/components/deIconPicker/deIconGroupPicker/index.vue index 0de188ea20..bb80907527 100644 --- a/frontend/src/components/deIconPicker/deIconGroupPicker/index.vue +++ b/frontend/src/components/deIconPicker/deIconGroupPicker/index.vue @@ -217,7 +217,10 @@ export default { return '' } }, - options: {}, + options: { + type: Object, + default: () => {} + }, width: { type: Number, default() { diff --git a/frontend/src/components/deIconPicker/index.vue b/frontend/src/components/deIconPicker/index.vue index f47284928e..f6ac0ce3a0 100644 --- a/frontend/src/components/deIconPicker/index.vue +++ b/frontend/src/components/deIconPicker/index.vue @@ -180,7 +180,10 @@ export default { return '' } }, - options: {}, + options: { + type: Object, + default: () => {} + }, width: { type: Number, default() { diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 6822dcbe3a..1a9c9056d3 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1923,6 +1923,7 @@ export default { field_description: 'Field description', table_description: 'Table description', relational_database: 'Relational database', + data_warehouse_lake: 'Data Warehouse/Data Lake', non_relational_database: 'Non relational database', all: 'All', other: 'other', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index e306347505..04ee75543b 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1917,6 +1917,7 @@ export default { field_description: '欄位描述', table_description: '表描述', relational_database: '關係型數據庫', + data_warehouse_lake: '數倉/數據湖', non_relational_database: '非關係型數據庫', all: '所有', other: '其他', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 733d69d3af..aabd516a5f 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1916,6 +1916,7 @@ export default { field_description: '字段描述', table_description: '表描述', relational_database: '关系型数据库', + data_warehouse_lake: '数仓/数据湖', non_relational_database: '非关系型数据库', all: '所有', other: '其他', diff --git a/frontend/src/views/background/BackgroundOverall.vue b/frontend/src/views/background/BackgroundOverall.vue index d3a9d706ec..0aa5fc5553 100644 --- a/frontend/src/views/background/BackgroundOverall.vue +++ b/frontend/src/views/background/BackgroundOverall.vue @@ -36,7 +36,10 @@ :span="6" style="padding-top: 5px" > - + {{ $t('chart.color') }} @@ -75,9 +78,12 @@ :span="4" style="padding-top: 5px" > - {{ - $t('panel.background') - }} + {{ + $t('panel.background') + }} @@ -113,7 +119,7 @@ :http-request="upload" :file-list="fileList" > - + diff --git a/frontend/src/views/dataset/add/AddSQL.vue b/frontend/src/views/dataset/add/AddSQL.vue index 27146e2883..61dbe828fc 100644 --- a/frontend/src/views/dataset/add/AddSQL.vue +++ b/frontend/src/views/dataset/add/AddSQL.vue @@ -49,8 +49,8 @@ size="small" > diff --git a/frontend/src/views/panel/filter/filterMain/FilterControl.vue b/frontend/src/views/panel/filter/filterMain/FilterControl.vue index 068c9ea7dd..32d4512603 100644 --- a/frontend/src/views/panel/filter/filterMain/FilterControl.vue +++ b/frontend/src/views/panel/filter/filterMain/FilterControl.vue @@ -279,7 +279,7 @@ export default { }, datasetParams: { type: Array, - default: [] + default: () => [] } }, data() { diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index a89a232b22..0d7f65fb38 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -17,7 +17,7 @@ style="border-bottom: 1px solid;border-bottom-color:#E6E6E6;" >
- +
- + {{ $t('panel.dashboard_theme') }} -
+
- + - + - + - + - + - +
@@ -81,8 +81,10 @@ import BackgroundOverall from '@/views/background/BackgroundOverall' export default { components: { BackgroundOverall, + // eslint-disable-next-line Background, FilterStyleSelector, + // eslint-disable-next-line ComponentStyle, ViewTitle, slider, diff --git a/frontend/src/views/system/datasource/DsFormContent.vue b/frontend/src/views/system/datasource/DsFormContent.vue index cb4f2da004..aabaaae3bc 100644 --- a/frontend/src/views/system/datasource/DsFormContent.vue +++ b/frontend/src/views/system/datasource/DsFormContent.vue @@ -71,8 +71,8 @@
{{ - positionCheck('appMarket') ? $t('app_template.datasource_info') : $t('datasource.basic_info') - }} + positionCheck('appMarket') ? $t('app_template.datasource_info') : $t('datasource.basic_info') + }}
{ - if (!valid) { - return false - } - const appApplyForm = { - ...this.attachForm, - ...this.historyDsForm - } - const method = this.formType === 'add' ? appApply : appEdit - this.appApplyMethod(method, appApplyForm) + if (!valid) { + return false } + const appApplyForm = { + ...this.attachForm, + ...this.historyDsForm + } + const method = this.formType === 'add' ? appApply : appEdit + this.appApplyMethod(method, appApplyForm) + } ) }, save() { @@ -957,10 +957,10 @@ export default { } if (this.positionCheck('appMarket')) { this.$refs.attachParamsForm.validate(valid => { - if (!valid) { - return false - } + if (!valid) { + return false } + } ) } this.$refs.dsForm.validate((valid) => { @@ -1105,10 +1105,10 @@ export default { } if (this.positionCheck('appMarket')) { this.$refs.attachParamsForm.validate(valid => { - if (!valid) { - return false - } + if (!valid) { + return false } + } ) } this.$refs.dsForm.validate((valid) => { diff --git a/frontend/src/views/system/datasource/DsTree.vue b/frontend/src/views/system/datasource/DsTree.vue index a115725a0e..4196212809 100644 --- a/frontend/src/views/system/datasource/DsTree.vue +++ b/frontend/src/views/system/datasource/DsTree.vue @@ -265,12 +265,16 @@ @tab-click="handleClick" > +
{{ $t(`datasource.${nameMap[idx]}`) }}
+ >{{ nameClassMap[idx] }}
{ this.dsTypes = res.data - const databaseList = [[], [], []] + const databaseList = [[], [], [], []] this.dsTypes.forEach((item) => { - const index = this.typeList.findIndex(ele => ele === item.databaseClassification) + const index = this.typeList.findIndex(ele => ele.includes(item.name)) if (index !== -1) { databaseList[index].push(item) } diff --git a/frontend/src/views/wizard/index.vue b/frontend/src/views/wizard/index.vue index d8eb6eba83..2845be662c 100644 --- a/frontend/src/views/wizard/index.vue +++ b/frontend/src/views/wizard/index.vue @@ -30,12 +30,12 @@ /> - + - +
@@ -44,15 +44,15 @@ + >{{ $t('wizard.more') }}
- + - +
@@ -61,7 +61,7 @@ + >{{ $t('wizard.more') }}
    @@ -93,10 +93,10 @@ {{ $t('wizard.web') }}www.dataease.io + style="text-decoration:underline;" + target="_blank" + href="https://www.dataease.io" + >www.dataease.io
From 81f30ac555eed7264b378461981629312b8cd3ed Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 20 Dec 2022 11:16:35 +0800 Subject: [PATCH 02/16] =?UTF-8?q?fix(=E5=9C=B0=E5=9B=BE):=20=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E4=B8=8B=E9=92=BB=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/service/chart/util/ChartDataBuild.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/dataease/service/chart/util/ChartDataBuild.java b/backend/src/main/java/io/dataease/service/chart/util/ChartDataBuild.java index e720913b17..f2c03fcbdb 100644 --- a/backend/src/main/java/io/dataease/service/chart/util/ChartDataBuild.java +++ b/backend/src/main/java/io/dataease/service/chart/util/ChartDataBuild.java @@ -15,6 +15,9 @@ import java.util.*; import java.util.stream.Collectors; public class ChartDataBuild { + + private final static String format = "(%s)"; + // AntV public static Map transChartDataAntV(List xAxis, List yAxis, ChartViewWithBLOBs view, List data, boolean isDrill) { Map map = new HashMap<>(); @@ -969,7 +972,7 @@ public class ChartDataBuild { Map> groupDataList = detailData.stream().collect(Collectors.groupingBy(item -> ArrayUtil.join(ArrayUtil.sub(item, 0, xEndIndex), "-de-", "(", ")"))); tableRow.forEach(row -> { - String key = xAxis.stream().map(x -> row.get(x.getDataeaseName()).toString()).collect(Collectors.joining("-de-", "(", ")")); + String key = xAxis.stream().map(x -> String.format(format, row.get(x.getDataeaseName()).toString())).collect(Collectors.joining("-de-")); List detailFieldValueList = groupDataList.get(key); List> detailValueMapList = detailFieldValueList.stream().map((detailArr -> { Map temp = new HashMap<>(); From 13c995eac53722c01a276ae718453c9696221073 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 20 Dec 2022 14:18:13 +0800 Subject: [PATCH 03/16] =?UTF-8?q?fix(=E7=99=BB=E5=BD=95):=20=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E8=BF=87=E6=9C=9F=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/auth/filter/JWTFilter.java | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/backend/src/main/java/io/dataease/auth/filter/JWTFilter.java b/backend/src/main/java/io/dataease/auth/filter/JWTFilter.java index 2d60576759..a68673c3c1 100644 --- a/backend/src/main/java/io/dataease/auth/filter/JWTFilter.java +++ b/backend/src/main/java/io/dataease/auth/filter/JWTFilter.java @@ -1,6 +1,5 @@ package io.dataease.auth.filter; -import cn.hutool.core.util.URLUtil; import com.auth0.jwt.algorithms.Algorithm; import io.dataease.auth.entity.ASKToken; import io.dataease.auth.entity.JWTToken; @@ -24,10 +23,8 @@ import org.springframework.web.bind.annotation.RequestMethod; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; -import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.nio.charset.Charset; public class JWTFilter extends BasicHttpAuthenticationFilter { @@ -161,18 +158,4 @@ public class JWTFilter extends BasicHttpAuthenticationFilter { httpServletResponse.setHeader("authentication-status", "login_expire"); } - @Override - protected boolean onAccessDenied(ServletRequest req, ServletResponse res, Object mappedValue) throws Exception { - HttpServletResponse response = (HttpServletResponse) res; - HttpServletRequest request = (HttpServletRequest) req; - String requestURI = request.getRequestURI(); - String msg = requestURI + " has been denied"; - String encode = URLUtil.encode(msg, Charset.forName("UTF-8")); - Cookie cookie_error = new Cookie("onAccessDeniedMsg", encode); - cookie_error.setPath("/"); - response.addCookie(cookie_error); - response.sendRedirect("/"); - return false; - } - } From 8cfee501fe16782fec705427dc8ac17b21fd3227 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 20 Dec 2022 15:24:42 +0800 Subject: [PATCH 04/16] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4Tab=E7=94=BB=E5=B8=83=E6=97=B6=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E6=B8=85=E7=90=86=E5=AF=B9=E5=BA=94=E7=94=BB=E5=B8=83?= =?UTF-8?q?=E7=9A=84=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/widget/deWidget/DeTabs.vue | 2 +- frontend/src/store/index.js | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/widget/deWidget/DeTabs.vue b/frontend/src/components/widget/deWidget/DeTabs.vue index fa9c821dfc..23c51cb41c 100644 --- a/frontend/src/components/widget/deWidget/DeTabs.vue +++ b/frontend/src/components/widget/deWidget/DeTabs.vue @@ -640,7 +640,7 @@ export default { while (len--) { if (this.element.options.tabList[len].name === param.name) { this.element.options.tabList.splice(len, 1) - + this.$store.commit('deleteComponentsWithCanvasId', this.element.id + '-' + param.name) const activeIndex = (len - 1 + this.element.options.tabList.length) % this.element.options.tabList.length this.activeTabName = this.element.options.tabList[activeIndex].name } diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index fda7afc92e..a6f76f0cda 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -503,6 +503,9 @@ const data = { const element = state.componentData[index] if (element.id && element.id === id) { state.componentData.splice(index, 1) + if (element.type === 'de-tabs') { + this.commit('deleteComponentsWithCanvasId', element.id) + } break } } @@ -811,6 +814,16 @@ const data = { state.mousePointShadowMap.mouseY = mousePoint.mouseY state.mousePointShadowMap.width = mousePoint.width state.mousePointShadowMap.height = mousePoint.height + }, + deleteComponentsWithCanvasId(state, canvasId) { + if (canvasId && canvasId.length > 10) { + for (let index = 0; index < state.componentData.length; index++) { + const element = state.componentData[index] + if (element.canvasId && element.canvasId.includes(canvasId)) { + state.componentData.splice(index, 1) + } + } + } } }, modules: { From f009996a95f53b8e4c3a93acf4f6bca34a13359e Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 20 Dec 2022 16:08:56 +0800 Subject: [PATCH 05/16] =?UTF-8?q?refactor(=E6=A8=A1=E6=9D=BF=E5=B8=82?= =?UTF-8?q?=E5=9C=BA):=20=E6=A8=A1=E6=9D=BF=E5=B8=82=E5=9C=BA=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=8E=BB=E6=8E=89=E5=BA=94=E7=94=A8=E7=B3=BB=E5=88=97?= =?UTF-8?q?=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templateMarket/TemplateMarketService.java | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/backend/src/main/java/io/dataease/service/templateMarket/TemplateMarketService.java b/backend/src/main/java/io/dataease/service/templateMarket/TemplateMarketService.java index 658c23aa91..978f11c73b 100644 --- a/backend/src/main/java/io/dataease/service/templateMarket/TemplateMarketService.java +++ b/backend/src/main/java/io/dataease/service/templateMarket/TemplateMarketService.java @@ -29,56 +29,56 @@ import java.util.stream.Collectors; @Service public class TemplateMarketService { - private final static String POSTS_API="/api/content/posts?page=0&size=2000"; - private final static String CATEGORIES_API="/api/content/categories"; + private final static String POSTS_API = "/api/content/posts?page=0&size=2000"; + private final static String CATEGORIES_API = "/api/content/categories"; @Resource private SystemParameterService systemParameterService; /** - * @Description Get template file from template market * @param templateUrl template url + * @Description Get template file from template market */ - public PanelTemplateFileDTO getTemplateFromMarket(String templateUrl){ - if(StringUtils.isNotEmpty(templateUrl)){ + public PanelTemplateFileDTO getTemplateFromMarket(String templateUrl) { + if (StringUtils.isNotEmpty(templateUrl)) { String sufUrl = systemParameterService.templateMarketInfo().getTemplateMarketUlr(); Gson gson = new Gson(); - String templateInfo = HttpClientUtil.get(sufUrl+templateUrl,null); + String templateInfo = HttpClientUtil.get(sufUrl + templateUrl, null); return gson.fromJson(templateInfo, PanelTemplateFileDTO.class); - }else{ + } else { return null; } } /** - * @Description Get info from template market content api * @param url content api url + * @Description Get info from template market content api */ - public String marketGet(String url,String accessKey){ + public String marketGet(String url, String accessKey) { HttpClientConfig config = new HttpClientConfig(); - config.addHeader("API-Authorization",accessKey); - return HttpClientUtil.get(url,config); + config.addHeader("API-Authorization", accessKey); + return HttpClientUtil.get(url, config); } - public MarketBaseResponse searchTemplate(TemplateMarketSearchRequest request){ - try{ + public MarketBaseResponse searchTemplate(TemplateMarketSearchRequest request) { + try { BasicInfo basicInfo = systemParameterService.templateMarketInfo(); - String result = marketGet(basicInfo.getTemplateMarketUlr()+POSTS_API,basicInfo.getTemplateAccessKey()); - List postsResult = JSONObject.parseObject(result).getJSONObject("data").getJSONArray("content").toJavaList(TemplateMarketDTO.class); - return new MarketBaseResponse(basicInfo.getTemplateMarketUlr(),postsResult); - }catch (Exception e){ + String result = marketGet(basicInfo.getTemplateMarketUlr() + POSTS_API, basicInfo.getTemplateAccessKey()); + List postsResult = JSONObject.parseObject(result).getJSONObject("data").getJSONArray("content").toJavaList(TemplateMarketDTO.class); + return new MarketBaseResponse(basicInfo.getTemplateMarketUlr(), postsResult); + } catch (Exception e) { DataEaseException.throwException(e); } return null; } - public List getCategories(){ + public List getCategories() { BasicInfo basicInfo = systemParameterService.templateMarketInfo(); - String resultStr = marketGet(basicInfo.getTemplateMarketUlr()+CATEGORIES_API,basicInfo.getTemplateAccessKey()); + String resultStr = marketGet(basicInfo.getTemplateMarketUlr() + CATEGORIES_API, basicInfo.getTemplateAccessKey()); List categories = JSONObject.parseObject(resultStr).getJSONArray("data").toJavaList(TemplateCategory.class); - if(CollectionUtils.isNotEmpty(categories)){ - return categories.stream().sorted(Comparator.comparing(TemplateCategory::getPriority)).map(TemplateCategory :: getName).collect(Collectors.toList()); - }else{ + if (CollectionUtils.isNotEmpty(categories)) { + return categories.stream().filter(item -> !"应用系列".equals(item.getName())).sorted(Comparator.comparing(TemplateCategory::getPriority)).map(TemplateCategory::getName).collect(Collectors.toList()); + } else { return null; } From d005f980c691bd788ff051378900d42a0694914d Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 20 Dec 2022 17:10:27 +0800 Subject: [PATCH 06/16] =?UTF-8?q?fix(=E8=BF=87=E6=BB=A4=E5=99=A8):=20?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4=E8=BF=87=E6=BB=A4=E5=99=A8?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=AE=BE=E7=BD=AE=E5=A4=9A=E4=B8=AA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E6=97=B6=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/panel/filter/filterMain/FilterControl.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/panel/filter/filterMain/FilterControl.vue b/frontend/src/views/panel/filter/filterMain/FilterControl.vue index 32d4512603..46d2117b18 100644 --- a/frontend/src/views/panel/filter/filterMain/FilterControl.vue +++ b/frontend/src/views/panel/filter/filterMain/FilterControl.vue @@ -360,9 +360,12 @@ export default { changeDynamicParams(val, name) { const start = this.attrs.startParameters ? JSON.parse(JSON.stringify(this.attrs.startParameters)) : [] - const end = this.attrs.endParameters ? JSON.parse(JSON.stringify(this.attrs.endParameters)) : [] + let end = this.attrs.endParameters ? JSON.parse(JSON.stringify(this.attrs.endParameters)) : [] if (end?.length) { - end[0] += '_START_END_SPLIT' + end = end.map(item => { + item = item + '_START_END_SPLIT' + return item + }) } this.attrs.parameters = [...new Set([...start, ...end])] }, @@ -393,6 +396,12 @@ export default { enableParametersChange(value) { if (!value) { this.attrs.parameters = [] + if (this.attrs.startParameters?.length) { + this.attrs.startParameters = [] + } + if (this.attrs.endParameters?.length) { + this.attrs.endParameters = [] + } } this.fillAttrs2Filter() }, From b1ea50f01b2264423c8367ca4b9e342f9b9e152a Mon Sep 17 00:00:00 2001 From: junjun Date: Tue, 20 Dec 2022 17:45:15 +0800 Subject: [PATCH 07/16] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20=E6=9F=B1?= =?UTF-8?q?=E7=8A=B6=E5=9B=BE=E3=80=81=E6=8A=98=E7=BA=BF=E5=9B=BE=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=BB=93=E6=9E=9C=E9=9A=90=E8=97=8F=E7=A9=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=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 | 6 ++--- frontend/src/lang/zh.js | 6 ++--- .../src/views/chart/chart/bar/bar_antv.js | 23 ++++++++++++++++--- .../src/views/chart/chart/line/line_antv.js | 11 ++++++++- .../chart/components/senior/FunctionCfg.vue | 4 ++-- 6 files changed, 40 insertions(+), 14 deletions(-) diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index d72a3e7a6d..7575cc3147 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1480,9 +1480,9 @@ export default { total_sort_desc: 'DESC', total_sort_field: 'Sort Field', empty_data_strategy: 'Empty Data Strategy', - break_line: 'Disconnection', + break_line: 'Keep', set_zero: 'Set Zero', - ignore_data: 'Ignore Data', + ignore_data: 'Hide Data', sub_dimension_tip: 'This field is required, and cannot be included in the type axis, you should choose non-group chart if you don\'t need it, or you will get unexpected chart.', drill_dimension_tip: 'Only fields in the dataset can be drilled', table_scroll_tip: 'The detail table is only effective when the pagination mode is "Drop-down".', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 787f8b03f1..cc571a671f 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1479,9 +1479,9 @@ export default { total_sort_desc: '降序', total_sort_field: '排序字段', empty_data_strategy: '空值處理', - break_line: '線條斷開', - set_zero: '置為0,線條不斷開', - ignore_data: '跳過空值,不展示', + break_line: '保持為空', + set_zero: '置為0', + ignore_data: '隱藏空值', sub_dimension_tip: '該字段為必填項,且不應使用類別軸中的字段,若無需該字段,請選擇基礎圖表進行展示,否則展示效果不理想', drill_dimension_tip: '鑽取字段僅支持數據集中的字段', table_scroll_tip: '明細表僅在分頁模式為"下拉"時生效。', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 2cc9c18adb..0d23929039 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1478,9 +1478,9 @@ export default { total_sort_desc: '降序', total_sort_field: '排序字段', empty_data_strategy: '空值处理', - break_line: '线条断开', - set_zero: '置为0,线条不断开', - ignore_data: '跳过空值,不展示', + break_line: '保持为空', + set_zero: '置为0', + ignore_data: '隐藏空值', sub_dimension_tip: '该字段为必填项,且不应使用类别轴中的字段,若无需该字段,请选择基础图表进行展示,否则展示效果不理想。', drill_dimension_tip: '钻取字段仅支持数据集中的字段', table_scroll_tip: '明细表仅在分页模式为"下拉"时生效。', diff --git a/frontend/src/views/chart/chart/bar/bar_antv.js b/frontend/src/views/chart/chart/bar/bar_antv.js index e5a2694c5b..76c8121c05 100644 --- a/frontend/src/views/chart/chart/bar/bar_antv.js +++ b/frontend/src/views/chart/chart/bar/bar_antv.js @@ -11,7 +11,8 @@ import { getAnalyse, setGradientColor } from '@/views/chart/chart/common/common_antv' -import { antVCustomColor } from '@/views/chart/chart/util' +import { antVCustomColor, handleEmptyDataStrategy } from '@/views/chart/chart/util' +import _ from 'lodash' export function baseBarOptionAntV(plot, container, chart, action, isGroup, isStack) { // theme @@ -24,7 +25,7 @@ export function baseBarOptionAntV(plot, container, chart, action, isGroup, isSta const xAxis = getXAxis(chart) const yAxis = getYAxis(chart) // data - const data = chart.data.data + const data = _.cloneDeep(chart.data.data) // config const slider = getSlider(chart) const analyse = getAnalyse(chart) @@ -109,6 +110,14 @@ export function baseBarOptionAntV(plot, container, chart, action, isGroup, isSta return setGradientColor(ele, customAttr.color.gradient, 270) }) } + // 处理空值 + if (chart.senior) { + let emptyDataStrategy = JSON.parse(chart.senior)?.functionCfg?.emptyDataStrategy + if (!emptyDataStrategy) { + emptyDataStrategy = 'breakLine' + } + handleEmptyDataStrategy(emptyDataStrategy, chart, data, options) + } // 开始渲染 if (plot) { @@ -133,7 +142,7 @@ export function hBaseBarOptionAntV(plot, container, chart, action, isGroup, isSt const xAxis = getXAxis(chart) const yAxis = getYAxis(chart) // data - const data = chart.data.data + const data = _.cloneDeep(chart.data.data) // config const slider = getSlider(chart) const analyse = getAnalyse(chart) @@ -211,6 +220,14 @@ export function hBaseBarOptionAntV(plot, container, chart, action, isGroup, isSt return setGradientColor(ele, customAttr.color.gradient) }) } + // 处理空值 + if (chart.senior) { + let emptyDataStrategy = JSON.parse(chart.senior)?.functionCfg?.emptyDataStrategy + if (!emptyDataStrategy) { + emptyDataStrategy = 'breakLine' + } + handleEmptyDataStrategy(emptyDataStrategy, chart, data, options) + } // 开始渲染 if (plot) { diff --git a/frontend/src/views/chart/chart/line/line_antv.js b/frontend/src/views/chart/chart/line/line_antv.js index f6b876a934..b8111e6c79 100644 --- a/frontend/src/views/chart/chart/line/line_antv.js +++ b/frontend/src/views/chart/chart/line/line_antv.js @@ -89,6 +89,7 @@ export function baseLineOptionAntV(plot, container, chart, action) { } // custom color options.color = antVCustomColor(chart) + // 处理空值 if (chart.senior) { let emptyDataStrategy = JSON.parse(chart.senior)?.functionCfg?.emptyDataStrategy if (!emptyDataStrategy) { @@ -119,7 +120,7 @@ export function baseAreaOptionAntV(plot, container, chart, action, isStack) { const xAxis = getXAxis(chart) const yAxis = getYAxis(chart) // data - const data = chart.data.data + const data = _.cloneDeep(chart.data.data) // config const slider = getSlider(chart) const analyse = getAnalyse(chart) @@ -197,6 +198,14 @@ export function baseAreaOptionAntV(plot, container, chart, action, isStack) { } } } + // 处理空值 + if (chart.senior) { + let emptyDataStrategy = JSON.parse(chart.senior)?.functionCfg?.emptyDataStrategy + if (!emptyDataStrategy) { + emptyDataStrategy = 'breakLine' + } + handleEmptyDataStrategy(emptyDataStrategy, chart, data, options) + } // 开始渲染 if (plot) { diff --git a/frontend/src/views/chart/components/senior/FunctionCfg.vue b/frontend/src/views/chart/components/senior/FunctionCfg.vue index 4fe2252ca1..31f96f2968 100644 --- a/frontend/src/views/chart/components/senior/FunctionCfg.vue +++ b/frontend/src/views/chart/components/senior/FunctionCfg.vue @@ -68,7 +68,7 @@ /> @@ -174,7 +174,7 @@ span{ } .form-item ::v-deep .el-radio-group{ display: flex; - flex-direction: row; + flex-direction: column; flex-wrap: wrap; label { line-height: 28px; From 48b0fed12f9ef5018ee5c10ecd049ecdaa710e3b Mon Sep 17 00:00:00 2001 From: junjun Date: Tue, 20 Dec 2022 19:22:23 +0800 Subject: [PATCH 08/16] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20=E6=9F=B1?= =?UTF-8?q?=E7=8A=B6=E5=9B=BE=E3=80=81=E6=8A=98=E7=BA=BF=E5=9B=BE=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=BB=93=E6=9E=9C=E9=9A=90=E8=97=8F=E7=A9=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/components/senior/FunctionCfg.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/chart/components/senior/FunctionCfg.vue b/frontend/src/views/chart/components/senior/FunctionCfg.vue index 31f96f2968..835e6b48fc 100644 --- a/frontend/src/views/chart/components/senior/FunctionCfg.vue +++ b/frontend/src/views/chart/components/senior/FunctionCfg.vue @@ -76,8 +76,11 @@ v-model="functionForm.emptyDataStrategy" @change="changeFunctionCfg" > - {{ $t('chart.break_line') }} - {{ $t('chart.set_zero') }} + {{ chart.type.includes('bar')?$t('chart.set_zero'):$t('chart.break_line') }} + {{ $t('chart.set_zero') }} {{ $t('chart.ignore_data') }} From ab85825fc91e9686709290743ffb7525339e3250 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 21 Dec 2022 12:05:46 +0800 Subject: [PATCH 09/16] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E5=8F=AF=E4=BB=A5=E5=8D=95=E7=8B=AC=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E9=A2=91=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/dataease/ext/ExtChartViewMapper.xml | 645 +++++++++--------- .../main/resources/db/migration/V46__1.18.sql | 23 +- .../canvas/components/editor/EditBar.vue | 16 +- .../canvas/customComponent/UserView.vue | 22 +- frontend/src/lang/en.js | 1 + frontend/src/lang/tw.js | 1 + frontend/src/lang/zh.js | 1 + frontend/src/store/index.js | 17 + frontend/src/views/chart/group/Group.vue | 278 ++++---- frontend/src/views/chart/view/ChartEdit.vue | 151 +++- .../panelStyle/OverallSetting.vue | 1 - 11 files changed, 652 insertions(+), 504 deletions(-) diff --git a/backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml b/backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml index c4d4d4ad46..8e5db11c37 100644 --- a/backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml +++ b/backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml @@ -8,14 +8,11 @@ - + SELECT chart_view.* + FROM chart_view + LEFT JOIN panel_view ON chart_view.id = panel_view.chart_view_id + WHERE panel_view.panel_id = #{panelId} - INSERT INTO chart_view_cache ( - id, - `name`, - title, - scene_id, - table_id, - `type`, - render, - result_count, - result_mode, - create_by, - create_time, - update_time, - style_priority, - chart_type, - is_plugin, - x_axis, - x_axis_ext, - y_axis, - y_axis_ext, - ext_stack, - ext_bubble, - custom_attr, - custom_style, - custom_filter, - drill_fields, - senior, - SNAPSHOT, - data_from - ) SELECT - id, - `name`, - title, - scene_id, - table_id, - `type`, - render, - result_count, - result_mode, - create_by, - create_time, - update_time, - style_priority, - chart_type, - is_plugin, - x_axis, - x_axis_ext, - y_axis, - y_axis_ext, - ext_stack, - ext_bubble, - custom_attr, - custom_style, - custom_filter, - drill_fields, - senior, - SNAPSHOT, - data_from from chart_view - WHERE - chart_view.id = #{id} + INSERT INTO chart_view_cache (id, + `name`, + title, + scene_id, + table_id, + `type`, + render, + result_count, + result_mode, + create_by, + create_time, + update_time, + style_priority, + chart_type, + is_plugin, + x_axis, + x_axis_ext, + y_axis, + y_axis_ext, + ext_stack, + ext_bubble, + custom_attr, + custom_style, + custom_filter, + drill_fields, + senior, + SNAPSHOT, + data_from, + refresh_view_enable, + refresh_unit, + refresh_time) + SELECT id, + `name`, + title, + scene_id, + table_id, + `type`, + render, + result_count, + result_mode, + create_by, + create_time, + update_time, + style_priority, + chart_type, + is_plugin, + x_axis, + x_axis_ext, + y_axis, + y_axis_ext, + ext_stack, + ext_bubble, + custom_attr, + custom_style, + custom_filter, + drill_fields, + senior, + SNAPSHOT, + data_from, + refresh_view_enable, + refresh_unit, + refresh_time + from chart_view + WHERE chart_view.id = #{id} - INSERT INTO chart_view_cache ( - id, - `name`, - title, - scene_id, - table_id, - `type`, - render, - result_count, - result_mode, - create_by, - create_time, - update_time, - style_priority, - chart_type, - is_plugin, - x_axis, - x_axis_ext, - y_axis, - y_axis_ext, - ext_stack, - ext_bubble, - custom_attr, - custom_style, - custom_filter, - drill_fields, - senior, - SNAPSHOT, - data_from - ) SELECT - #{newViewId} as id, - `name`, - title, - scene_id, - table_id, - `type`, - render, - result_count, - result_mode, - create_by, - create_time, - update_time, - style_priority, - chart_type, - is_plugin, - x_axis, - x_axis_ext, - y_axis, - y_axis_ext, - ext_stack, - ext_bubble, - custom_attr, - custom_style, - custom_filter, - drill_fields, - senior, - SNAPSHOT, - data_from from chart_view_cache - WHERE - chart_view_cache.id = #{sourceViewId} + INSERT INTO chart_view_cache (id, + `name`, + title, + scene_id, + table_id, + `type`, + render, + result_count, + result_mode, + create_by, + create_time, + update_time, + style_priority, + chart_type, + is_plugin, + x_axis, + x_axis_ext, + y_axis, + y_axis_ext, + ext_stack, + ext_bubble, + custom_attr, + custom_style, + custom_filter, + drill_fields, + senior, + SNAPSHOT, + data_from, + refresh_view_enable, + refresh_unit, + refresh_time) + SELECT #{newViewId} as id, + `name`, + title, + scene_id, + table_id, + `type`, + render, + result_count, + result_mode, + create_by, + create_time, + update_time, + style_priority, + chart_type, + is_plugin, + x_axis, + x_axis_ext, + y_axis, + y_axis_ext, + ext_stack, + ext_bubble, + custom_attr, + custom_style, + custom_filter, + drill_fields, + senior, + SNAPSHOT, + data_from, + refresh_view_enable, + refresh_unit, + refresh_time + from chart_view_cache + WHERE chart_view_cache.id = #{sourceViewId} - INSERT INTO chart_view_cache ( - id, - `name`, - title, - scene_id, - table_id, - `type`, - render, - result_count, - result_mode, - create_by, - create_time, - update_time, - style_priority, - chart_type, - is_plugin, - x_axis, - x_axis_ext, - y_axis, - y_axis_ext, - ext_stack, - ext_bubble, - custom_attr, - custom_style, - custom_filter, - drill_fields, - senior, - SNAPSHOT, - data_from - ) SELECT - id, - `name`, - title, - scene_id, - table_id, - `type`, - render, - result_count, - result_mode, - create_by, - create_time, - update_time, - style_priority, - chart_type, - is_plugin, - x_axis, - x_axis_ext, - y_axis, - y_axis_ext, - ext_stack, - ext_bubble, - custom_attr, - custom_style, - custom_filter, - drill_fields, - senior, - SNAPSHOT, - data_from from chart_view - WHERE - chart_view.scene_id = #{panelId} + INSERT INTO chart_view_cache (id, + `name`, + title, + scene_id, + table_id, + `type`, + render, + result_count, + result_mode, + create_by, + create_time, + update_time, + style_priority, + chart_type, + is_plugin, + x_axis, + x_axis_ext, + y_axis, + y_axis_ext, + ext_stack, + ext_bubble, + custom_attr, + custom_style, + custom_filter, + drill_fields, + senior, + SNAPSHOT, + data_from, + refresh_view_enable, + refresh_unit, + refresh_time) + SELECT id, + `name`, + title, + scene_id, + table_id, + `type`, + render, + result_count, + result_mode, + create_by, + create_time, + update_time, + style_priority, + chart_type, + is_plugin, + x_axis, + x_axis_ext, + y_axis, + y_axis_ext, + ext_stack, + ext_bubble, + custom_attr, + custom_style, + custom_filter, + drill_fields, + senior, + SNAPSHOT, + data_from, + refresh_view_enable, + refresh_unit, + refresh_time + from chart_view + WHERE chart_view.scene_id = #{panelId} - SELECT * FROM chart_view - WHERE - id IN ( - SELECT - chart_view_id - FROM - panel_view - WHERE - panel_id = #{panelId} - ) + SELECT * + FROM chart_view + WHERE id IN (SELECT chart_view_id + FROM panel_view + WHERE panel_id = #{panelId}) @@ -480,10 +482,12 @@ #{viewId} - + - delete from chart_view_cache where id = #{viewId} - + delete + from chart_view_cache + where id = #{viewId} + UPDATE chart_view cv, @@ -514,7 +518,10 @@ cv.drill_fields = cve.drill_fields, cv.senior = cve.senior, cv.SNAPSHOT = cve.SNAPSHOT, - cv.data_from = cve.data_from + cv.data_from = cve.data_from, + cv.refresh_view_enable = cve.refresh_view_enable, + cv.refresh_unit = cve.refresh_unit, + cv.refresh_time = cve.refresh_time where cve.id = cv.id and cv.id in #{viewId} @@ -523,69 +530,75 @@ UPDATE chart_view_cache cv, - chart_view cve + chart_view cve SET cv.`name` = cve.`name`, - cv.title = cve.title, - cv.scene_id = cve.scene_id, - cv.table_id = cve.table_id, - cv.`type` = cve.`type`, - cv.render = cve.render, - cv.result_count = cve.result_count, - cv.result_mode = cve.result_mode, - cv.create_by = cve.create_by, - cv.create_time = cve.create_time, - cv.update_time = cve.update_time, - cv.style_priority = cve.style_priority, - cv.chart_type = cve.chart_type, - cv.is_plugin = cve.is_plugin, - cv.x_axis = cve.x_axis, - cv.x_axis_ext = cve.x_axis_ext, - cv.y_axis = cve.y_axis, - cv.y_axis_ext = cve.y_axis_ext, - cv.ext_stack = cve.ext_stack, - cv.ext_bubble = cve.ext_bubble, - cv.custom_attr = cve.custom_attr, - cv.custom_style = cve.custom_style, - cv.custom_filter = cve.custom_filter, - cv.drill_fields = cve.drill_fields, - cv.senior = cve.senior, - cv.SNAPSHOT = cve.SNAPSHOT, - cv.data_from = cve.data_from - where cve.id = cv.id and cv.id =#{viewId} + cv.title = cve.title, + cv.scene_id = cve.scene_id, + cv.table_id = cve.table_id, + cv.`type` = cve.`type`, + cv.render = cve.render, + cv.result_count = cve.result_count, + cv.result_mode = cve.result_mode, + cv.create_by = cve.create_by, + cv.create_time = cve.create_time, + cv.update_time = cve.update_time, + cv.style_priority = cve.style_priority, + cv.chart_type = cve.chart_type, + cv.is_plugin = cve.is_plugin, + cv.x_axis = cve.x_axis, + cv.x_axis_ext = cve.x_axis_ext, + cv.y_axis = cve.y_axis, + cv.y_axis_ext = cve.y_axis_ext, + cv.ext_stack = cve.ext_stack, + cv.ext_bubble = cve.ext_bubble, + cv.custom_attr = cve.custom_attr, + cv.custom_style = cve.custom_style, + cv.custom_filter = cve.custom_filter, + cv.drill_fields = cve.drill_fields, + cv.senior = cve.senior, + cv.SNAPSHOT = cve.SNAPSHOT, + cv.data_from = cve.data_from, + cv.refresh_view_enable = cve.refresh_view_enable, + cv.refresh_unit = cve.refresh_unit, + cv.refresh_time = cve.refresh_time + where cve.id = cv.id and cv.id =#{viewId} UPDATE chart_view_cache cve, - chart_view cv + chart_view cv SET cv.`name` = cve.`name`, - cv.title = cve.title, - cv.scene_id = cve.scene_id, - cv.table_id = cve.table_id, - cv.`type` = cve.`type`, - cv.render = cve.render, - cv.result_count = cve.result_count, - cv.result_mode = cve.result_mode, - cv.create_by = cve.create_by, - cv.create_time = cve.create_time, - cv.update_time = cve.update_time, - cv.style_priority = cve.style_priority, - cv.chart_type = cve.chart_type, - cv.is_plugin = cve.is_plugin, - cv.x_axis = cve.x_axis, - cv.x_axis_ext = cve.x_axis_ext, - cv.y_axis = cve.y_axis, - cv.y_axis_ext = cve.y_axis_ext, - cv.ext_stack = cve.ext_stack, - cv.ext_bubble = cve.ext_bubble, - cv.custom_attr = cve.custom_attr, - cv.custom_style = cve.custom_style, - cv.custom_filter = cve.custom_filter, - cv.drill_fields = cve.drill_fields, - cv.senior = cve.senior, - cv.SNAPSHOT = cve.SNAPSHOT, - cv.data_from = cve.data_from - where cve.id = cv.id and cv.id =#{viewId} + cv.title = cve.title, + cv.scene_id = cve.scene_id, + cv.table_id = cve.table_id, + cv.`type` = cve.`type`, + cv.render = cve.render, + cv.result_count = cve.result_count, + cv.result_mode = cve.result_mode, + cv.create_by = cve.create_by, + cv.create_time = cve.create_time, + cv.update_time = cve.update_time, + cv.style_priority = cve.style_priority, + cv.chart_type = cve.chart_type, + cv.is_plugin = cve.is_plugin, + cv.x_axis = cve.x_axis, + cv.x_axis_ext = cve.x_axis_ext, + cv.y_axis = cve.y_axis, + cv.y_axis_ext = cve.y_axis_ext, + cv.ext_stack = cve.ext_stack, + cv.ext_bubble = cve.ext_bubble, + cv.custom_attr = cve.custom_attr, + cv.custom_style = cve.custom_style, + cv.custom_filter = cve.custom_filter, + cv.drill_fields = cve.drill_fields, + cv.senior = cve.senior, + cv.SNAPSHOT = cve.SNAPSHOT, + cv.data_from = cve.data_from, + cv.refresh_view_enable = cve.refresh_view_enable, + cv.refresh_unit = cve.refresh_unit, + cv.refresh_time = cve.refresh_time + where cve.id = cv.id and cv.id =#{viewId} @@ -600,55 +613,49 @@ - INSERT INTO chart_view_field ( - id, - table_id, - chart_id, - origin_name, - `name`, - dataease_name, - group_type, - `type`, - `size`, - de_type, - de_type_format, - de_extract_type, - ext_field, - `checked`, - column_index, - last_sync_time - ) SELECT - uuid() AS id, - chart_view_field.table_id, - chart_view_field.pv_copy.chart_view_id AS chart_id, - chart_view_field.origin_name, - chart_view_field.`name`, - chart_view_field.dataease_name, - chart_view_field.group_type, - chart_view_field.`type`, - chart_view_field.`size`, - chart_view_field.de_type, - chart_view_field.de_type_format, - chart_view_field.de_extract_type, - chart_view_field.ext_field, - chart_view_field.`checked`, - chart_view_field.column_index, - chart_view_field.last_sync_time - FROM - ( - SELECT - panel_id, - copy_from_view, - chart_view_id - FROM - panel_view - WHERE - copy_id = #{copyId} - ) pv_copy - INNER JOIN chart_view_field ON chart_view_field.chart_id = pv_copy.copy_from_view + INSERT INTO chart_view_field (id, + table_id, + chart_id, + origin_name, + `name`, + dataease_name, + group_type, + `type`, + `size`, + de_type, + de_type_format, + de_extract_type, + ext_field, + `checked`, + column_index, + last_sync_time) + SELECT uuid() AS id, + chart_view_field.table_id, + chart_view_field.pv_copy.chart_view_id AS chart_id, + chart_view_field.origin_name, + chart_view_field.`name`, + chart_view_field.dataease_name, + chart_view_field.group_type, + chart_view_field.`type`, + chart_view_field.`size`, + chart_view_field.de_type, + chart_view_field.de_type_format, + chart_view_field.de_extract_type, + chart_view_field.ext_field, + chart_view_field.`checked`, + chart_view_field.column_index, + chart_view_field.last_sync_time + FROM (SELECT panel_id, + copy_from_view, + chart_view_id + FROM panel_view + WHERE copy_id = #{copyId}) pv_copy + INNER JOIN chart_view_field ON chart_view_field.chart_id = pv_copy.copy_from_view diff --git a/backend/src/main/resources/db/migration/V46__1.18.sql b/backend/src/main/resources/db/migration/V46__1.18.sql index 6d1a5fa29b..a6e13beab1 100644 --- a/backend/src/main/resources/db/migration/V46__1.18.sql +++ b/backend/src/main/resources/db/migration/V46__1.18.sql @@ -10,8 +10,25 @@ ALTER TABLE `sys_task` ADD COLUMN `status` tinyint(1) NULL DEFAULT 1 COMMENT '运行状态' AFTER `create_time`; -INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`) VALUES (1100, 1, 0, 1, '血缘关系', 'sys-relationship', 'system/relationship/index', 1002, 'sys-relationship', 'relationship', 0, 0, 0, 'relationship:read'); +INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, + `path`, `i_frame`, `cache`, `hidden`, `permission`) +VALUES (1100, 1, 0, 1, '血缘关系', 'sys-relationship', 'system/relationship/index', 1002, 'sys-relationship', + 'relationship', 0, 0, 0, 'relationship:read'); -UPDATE `sys_menu` SET `menu_sort` = 1003 WHERE (`menu_id` = 101); +UPDATE `sys_menu` +SET `menu_sort` = 1003 +WHERE (`menu_id` = 101); -UPDATE `my_plugin` SET `version` = '1.18.0' where `plugin_id` > 0; +UPDATE `my_plugin` +SET `version` = '1.18.0' +where `plugin_id` > 0; + +ALTER TABLE `chart_view` + ADD COLUMN `refresh_view_enable` tinyint(1) NULL DEFAULT 0 COMMENT '是否开启刷新' AFTER `view_fields`, +ADD COLUMN `refresh_unit` varchar(255) NULL DEFAULT 'minute' COMMENT '刷新时间单位' AFTER `refresh_view_enable`, +ADD COLUMN `refresh_time` int(13) NULL DEFAULT 5 COMMENT '刷新时间' AFTER `refresh_unit`; + +ALTER TABLE `chart_view_cache` + ADD COLUMN `refresh_view_enable` tinyint(1) NULL DEFAULT 0 COMMENT '是否开启刷新' AFTER `view_fields`, +ADD COLUMN `refresh_unit` varchar(255) NULL DEFAULT 'minute' COMMENT '刷新时间单位' AFTER `refresh_view_enable`, +ADD COLUMN `refresh_time` int(13) NULL DEFAULT 5 COMMENT '刷新时间' AFTER `refresh_unit`; diff --git a/frontend/src/components/canvas/components/editor/EditBar.vue b/frontend/src/components/canvas/components/editor/EditBar.vue index 471c4186f2..7c7e833cc5 100644 --- a/frontend/src/components/canvas/components/editor/EditBar.vue +++ b/frontend/src/components/canvas/components/editor/EditBar.vue @@ -137,7 +137,7 @@ :target="curComponent.hyperlinks.openMode " :href="curComponent.hyperlinks.content " > - + @@ -496,19 +496,7 @@ export default { }, // 清除相同sourceViewId 的 联动条件 clearLinkage() { - this.componentData.forEach(item => { - if (item.linkageFilters && item.linkageFilters.length > 0) { - const newList = item.linkageFilters.filter(linkage => linkage.sourceViewId !== this.element.propValue.viewId) - item.linkageFilters.splice(0, item.linkageFilters.length) - // 重新push 可保证数组指针不变 可以watch到 - if (newList.length > 0) { - newList.forEach(newLinkage => { - item.linkageFilters.push(newLinkage) - }) - } - } - }) - bus.$emit('clear_panel_linkage', { viewId: this.element.propValue.viewId }) + this.$store.commit('clearViewLinkage', this.element.propValue.viewId) }, goFile() { this.$refs.files.click() diff --git a/frontend/src/components/canvas/customComponent/UserView.vue b/frontend/src/components/canvas/customComponent/UserView.vue index eab9fd0802..b950c2a008 100644 --- a/frontend/src/components/canvas/customComponent/UserView.vue +++ b/frontend/src/components/canvas/customComponent/UserView.vue @@ -305,6 +305,7 @@ export default { }, data() { return { + innerRefreshTimer: null, mobileChartDetailsVisible: false, chartDetailsVisible: false, showChartInfo: {}, @@ -393,7 +394,7 @@ export default { return this.httpRequest.status && this.chart.type && this.chart.type === 'label' }, loadingFlag() { - return (this.canvasStyleData.refreshViewLoading || this.searchCount === 0) && this.requestStatus === 'waiting' + return (this.canvasStyleData.refreshViewLoading || (!this.innerRefreshTimer && this.searchCount === 0)) && this.requestStatus === 'waiting' }, panelInfo() { return this.$store.state.panel.panelInfo @@ -520,7 +521,8 @@ export default { }, // 监听外部计时器变化 searchCount: function(val1) { - if (val1 > 0 && this.requestStatus !== 'waiting') { + // 内部计时器启动 忽略外部计时器 + if (val1 > 0 && this.requestStatus !== 'waiting' && !this.innerRefreshTimer) { this.getData(this.element.propValue.viewId) } }, @@ -547,6 +549,7 @@ export default { }, beforeDestroy() { + this.innerRefreshTimer && clearInterval(this.innerRefreshTimer) bus.$off('plugin-chart-click', this.pluginChartClick) bus.$off('plugin-jump-click', this.pluginJumpClick) bus.$off('plugin-add-view-track-filter', this.pluginAddViewTrackFilter) @@ -566,6 +569,20 @@ export default { } }, methods: { + //编辑状态下 不启动刷新 + buildInnerRefreshTimer(refreshViewEnable = false, refreshUnit = 'minute', refreshTime = 5) { + if (this.editMode === 'preview' && !this.innerRefreshTimer && refreshViewEnable) { + this.innerRefreshTimer && clearInterval(this.innerRefreshTimer) + const timerRefreshTime = refreshUnit === 'second' ? refreshTime * 1000 : refreshTime * 60000 + this.innerRefreshTimer = setInterval(() => { + this.clearViewLinkage() + this.getData(this.element.propValue.viewId) + }, timerRefreshTime) + } + }, + clearViewLinkage() { + this.$store.commit('clearViewLinkage', this.element.propValue.viewId) + }, responseResetButton() { if (!this.cfilters?.length) { this.getData(this.element.propValue.viewId, false) @@ -741,6 +758,7 @@ export default { if (response.success) { this.chart = response.data this.view = response.data + this.buildInnerRefreshTimer(this.chart.refreshViewEnable, this.chart.refreshUnit, this.chart.refreshTime) this.$emit('fill-chart-2-parent', this.chart) this.getDataOnly(response.data, dataBroadcast) this.chart['position'] = this.inTab ? 'tab' : 'panel' diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 0d1b11ca47..4af97a6d3e 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -931,6 +931,7 @@ export default { password_input_error: 'Original password input error' }, chart: { + chart_refresh_tips: 'View refresh setting takes precedence over panel refresh setting', '1-trend': 'trend', '2-state': 'State', '3-rank': 'Rank', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 4641716985..43ee0991f2 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -930,6 +930,7 @@ export default { password_input_error: '原始密碼輸入錯誤' }, chart: { + chart_refresh_tips: '視圖刷新設置優先於儀表板刷新設置', '1-trend': '趨勢', '2-state': '狀態', '3-rank': '排名', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index b9078e74b6..8f1ac7cc22 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -929,6 +929,7 @@ export default { password_input_error: '原始密码输入错误' }, chart: { + chart_refresh_tips: '视图刷新设置优先于仪表板刷新设置', '1-trend': '趋势', '2-state': '状态', '3-rank': '排名', diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index a6f76f0cda..d2f832d71d 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -824,6 +824,23 @@ const data = { } } } + }, + // 清除相同sourceViewId 的 联动条件 + clearViewLinkage(state, viewId) { + state.componentData.forEach(item => { + if (item.linkageFilters && item.linkageFilters.length > 0) { + const newList = item.linkageFilters.filter(linkage => linkage.sourceViewId !== viewId) + item.linkageFilters.splice(0, item.linkageFilters.length) + // 重新push 可保证数组指针不变 可以watch到 + if (newList.length > 0) { + newList.forEach(newLinkage => { + item.linkageFilters.push(newLinkage) + }) + } + } + }) + + bus.$emit('clear_panel_linkage', { viewId: viewId }) } }, modules: { diff --git a/frontend/src/views/chart/group/Group.vue b/frontend/src/views/chart/group/Group.vue index 63aa526890..89ec69c2ec 100644 --- a/frontend/src/views/chart/group/Group.vue +++ b/frontend/src/views/chart/group/Group.vue @@ -13,7 +13,7 @@ @click="add('group')" />
- + - {{ searchMap[searchType] }} + {{ searchMap[searchType] }} {{ $t('commons.all') }} @@ -63,7 +63,7 @@ > - + - + - +
{{ $t('chart.cancel') }} + >{{ $t('chart.cancel') }} + {{ $t('chart.confirm') }} + >{{ $t('chart.confirm') }} +
@@ -264,7 +266,7 @@ :label="$t('commons.name')" prop="name" > - +
{{ $t('chart.cancel') }} + >{{ $t('chart.cancel') }} + {{ $t('chart.confirm') }} + >{{ $t('chart.confirm') }} +
@@ -318,8 +322,8 @@ :active="createActive" align-center > - - + + {{ $t('chart.cancel') }} + >{{ $t('chart.cancel') }} + {{ $t('chart.preview') - }} + >{{ + $t('chart.preview') + }} {{ $t('dataset.cancel') }} + >{{ $t('dataset.cancel') }} + {{ - $t('dataset.confirm') }} + $t('dataset.confirm') + }} @@ -465,14 +473,16 @@ {{ $t('dataset.cancel') }} + >{{ $t('dataset.cancel') }} + {{ - $t('dataset.confirm') }} + $t('dataset.confirm') + }} @@ -480,27 +490,26 @@ diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 4931d8baba..1fb3e092a3 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -192,7 +192,7 @@ @command="chartFieldEdit" > - + - + {{ $t('chart.change_chart_type') }} - + @@ -406,6 +406,68 @@ + + + + + + + + {{ $t('panel.refresh_frequency') }} + + +
+ {{ $t('chart.chart_refresh_tips') }} +
+ +
+ + + {{ $t('panel.enable_refresh_view') }} + + + + + + + + +
{{ - $t('chart.drag_block_table_data_column') - }} + $t('chart.drag_block_table_data_column') + }} {{ $t('chart.drag_block_type_axis') }} @@ -499,18 +561,18 @@ v-else-if="view.type && view.type.includes('pie')" >{{ $t('chart.drag_block_pie_label') }} {{ - $t('chart.drag_block_funnel_split') - }} + $t('chart.drag_block_funnel_split') + }} {{ - $t('chart.drag_block_radar_label') - }} + $t('chart.drag_block_radar_label') + }} {{ $t('chart.area') }} {{ - $t('chart.drag_block_treemap_label') - }} + $t('chart.drag_block_treemap_label') + }} {{ - $t('chart.drag_block_word_cloud_label') - }} + $t('chart.drag_block_word_cloud_label') + }} {{ $t('chart.drag_block_label') }} / {{ $t('chart.dimension') }} @@ -633,8 +695,8 @@ > {{ - $t('chart.drag_block_table_data_column') - }} + $t('chart.drag_block_table_data_column') + }} {{ $t('chart.drag_block_value_axis') }} @@ -642,30 +704,30 @@ v-else-if="view.type && view.type.includes('pie')" >{{ $t('chart.drag_block_pie_angel') }} {{ - $t('chart.drag_block_funnel_width') - }} + $t('chart.drag_block_funnel_width') + }} {{ - $t('chart.drag_block_radar_length') - }} + $t('chart.drag_block_radar_length') + }} {{ - $t('chart.drag_block_gauge_angel') - }} + $t('chart.drag_block_gauge_angel') + }} {{ $t('chart.drag_block_label_value') }} {{ $t('chart.chart_data') }} {{ - $t('chart.drag_block_treemap_size') - }} + $t('chart.drag_block_treemap_size') + }} {{ - $t('chart.drag_block_value_axis_main') - }} + $t('chart.drag_block_value_axis_main') + }} {{ $t('chart.drag_block_progress') }} {{ - $t('chart.drag_block_word_cloud_size') - }} + $t('chart.drag_block_word_cloud_size') + }} / {{ $t('chart.quota') }} - + @@ -1293,7 +1355,7 @@ width="800px" class="dialog-css" > - + @@ -2170,31 +2170,31 @@ export default { } .de-drag-top { - left: 0; - top: 0; + left: 1px; + top: 1px; height: 12px; - width: 100%; + width: calc(100% - 2px); } .de-drag-right { - right: 0; - top: 0; + right: 1px; + top: 1px; width: 16px; - height: 100%; + height: calc(100% - 30px); } .de-drag-bottom { - left: 0; - bottom: 0; + left: 1px; + bottom: 1px; height: 12px; - width: 100%; + width: calc(100% - 2px); } .de-drag-left { - left: 0; - top: 0; + left: 1px; + top: 1px; width: 16px; - height: 100%; + height: calc(100% - 2px); } From 1f2005712bd088e4ec22a4fd4007f02d832f458e Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Wed, 21 Dec 2022 17:56:43 +0800 Subject: [PATCH 15/16] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE(=E6=8A=98=E7=BA=BF?= =?UTF-8?q?=E5=9B=BE)):=20=E4=BF=AE=E5=A4=8D=E6=8A=98=E7=BA=BF=E5=9B=BE?= =?UTF-8?q?=E6=9C=89=E5=AD=90=E7=BB=B4=E5=BA=A6=E6=97=B6=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes https://github.com/dataease/dataease/issues/4137 --- frontend/src/views/chart/chart/common/common_antv.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/chart/chart/common/common_antv.js b/frontend/src/views/chart/chart/common/common_antv.js index 32a1e2f091..c869d8132c 100644 --- a/frontend/src/views/chart/chart/common/common_antv.js +++ b/frontend/src/views/chart/chart/common/common_antv.js @@ -153,7 +153,7 @@ export function getLabel(chart) { // label value formatter if (chart.type && chart.type !== 'waterfall') { label.formatter = function(param) { - let yAxis, extStack + let yAxis, extStack, xaxisExt let res = param.value try { yAxis = JSON.parse(chart.yaxis) @@ -165,11 +165,16 @@ export function getLabel(chart) { } catch (e) { extStack = JSON.parse(JSON.stringify(chart.extStack)) } + try { + xaxisExt = JSON.parse(chart.xaxisExt) + } catch (e) { + xaxisExt = JSON.parse(JSON.stringify(chart.xaxisExt)) + } - if (equalsAny(chart.type, 'bar-stack', 'line-stack', + if (equalsAny(chart.type, 'line', 'bar-stack', 'line-stack', 'bar-stack-horizontal', 'percentage-bar-stack', 'percentage-bar-stack-horizontal')) { let f - if (extStack && extStack.length > 0) { + if (extStack?.length > 0 || xaxisExt?.length > 0) { f = yAxis[0] } else { for (let i = 0; i < yAxis.length; i++) { From 54d9f5d5f1d2d70787d269953bc37f8b054e4398 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Wed, 21 Dec 2022 17:58:03 +0800 Subject: [PATCH 16/16] =?UTF-8?q?feat(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../panel/PanelGroupController.java | 7 ++++ .../io/dataease/ext/ExtPanelGroupMapper.java | 3 ++ .../io/dataease/ext/ExtPanelGroupMapper.xml | 34 +++++++++++++++++++ .../service/panel/PanelGroupService.java | 12 +++++++ 4 files changed, 56 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 28bb812286..dbe2e68035 100644 --- a/backend/src/main/java/io/dataease/controller/panel/PanelGroupController.java +++ b/backend/src/main/java/io/dataease/controller/panel/PanelGroupController.java @@ -14,6 +14,7 @@ import io.dataease.dto.PermissionProxy; import io.dataease.dto.authModel.VAuthModelDTO; import io.dataease.dto.panel.PanelExport2App; import io.dataease.dto.panel.PanelGroupDTO; +import io.dataease.plugins.common.base.domain.PanelGroup; import io.dataease.service.panel.PanelGroupService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -50,6 +51,12 @@ public class PanelGroupController { return panelGroupService.tree(request); } + @ApiOperation("查询当前用户仪表板") + @GetMapping("/list") + public List list() { + return panelGroupService.list(); + } + @ApiOperation("默认树") @PostMapping("/defaultTree") public List defaultTree(@RequestBody PanelGroupRequest request) { diff --git a/backend/src/main/java/io/dataease/ext/ExtPanelGroupMapper.java b/backend/src/main/java/io/dataease/ext/ExtPanelGroupMapper.java index 68d10de928..30dbcd2c75 100644 --- a/backend/src/main/java/io/dataease/ext/ExtPanelGroupMapper.java +++ b/backend/src/main/java/io/dataease/ext/ExtPanelGroupMapper.java @@ -3,6 +3,7 @@ package io.dataease.ext; import io.dataease.controller.request.panel.PanelGroupRequest; import io.dataease.dto.RelationDTO; import io.dataease.dto.panel.PanelGroupDTO; +import io.dataease.plugins.common.base.domain.PanelGroup; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -30,4 +31,6 @@ public interface ExtPanelGroupMapper { List panelGroupInit(); List queryPanelRelation(@Param("panelId") String panelId, @Param("userId") Long userId); + + List listPanelByUser(@Param("userId") long userId); } diff --git a/backend/src/main/java/io/dataease/ext/ExtPanelGroupMapper.xml b/backend/src/main/java/io/dataease/ext/ExtPanelGroupMapper.xml index d172a7e8f4..4c6343e5e3 100644 --- a/backend/src/main/java/io/dataease/ext/ExtPanelGroupMapper.xml +++ b/backend/src/main/java/io/dataease/ext/ExtPanelGroupMapper.xml @@ -320,4 +320,38 @@ where pg.id=#{panelId,jdbcType=VARCHAR} group by dt.id + + diff --git a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java index 947073c9dd..64f48249e3 100644 --- a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java +++ b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import io.dataease.auth.annotation.DeCleaner; +import io.dataease.auth.api.dto.CurrentUserDto; import io.dataease.commons.constants.*; import io.dataease.commons.utils.*; import io.dataease.controller.request.authModel.VAuthModelRequest; @@ -151,6 +152,17 @@ public class PanelGroupService { return TreeUtils.mergeTree(panelGroupDTOList, "default_panel"); } + public List list() { + CurrentUserDto user = AuthUtils.getUser(); + if (user.getIsAdmin()) { + PanelGroupExample example = new PanelGroupExample(); + example.setOrderByClause("name"); + example.createCriteria().andNodeTypeEqualTo("panel"); + return panelGroupMapper.selectByExample(example); + } + return extPanelGroupMapper.listPanelByUser(user.getUserId()); + } + @DeCleaner(value = DePermissionType.PANEL, key = "pid") public String save(PanelGroupRequest request) { checkPanelName(request.getName(), request.getPid(), PanelConstants.OPT_TYPE_INSERT, null, request.getNodeType());