[关闭]
@yiranphp 2016-05-09T02:13:44.000000Z 字数 896 阅读 1273

仪表盘代码的学习

dashboard


梳理后的数据结构

  1. {
  2. id:
  3. title:
  4. pages: {
  5. activeIndex: 2,
  6. data: [{
  7. id:
  8. title:
  9. height:
  10. widgetsData:[{具体结构见下面}]
  11. }]
  12. }
  13. }
  14. widgetsData对应的结构
  15. {
  16. id: "dashboard367_page1461633458521_widget0",
  17. type: "KPIWidget",
  18. ui: {
  19. width:
  20. height:
  21. left:
  22. top:
  23. draggable: {}
  24. resizable: {}
  25. },
  26. toolbar: {
  27. type: "KPIToolbar",
  28. settings: {
  29. items: [
  30. {
  31. type: "StyleSetting",
  32. data: {
  33. bgVal: "opaque"
  34. }
  35. },
  36. {
  37. type: "TierSetting",
  38. data: {
  39. zIndex: 3
  40. }
  41. },
  42. {
  43. type: "KPISetting",
  44. data: {
  45. filterWidgetIDs: [
  46. "dashboard367_page-1_widget0",
  47. "dashboard367_page1461633458521_widget4",
  48. "dashboard367_page-1_widget1",
  49. "dashboard367_page1461633458521_widget3"
  50. ],
  51. cube: "connection/店铺数据/店铺数据/base_shop_base",
  52. measure: "Measures.pv",
  53. filterType: "now",
  54. filterValue: 2,
  55. filter: "date_year",
  56. dimension: "date_year_month",
  57. showChart: false
  58. }
  59. }
  60. ]
  61. }
  62. },
  63. data: {}
  64. }

dashboard初始化就渲染

page:getDataTemplate

  1. def("getDataTemplate", function (feed) {
  2. return $.extend(true, {
  3. //id: -1,
  4. //title: "",
  5. height: NewBIConstant.Page.DEFAULT_HEIGHT,
  6. widgetsData: []
  7. }, feed);
  8. });
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注