diff --git a/src/components/DataActions/index.vue b/src/components/DataActions/index.vue
index 6812d574c..26bf9f6fc 100644
--- a/src/components/DataActions/index.vue
+++ b/src/components/DataActions/index.vue
@@ -360,6 +360,8 @@ $color-drop-menu-border: #e4e7ed;
}
.el-dropdown-menu__item {
+ padding: 0 20px;
+
&.is-disabled {
color: var(--color-disabled);
cursor: not-allowed;
diff --git a/src/components/Form/FormFields/DateRangePicker.vue b/src/components/Form/FormFields/DateRangePicker.vue
new file mode 100644
index 000000000..1e2d85286
--- /dev/null
+++ b/src/components/Form/FormFields/DateRangePicker.vue
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
diff --git a/src/components/Form/FormFields/DatetimeRangePicker.vue b/src/components/Form/FormFields/DatetimeRangePicker.vue
index 1e2d85286..f89d501ba 100644
--- a/src/components/Form/FormFields/DatetimeRangePicker.vue
+++ b/src/components/Form/FormFields/DatetimeRangePicker.vue
@@ -7,9 +7,9 @@
:picker-options="pickerOptions"
:range-separator="$tc('To')"
:start-placeholder="$tc('DateStart')"
+ :type="type"
class="datepicker"
size="small"
- type="datetimerange"
v-bind="$attrs"
@change="handleDateChange"
v-on="$listeners"
@@ -28,6 +28,15 @@ export default {
dateEnd: {
type: [Number, String, Date],
default: null
+ },
+ type: {
+ type: String,
+ default: 'daterange'
+ // default: 'datetimerange'
+ },
+ toMinMax: {
+ type: Boolean,
+ default: true
}
},
data() {
@@ -35,6 +44,10 @@ export default {
const endValue = this.dateEnd || this.$route.query['date_end']
const dateStart = new Date(startValue)
const dateTo = new Date(endValue)
+ if (this.toMinMax) {
+ dateStart.setHours(0, 0, 0, 0)
+ dateTo.setHours(23, 59, 59, 999)
+ }
return {
value: [dateStart, dateTo],
pickerOptions: {
@@ -74,9 +87,13 @@ export default {
}
},
onShortcutClick(picker, day) {
- const end = new Date()
- const start = new Date()
+ let start = new Date()
+ let end = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * day)
+ if (this.toMinMax) {
+ start = new Date(start.setHours(0, 0, 0, 0))
+ end = new Date(end.setHours(23, 59, 59, 999))
+ }
picker.$emit('pick', [start, end])
}
}
@@ -85,8 +102,11 @@ export default {