This paper investigates the co-optimization problem of task allocation and path planning in multi-UAV collaborative systems. Addressing the challenges of strong coupling, high dimensionality, and real-time requirements in dynamic complex environments, a distributed co-optimization framework integrating hierarchical planning concepts with spatiotemporal constraints is proposed. By constructing a multi-objective mixed-integer programming model, designing a lightweight event-triggered task allocation algorithm (improved CBBA), and integrating a hierarchical path planning strategy (global meta-heuristic search + local model predictive control), the framework enhances task execution efficiency and system robustness while reducing communication overhead. Simulation and experimental results demonstrate its superior performance in typical scenarios such as disaster relief and precision agriculture. This research provides an efficient, reliable, and scalable solution for practical applications involving large-scale heterogeneous UAV swarms, holding significant theoretical implications and engineering value.