perf: 调整
This commit is contained in:
@ -33,7 +33,7 @@
|
||||
<div class="filter-row flex">
|
||||
<div class="filter-row-item flex items-center">
|
||||
<span class="label">时间筛选</span>
|
||||
<DatePicker.RangePicker v-model:value="query.data_time" allowClear format="YYYY-MM-DD" class="!w-240px" />
|
||||
<DatePicker.RangePicker v-model="data_time" allowClear format="YYYY-MM-DD" class="!w-240px" @change="onDateChange" />
|
||||
</div>
|
||||
<Button type="primary" ghost class="mr-12px" @click="handleSearch">
|
||||
<template #icon>
|
||||
@ -80,6 +80,8 @@ import PlanSelect from '@/views/components/common/PlanSelect.vue';
|
||||
const { TabPane } = Tabs;
|
||||
const { Option } = Select;
|
||||
const accountType = ref("1");
|
||||
const data_time = ref([]);
|
||||
const operators = ref([]);
|
||||
|
||||
const onLoading = ref(true);
|
||||
|
||||
@ -108,6 +110,19 @@ const handleTabClick = (value) => {
|
||||
accountType.value = value;
|
||||
handleSearch();
|
||||
};
|
||||
|
||||
const onDateChange = (date) => {
|
||||
if (!date) {
|
||||
query.data_time = [];
|
||||
handleSearch();
|
||||
return;
|
||||
}
|
||||
|
||||
const [start, end] = date;
|
||||
const FORMAT_DATE = 'YYYY-MM-DD';
|
||||
query.data_time = [dayjs(start).startOf('day').format(FORMAT_DATE), dayjs(end).endOf('day').format(FORMAT_DATE)];
|
||||
handleSearch();
|
||||
};
|
||||
const mergeChartData = (apiResponse) => {
|
||||
console.log(apiResponse, 'apiResponse');
|
||||
chartConfigs.value = chartConfigs.value.map((config) => {
|
||||
@ -221,14 +236,15 @@ const chartConfigs = ref([
|
||||
},
|
||||
]);
|
||||
const handleReset = async () => {
|
||||
data_time.value = [];
|
||||
query.platform = undefined;
|
||||
query.operator_id = undefined;
|
||||
query.data_time = [];
|
||||
query.ids = [];
|
||||
query.placement_account_id = [];
|
||||
handleSearch();
|
||||
};
|
||||
|
||||
const operators = ref([]);
|
||||
onMounted(() => {
|
||||
handleSearch();
|
||||
getOperators();
|
||||
|
||||
Reference in New Issue
Block a user