25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 

34 satır
908 B

  1. const Base = require('../base');
  2. module.exports = class extends Base {
  3. async indexAction() {
  4. this.assign('currentPage', 'dashboard');
  5. this.assign('pageTitle', '控制台');
  6. this.assign('adminUser', this.adminUser || {});
  7. this.assign('canView', this.isSuperAdmin || (this.userPermissions || []).includes('patient:view'));
  8. return this.display();
  9. }
  10. // 控制台统计数据接口
  11. async statsAction() {
  12. const model = this.model('patient');
  13. const [counts, todayCounts, trend, recent] = await Promise.all([
  14. model.getStatusCounts(),
  15. model.getTodayCounts(),
  16. model.getDailyTrend(30),
  17. model.getRecentList(10)
  18. ]);
  19. return this.success({
  20. counts,
  21. todayCounts,
  22. trend: trend.map(r => ({
  23. date: r.date,
  24. total: parseInt(r.total, 10) || 0,
  25. rectal: parseInt(r.rectal, 10) || 0
  26. })),
  27. recent
  28. });
  29. }
  30. };