From fe63b85f09a3a3639c05e83110d830da9fd59911 Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Mon, 21 Feb 2022 17:58:33 +0800
Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=E8=A7=86=E5=9B=BE=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=E6=94=AF=E6=8C=81=E8=AE=BE=E7=BD=AE=E8=83=8C=E6=99=AF?=
=?UTF-8?q?=E5=9B=BE=E7=89=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/canvas/components/Toolbar.vue | 3 +-
.../canvas/custom-component/UserView.vue | 138 +++++++-----
frontend/src/views/chart/chart/chart.js | 8 +
.../src/views/chart/chart/common/common.js | 2 +-
.../views/chart/chart/common/common_antv.js | 2 +-
.../views/chart/components/ChartComponent.vue | 2 +-
.../chart/components/ChartComponentG2.vue | 2 +-
.../chart/components/ChartComponentS2.vue | 18 +-
.../BackgroundColorSelector.vue | 196 +++++++++++++++---
.../chart/components/normal/LabelNormal.vue | 2 +-
.../chart/components/table/TableNormal.vue | 4 +-
frontend/src/views/chart/view/ChartEdit.vue | 33 ++-
12 files changed, 296 insertions(+), 114 deletions(-)
diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue
index a7663d7af6..da033cd36a 100644
--- a/frontend/src/components/canvas/components/Toolbar.vue
+++ b/frontend/src/components/canvas/components/Toolbar.vue
@@ -126,7 +126,8 @@ export default {
'targetLinkageInfo',
'mobileLayoutStatus',
'mobileComponentData',
- 'componentDataCache'
+ 'componentDataCache',
+ 'styleChangeTimes'
])
},
created() {
diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue
index a17634a791..69f5a4ee7c 100644
--- a/frontend/src/components/canvas/custom-component/UserView.vue
+++ b/frontend/src/components/canvas/custom-component/UserView.vue
@@ -8,62 +8,64 @@
'rect-shape'
]"
>
-
-
-
- {{ message }},{{ $t('chart.chart_show_error') }}
-
- {{ $t('chart.chart_error_tips') }}
+
+
+
+
+ {{ message }},{{ $t('chart.chart_show_error') }}
+
+ {{ $t('chart.chart_error_tips') }}
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
@@ -90,6 +92,7 @@ import EditBarView from '@/components/canvas/components/Editor/EditBarView'
import { customAttrTrans, customStyleTrans, recursionTransObj } from '@/components/canvas/utils/style'
import ChartComponentS2 from '@/views/chart/components/ChartComponentS2'
import PluginCom from '@/views/system/plugin/PluginCom'
+import { hexColorToRGBA } from '@/views/chart/chart/util'
export default {
name: 'UserView',
components: { PluginCom, ChartComponentS2, EditBarView, ChartComponent, TableNormal, LabelNormal, DrillPath, ChartComponentG2 },
@@ -168,6 +171,31 @@ export default {
this.bindPluginEvent()
},
computed: {
+ // 视图
+ componentBackGround() {
+ const customStyle = JSON.parse(this.chart.customStyle)
+ let style = {
+ height: '100%',
+ width: '100%',
+ backgroundSize: '100% 100% !important',
+ borderRadius: '0px'
+ }
+ if (customStyle && customStyle.background) {
+ style.borderRadius = customStyle.background.borderRadius + 'px!important'
+ if (customStyle.background.backgroundType === 'outImage' && typeof (customStyle.background.outImage) === 'string') {
+ style = {
+ background: `url(${customStyle.background.outImage}) no-repeat`,
+ ...style
+ }
+ } else if (!customStyle.background.backgroundType || customStyle.background.backgroundType === 'color') {
+ style = {
+ background: hexColorToRGBA(customStyle.background.color, customStyle.background.alpha),
+ ...style
+ }
+ }
+ }
+ return style
+ },
scaleCoefficient() {
if (this.terminal === 'pc' && !this.mobileLayoutStatus) {
return 1.1
diff --git a/frontend/src/views/chart/chart/chart.js b/frontend/src/views/chart/chart/chart.js
index df770bd6e8..179f42bcc7 100644
--- a/frontend/src/views/chart/chart/chart.js
+++ b/frontend/src/views/chart/chart/chart.js
@@ -1,3 +1,8 @@
+import {ApplicationContext} from "@/utils/ApplicationContext";
+import {BASE_MOBILE_STYLE, HYPERLINKS} from "@/components/canvas/custom-component/component-list";
+import store from "@/store";
+import {deepCopy, resetID} from "@/components/canvas/utils/utils";
+
export const DEFAULT_COLOR_CASE = {
value: 'default',
colors: ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'],
@@ -192,7 +197,10 @@ export const DEFAULT_YAXIS_EXT_STYLE = {
}
}
export const DEFAULT_BACKGROUND_COLOR = {
+ backgroundType: 'color',
color: '#ffffff',
+ outImage: null,
+ innerImage: null,
alpha: 100,
borderRadius: 5
}
diff --git a/frontend/src/views/chart/chart/common/common.js b/frontend/src/views/chart/chart/common/common.js
index 3945d4f4bf..34445d128d 100644
--- a/frontend/src/views/chart/chart/common/common.js
+++ b/frontend/src/views/chart/chart/common/common.js
@@ -174,7 +174,7 @@ export function componentStyle(chart_option, chart) {
chart_option.radar.splitArea = customStyle.split.splitArea
}
if (customStyle.background) {
- chart_option.backgroundColor = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
+ // chart_option.backgroundColor = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
}
}
}
diff --git a/frontend/src/views/chart/chart/common/common_antv.js b/frontend/src/views/chart/chart/common/common_antv.js
index 4175a70bf1..b67db98842 100644
--- a/frontend/src/views/chart/chart/common/common_antv.js
+++ b/frontend/src/views/chart/chart/common/common_antv.js
@@ -40,7 +40,7 @@ export function getTheme(chart) {
customStyle = JSON.parse(chart.customStyle)
// bg
if (customStyle.background) {
- bgColor = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
+ // bgColor = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
}
// legend
if (customStyle.legend) {
diff --git a/frontend/src/views/chart/components/ChartComponent.vue b/frontend/src/views/chart/components/ChartComponent.vue
index 3082ccf498..aaadf57ee5 100644
--- a/frontend/src/views/chart/components/ChartComponent.vue
+++ b/frontend/src/views/chart/components/ChartComponent.vue
@@ -7,7 +7,7 @@
:style="trackBarStyleTime"
@trackClick="trackClick"
/>
-
+
diff --git a/frontend/src/views/chart/components/ChartComponentG2.vue b/frontend/src/views/chart/components/ChartComponentG2.vue
index 66c9437c86..ce766e8f2a 100644
--- a/frontend/src/views/chart/components/ChartComponentG2.vue
+++ b/frontend/src/views/chart/components/ChartComponentG2.vue
@@ -87,7 +87,7 @@ export default {
},
bg_class() {
return {
- borderRadius: this.borderRadius
+ // borderRadius: this.borderRadius
}
}
},
diff --git a/frontend/src/views/chart/components/ChartComponentS2.vue b/frontend/src/views/chart/components/ChartComponentS2.vue
index e4b4b3b1fd..318997f0f1 100644
--- a/frontend/src/views/chart/components/ChartComponentS2.vue
+++ b/frontend/src/views/chart/components/ChartComponentS2.vue
@@ -1,10 +1,10 @@
-
+
{{ chart.title }}
-
+
@@ -109,7 +109,6 @@ export default {
},
bg_class() {
return {
- borderRadius: this.borderRadius
}
}
},
@@ -259,12 +258,7 @@ export default {
}
},
setBackGroundBorder() {
- if (this.chart.customStyle) {
- const customStyle = JSON.parse(this.chart.customStyle)
- if (customStyle.background) {
- this.borderRadius = (customStyle.background.borderRadius || 0) + 'px'
- }
- }
+
},
chartResize() {
this.initData()
@@ -325,12 +319,6 @@ export default {
this.$refs.title.style.fontSize = customStyle.text.fontSize + 'px'
}
}
- if (customStyle.background) {
- this.title_class.background = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
- this.borderRadius = (customStyle.background.borderRadius || 0) + 'px'
-
- this.container_bg_class.background = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
- }
}
},
diff --git a/frontend/src/views/chart/components/component-style/BackgroundColorSelector.vue b/frontend/src/views/chart/components/component-style/BackgroundColorSelector.vue
index d51a1ed91c..3d985280ff 100644
--- a/frontend/src/views/chart/components/component-style/BackgroundColorSelector.vue
+++ b/frontend/src/views/chart/components/component-style/BackgroundColorSelector.vue
@@ -1,24 +1,74 @@
-
-
-
-
-
-
-
-
-
+
+
+ {{ $t('chart.color') }}
+
+
+
+
+
+
+
+ {{ $t('panel.photo') }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('chart.border_radius') }}
+
+
-
-
+
+
+
+
+ {{ $t('chart.not_alpha') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/views/chart/components/normal/LabelNormal.vue b/frontend/src/views/chart/components/normal/LabelNormal.vue
index 616692f810..a9e5e42994 100644
--- a/frontend/src/views/chart/components/normal/LabelNormal.vue
+++ b/frontend/src/views/chart/components/normal/LabelNormal.vue
@@ -161,7 +161,7 @@ export default {
this.title_class.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal'
}
if (customStyle.background) {
- this.bg_class.background = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
+ // this.bg_class.background = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
}
}
},
diff --git a/frontend/src/views/chart/components/table/TableNormal.vue b/frontend/src/views/chart/components/table/TableNormal.vue
index c9afef2d35..1735e2e801 100644
--- a/frontend/src/views/chart/components/table/TableNormal.vue
+++ b/frontend/src/views/chart/components/table/TableNormal.vue
@@ -1,5 +1,5 @@
-
+
{{ chart.title }}
-
-
+
+
-1) {
+ this.$store.commit('recordSnapshot')
bus.$emit('PanelSwitchComponent', { name: 'PanelEdit' })
}
this.$success(this.$t('commons.save_success'))
From e7ccb7c685dc9be73ce6240c9d6069dfcb9d7698 Mon Sep 17 00:00:00 2001
From: junjun
Date: Mon, 21 Feb 2022 18:17:09 +0800
Subject: [PATCH 2/5] =?UTF-8?q?fix:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF=E5=A4=8D?=
=?UTF-8?q?=E5=88=B6=E9=80=8F=E8=A7=86=E5=9B=BE=E6=8A=A5=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml | 2 ++
1 file changed, 2 insertions(+)
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 e17913ef66..910eb49c84 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
@@ -94,6 +94,7 @@
`type`,
`title`,
`x_axis`,
+ `x_axis_ext`,
`y_axis`,
`custom_attr`,
`custom_style`,
@@ -119,6 +120,7 @@
`type`,
GET_CHART_VIEW_COPY_NAME ( #{oldChartId} ),
`x_axis`,
+ `x_axis_ext`,
`y_axis`,
`custom_attr`,
`custom_style`,
From 8823a6e035fa078e2e0ec521a4f7b15511cd5ee9 Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Tue, 22 Feb 2022 09:49:59 +0800
Subject: [PATCH 3/5] =?UTF-8?q?refactor:=20=E8=A7=86=E5=9B=BE=E5=8E=BB?=
=?UTF-8?q?=E6=8E=89=E9=87=8D=E5=90=8D=E6=A0=A1=E9=AA=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/io/dataease/service/chart/ChartGroupService.java | 4 ----
.../main/java/io/dataease/service/chart/ChartViewService.java | 4 ----
2 files changed, 8 deletions(-)
diff --git a/backend/src/main/java/io/dataease/service/chart/ChartGroupService.java b/backend/src/main/java/io/dataease/service/chart/ChartGroupService.java
index 51ae28e3ed..2ab6043ee2 100644
--- a/backend/src/main/java/io/dataease/service/chart/ChartGroupService.java
+++ b/backend/src/main/java/io/dataease/service/chart/ChartGroupService.java
@@ -130,9 +130,5 @@ public class ChartGroupService {
if (ObjectUtils.isNotEmpty(chartGroup.getLevel())) {
criteria.andLevelEqualTo(chartGroup.getLevel());
}
- List list = chartGroupMapper.selectByExample(chartGroupExample);
- if (list.size() > 0) {
- throw new RuntimeException(Translator.get("i18n_name_cant_repeat_same_group"));
- }
}
}
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 2eb4a6a591..78a32e13af 100644
--- a/backend/src/main/java/io/dataease/service/chart/ChartViewService.java
+++ b/backend/src/main/java/io/dataease/service/chart/ChartViewService.java
@@ -1656,10 +1656,6 @@ public class ChartViewService {
if (StringUtils.isNotEmpty(chartView.getName())) {
criteria.andNameEqualTo(chartView.getName());
}
- List list = chartViewMapper.selectByExampleWithBLOBs(chartViewExample);
- if (list.size() > 0) {
- throw new RuntimeException(Translator.get("i18n_name_cant_repeat_same_group"));
- }
}
public ChartDetail getChartDetail(String id) {
From cd5fb46d0d0821daf37fb9e487a8d408afb22e6e Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Tue, 22 Feb 2022 11:04:05 +0800
Subject: [PATCH 4/5] =?UTF-8?q?refactor:=20=E5=8E=BB=E6=8E=89=E8=A7=86?=
=?UTF-8?q?=E5=9B=BE=E6=9D=83=E9=99=90=E6=A0=A1=E9=AA=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../base/mapper/ext/ExtChartViewMapper.xml | 9 +++------
frontend/src/views/chart/view/ChartEdit.vue | 17 -----------------
2 files changed, 3 insertions(+), 23 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 e17913ef66..0f3d43133a 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
@@ -10,19 +10,16 @@