Built files from Bizgaze WebServer
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

createdashboard.min.js 9.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. var Unibase;(function(n){let t;(function(t){let i;(function(i){let r;(function(r){class u extends t.Core.BaseComponent{constructor(){super();this.dashboardManager=i.Managers.DashboardManager.Instance()}cssFiles(){return[]}jsFiles(){return["platform/dashboards/managers/dashboardmanager.js","platform/dashboards/requests/dashboards.js","platform/dashboards/components/dashboardpermissions.js","platform/portlets/managers/portletmanager.js"]}html(){return`<form id="frm_Bizgaze_EditDashboard" method="post" data-validate="parsley" class="w-f bg-white"><div class="header b-b bg-white"><strong id="form_header_name">Create Dashboard</strong><a class="btn btn-xs btn-icon ml-auto"><i class="ti-help-alt"></i></a></div><div class="scrollable"><div id="Unibase_EditDashboardErrorMessages" class="clear"></div><div id="EditDashboard" class="card"><div class="card-header">Details</div><div class="card-body">
  2. <div class="row"><div class="col-lg-12"><div class="floating-label-form-group floating-label-form-group-with-value focus" id="div_DashboardName"><label for="txt_NewDashboardName" id="lbl_Dashboardname">Dashboard Name<span class="text-danger"> *</span></label><div class=""><input type="text" id="Txt_EditDashboardName" class="form-control value-control floating-label-control" data-isdynamic="false" placeholder="Dashboard Name *" data-placeholder="Enter Dashboard Name" data-label="Dashboard Name *" /></div><input type="hidden" id="EditDashboardId" value="0" /></div></div></div><div class="row my-4"><div class="col-lg-6"><div class="floating-label-form-group floating-label-form-group-with-value focus" id="div_DashboardGroup"><label for="ddl_Title" id="lbl_Title">Dashboard Group</label>
  3. <select id="ddl_DashboardGroups" class="form-control" style="font-size:14px"></select>
  4. <label for="Validation" id="lblValidation_DashboardGroup"></label>
  5. </div>
  6. </div>
  7. <div class="col-lg-6">
  8. <div class="floating-label-form-group floating-label-form-group-with-value focus" id="div_Dashboardindex">
  9. <label for="lbl_EditDashboardIndex" id="lbl_Dashboardindex">Index Number</label>
  10. <div class="input-group">
  11. <input type="number" id="Txt_EditDashboardIndex" min="0" onkeypress="return event.charCode != 45 && event.charCode!=101" class="form-control value-control floating-label-control" data-isdynamic="false" placeholder="Dashboard Index" data-placeholder="Enter Dashboard Index" data-label="Dashboard Index" />
  12. </div>
  13. </div>
  14. </div>
  15. </div>
  16. <div class="row"><div class="col-lg-6 d-flex justify-content-between align-items-center"><span>Pin Common Filters</span><label class="switch mb-0" for="pinCmnFiltersChk"><input type="checkbox" class="pin-cmn-filters-chk" id="pinCmnFiltersChk"><span></span></label></div>
  17. <div class="col-sm-6 m-b hidden">
  18. <label>Select Lobs</label>
  19. <input type="hidden" id="hfLobs" />
  20. <select multiple="multiple" id="txtLobs" style="width:100%" class="txtLobs"></select></div></div>
  21. </div>
  22. </div>
  23. <div class="card">
  24. <div class="card-header">
  25. <span>Permissions</span>
  26. </div>
  27. <div class="card-body">
  28. <div id="divBizgaze_DashboardPermissions_MessagesPlaceholder" class="clear m-b-sm">
  29. </div>
  30. <div class="row">
  31. <div class="col-sm-12">
  32. <strong>Is Trackable ?</strong>
  33. <a href="javascript:;">
  34. <label class="switch pull-right">
  35. <input id="Ch_IsTrackable" type="checkbox" data-group="Viewable">
  36. <span class="slider round"></span>
  37. </label>
  38. </a>
  39. </div>
  40. </div>
  41. <div class="row">
  42. <div class="col-sm-12">
  43. <strong>Everyone can view?</strong>
  44. <a href="javascript:;">
  45. <label class="switch pull-right">
  46. <input id="chkIsDashboardViewable" type="checkbox" data-group="Viewable" checked>
  47. <span class="slider round"></span>
  48. </label>
  49. </a>
  50. </div>
  51. </div>
  52. <div class="row hidden mb-4" id="div_DashboardViewRoles">
  53. <div class="col-sm-12 m-b">
  54. <label>Roles that <strong>can</strong> view</label>
  55. <input type="hidden" id="hfDashboardViewRoles" />
  56. <select type="text" id="txtDashboardViewRoles" style="width:100%" value="" multiple="multiple"></select>
  57. </div>
  58. </div>
  59. <div class="row" id="div_DashboardExcludeViewRoles">
  60. <div class="col-sm-12 m-b">
  61. <label>Roles that <strong>can't</strong> view</label>
  62. <input type="hidden" id="hfDashboardExcludeViewRoles" />
  63. <select type="text" id="txtDashboardExcludeViewRoles" style="width:100%" value="" multiple="multiple"></select>
  64. </div>
  65. </div>
  66. <div class="row" id="divWPStages">
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. <div class="footer bg-white b-t">
  72. <a href="javascript:;" id="btn_CloseDashboard" class="pull-left btn btn-light btn-sm mr-auto">Close</a>
  73. <a href="javascript:;" id="btn_SaveDashboard" class="pull-right btn btn-sm btn-primary">Save</a>
  74. </div>
  75. </form>`}load(){var r=this;r.loadDashboardGroups();$("#chkIsDashboardViewable").change(function(){var n=$("#chkIsDashboardViewable").prop("checked");n?($("#div_DashboardViewRoles").addClass("hidden"),$("#div_DashboardExcludeViewRoles").removeClass("hidden")):($("#div_DashboardExcludeViewRoles").removeClass("hidden"),$("#div_DashboardViewRoles").removeClass("hidden"))});let i=[],t=[];$("#txtDashboardViewRoles").on("select2:select",function(n){var u=n.params.data,r;Number(u.id)!=0&&(r=u.id,i.push(r),$(t).each(function(n,i){if(i==r){var u=t.indexOf(i);return u>-1&&t.splice(u,1),t.splice(i,1),jQuery("#txtDashboardExcludeViewRoles").val(t).trigger("change"),!1}}))});$("#txtDashboardViewRoles").on("select2:unselect",function(n){var t=n.params.data,r;Number(t.id)!=0&&(r=Number(t.id),i.pop(r))});$("#txtDashboardExcludeViewRoles").on("select2:select",function(n){var u=n.params.data,r;Number(u.id)!=0&&(r=u.id,t.push(r),$(i).each(function(n,t){if(t==r){var u=i.indexOf(t);return u>-1&&i.splice(u,1),jQuery("#txtDashboardViewRoles").val(i).trigger("change"),!1}}))});$("#txtDashboardExcludeViewRoles").on("select2:unselect",function(n){var i=n.params.data,r;Number(i.id)!=0&&(r=i.id,t.pop(r))});$("#btn_SaveDashboard").click(function(){if($("#Txt_EditDashboardName").val()=="")return MessageHelper.Instance().showError("Dashboard Name is required","Unibase_EditDashboardErrorMessages"),!1;let u=new n.Platform.Dashboards.Requests.Dashboard;u.DashboardName=String($("#Txt_EditDashboardName").val());u.DashboardIndex=Number($("#Txt_EditDashboardIndex").val());u.DashboardGroupId=Number($("#ddl_DashboardGroups").val());u.ViewRoles=i;u.ExcludeRoles=t;u.IsTrackable=$("#Ch_IsTrackable").is(":checked");u.ViewAllStages=!0;u.PinCommonFilters=$("#pinCmnFiltersChk").is(":checked");r.dashboardManager.saveDashboard(u).then(function(t){t.errors==null?(r.navigationHelper.closePopUp(),MessageHelper.Instance().showSuccess("Dashboard Saved Successfully",""),n.Platform.Dashboards.Components.ManageDashboard.Instance().loadDashboardGroups()):MessageHelper.Instance().showError(t.errors[0],"Unibase_EditDashboardErrorMessages")})});$("#btn_CloseDashboard").click(function(){r.navigationHelper.closePopUp()});n.Platform.Dashboards.Components.DashboardPermissions.Instance().select2dashboardbinding(0,!1,[],[],[],[],"txtDashboardViewRoles","txtDashboardExcludeViewRoles")}loadDashboardGroups(){var n=this;n.dashboardManager.getDashboardGroups().then(function(n){var i="",t,u;let r="";for(t=0;t<n.result.length;t++)r+='<option value="'+n.result[t].DashboardGroupId+'">'+n.result[t].DashboardGroupName+"<\/option>",i+='<input type="hidden" class="portletscount_'+n.result[t].DashboardGroupId+'" value = "'+n.result[t].PortletCount+'">';u='<option value="0">No Group<\/option>';$("#ddl_DashboardGroups").html(u+r).append(i);$("#ddl_DashboardGroups").change(function(){var n=0,t=Number($("#ddl_DashboardGroups").val());n=Number($(".portletscount_"+t+"").val());$("#Txt_EditDashboardIndex").val(n);t!=0&&$("#Txt_EditDashboardIndex").attr("disabled","true")})})}static Instance(){return new u}}r.CreateDashboard=u})(r=i.Components||(i.Components={}))})(i=t.Dashboards||(t.Dashboards={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));