diff --git a/backend/src/main/resources/db/migration/V44__1.17.sql b/backend/src/main/resources/db/migration/V44__1.17.sql index 833626b004..13a33cb876 100644 --- a/backend/src/main/resources/db/migration/V44__1.17.sql +++ b/backend/src/main/resources/db/migration/V44__1.17.sql @@ -1,4 +1,6 @@ ALTER TABLE `sys_log` CHANGE COLUMN `user_id` `user_id` BIGINT NULL COMMENT '操作人', CHANGE COLUMN `login_name` `login_name` VARCHAR (255) NULL COMMENT '登录账号', - CHANGE COLUMN `nick_name` `nick_name` VARCHAR (255) NULL COMMENT '姓名'; \ No newline at end of file + CHANGE COLUMN `nick_name` `nick_name` VARCHAR (255) NULL COMMENT '姓名'; + +UPDATE `sys_menu` SET `component` = 'dataset/Form' WHERE (`menu_id` = '800'); diff --git a/frontend/src/assets/login-desc.png b/frontend/src/assets/login-desc.png index b296cf2574..bf078d5564 100644 Binary files a/frontend/src/assets/login-desc.png and b/frontend/src/assets/login-desc.png differ diff --git a/frontend/src/components/widget/serviceImpl/TimeDateRangeServiceImpl.js b/frontend/src/components/widget/serviceImpl/TimeDateRangeServiceImpl.js index ec41b71476..c411217f3e 100644 --- a/frontend/src/components/widget/serviceImpl/TimeDateRangeServiceImpl.js +++ b/frontend/src/components/widget/serviceImpl/TimeDateRangeServiceImpl.js @@ -222,6 +222,10 @@ class TimeDateRangeServiceImpl extends WidgetService { } } dynamicDateFormNow(element) { + const values = this.dynamicDateFormNowProxy(element) + return this.formatDynamicTimes(values, element) + } + dynamicDateFormNowProxy(element) { if (element.options.attrs.default === null || typeof element.options.attrs.default === 'undefined' || !element.options.attrs.default.isDynamic) return null if (element.options.attrs.default.dkey === 0) { @@ -265,6 +269,34 @@ class TimeDateRangeServiceImpl extends WidgetService { return [startTime, endTime] } } + + formatDynamicTimes(values, element) { + if (!values?.length || !element.options.attrs.default.isDynamic) { + return values + } + const baseTime = +new Date('2022-11-09 00:00:00.000') + let labelFormat = 'yyyy-MM-dd' + if (element.options.attrs.showTime && element.options.attrs.accuracy) { + labelFormat = labelFormat + ' ' + element.options.attrs.accuracy + } + let [ start, end ] = values + + const attrs = element.options.attrs + + if (attrs.default.sDynamicSuffixTime && attrs.default.isDynamic && attrs.default.dkey === 4 && attrs.showTime) { + start = attrs.default.sDynamicSuffixTime - baseTime + timeSection(start, 'date')[0] + } else { + start = timeSection(start, 'date', labelFormat)[0] + } + if (attrs.default.eDynamicSuffixTime && attrs.default.isDynamic && attrs.default.dkey === 4 && attrs.showTime) { + end = attrs.default.eDynamicSuffixTime - baseTime + timeSection(end, 'date')[0] + } else { + end = timeSection(end, 'date', labelFormat)[1] + } + + const results = [start, end] + return results + } validDynamicValue(element) { if (!element.options.attrs.default.isDynamic) return true if (element.options.attrs.default.dkey !== 4) return true diff --git a/frontend/src/styles/index.scss b/frontend/src/styles/index.scss index 22bf035642..47ba9071c1 100644 --- a/frontend/src/styles/index.scss +++ b/frontend/src/styles/index.scss @@ -770,7 +770,7 @@ div:focus { .no-label-item { .el-form-item__content { - margin-left: 10px !important; + margin-left: 5px !important; } } diff --git a/frontend/src/views/dataset/data/ViewTable.vue b/frontend/src/views/dataset/data/ViewTable.vue index b22355bc22..44ddc7a8cc 100644 --- a/frontend/src/views/dataset/data/ViewTable.vue +++ b/frontend/src/views/dataset/data/ViewTable.vue @@ -68,6 +68,7 @@ {{ $t('dynamic_time.fix') }} - {{ $t('dynamic_time.dynamic') }} + {{ $t('dynamic_time.dynamic') }} + @@ -82,6 +80,7 @@ > + + + +
@@ -153,6 +169,7 @@ > + + + +
time[0] || this.isOneDay)) this.element.options.manualModify = false + }, + + fillEmptySuffixTime() { + if (!this.element.options.attrs.default.sDynamicSuffixTime) { + this.$set(this.element.options.attrs.default, 'sDynamicSuffixTime', this.baseTime) + } + + if (!this.element.options.attrs.default.eDynamicSuffixTime) { + this.$set(this.element.options.attrs.default, 'eDynamicSuffixTime', new Date('2022-11-09 23:59:59.999').getTime()) + } + }, + eDynamicSuffixTimeChange(val) { + this.setDval() + }, + sDynamicSuffixTimeChange(val) { + this.setDval() } } } diff --git a/frontend/src/views/panel/filter/filterMain/FilterControl.vue b/frontend/src/views/panel/filter/filterMain/FilterControl.vue index d4234d9e74..4067341c30 100644 --- a/frontend/src/views/panel/filter/filterMain/FilterControl.vue +++ b/frontend/src/views/panel/filter/filterMain/FilterControl.vue @@ -270,7 +270,10 @@ export default { }, showTimeChange(value) { this.attrs.accuracy = this.accuracyOptions[1].id - this.attrs.default.isDynamic = false + if (this.widget.name !== 'timeDateRangeWidget') { + this.attrs.default.isDynamic = false + } + this.fillAttrs2Filter() }, checkedViewsChange(values) {