The proliferation of new energy solutions and the enhanced accessibility of distributed power sources have significantly increased the complexity and variability of microgrid structures. Due to inherent limitations in its operational mode, the traditional centralized optimization method falls short in effectively addressing the economic dispatch problem in contemporary microgrids. In this paper, a distributed optimization method is devised to address the economic dispatch problem of microgrids under directed graphs by leveraging the consensus algorithm of multi-agent systems. We define the incremental cost of each microgrid unit as the consensus variable, achieving convergence through a pioneering combination of event-triggered strategy and predefined-time control theory. This approach not only optimizes resource use but also ensures timely and efficient solution convergence, addressing critical gaps in existing methodologies. This approach enables control over the upper bound of convergence time for optimal solutions by directly adjusting time parameters in the controller under the directed graph. Consequently, it achieves coordinated control of the power output in microgrids within a predefined time while reducing the communication resources between nodes with event-triggered mechanism. The effectiveness of the proposed algorithm is verified through simulation and analysis.