|  | @@ -11,6 +11,7 @@ const props = defineProps({
 | 
	
		
			
				|  |  |    taskIds: Object,
 | 
	
		
			
				|  |  |  });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +const taskIds = ref(null);
 | 
	
		
			
				|  |  |  const tableColumns = ref([]);
 | 
	
		
			
				|  |  |  const tableData = ref([]);
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -52,7 +53,7 @@ const gridOptions = reactive({
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    customConfig: {
 | 
	
		
			
				|  |  |      storage: {
 | 
	
		
			
				|  |  | -      visible:true,
 | 
	
		
			
				|  |  | +      visible: true,
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    toolbarConfig: {
 | 
	
	
		
			
				|  | @@ -205,6 +206,7 @@ async function fetchMainData(taskIds, resetPage = false) {
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +//排序
 | 
	
		
			
				|  |  |  function handleSortChange({ column, order }) {
 | 
	
		
			
				|  |  |    sortOrder.value = order === 'asc' ? 'smallfirst' : 'bigfirst';
 | 
	
		
			
				|  |  |    const sortField = column.field;
 | 
	
	
		
			
				|  | @@ -226,8 +228,38 @@ function handleSortChange({ column, order }) {
 | 
	
		
			
				|  |  |    fetchMainData(props.taskIds, true);
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +// 导出数据接口
 | 
	
		
			
				|  |  | +async function handleExport() {
 | 
	
		
			
				|  |  | +  try {
 | 
	
		
			
				|  |  | +    gridOptions.loading = true;
 | 
	
		
			
				|  |  | +    const params = {
 | 
	
		
			
				|  |  | +      page: gridOptions.pagerConfig.currentPage,
 | 
	
		
			
				|  |  | +      limit: gridOptions.pagerConfig.pageSize,
 | 
	
		
			
				|  |  | +      task_ids: props.taskIds,
 | 
	
		
			
				|  |  | +      day_start_date: dayStartDate.value,
 | 
	
		
			
				|  |  | +      day_end_date: dayEndDate.value,
 | 
	
		
			
				|  |  | +      week_start_date: weekStart.value,
 | 
	
		
			
				|  |  | +      week_end_date: weekEnd.value,
 | 
	
		
			
				|  |  | +      month_start_date: monthStartDate.value,
 | 
	
		
			
				|  |  | +      month_end_date: monthEndDate.value,
 | 
	
		
			
				|  |  | +    };
 | 
	
		
			
				|  |  | +    const response = await exportData(params);
 | 
	
		
			
				|  |  | +    const url = window.URL.createObjectURL(new Blob([response.data]));
 | 
	
		
			
				|  |  | +    const link = document.createElement('a');
 | 
	
		
			
				|  |  | +    link.href = url;
 | 
	
		
			
				|  |  | +    link.setAttribute('download', '合并数据展示.xlsx');
 | 
	
		
			
				|  |  | +    document.body.appendChild(link);
 | 
	
		
			
				|  |  | +    link.click();
 | 
	
		
			
				|  |  | +    gridOptions.loading = false;
 | 
	
		
			
				|  |  | +    ElMessage.success('导出数据成功');
 | 
	
		
			
				|  |  | +  } catch (error) {
 | 
	
		
			
				|  |  | +    console.error('导出数据失败:', error);
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  // 监测 taskIds 变化
 | 
	
		
			
				|  |  |  watch(() => props.taskIds, (newTaskIds) => {
 | 
	
		
			
				|  |  | +  taskIds.value = newTaskIds;
 | 
	
		
			
				|  |  |    fetchMainData(newTaskIds, true);
 | 
	
		
			
				|  |  |  });
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -243,18 +275,14 @@ watch(() => props.dayDate, (newDayDate) => {
 | 
	
		
			
				|  |  |      dayStartDate.value = dailyStartDate;
 | 
	
		
			
				|  |  |      dayEndDate.value = dailyTime;
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | -  //clearSorting();
 | 
	
		
			
				|  |  |  });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  watch(() => props.weekDate, (newWeekDate) => {
 | 
	
		
			
				|  |  |    if (newWeekDate) {
 | 
	
		
			
				|  |  |      const { weekStartDate, weekEndDate } = newWeekDate;
 | 
	
		
			
				|  |  |      weekStart.value = weekStartDate;
 | 
	
		
			
				|  |  |      weekEnd.value = weekEndDate;
 | 
	
		
			
				|  |  | -    fetchMainData(props.taskIds);
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | -  //clearSorting();
 | 
	
		
			
				|  |  |  });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  watch(() => props.monthDate, (newMonthDate) => {
 | 
	
	
		
			
				|  | @@ -263,9 +291,12 @@ watch(() => props.monthDate, (newMonthDate) => {
 | 
	
		
			
				|  |  |      monthStartDate.value = startDate;
 | 
	
		
			
				|  |  |      monthEndDate.value = endDate;
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | -  //clearSorting();
 | 
	
		
			
				|  |  | +  if (taskIds.value) {
 | 
	
		
			
				|  |  | +    fetchMainData(props.taskIds, true);
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  |  });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +//以下是表格样式
 | 
	
		
			
				|  |  |  const cellStyle = ({ columnIndex }) => {
 | 
	
		
			
				|  |  |    if (columnIndex < 6) {
 | 
	
		
			
				|  |  |      return {
 | 
	
	
		
			
				|  | @@ -296,34 +327,6 @@ const cellStyleHandler = ({ column }) => {
 | 
	
		
			
				|  |  |    return { fontSize: '12px' };
 | 
	
		
			
				|  |  |  };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -async function handleExport() {
 | 
	
		
			
				|  |  | -  try {
 | 
	
		
			
				|  |  | -    gridOptions.loading = true;
 | 
	
		
			
				|  |  | -    const params = {
 | 
	
		
			
				|  |  | -      page: gridOptions.pagerConfig.currentPage,
 | 
	
		
			
				|  |  | -      limit: gridOptions.pagerConfig.pageSize,
 | 
	
		
			
				|  |  | -      task_ids: props.taskIds,
 | 
	
		
			
				|  |  | -      day_start_date: dayStartDate.value,
 | 
	
		
			
				|  |  | -      day_end_date: dayEndDate.value,
 | 
	
		
			
				|  |  | -      week_start_date: weekStart.value,
 | 
	
		
			
				|  |  | -      week_end_date: weekEnd.value,
 | 
	
		
			
				|  |  | -      month_start_date: monthStartDate.value,
 | 
	
		
			
				|  |  | -      month_end_date: monthEndDate.value,
 | 
	
		
			
				|  |  | -    };
 | 
	
		
			
				|  |  | -    const response = await exportData(params);
 | 
	
		
			
				|  |  | -    const url = window.URL.createObjectURL(new Blob([response.data]));
 | 
	
		
			
				|  |  | -    const link = document.createElement('a');
 | 
	
		
			
				|  |  | -    link.href = url;
 | 
	
		
			
				|  |  | -    link.setAttribute('download', '合并数据展示.xlsx');
 | 
	
		
			
				|  |  | -    document.body.appendChild(link);
 | 
	
		
			
				|  |  | -    link.click();
 | 
	
		
			
				|  |  | -    gridOptions.loading = false;
 | 
	
		
			
				|  |  | -    ElMessage.success('导出数据成功');
 | 
	
		
			
				|  |  | -  } catch (error) {
 | 
	
		
			
				|  |  | -    console.error('导出数据失败:', error);
 | 
	
		
			
				|  |  | -  }
 | 
	
		
			
				|  |  | -}
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  function formatEmptyCell({ cellValue }) {
 | 
	
		
			
				|  |  |    if (cellValue === null || cellValue === undefined || cellValue === '') {
 | 
	
		
			
				|  |  |      return '--';
 | 
	
	
		
			
				|  | @@ -357,7 +360,7 @@ onMounted(() => {
 | 
	
		
			
				|  |  |        <div class="font-semibold" style="color: #0097f8">{{ row.platformName }}</div>
 | 
	
		
			
				|  |  |      </template>
 | 
	
		
			
				|  |  |      <template #brandName_default="{ row }">
 | 
	
		
			
				|  |  | -      <el-tag effect="plain" type="success" round>{{ row.brandName }}</el-tag>
 | 
	
		
			
				|  |  | +      <el-tag effect="plain" round type="success">{{ row.brandName }}</el-tag>
 | 
	
		
			
				|  |  |      </template>
 | 
	
		
			
				|  |  |    </vxe-grid>
 | 
	
		
			
				|  |  |  </template>
 |