forked from github/dataease
Merge pull request #1605 from dataease/pr@dev@fix_dynamic_time
fix: 动态时间组件
This commit is contained in:
commit
3a4b0b3005
@ -114,10 +114,8 @@ class TimeDateServiceImpl extends WidgetService {
|
||||
const tarYear = nowYear
|
||||
if (dynamicSuffix === 'before') {
|
||||
const deffMonth = nowMonth - dynamicPrefix
|
||||
let diffYear = deffMonth / 12
|
||||
if (deffMonth < 0) {
|
||||
diffYear -= 1
|
||||
}
|
||||
const diffYear = Math.floor(deffMonth / 12)
|
||||
|
||||
return new Date(tarYear + diffYear, nowMonth - dynamicPrefix % 12, nowDate).getTime()
|
||||
} else {
|
||||
const deffMonth = nowMonth + dynamicPrefix
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div v-if="element">
|
||||
<div v-if="element" class="default-value-div">
|
||||
<el-form ref="form" :model="element.options.attrs.default" label-width="100px">
|
||||
|
||||
<el-form-item :label="$t('dynamic_time.set_default')">
|
||||
@ -23,7 +23,7 @@
|
||||
<div class="inline">
|
||||
|
||||
<el-form-item v-if="element.options.attrs.default.isDynamic && element.options.attrs.default.dkey === 3" label="">
|
||||
<el-input v-model="element.options.attrs.default.dynamicPrefix" type="number" size="mini" :min="1" :max="10" @input="dynamicPrefixChange" />
|
||||
<el-input v-model="element.options.attrs.default.dynamicPrefix" type="number" size="mini" :min="1" :max="12" @input="dynamicPrefixChange" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-if="element.options.attrs.default.isDynamic && element.options.attrs.default.dkey === 3" label="" class="no-label-item">
|
||||
@ -126,6 +126,11 @@ export default {
|
||||
min-width: 70px;
|
||||
}
|
||||
}
|
||||
.inline{
|
||||
.el-form-item {
|
||||
margin-bottom: 5px !important;
|
||||
}
|
||||
}
|
||||
.relative-time {
|
||||
width: 100%;
|
||||
}
|
||||
|
@ -78,6 +78,8 @@ export default {
|
||||
.box-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-height: 100%;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user