From 8408b575b677010e078a166003afaf57c7cfafa7 Mon Sep 17 00:00:00 2001 From: junjun Date: Wed, 30 Mar 2022 17:03:08 +0800 Subject: [PATCH 1/7] =?UTF-8?q?refactor:=20=E6=8C=87=E6=A0=87=E5=8D=A1?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=8D=A1=E9=97=B4=E9=9A=94=E6=9C=80=E5=B0=8F?= =?UTF-8?q?=E5=80=BC=E9=99=90=E5=88=B6=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/components/shape-attr/SizeSelector.vue | 2 +- .../src/views/chart/components/shape-attr/SizeSelectorAntV.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/chart/components/shape-attr/SizeSelector.vue b/frontend/src/views/chart/components/shape-attr/SizeSelector.vue index 3a9c20a990..05180d7227 100644 --- a/frontend/src/views/chart/components/shape-attr/SizeSelector.vue +++ b/frontend/src/views/chart/components/shape-attr/SizeSelector.vue @@ -142,7 +142,7 @@ - + diff --git a/frontend/src/views/chart/components/shape-attr/SizeSelectorAntV.vue b/frontend/src/views/chart/components/shape-attr/SizeSelectorAntV.vue index a911e7ea4d..7b1d2c576c 100644 --- a/frontend/src/views/chart/components/shape-attr/SizeSelectorAntV.vue +++ b/frontend/src/views/chart/components/shape-attr/SizeSelectorAntV.vue @@ -168,7 +168,7 @@ - + From a6c49815e3cd2034110003ebd0a91a8792069f9b Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 30 Mar 2022 18:00:12 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fix:=20=E9=9B=86=E6=88=90=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E7=9A=84render=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/group/Group.vue | 11 +++++++++-- frontend/src/views/chart/view/ChartEdit.vue | 13 ++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/chart/group/Group.vue b/frontend/src/views/chart/group/Group.vue index 532a71277a..0b1a562bd4 100644 --- a/frontend/src/views/chart/group/Group.vue +++ b/frontend/src/views/chart/group/Group.vue @@ -204,7 +204,7 @@ !this.renderOptions.some(option => option.value === plugin.render)).map(plugin => { + return { name: plugin.render, value: plugin.render } + }) + return [...this.renderOptions, ...pluginOptions] } }, watch: { @@ -783,7 +790,7 @@ export default { view.extBubble = JSON.stringify([]) this.setChartDefaultOptions(view) const _this = this - post('/chart/view/newOne/' + this.panelInfo.id, view,true).then(response => { + post('/chart/view/newOne/' + this.panelInfo.id, view, true).then(response => { this.closeCreateChart() this.$store.dispatch('chart/setTableId', null) this.$store.dispatch('chart/setTableId', this.table.id) diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 2d8b81a76c..d340d4b660 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -175,7 +175,7 @@ @change="changeChartType()" > - + !this.renderOptions.some(option => option.value === plugin.render)).map(plugin => { + return { name: plugin.render, value: plugin.render } + }) + return [...this.renderOptions, ...pluginOptions] + } }, watch: { 'param': function(val) { From 4f30b4e40f77f00723802f6b08387846ef874129 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 30 Mar 2022 19:48:23 +0800 Subject: [PATCH 3/7] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=AF=BC=E5=85=A5=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/panel/list/EditPanel/index.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/panel/list/EditPanel/index.vue b/frontend/src/views/panel/list/EditPanel/index.vue index cac5c1826b..252483d93c 100644 --- a/frontend/src/views/panel/list/EditPanel/index.vue +++ b/frontend/src/views/panel/list/EditPanel/index.vue @@ -3,7 +3,7 @@ {{ $t('panel.custom') }} - + {{ $t('panel.import_template') }} {{ $t('panel.copy_template') }} @@ -23,7 +23,7 @@ - + {{ $t('commons.cancel') }} {{ $t('commons.confirm') }} @@ -168,6 +168,7 @@ export default { this.editPanel.panelInfo.name = this.importTemplateInfo.name this.editPanel.panelInfo.panelStyle = this.importTemplateInfo.panelStyle this.editPanel.panelInfo.panelData = this.importTemplateInfo.panelData + this.editPanel.panelInfo.dynamicData = this.importTemplateInfo.dynamicData } reader.readAsText(file) }, From c0682bcdc8d5eff982faaeb512115cce06a3d4eb Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 30 Mar 2022 20:15:02 +0800 Subject: [PATCH 4/7] =?UTF-8?q?refactor:=20=E5=A4=8D=E5=88=B6=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E5=90=8D=E7=A7=B0=E4=B8=8D=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/dataease/base/mapper/ext/ExtChartViewMapper.xml | 4 ++-- .../java/io/dataease/service/chart/ChartViewService.java | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml index 700328593c..7a638314fa 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml @@ -187,11 +187,11 @@ `senior`, `data_from`) SELECT #{newChartId}, - `name`, + GET_CHART_VIEW_COPY_NAME(#{oldChartId},#{panelId}) as `name`, #{panelId}, `table_id`, `type`, - `title`, + GET_CHART_VIEW_COPY_NAME(#{oldChartId},#{panelId}) as `title`, `x_axis`, `x_axis_ext`, `y_axis`, diff --git a/backend/src/main/java/io/dataease/service/chart/ChartViewService.java b/backend/src/main/java/io/dataease/service/chart/ChartViewService.java index 5862bb8c26..d42d44b804 100644 --- a/backend/src/main/java/io/dataease/service/chart/ChartViewService.java +++ b/backend/src/main/java/io/dataease/service/chart/ChartViewService.java @@ -116,6 +116,13 @@ public class ChartViewService { public ChartViewWithBLOBs newOne(ChartViewWithBLOBs chartView) { long timestamp = System.currentTimeMillis(); + // 校验名称 + ChartViewExample queryExample = new ChartViewExample(); + queryExample.createCriteria().andSceneIdEqualTo(chartView.getSceneId()).andNameEqualTo(chartView.getName()); + List result = chartViewMapper.selectByExample(queryExample); + if(CollectionUtils.isNotEmpty(result)){ + DEException.throwException(Translator.get("theme_name_repeat")); + } chartView.setUpdateTime(timestamp); chartView.setId(UUID.randomUUID().toString()); chartView.setCreateBy(AuthUtils.getUser().getUsername()); From dc026ae9b1618947a6ce1ca0aead018a14b4950f Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 30 Mar 2022 20:29:30 +0800 Subject: [PATCH 5/7] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0flyway?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/db/migration/V33__1.9.sql | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/backend/src/main/resources/db/migration/V33__1.9.sql b/backend/src/main/resources/db/migration/V33__1.9.sql index e0251c26f2..6812189375 100644 --- a/backend/src/main/resources/db/migration/V33__1.9.sql +++ b/backend/src/main/resources/db/migration/V33__1.9.sql @@ -259,3 +259,33 @@ ADD COLUMN `attach_params` tinyint(1) NULL COMMENT '是否附加点击参数' AF update `sys_menu` set menu_id = 100 where title = '首页'; INSERT INTO `sys_menu` VALUES (101, 1, 4, 1, '插件管理', 'system-plugin', 'system/plugin/index', 1002, 'peoples', 'plugin', b'0', b'0', b'0', 'plugin:read', NULL, NULL, NULL, 1620281952752); + +DROP FUNCTION IF EXISTS `GET_CHART_VIEW_COPY_NAME`; +delimiter ;; +CREATE FUNCTION `GET_CHART_VIEW_COPY_NAME`(chartId varchar(255),pid varchar(255)) + RETURNS varchar(255) CHARSET utf8mb4 + READS SQL DATA +BEGIN + +DECLARE chartName varchar(255); + +DECLARE regexpInfo varchar(255); + +DECLARE chartNameCount INTEGER; + +select `name` into chartName from chart_view where id =chartId; +/** +因为名称存在()等特殊字符,所以不能直接用REGEXP进行查找,qrtz_locks +1.用like 'chartName%' 过滤可能的数据项 +2.REPLACE(name,chartName,'') REGEXP '-copy\\(([0-9])+\\)$' 过滤去掉chartName后的字符以 -copy(/d) 结尾的数据 +3.(LENGTH(REPLACE(name,chartName,''))-LENGTH(replace(REPLACE(name,chartName,''),'-',''))=1) 确定只出现一次 ‘-’ 防止多次copy +**/ +select (count(1)+1) into chartNameCount from chart_view +where (LENGTH(REPLACE(name,chartName,''))-LENGTH(replace(REPLACE(name,chartName,''),'-',''))=1) +and REPLACE(name,chartName,'') REGEXP '-copy\\(([0-9])+\\)$' and name like CONCAT(chartName,'%') and chart_view.scene_id=pid ; + +RETURN concat(chartName,'-copy(',chartNameCount,')'); + +END +;; +delimiter ; From 4638d25bd14a4ba3080c863999672619a486dda3 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 30 Mar 2022 20:40:44 +0800 Subject: [PATCH 6/7] =?UTF-8?q?refactor:=20=E9=98=B2=E6=AD=A2=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E7=BC=96=E8=BE=91=E6=97=B6=E5=85=88=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/components/drag-item/ChartDragItem.vue | 2 +- frontend/src/views/chart/components/drag-item/DimensionItem.vue | 2 +- frontend/src/views/chart/components/drag-item/DrillItem.vue | 2 +- frontend/src/views/chart/components/drag-item/FilterItem.vue | 2 +- frontend/src/views/chart/components/drag-item/QuotaExtItem.vue | 2 +- frontend/src/views/chart/components/drag-item/QuotaItem.vue | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/chart/components/drag-item/ChartDragItem.vue b/frontend/src/views/chart/components/drag-item/ChartDragItem.vue index 7b6ba842d9..de4971a907 100644 --- a/frontend/src/views/chart/components/drag-item/ChartDragItem.vue +++ b/frontend/src/views/chart/components/drag-item/ChartDragItem.vue @@ -140,7 +140,7 @@ export default { }, data() { return { - tagType: getItemType(this.dimensionData, this.quotaData, this.item) + tagType: 'success' } }, watch: { diff --git a/frontend/src/views/chart/components/drag-item/DimensionItem.vue b/frontend/src/views/chart/components/drag-item/DimensionItem.vue index f8b5f60da0..8923633daf 100644 --- a/frontend/src/views/chart/components/drag-item/DimensionItem.vue +++ b/frontend/src/views/chart/components/drag-item/DimensionItem.vue @@ -120,7 +120,7 @@ export default { }, data() { return { - tagType: getItemType(this.dimensionData, this.quotaData, this.item) + tagType: 'success' } }, watch: { diff --git a/frontend/src/views/chart/components/drag-item/DrillItem.vue b/frontend/src/views/chart/components/drag-item/DrillItem.vue index 5e24b37397..c76fa5b506 100644 --- a/frontend/src/views/chart/components/drag-item/DrillItem.vue +++ b/frontend/src/views/chart/components/drag-item/DrillItem.vue @@ -56,7 +56,7 @@ export default { }, data() { return { - tagType: getItemType(this.dimensionData, this.quotaData, this.item) + tagType: 'success' } }, watch: { diff --git a/frontend/src/views/chart/components/drag-item/FilterItem.vue b/frontend/src/views/chart/components/drag-item/FilterItem.vue index 600de8f41c..56e87101c3 100644 --- a/frontend/src/views/chart/components/drag-item/FilterItem.vue +++ b/frontend/src/views/chart/components/drag-item/FilterItem.vue @@ -57,7 +57,7 @@ export default { }, data() { return { - tagType: getItemType(this.dimensionData, this.quotaData, this.item) + tagType: 'success' } }, watch: { diff --git a/frontend/src/views/chart/components/drag-item/QuotaExtItem.vue b/frontend/src/views/chart/components/drag-item/QuotaExtItem.vue index 8c08badb3d..2979641516 100644 --- a/frontend/src/views/chart/components/drag-item/QuotaExtItem.vue +++ b/frontend/src/views/chart/components/drag-item/QuotaExtItem.vue @@ -148,7 +148,7 @@ export default { return { compareItem: compareItem, disableEditCompare: false, - tagType: getItemType(this.dimensionData, this.quotaData, this.item) + tagType: 'success' } }, watch: { diff --git a/frontend/src/views/chart/components/drag-item/QuotaItem.vue b/frontend/src/views/chart/components/drag-item/QuotaItem.vue index 7b4539ff81..3d52773f22 100644 --- a/frontend/src/views/chart/components/drag-item/QuotaItem.vue +++ b/frontend/src/views/chart/components/drag-item/QuotaItem.vue @@ -148,7 +148,7 @@ export default { return { compareItem: compareItem, disableEditCompare: false, - tagType: getItemType(this.dimensionData, this.quotaData, this.item) + tagType: 'success' } }, watch: { From 46e38cb697ebec776a0639fc70efb741f42c18cc Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 30 Mar 2022 21:20:10 +0800 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/resources/db/migration/V33__1.9.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/main/resources/db/migration/V33__1.9.sql b/backend/src/main/resources/db/migration/V33__1.9.sql index 6812189375..2a2fd7a965 100644 --- a/backend/src/main/resources/db/migration/V33__1.9.sql +++ b/backend/src/main/resources/db/migration/V33__1.9.sql @@ -250,7 +250,7 @@ END ;; delimiter ; -INSERT INTO `my_plugin`(`plugin_id`, `name`, `store`, `free`, `cost`, `category`, `descript`, `version`, `install_type`, `creator`, `load_mybatis`, `release_time`, `install_time`, `module_name`, `icon`) VALUES (3, 'tabs插件', 'default', 0, 20000, 'panel', 'tabs插件', '1.0-SNAPSHOT', NULL, 'fit2cloud-chenyw', 0, NULL, NULL, 'dataease-extensions-tabs-backend', NULL); +INSERT INTO `my_plugin`(`plugin_id`, `name`, `store`, `free`, `cost`, `category`, `descript`, `version`, `install_type`, `creator`, `load_mybatis`, `release_time`, `install_time`, `module_name`, `icon`) VALUES (3, '选项卡插件', 'default', 0, 20000, 'panel', '选项卡插件', '1.0-SNAPSHOT', NULL, 'fit2cloud-chenyw', 0, NULL, NULL, 'dataease-extensions-tabs-backend', NULL); ALTER TABLE `panel_link_jump_info` ADD COLUMN `attach_params` tinyint(1) NULL COMMENT '是否附加点击参数' AFTER `checked`; @@ -289,3 +289,6 @@ RETURN concat(chartName,'-copy(',chartNameCount,')'); END ;; delimiter ; + +update `my_plugin` set `name` = 'X-Pack默认插件' where `plugin_id` = 1; +update `my_plugin` set `module_name` = 'view-bubblemap-backend' where `plugin_id` = 2;