The global epidemic has triggered severe health crises and economic downturns, while energy sector plays an important role in the complicated sector interdependence. In such context, to gain a deeper understanding of the energy sector's role during epidemic outbreaks, this study develops a new methodological framework. The framework first combines SEIDR epidemic model with dynamic input-output model and resource allocation DEA model, linking epidemiological and socioeconomic aspects. Empirically, this study focuses on China's economy by constructing an energy-manufacturing-service system. Our main conclusions are summarized as follows. First, the epidemic generates substantial effects on energy sector, while the size of effects is sensitive to the settings of some key parameters. Second, the energy sector suffers the most significant decline in total output and capital due to the epidemic, particularly in Shandong and Gansu. Conversely, Beijing and Chongqing have shown the least changes, indicating a more resilient performance in comparison to other provinces or province-equivalents. Finally, a well-designed resource allocation strategy can reduce inefficiency, and then reduce the economic losses possibly caused by the epidemic. The output of energy sector has reduced by 29.5%, indicating a need for targeted interventions and strategies to boost its performance.