Built files from Bizgaze WebServer
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

executedactions.widget.min.js 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Unibase;(function(n){let t;(function(t){let i;(function(i){let r;(function(i){class r extends t.Core.BaseComponent{constructor(){super(...arguments);this.page_index=0;this.page_size=10;this.count=0}cssFiles(){return[]}jsFiles(){return["platform/automation/managers/rulemanager.js","platform/automation/requests/executedaction.js","apps/communications/managers/sms/smsmanager.js","libs/jquery/pagination/jquery.pagination.js"]}html(){return`<form id="frmUnibase_ActionsData" data-validate="parsley" data-isdynamic="false">
  2. <div class="card bg-light">
  3. <div class="b-b bg-white card-header header">
  4. <span class="pull-right">
  5. <a class="btn_actionsdata_close pull-right" href="javascript:;">
  6. <i class="fa fa-close"></i>
  7. </a>
  8. </span>
  9. </div>
  10. <div class="card-body scrollable" style="overflow-y: scroll;">
  11. <div class="row">
  12. <table class="table">
  13. <thead>
  14. <tr id="Reminders_Row" class="bg-primary">
  15. <th>S.No</th>
  16. <th>Recipient</th>
  17. <th>Subject</th>
  18. </tr>
  19. </thead>
  20. <tbody class="ActionsDatalist_body"></tbody>
  21. </table>
  22. </div>
  23. </div>
  24. </div>
  25. </form>`}load(n,t){$(".btn_actionsdata_close").click(function(){$("#"+t).modal("hide");$("#"+t).remove()})}LoadFunctions(){$("#date_FromDate").daterangepicker({autoUpdateInput:!0,timePicker:!1,timePicker24Hour:!1,locale:{format:"DD/MM/YYYY"},singleDatePicker:!0,showDropdowns:!0,minYear:1901,maxDate:new Date(2050,11,31)});$("#date_ToDate").daterangepicker({autoUpdateInput:!1,timePicker:!1,timePicker24Hour:!1,locale:{format:"DD/MM/YYYY"},singleDatePicker:!0,showDropdowns:!0,minYear:1901,maxDate:new Date(2050,11,31)});$("#date_FromDate").on("apply.daterangepicker",function(){$("#div_FromDate").addClass("floating-label-form-group-with-value")});$("#date_ToDate").on("apply.daterangepicker",function(){$("#div_ToDate").addClass("floating-label-form-group-with-value")});$("#Apply_Conditions").click(function(){$(".ExecutedActionslist").html("");let t=new n.Platform.Automation.Requests.ExecutedAction,r=n.Platform.Helpers.DateTimeHelper.Instance().formatServerDateTime($("#date_FromDate").val()),u=new Date(r),f=n.Platform.Helpers.DateTimeHelper.Instance().formatServerDateTime($("#date_ToDate").val()),e=new Date(f),o=$("#chkZeroActions").is(":checked"),i=$("#txtAutoComplete_Actions option:selected").text();n.Platform.Automation.Components.ExecutedActions.Instance().page_index=0;t.StartDate=u;t.EndDate=e;i!="Select"&&(t.ActionTypeName=i);t.ZeroActions=o;n.Platform.Automation.Components.ExecutedActions.Instance().GetExecutedActions(t)})}init(t){this.render(t).then(function(){n.Platform.Automation.Components.ExecutedActions.Instance().LoadFunctions();n.Platform.Automation.Components.ExecutedActions.Instance().loadJsFiles()})}loadJsFiles(){var t=n.Platform.Automation.Components.ExecutedActions.Instance().jsFiles();n.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(t,function(){n.Platform.Automation.Components.ExecutedActions.Instance().LoadActions();let t=new n.Platform.Automation.Requests.ExecutedAction;var i=new Date;let r=n.Platform.Helpers.DateTimeHelper.Instance().serverDateformat(i),u=n.Platform.Helpers.DateTimeHelper.Instance().serverDateformat(i)+" 23:59";$("#date_FromDate").val(r);$("#date_ToDate").val(u);let f=n.Platform.Helpers.DateTimeHelper.Instance().formatServerDateTime($("#date_FromDate").val()),e=n.Platform.Helpers.DateTimeHelper.Instance().formatServerDateTime($("#date_ToDate").val()),o=new Date(f),s=new Date(e);t.StartDate=o;t.EndDate=s;t.ActionTypeName="";t.ZeroActions=!1;n.Platform.Automation.Components.ExecutedActions.Instance().GetExecutedActions(t)})}render(n){return __awaiter(this,void 0,void 0,function*(){$("."+n).empty();let t=`<form id="frmUnibase_ExecutedActions" data-validate="parsley" data-isdynamic="false">
  26. <div class="card bg-light">
  27. <div class="b-b bg-white card-header">
  28. <strong class="text-dark title" id="">Executed Actions</strong>
  29. <span class="badge badge-light badge-pill badge-outline span_executedactions_count">0</span>
  30. <span class="pull-right" id="executedactions_angle">
  31. <a class="btn_executedactions_angle" href="javascript:;" onclick="Unibase.Platform.Automation.Components.ExecutedActions.Instance().ToggleExecutedActions()">
  32. <i class="fa fa-angle-down"></i>
  33. <i class="fa fa-angle-up hidden"></i>
  34. </a>
  35. </span>
  36. </div>
  37. <div class="card-body Conditions hidden">
  38. <div class="row">
  39. <div class="col-sm-3">
  40. <div class="floating-label-form-group" id="div_FromDate">
  41. <label for="lbl" id="lbl_FromDate">FromDate</label>
  42. <div class="input-group">
  43. <input type="text" id="date_FromDate" class="form-control type-control datepicker-input hasDatepicker value-control floating-label-control" placeholder="FromDate" data-placeholder="dd/mm/yyyy" data-label="FromDate">
  44. <span class="input-group-addon mt-10"><i class="fa fa-calendar"></i></span>
  45. <input type="hidden" id="hf_FromDate" />
  46. </div>
  47. </div>
  48. </div>
  49. <div class="col-sm-3">
  50. <div class="floating-label-form-group" id="div_ToDate">
  51. <label for="lbl" id="lbl_ToDate">ToDate</label>
  52. <div class="input-group">
  53. <input type="text" id="date_ToDate" class="form-control type-control datepicker-input hasDatepicker value-control floating-label-control" placeholder="ToDate" data-placeholder="dd/mm/yyyy" data-label="ToDate">
  54. <span class="input-group-addon mt-10"><i class="fa fa-calendar"></i></span>
  55. <input type="hidden" id="hf_ToDate" />
  56. </div>
  57. </div>
  58. </div>
  59. <div class="col-sm-2">
  60. <div class="input-group mt-30">
  61. <select id="txtAutoComplete_Actions" class="form-control text-control" style="width:100%;" placeholder="User" data-placeholder="User" data-label="" data-istagselect="true"></select>
  62. <input type="hidden" id="hf_Autocomplete_Actions" class="form-control value-control" data-isdynamic="true" />
  63. </div>
  64. </div>
  65. <div class="col-sm-2">
  66. <div class="custom-control custom-checkbox divEnablePieces checkbox-primary mt-40">
  67. <input type="checkbox" class="custom-control-input" id="chkZeroActions">
  68. <label class="custom-control-label" for="chkZeroActions">Zero Actions</label>&nbsp
  69. </div>
  70. </div>
  71. <div class="col-sm-2">
  72. <button type="button" id="Apply_Conditions" class="btn btn-success mt-30">Apply</button>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="card-body scrollable" style="overflow-y: scroll;">
  77. <div class="row">
  78. <table class="table">
  79. <thead>
  80. <tr class="bg-primary">
  81. <th>Action Name</th>
  82. <th>Action Type</th>
  83. <th>Start Date</th>
  84. <th>End date</th>
  85. <th>Count</th>
  86. </tr>
  87. </thead>
  88. <tbody class="ExecutedActionslist_body"></tbody>
  89. </table>
  90. </div>
  91. </div>
  92. <div class="bg-white card-footer footer" id="ExecutedActionsFooter">
  93. <div class="Div_pagination row col-sm-12 mt-15">
  94. <div class="col-sm-4" id="list_count">
  95. <span id="TotalRecords" class="text-muted">Total : <span id="lblItemTotalRecords" class="lblItemTotalRecords mr-30"></span></span>
  96. </div>
  97. <div class="col-sm-8">
  98. <div id="divpagination" class="pagination custom-pagination pagination-rounded pull-right"></div>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. </form>`;return yield $("."+n).append(t)})}ToggleExecutedActions(){$("#frmUnibase_ExecutedActions").find(".fa-angle-down").toggleClass("hidden");$("#frmUnibase_ExecutedActions").find(".fa-angle-up").toggleClass("hidden");$("#frmUnibase_ExecutedActions").find(".Conditions").toggleClass("hidden")}GetExecutedActionsCount(){n.Platform.Automation.Managers.RuleManager.Instance().ExecutedActions().then(function(n){n.result.length>0&&$(".span_executedactions_count").text(n.result.length)})}GetExecutedActions(t){let i=n.Platform.Automation.Components.ExecutedActions.Instance().page_index,u=n.Platform.Automation.Components.ExecutedActions.Instance().page_size;t.PageIndex=n.Platform.Automation.Components.ExecutedActions.Instance().page_index;t.PageRows=n.Platform.Automation.Components.ExecutedActions.Instance().page_size;var r=i;r=i<1?0:i;n.Platform.Automation.Managers.RuleManager.Instance().ExecutedActionsList(t).then(function(i){var f,l,b;if(i.result.length>0){$(".ExecutedActionslist_body").html('<tr class="ExecutedActionslist hidden"><\/tr>');var k=n.Platform.Automation.Components.ExecutedActions.Instance().count,c="",u=i.result;for(f=0;f<u.length;f++){var r=u[f],a=r.RuleActionName,v=r.ActionName,y=n.Platform.Helpers.DateTimeHelper.Instance().FormatDateTimeWithoutSeconds(r.StartDate),p=n.Platform.Helpers.DateTimeHelper.Instance().FormatDateTimeWithoutSeconds(r.EndDate),w=r.ActionName.replace("Send","");c="<tr><td>"+a+"<\/td><td>"+v+"<\/td><td>"+y+"<\/td><td>"+p+'<\/td><td><a href="javascript:;" onclick="Unibase.Platform.Automation.Components.ExecutedActions.Instance().LoadPopoupDetails(\''+r.ActionName+"','"+r.ExecutedActionId+"');\">"+r.ReminderCount+" "+w+"s<\/a><\/td><\/tr>";$(".ExecutedActionslist:last").before(c)}if(u.length<=0)$(".Div_pagination").hide();else{$(".Div_pagination").show();var e=u[0].TotalRecords,o=0,s=0,h=(n.Platform.Automation.Components.ExecutedActions.Instance().page_index+1)*10;e>0&&(o=1,s=e);e>h&&(s=h);n.Platform.Automation.Components.ExecutedActions.Instance().page_index>0&&(o+=h-10);l=o+" - "+s+" of "+e;$(".Div_pagination").show();$(".lblItemTotalRecords").text(l);b=$(".Div_pagination").find("#divpagination");n.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("libs/jquery/pagination/jquery.pagination.js",function(){var i;i=$(".Div_pagination").find("#divpagination");i.pagination(u[0].TotalRecords,10,{current_page:n.Platform.Automation.Components.ExecutedActions.Instance().page_index,callback:function(i){n.Platform.Automation.Components.ExecutedActions.Instance().page_index=i;n.Platform.Automation.Components.ExecutedActions.Instance().GetExecutedActions(t)}})})}n.Platform.Automation.Components.ExecutedActions.Instance().page_index=0;$(".span_executedactions_count").text(u[0].TotalRecords)}else $(".ExecutedActionslist_body").html("No Records Found"),$(".span_executedactions_count").text("0")})}LoadPopoupDetails(i,r){if(n.Platform.Helpers.NavigationHelper.Instance().popup(r,"",n.Platform.Automation.Components.ExecutedActions.Instance(),null,t.Helpers.Size.DockLeft),i=="Send Notification")n.Platform.Automation.Components.ExecutedActions.Instance().LoadReminderDetails(r);else if(i=="Send Sms")n.Platform.Automation.Components.ExecutedActions.Instance().LoadSMSDetails(r);else if(i=="Send Email")n.Platform.Automation.Components.ExecutedActions.Instance().LoadMailDetails(r);else if(i=="Send Task")n.Platform.Automation.Components.ExecutedActions.Instance().LoadTaskDetails(r);else return!1}LoadActions(){n.Platform.Automation.Managers.RuleManager.Instance().getActions().then(function(n){var t,i;let r=document.getElementById("txtAutoComplete_Actions");$("#txtAutoComplete_Actions").empty();t=document.createElement("option");t.text="Select";t.value="";r.appendChild(t);for(let t=0;t<=n.length-1;t++)i=document.createElement("option"),i.text=n[t].ActionName,i.value=n[t].ActionId.toString(),r.appendChild(i)})}LoadReminderDetails(t){n.Platform.Communications.Managers.ReminderManager.Instance().getRemindersWithType(t,!1).then(function(n){var i,r,t,u,f;if(n.result.length>0)for($(".ActionsDatalist_body").html('<tr class="ActionsDatalist_body hidden"><\/tr>'),i="",r=n.result,t=0;t<r.length;t++)u=r[t],f=t+1,i='<tr class="Notification-item"><td>'+f+"<\/td><td>"+u.ToUserName+"<\/td><td>"+u.Message+"<\/td><\/tr>",$(".ActionsDatalist_body:last").before(i)})}LoadSMSDetails(t){n.Apps.Communications.Managers.SmsManager.Instance().getSmsByExecutedActionId(t).then(function(n){var f,r,u,i,t,e;if(n.result.length>0)for(f="<th>Phone Number<\/th><th>Status<\/th><th class='hidden'>Delivery Report<\/th>",$("#Reminders_Row").append(f),$(".ActionsDatalist_body").html('<tr class="ActionsDatalist_body hidden"><\/tr>'),r="",u=n.result,i=0;i<u.length;i++)t=u[i],e=i+1,r='<tr class="Sms-item"><td>'+e+"<\/td><td>"+t.ToUserName+"<\/td><td>"+t.SmsBody+"<\/td><td>"+t.ToPhoneNumber+"<\/td><td>"+t.RecipientStatus+'<\/td><td class="hidden">'+t.DeliveryReport+"<\/td><\/tr>",$(".ActionsDatalist_body:last").before(r)})}LoadMailDetails(t){this.fileCacheHelper.loadJsFile("apps/communications/managers/mails/mailmanager.js",function(){n.Apps.Communications.Managers.MailManager.Instance().getMailByExecutedActionId(t).then(function(n){var i=" ",r,u,t,f;for(i="<tr><th>S.No.<\/th><th>Recipient<\/th><th>Mail Address<\/th><th>Mail Subject<\/th><\/tr>",$(".Reminders-head").html(i),$(".Reminders-body").html('<tr class="Notification-item hidden"><\/tr>'),r=0,u=0;u<n.result.length;u++)if(t=n.result[u],t.ToEmailAddress!=null&&t.ToEmailAddress!=""&&t.ToEmailAddress!=undefined){f=t.ToEmailAddress.split(",");for(let n=0;n<f.length;n++)r=r+1,i='<tr class="Notification-item"><td>'+r+"<\/td><td>"+f[n]+'<\/td><td class="text-truncate w-200">'+t.MailBody+"<\/td><\/tr>",$(".ActionsDatalist_body:last").append(i)}})})}LoadTaskDetails(t){n.Platform.Communications.Managers.ReminderManager.Instance().getRemindersWithType(t,!0).then(function(n){var i,r,t,u,f;if(n.result.length>0)for($(".ActionsDatalist_body").html('<tr class="ActionsDatalist_body hidden"><\/tr>'),i="",r=n.result,t=0;t<r.length;t++)u=r[t],f=t+1,i='<tr class="Notification-item"><td>'+f+"<\/td><td>"+u.ToUserName+"<\/td><td>"+u.Message+"<\/td><\/tr>",$(".ActionsDatalist_body:last").before(i)})}static Instance(){return this.instance===undefined&&(this.instance=new r),this.instance}}i.ExecutedActions=r})(r=i.Components||(i.Components={}))})(i=t.Automation||(t.Automation={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));