perf: use dateRange
gitea/salix-front/pipeline/pr-master This commit looks good
Details
gitea/salix-front/pipeline/pr-master This commit looks good
Details
This commit is contained in:
parent
229130409a
commit
b6161a41e8
|
@ -2,7 +2,7 @@
|
||||||
import { ref, computed, onBeforeMount } from 'vue';
|
import { ref, computed, onBeforeMount } from 'vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { toDate } from 'src/filters/index';
|
import { dateRange, toDate } from 'src/filters/index';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
|
@ -140,14 +140,9 @@ const updateDateParams = (value, params) => {
|
||||||
|
|
||||||
const { dated, previousDays, scopeDays } = campaign;
|
const { dated, previousDays, scopeDays } = campaign;
|
||||||
const _date = new Date(dated);
|
const _date = new Date(dated);
|
||||||
_date.setHours(0, 0, 0, 0);
|
const [from, to] = dateRange(_date);
|
||||||
params.from = new Date(
|
params.from = new Date(from.setDate(from.getDate() - previousDays)).toISOString();
|
||||||
new Date(dated).setDate(_date.getDate() - previousDays)
|
params.to = new Date(to.setDate(to.getDate() + scopeDays)).toISOString();
|
||||||
).toISOString();
|
|
||||||
_date.setHours(23, 59, 59, 59);
|
|
||||||
params.to = new Date(
|
|
||||||
new Date(dated).setDate(_date.getDate() + scopeDays)
|
|
||||||
).toISOString();
|
|
||||||
return params;
|
return params;
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue