index.coffee 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # app/pages/Admin/Dashboard/index.coffee
  2. if globalThis.stylFns and globalThis.stylFns['app/pages/Admin/Dashboard/index.styl']
  3. styleElement = document.createElement('style')
  4. styleElement.type = 'text/css'
  5. styleElement.textContent = globalThis.stylFns['app/pages/Admin/Dashboard/index.styl']
  6. document.head.appendChild(styleElement)
  7. module.exports = {
  8. props:
  9. domainSettings:
  10. type: Object
  11. default: -> {}
  12. language:
  13. type: String
  14. default: 'ru'
  15. data: ->
  16. {
  17. stats: {
  18. products: 0,
  19. categories: 0,
  20. orders: 0,
  21. users: 0
  22. }
  23. recentActivity: []
  24. loading: true
  25. }
  26. methods:
  27. loadDashboardData: ->
  28. @loading = true
  29. # Заглушка для загрузки данных
  30. setTimeout (=>
  31. @stats = {
  32. products: 156,
  33. categories: 12,
  34. orders: 24,
  35. users: 89
  36. }
  37. @recentActivity = [
  38. { type: 'product', action: 'created', name: 'Грунтовка глубокого проникновения', time: '5 мин назад' },
  39. { type: 'order', action: 'placed', name: 'Заказ #00125', time: '10 мин назад' },
  40. { type: 'user', action: 'registered', name: 'Новый пользователь', time: '15 мин назад' }
  41. ]
  42. @loading = false
  43. ), 1000
  44. mounted: ->
  45. @loadDashboardData()
  46. log '📊 Дашборд админ-панели загружен'
  47. render: (new Function '_ctx', '_cache', globalThis.renderFns['app/pages/Admin/Dashboard/index.pug'])()
  48. }