From 5daa4abd0f3d0cfae0d952f41da6376112640725 Mon Sep 17 00:00:00 2001 From: "hong.yang" Date: Mon, 25 Sep 2023 09:20:48 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20G2=E7=BB=84=E4=BB=B6=E7=9A=84setting?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=A1=B9=E6=94=B9=E4=B8=BA=E4=BD=BF=E7=94=A8?= =?UTF-8?q?Map=E5=88=97=E8=A1=A8=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit G2组件的setting配置项改为使用Map列表存储 --- .../core/module/chart/components/CustomComponentChart.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DataRoom/dataroom-core/src/main/java/com/gccloud/dataroom/core/module/chart/components/CustomComponentChart.java b/DataRoom/dataroom-core/src/main/java/com/gccloud/dataroom/core/module/chart/components/CustomComponentChart.java index 3bf9bd47..990522d0 100644 --- a/DataRoom/dataroom-core/src/main/java/com/gccloud/dataroom/core/module/chart/components/CustomComponentChart.java +++ b/DataRoom/dataroom-core/src/main/java/com/gccloud/dataroom/core/module/chart/components/CustomComponentChart.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; +import java.util.Map; /** * 自定义组件 @@ -38,7 +39,7 @@ public class CustomComponentChart extends Chart { private Object option; @ApiModelProperty(notes = "右侧面板自定义配置") - private List setting; + private List> setting; @ApiModelProperty(notes = "组件的唯一名称") private String name; From a488f88c6c26d1c1ddbb4cbf52543de0798cdff5 Mon Sep 17 00:00:00 2001 From: "liu.shiyi" Date: Mon, 25 Sep 2023 09:50:21 +0800 Subject: [PATCH 2/6] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E6=9D=A1=E5=BD=A2=E5=9B=BE=E6=95=B0=E6=8D=AE=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E9=85=8D=E7=BD=AE=E5=A4=B1=E6=95=88=E5=8F=8A?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data-room-ui/packages/G2Plots/条形图/基础条形图.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-room-ui/packages/G2Plots/条形图/基础条形图.js b/data-room-ui/packages/G2Plots/条形图/基础条形图.js index ff859ef6..027592f6 100644 --- a/data-room-ui/packages/G2Plots/条形图/基础条形图.js +++ b/data-room-ui/packages/G2Plots/条形图/基础条形图.js @@ -527,7 +527,7 @@ const option = { radius: [10, 10, 0, 0]// 设置条形图的圆角 }, label: { - position: 'middle', + layout:{}, style: { fill: '#59F25F', opacity: 0, From 1e664b2929baa3275061bc2aed24eaa63c217dca Mon Sep 17 00:00:00 2001 From: "liu.shiyi" Date: Mon, 25 Sep 2023 09:59:55 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix:=E5=8E=BB=E9=99=A4=E6=9D=A1=E5=BD=A2?= =?UTF-8?q?=E5=9B=BE=E7=9A=84=E6=9D=A1=E5=BD=A2=E6=A0=B7=E5=BC=8F=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../G2Plots/条形图/分组条形图.js | 60 +++++++++--------- .../G2Plots/条形图/基础条形图.js | 61 ++++++++++--------- 2 files changed, 61 insertions(+), 60 deletions(-) diff --git a/data-room-ui/packages/G2Plots/条形图/分组条形图.js b/data-room-ui/packages/G2Plots/条形图/分组条形图.js index 0bb73110..3001474a 100644 --- a/data-room-ui/packages/G2Plots/条形图/分组条形图.js +++ b/data-room-ui/packages/G2Plots/条形图/分组条形图.js @@ -59,35 +59,35 @@ const setting = [ }, /** 样式配置 **/ // 图表 graph - { - label: '条形样式', - type: 'select', // 设置组件类型 - field: 'shape', // 字段 - optionField: 'shape', // 对应options中的字段 - // 是否多选 - multiple: false, - value: 'default', - tabName: 'custom', - options: [ - { - label: '实心条形', - value: 'default' - }, - // { - // label: '线性', - // value: 'line' - // }, - { - label: '空心条形', - value: 'hollow-rect' - }, - { - label: '钉形', - value: 'tick' - } - ], - groupName: 'graph' - }, + // { + // label: '条形样式', + // type: 'select', // 设置组件类型 + // field: 'shape', // 字段 + // optionField: 'shape', // 对应options中的字段 + // // 是否多选 + // multiple: false, + // value: 'default', + // tabName: 'custom', + // options: [ + // { + // label: '实心条形', + // value: 'default' + // }, + // // { + // // label: '线性', + // // value: 'line' + // // }, + // { + // label: '空心条形', + // value: 'hollow-rect' + // }, + // { + // label: '钉形', + // value: 'tick' + // } + // ], + // groupName: 'graph' + // }, { label: '圆角设置', // 设置组件类型 @@ -565,7 +565,7 @@ const option = { dataKey: 'data', data, isGroup: true, - shape: ' ', + // shape: ' ', xField: 'value', yField: 'label', legendEnable: false, diff --git a/data-room-ui/packages/G2Plots/条形图/基础条形图.js b/data-room-ui/packages/G2Plots/条形图/基础条形图.js index 027592f6..d1d7b670 100644 --- a/data-room-ui/packages/G2Plots/条形图/基础条形图.js +++ b/data-room-ui/packages/G2Plots/条形图/基础条形图.js @@ -46,35 +46,35 @@ const setting = [ }, /** 样式配置 **/ // 图表 graph - { - label: '条形样式', - type: 'select', // 设置组件类型 - field: 'shape', // 字段 - optionField: 'shape', // 对应options中的字段 - // 是否多选 - multiple: false, - value: 'default', - tabName: 'custom', - options: [ - { - label: '实心条形', - value: 'default' - }, - // { - // label: '线性', - // value: 'line' - // }, - { - label: '空心条形', - value: 'hollow-rect' - }, - { - label: '钉形', - value: 'tick' - } - ], - groupName: 'graph' - }, + // { + // label: '条形样式', + // type: 'select', // 设置组件类型 + // field: 'shape', // 字段 + // optionField: 'shape', // 对应options中的字段 + // // 是否多选 + // multiple: false, + // value: 'default', + // tabName: 'custom', + // options: [ + // { + // label: '实心条形', + // value: 'default' + // }, + // // { + // // label: '线性', + // // value: 'line' + // // }, + // { + // label: '空心条形', + // value: 'hollow-rect' + // }, + // { + // label: '钉形', + // value: 'tick' + // } + // ], + // groupName: 'graph' + // }, { label: '圆角设置', // 设置组件类型 @@ -509,7 +509,7 @@ const option = { data, xField: 'value', yField: 'year', - shape: 'default', // 条形图形状 + // shape: 'default', // 条形图形状 seriesField: 'year', color: ['#5B8FF9', '#61DDAA', '#5D7092', '#F6BD16', '#6F5EF9', '#6DC8EC', '#945FB9', '#FF9845', '#1E9493', '#FF99C3'], legendEnable: true, @@ -527,6 +527,7 @@ const option = { radius: [10, 10, 0, 0]// 设置条形图的圆角 }, label: { + position: 'middle', layout:{}, style: { fill: '#59F25F', From 2d8112738506dbe84937a66de943c9acef5d35d7 Mon Sep 17 00:00:00 2001 From: "wu.jian2" Date: Mon, 25 Sep 2023 10:11:23 +0800 Subject: [PATCH 4/6] =?UTF-8?q?feat:=20=E6=A0=B9=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=84=8F=E8=A7=81=E8=B0=83=E6=95=B4=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E3=80=81=E6=97=A5=E6=9C=9F=E6=97=B6=E9=97=B4=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=99=A8=E7=BB=84=E4=BB=B6=E9=85=8D=E7=BD=AE=EF=BC=8C=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=A0=BC=E5=BC=8F=E5=8C=96=E6=95=B0=E6=8D=AE=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E4=B8=BA=E8=87=AA=E5=AE=9A=E4=B9=89=EF=BC=8C=E5=8E=BB?= =?UTF-8?q?=E9=99=A4Date=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BasicComponents/CurrentTime/index.vue | 4 ++-- .../BasicComponents/DateTimePicker/index.vue | 6 +++++- .../BasicComponents/DateTimePicker/setting.vue | 17 +++++++++++------ .../DateTimePicker/settingConfig.js | 6 +++--- .../BasicComponents/TimePicker/index.vue | 11 ++++++++++- .../BasicComponents/TimePicker/setting.vue | 17 ++++++++--------- .../BasicComponents/TimePicker/settingConfig.js | 6 +++--- .../packages/js/utils/getComponentConfig.js | 2 +- 8 files changed, 43 insertions(+), 26 deletions(-) diff --git a/data-room-ui/packages/BasicComponents/CurrentTime/index.vue b/data-room-ui/packages/BasicComponents/CurrentTime/index.vue index ea09a316..f3aea7b0 100644 --- a/data-room-ui/packages/BasicComponents/CurrentTime/index.vue +++ b/data-room-ui/packages/BasicComponents/CurrentTime/index.vue @@ -31,8 +31,8 @@ import moment from 'moment' import paramsMixins from 'data-room-ui/js/mixins/paramsMixins' import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting' -import cloneDeep from "lodash/cloneDeep"; -import {mapMutations, mapState} from 'vuex' +import cloneDeep from 'lodash/cloneDeep' +import { mapMutations, mapState } from 'vuex' export default { name: 'CurrentTime', mixins: [paramsMixins], diff --git a/data-room-ui/packages/BasicComponents/DateTimePicker/index.vue b/data-room-ui/packages/BasicComponents/DateTimePicker/index.vue index 17b51ce6..cd43e446 100644 --- a/data-room-ui/packages/BasicComponents/DateTimePicker/index.vue +++ b/data-room-ui/packages/BasicComponents/DateTimePicker/index.vue @@ -52,7 +52,7 @@ export default { if (val && val.customize && val.customize.formatType === 'custom') { // 解决时间格式化类型为自定义时,时间格式化类型和时间格式化值数据类型不匹配的问题 this.$nextTick(() => { - this.value = toString(this.value) + this.config.customize.value = toString(this.config.customize.value) }) } }, @@ -65,6 +65,10 @@ export default { document.querySelector(`.date-picker-${this.config.code}`).style.pointerEvents = 'none' } this.changeStyle(this.config) + // 将config.customize.value设置值为当前时间 : + if (this.config.customize.value === '') { + this.config.customize.value = new Date() + } }, beforeDestroy () { }, diff --git a/data-room-ui/packages/BasicComponents/DateTimePicker/setting.vue b/data-room-ui/packages/BasicComponents/DateTimePicker/setting.vue index ff6a547b..8f52700e 100644 --- a/data-room-ui/packages/BasicComponents/DateTimePicker/setting.vue +++ b/data-room-ui/packages/BasicComponents/DateTimePicker/setting.vue @@ -137,13 +137,22 @@ /> +
+ 时间格式示例:
+ yyyy:表示年份,
+ MM:表示月份,
+ dd:表示日期,
+ HH:表示小时(24小时制),
+ mm:表示分钟,
+ ss:表示秒,
+ 具体可参考Element-UI官网的日期选择器的时间格式化部分。 +
@@ -193,7 +202,6 @@ export default { second: 'ss', // 时间格式化类型选项 formatTypeOptions: [ - { label: 'Date 对象', value: 'default' }, { label: '时间戳', value: 'timestamp' }, { label: '自定义', value: 'custom' } ], @@ -213,10 +221,7 @@ export default { mounted () {}, methods: { selectFormatType (type) { - if (type === 'default') { - this.config.customize.value = '' - this.config.customize.valueFormat = '' - } else if (type === 'timestamp') { + if (type === 'timestamp') { this.config.customize.value = 0 this.config.customize.valueFormat = 'timestamp' } else if (type === 'custom') { diff --git a/data-room-ui/packages/BasicComponents/DateTimePicker/settingConfig.js b/data-room-ui/packages/BasicComponents/DateTimePicker/settingConfig.js index aeb80e2d..fc580d74 100644 --- a/data-room-ui/packages/BasicComponents/DateTimePicker/settingConfig.js +++ b/data-room-ui/packages/BasicComponents/DateTimePicker/settingConfig.js @@ -31,10 +31,10 @@ const customConfig = { fontSize: 20, // 显示类型 year/month/date/week/ datetime/datetimerange/daterange type: 'datetime', - // 时间格式化类型:Date 对象(default),时间戳(timestamp),自定义(custom) - formatType: 'default', + // 时间格式化类型:时间戳(timestamp),自定义(custom) + formatType: 'custom', // 绑定值的格式 - valueFormat: '', + valueFormat: 'yyyy-MM-dd HH:mm:ss', // 下拉框 dropDownBox: { // 下拉框背景颜色 diff --git a/data-room-ui/packages/BasicComponents/TimePicker/index.vue b/data-room-ui/packages/BasicComponents/TimePicker/index.vue index 67fd912c..9fac689d 100644 --- a/data-room-ui/packages/BasicComponents/TimePicker/index.vue +++ b/data-room-ui/packages/BasicComponents/TimePicker/index.vue @@ -14,6 +14,7 @@