a broker system for Supercredit
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

137 lines
3.8KB

  1. var layout= {
  2. id: 'summary_layout',
  3. css: 'summary_layout',
  4. "rows": [
  5. {
  6. view: "toolbar", id:"topMenu", elements:[
  7. {
  8. view: "icon", icon: "mdi mdi-menu",
  9. click: function(){
  10. return ; //disable side menu
  11. if( $$("menu").config.hidden){
  12. $$("menu").show();
  13. }
  14. else
  15. $$("menu").hide();
  16. }
  17. },
  18. {
  19. view: "label",
  20. label: "Supercredit Transactions"
  21. }
  22. ]
  23. },
  24. { id:"workspace", rows:[
  25. { template:"loading ...." }
  26. ]},
  27. { "view": "template", id:"footer", css: "footer", "template": "", "role": "placeholder", "height": 20 }
  28. ]
  29. }
  30. //main area
  31. webix.ui(layout)
  32. //side menu
  33. webix.ready(function(){
  34. webix.ui({
  35. view: "sidemenu",
  36. id: "menu",
  37. width: 200,
  38. position: "left",
  39. state:function(state){
  40. var toolbarHeight = $$("header").$height;
  41. state.top = toolbarHeight;
  42. state.height -= toolbarHeight;
  43. },
  44. css: "my_menu",
  45. body:{
  46. view:"list",
  47. borderless:true,
  48. scroll: false,
  49. template: "<span class='webix_icon mdi mdi-#icon#'></span> #value#",
  50. data:[
  51. {id: 1, value: "All", icon: "briefcase-account"},
  52. {id: 2, value: "upfront", icon: "account-arrow-left"},
  53. {id: 3, value: "Trail", icon: "account"},
  54. {id: 4, value: "Procesing", icon: "cube"},
  55. {id: 5, value: "App in Progress", icon: "chart-bar"},
  56. {id: 6, value: "Approved", icon: "database"},
  57. {id: 7, value: "Settled", icon: "cash-usd"},
  58. {id: 8, value: "Finished", icon: "cogs"}
  59. ],
  60. select:true,
  61. type:{
  62. height: 40
  63. }
  64. }
  65. });
  66. initTopMenu($$('summary_layout'), $$('topMenu'));
  67. });
  68. //summary data
  69. var summary_graph = {
  70. "cols": [
  71. {
  72. "width": 200,
  73. "css" : "Label",
  74. "rows": [
  75. { "padding": { "left": 10 },
  76. "cols": [
  77. { "view": "label", "label": "Brokers" },
  78. { "view": "icon", "icon": "wxi-search" }
  79. ]
  80. },
  81. { "view": "list", "url": "data/staff.json", "select": "true" }
  82. ]
  83. },
  84. {
  85. "rows": [
  86. {
  87. "view":"timeline",
  88. "layout": "x",
  89. "height": 200,
  90. "data": demo_summary_loan_counts,
  91. "scroll": false
  92. },
  93. {
  94. "cols": [
  95. { "view": "chart", "width": 400, "pieInnerText": "#value#", "label": "#month#", "url": "data/demo_chart.json" },
  96. { "view": "chart", "type": "spline", "xAxis": { "template": "#value#", "lines": false },
  97. "yAxis": {},
  98. "url": "data/demo_chart.json"
  99. },
  100. { "view": "chart", "type": "barH", "yAxis": { "template": "#value#" },
  101. "xAxis": {},
  102. "color": "#color#",
  103. "url": "data/demo_chart.json"
  104. }
  105. ]
  106. },
  107. {
  108. "view": "datatable",
  109. "columns": [
  110. { "id": "title", "header": "Loan description", "fillspace": true, "sort": "string" },
  111. { "id": "year", "header": "Date", "sort": "string" },
  112. { "id": "votes", "header": "Loan Amount", "sort": "string" },
  113. { "id": "rating", "header": "Upfront", "sort": "string" },
  114. { "id": "rank", "header": "Tail paid", "sort": "string" },
  115. { "id": "category", "header": "Lender", "sort": "string", "width": 200 }
  116. ],
  117. "url": "data/demo_table.json"
  118. }
  119. ]
  120. }
  121. ]
  122. }
  123. function show_summary() {
  124. webix.ui(summary_graph, $$('summary_layout').getChildViews()[1]);
  125. }
  126. webix.ready(function(){
  127. show_summary();
  128. });