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; 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 @@