Built files from Bizgaze WebServer
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

owlcarouselslider.js 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. var Unibase;
  2. (function (Unibase) {
  3. let Themes;
  4. (function (Themes) {
  5. let Compact;
  6. (function (Compact) {
  7. let KpiWidgets;
  8. (function (KpiWidgets) {
  9. class Owlcarouselslider extends Unibase.Platform.Core.BaseComponent {
  10. html(id, containerid) {
  11. let title = id[0].WidgetName;
  12. var html = '<div class="card mb-0 card-sm bgcolorset_' + id[0].PortletWidgetId + ' kpi_card_class_' + id[0].PortletWidgetId + '"><div class="card-body border-0 p-0"><div id="sales_slider_' + id[0].PortletWidgetId + '" class="carousel slide"><div class="d-flex font-weight-500 text-dark px-3 py-2" ><div class="w-95 "> <span class="w-100 font-16 mt-5" id="hf_kpi_widgetName_' + id[0].PortletWidgetId + '">' + title + '</span></div> <span class="w-15 text-right"><a href="#" class="pull-right reportappend"></a></span></div><div class="bottom-carousel px-0"><div class="d-flex flex-row"><div class="owl-carousel carousel-inner w-100 d-flex"> <div class="item w-25 teal-light-4 carouselItem_0 active"><div class="bg-teal-light-4"> <span class="d-flex flex-column font-weight-500 pb-2 text-dark"> <span class="textProperty_100020390001757" style="font-size: 32px;">236</span> <span class="font-13 font-weight-normal text-dark">Lead</span> </span></div></div><div class="item w-25 neon-light-2 carouselItem_1"><div class="bg-neon-light-2"> <span class="d-flex flex-column font-weight-500 pb-2 text-dark"> <span class="textProperty_100020390001757" style="font-size: 32px;">16</span> <span class="font-13 font-weight-normal text-dark">Qualify</span> </span></div></div><div class="item w-25 yellow-light-2 carouselItem_2"><div class="bg-yellow-light-2"> <span class="d-flex flex-column font-weight-500 pb-2 text-dark"> <span class="textProperty_100020390001757" style="font-size: 32px;">331</span> <span class="font-13 font-weight-normal text-dark">Total Customers</span> </span></div></div><div class="item w-25 pink-light-4 carouselItem_3"><div class="bg-pink-light-4"> <span class="d-flex flex-column font-weight-500 pb-2 text-dark"> <span class="textProperty_100020390001757" style="font-size: 32px;">75</span> <span class="font-13 font-weight-normal text-dark">Confirmed</span> </span></div></div><div class="item w-25 d-none carouselItem_4"><div class="bg-d-none"> <span class="d-flex flex-column font-weight-500 pb-2 text-dark"> <span class="textProperty_100020390001757" style="font-size: 32px;">3</span> <span class="font-13 font-weight-normal text-dark">Rejected</span> </span></div></div> </div></div></div></div></div></div></div>';
  13. return html;
  14. }
  15. jsFiles() {
  16. return ["platform/widgets/managers/interfaces/iwidgetmanager.js", "platform/widgets/managers/widgetmanager.js", "platform/core/helpers/propertyhelper/propertyhelper.js", "platform/core/helpers/token/tokenhelper.js", "platform/core/helpers/numberhelper/numberhelper.js", "platform/analytics/components/reportviewer/reportviewer.js", "https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"];
  17. }
  18. cssFiles() {
  19. return [];
  20. }
  21. load(id, containerid, callback) {
  22. let instance = this;
  23. let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
  24. let fromDate = "", toDate = "";
  25. var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
  26. var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
  27. if (cf_fromDate != null && cf_toDate != null) {
  28. fromDate = cf_fromDate.toString();
  29. toDate = cf_toDate.toString();
  30. }
  31. else {
  32. fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
  33. toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
  34. }
  35. var parameters = {
  36. WidgetId: id[0].WidgetId,
  37. PortletWidgetId: id[0].PortletWidgetId,
  38. InstalledAppId: id[0].InstalledAppId,
  39. InputParameters: inputparameters,
  40. FromDate: fromDate,
  41. ToDate: toDate
  42. };
  43. instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
  44. }
  45. loadResponseData(portletwidgetid, detailContainer, parameters) {
  46. let instance = this;
  47. Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKpiWidgetData(parameters).then(function (response) {
  48. instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
  49. });
  50. }
  51. loadData(portletwidgetid, containerid, parameters, IsPreview, response) {
  52. containerid = "." + containerid;
  53. var instance = this;
  54. var cssproperty = JSON.parse(response.result.CssProperty);
  55. if (response.result != null) {
  56. var post = response.result;
  57. var data = JSON.parse(post.Data);
  58. var obj = new Object();
  59. var parentobj = [];
  60. for (var i = 0; i < data.length; i++) {
  61. var data_1 = data[i];
  62. var j = 1;
  63. for (var key in data_1) {
  64. obj['Value_' + j] = data_1[key];
  65. j++;
  66. }
  67. parentobj.push({
  68. value_1: obj["Value_1"],
  69. value_2: obj["Value_2"],
  70. value_3: obj["Value_3"]
  71. });
  72. var margin = "margin-top:-5px";
  73. if (parentobj[i].value_3 == undefined || parentobj[i].value_3 == null) {
  74. parentobj[i].value_3 = "";
  75. margin = "margin-top:5px";
  76. }
  77. }
  78. var html = "", html2 = "", bg_color = '';
  79. for (var i = 0; i < parentobj.length; i++) {
  80. if (i == 0) {
  81. bg_color = 'teal-light-4';
  82. }
  83. if (i == 1) {
  84. bg_color = 'neon-light-2';
  85. }
  86. if (i == 2) {
  87. bg_color = 'yellow-light-2';
  88. }
  89. if (i == 3) {
  90. bg_color = 'pink-light-4';
  91. }
  92. if (i == 4) {
  93. bg_color = 'd-none';
  94. }
  95. html += '<div class="item w-25 ' + bg_color + ' carouselItem_' + i + '"><div class="bg-' + bg_color + '"> <span class="d-flex flex-column font-weight-500 pb-2 text-dark"> <span class="textProperty_' + portletwidgetid + '">' + parentobj[i].value_2 + '</span> <span class="font-13 font-weight-normal text-dark">' + parentobj[i].value_1 + '</span> </span></div></div>';
  96. html2 = '<small id="showreport_' + portletwidgetid + '" class="showreport_' + portletwidgetid + ' font-sm-11"><span class="nav-icon-wrap"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small>';
  97. }
  98. $(".owl-carousel").owlCarousel({
  99. items: 3,
  100. nav: true,
  101. loop: true,
  102. autoplay: false
  103. });
  104. $(containerid).find(".carousel-inner").html(html);
  105. $(containerid).find('.textProperty_' + portletwidgetid).css({ "font-size": cssproperty[0].FontSize + 'px' });
  106. $(containerid).find(".reportappend").html(html2);
  107. $(containerid).find(".carouselItem_0").addClass('active');
  108. $(containerid).find('#sales_slider_' + portletwidgetid).carousel({
  109. interval: 3000
  110. });
  111. $(containerid).find('#sales_slider_' + portletwidgetid).carousel("cycle");
  112. var colors = ["primary", "success", "warning", "danger", "info", "light", "secondary", "dark"];
  113. }
  114. $(containerid).siblings('.line-loader').remove();
  115. $(containerid).removeClass('hidden');
  116. }
  117. static Instance() {
  118. if (this.instance === null || this.instance === undefined)
  119. this.instance = new Owlcarouselslider();
  120. return this.instance;
  121. }
  122. }
  123. KpiWidgets.Owlcarouselslider = Owlcarouselslider;
  124. })(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
  125. })(Compact = Themes.Compact || (Themes.Compact = {}));
  126. })(Themes = Unibase.Themes || (Unibase.Themes = {}));
  127. })(Unibase || (Unibase = {}));