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.

conditions.min.js 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){class i{getConditions(){return`<form id="frmUnibase_Condition" data-validate="parsley" data-isdynamic="false">
  2. <div class="row">
  3. <label class="col-sm-4">Attribute Name</label>
  4. <label class="col-sm-4">Condition</label>
  5. <label class="col-sm-4">Value</label>
  6. </div>
  7. <div class="row">
  8. <div class="col-sm-4 mt-5">
  9. <select id="ddl_Action_PropertyName" class="form-control value-control" data-isdynamic="true">
  10. <option value="">Select</option>
  11. </select>
  12. <input type="hidden" id="hf_Action_PropertyName">
  13. </div>
  14. <div class="col-sm-4 mt-5">
  15. <select id="ddl_Action_Operator" class="form-control value-control" data-isdynamic="true">
  16. <option value="0">Select</option>
  17. <option value="1">Equals</option>
  18. <option value="2">NotEquals</option>
  19. <option value="3">EqualsColumn</option>
  20. <option value="4">NotEqualsColumn</option>
  21. <option value="5">GreaterThan</option>
  22. <option value="6">GreaterThanOrEquals</option>
  23. <option value="7">LessThan</option>
  24. <option value="8">LessThanOrEquals</option>
  25. <option value="9">GreaterThanColumn</option>
  26. <option value="10">GreaterThanOrEqualsColumn</option>
  27. <option value="11">LessThanColumn</option>
  28. <option value="12">LessThanOrEqualsColumn</option>
  29. <option value="13">Empty</option>
  30. <option value="14">NotEmpty</option>
  31. <option value="15">Contains</option>
  32. <option value="16">DoesNotContains</option>
  33. <option value="17">StartsWith</option>
  34. <option value="18">EndsWith</option>
  35. <option value="19">In</option>
  36. <option value="20">NotIn</option>
  37. <option value="21">Between</option>
  38. <option value="22">NotBetween</option>
  39. <option value="23">Date</option>
  40. </select>
  41. <input type="hidden" id="hf_Action_Operator">
  42. </div>
  43. <div class="col-sm-3 mt-5">
  44. <input type="text" id="txt_Action_Value" class="form-control value-control floating-label-control" placeholder="Enter Value"/>
  45. <input type="hidden" id="hf_Action_Value" />
  46. </div>
  47. <div class="col-sm-1 pull-right mt-5">
  48. <span class="pull-right">
  49. <a id="" title="Create" onclick="Unibase.Platform.Automation.Components.Conditions.Instance().AddActionCondition();">
  50. <i class="fa fa-plus"></i>
  51. </a>
  52. </span>
  53. </div>
  54. </div>
  55. <div class="row mt-10" id="AddActionCondition">
  56. </div>
  57. </form>`}AddActionCondition(){var i,t;n.Platform.Automation.Components.Conditions.conflag=0;i="";n.Platform.Automation.Components.Conditions.conlen=n.Platform.Automation.Components.Conditions.concount?n.Platform.Automation.Components.Conditions.concount:n.Platform.Automation.Components.Conditions.conlen+1;var e=$("#ddl_Action_PropertyName :selected").val(),r=$("#ddl_Action_PropertyName :selected").text(),o=$("#ddl_Action_Operator :selected").val(),u=$("#ddl_Action_Operator :selected").text(),f=$("#txt_Action_Value").val();if(i+='<div class="ActionConditionrow col-sm-12" id="row_'+n.Platform.Automation.Components.Conditions.conlen+'"><label id="PropertyName_'+n.Platform.Automation.Components.Conditions.conlen+'" class="col-sm-4">'+$("#ddl_Action_PropertyName :selected").text()+'<\/label><label id="Operator_'+n.Platform.Automation.Components.Conditions.conlen+'" class="col-sm-4">'+$("#ddl_Action_Operator :selected").text()+'<\/label><label id="OperatorValue_'+n.Platform.Automation.Components.Conditions.conlen+'" class="hidden">'+$("#ddl_Action_Operator :selected").val()+'<\/label><label id="Value_'+n.Platform.Automation.Components.Conditions.conlen+'" class="col-sm-3">'+$("#txt_Action_Value").val()+'<\/label><label id="hf_RuleConditionId_'+n.Platform.Automation.Components.Conditions.conlen+'" class="hidden">0<\/label><span class="pull-right"><a id="btnEdit_'+n.Platform.Automation.Components.Conditions.conlen+'" onclick="Unibase.Platform.Automation.Components.Conditions.Instance().EditRow('+n.Platform.Automation.Components.Conditions.conlen+');"> <i class="fa fa-pencil mr-5"><\/i><\/a><a id="btn_'+n.Platform.Automation.Components.Conditions.conlen+'" onclick="Unibase.Platform.Automation.Components.Conditions.Instance().DeleteRow('+n.Platform.Automation.Components.Conditions.conlen+');"> <i class="fa fa-trash text-danger"><\/i><\/a><\/span><div>',$("#ddl_Action_PropertyName").val()!="0"&&$("#ddl_Action_Operator").val()!="0"&&$("#txt_Action_Value").val()){if(n.Platform.Automation.Components.Conditions.conlen!=1)for(t=0;t<n.Platform.Automation.Components.Conditions.conditionArray.length;t++)if($("#ddl_Action_PropertyName :selected").text()==n.Platform.Automation.Components.Conditions.conditionArray[t].AttributeName&&$("#ddl_Action_Operator :selected").text()==n.Platform.Automation.Components.Conditions.conditionArray[t].ConditionName&&$("#txt_Action_Value").val()==n.Platform.Automation.Components.Conditions.conditionArray[t].Value)return n.Platform.Automation.Components.Conditions.conflag=1,n.Platform.Automation.Components.Conditions.conlen=n.Platform.Automation.Components.Conditions.conlen-1,MessageHelper.Instance().showError("Already Exists","Unibase_Actions_ValidationSummary"),!1;n.Platform.Automation.Components.Conditions.conflag==0&&($("#AddActionCondition").append(i),n.Platform.Automation.Components.Conditions.concount=0,$("#ddl_Action_PropertyName").val("0"),$("#ddl_Action_Operator").val("0"),$("#txt_Action_Value").val(""),n.Platform.Automation.Components.Conditions.conflag=0,n.Platform.Automation.Components.Conditions.conditionArray.push({AttributeName:r,ConditionName:u,Value:f}))}else n.Platform.Automation.Components.Conditions.conlen=n.Platform.Automation.Components.Conditions.conlen-1,MessageHelper.Instance().showError("Required fields are not provided","Unibase_Actions_ValidationSummary")}EditRow(t){$("#ddl_Action_PropertyName").val($("#PropertyName_"+t+"").text());$("#ddl_Action_Operator").val($("#OperatorValue_"+t+"").text());$("#txt_Action_Value").val($("#Value_"+t+"").text());$("#hfActionConditionId").val($("#hf_RuleConditionId_"+t+"").text());$("#row_"+t+"").remove();n.Platform.Automation.Components.Conditions.concount=t;for(var i in n.Platform.Automation.Components.Conditions.conditionArray)if($("#ddl_Action_PropertyName :selected").text()==n.Platform.Automation.Components.Conditions.conditionArray[i].AttributeName&&$("#ddl_Action_Operator :selected").text()==n.Platform.Automation.Components.Conditions.conditionArray[i].ConditionName&&$("#txt_Action_Value").val()==n.Platform.Automation.Components.Conditions.conditionArray[i].Value){n.Platform.Automation.Components.Conditions.conditionArray.splice(Number(i),1);break}}DeleteRow(){for(var t in n.Platform.Automation.Components.Conditions.conditionArray)if($("#PropertyName_"+n.Platform.Automation.Components.Conditions.conlen).text()==n.Platform.Automation.Components.Conditions.conditionArray[t].AttributeName&&$("#Operator_"+n.Platform.Automation.Components.Conditions.conlen).text()==n.Platform.Automation.Components.Conditions.conditionArray[t].ConditionName&&$("#Value_"+n.Platform.Automation.Components.Conditions.conlen).text()==n.Platform.Automation.Components.Conditions.conditionArray[t].Value)break;$("#row_"+n.Platform.Automation.Components.Conditions.conlen+"").remove()}AddConditionArray(){let n=[];return $(".ActionConditionrow").each(function(){let t={},r=$(this).find(".EventKeys"),i=r.prevObject[0].id.split("_");i=i[1];t.RuleConditionId=Number($(this).find("#hf_RuleConditionId_"+i+"").text());t.RuleId=0;t.PropertyName=$(this).find("#PropertyName_"+i+"").text();t.OperatorType=$(this).find("#Operator_"+i+"").text();t.FromValue=$(this).find("#Value_"+i+"").text();t.ToValue=$(this).find("#Value_"+i+"").text();t.RuleActionId=0;n.push(t)}),n}LoadConditions(t,i){n.Platform.Automation.Components.Conditions.conditionArray=[];n.Platform.Automation.Components.Conditions.conlen=0;n.Platform.Automation.Managers.RuleManager.Instance().getRuleActionConditions(t,i).then(function(t){for(var r,i=0;i<t.length;i++){r="";let u=n.Platform.Automation.Enums.ExpOp[t[i].OperatorId];n.Platform.Automation.Components.Conditions.conlen=i+1;r+='<div class="ActionConditionrow col-sm-12" id="row_'+n.Platform.Automation.Components.Conditions.conlen+'"><label id="PropertyName_'+n.Platform.Automation.Components.Conditions.conlen+'" class="col-sm-4">'+t[i].PropertyName+'<\/label><label id="Operator_'+n.Platform.Automation.Components.Conditions.conlen+'" class="col-sm-4">'+u+'<\/label><label id="OperatorValue_'+n.Platform.Automation.Components.Conditions.conlen+'" class="hidden">'+t[i].OperatorId+'<\/label><label id="Value_'+n.Platform.Automation.Components.Conditions.conlen+'" class="col-sm-3">'+t[i].FromValue+'<\/label><label id="hf_RuleConditionId_'+n.Platform.Automation.Components.Conditions.conlen+'" class="hidden">'+t[i].RuleConditionId+'<\/label><span class="pull-right"><a id="btnEdit_'+n.Platform.Automation.Components.Conditions.conlen+'" onclick="Unibase.Platform.Automation.Components.Conditions.Instance().EditRow('+n.Platform.Automation.Components.Conditions.conlen+');"> <i class="fa fa-pencil mr-5"><\/i><\/a><a id="btn_'+n.Platform.Automation.Components.Conditions.conlen+'" onclick="Unibase.Platform.Automation.Components.Conditions.Instance().DeleteRow('+n.Platform.Automation.Components.Conditions.conlen+","+t[i].RuleConditionId+');"> <i class="fa fa-trash text-danger"><\/i><\/a><\/span><div>';n.Platform.Automation.Components.Conditions.conditionArray.push({AttributeName:t[i].PropertyName,ConditionName:t[i].Operatortype,Value:t[i].FromValue});$("#AddActionCondition").append(r);n.Platform.Automation.Components.Conditions.isCreate=1}})}LoadConditionProperties(t){n.Platform.Automation.Managers.RuleManager.Instance().getTokens(t).then(function(n){var t,i;let r=document.getElementById("ddl_Action_PropertyName");$("#ddl_Action_PropertyName").empty();t=document.createElement("option");t.text="Select";t.value="0";r.appendChild(t);for(let t=0;t<=n.length-1;t++)i=document.createElement("option"),i.text=n[t],i.value=n[t],r.appendChild(i)})}LoadConditionsData(t){var i,r;if(t.length!=0)for(n.Platform.Automation.Components.Conditions.conditionArray=[],n.Platform.Automation.Components.Conditions.conlen=0,i=0;i<t.length;i++){r="";let u=n.Platform.Automation.Enums.ExpOp[t[i].OperatorType];n.Platform.Automation.Components.Conditions.conlen=i+1;r+='<div class="ActionConditionrow col-sm-12" id="row_'+n.Platform.Automation.Components.Conditions.conlen+'"><label id="PropertyName_'+n.Platform.Automation.Components.Conditions.conlen+'" class="col-sm-4">'+t[i].PropertyName+'<\/label><label id="Operator_'+n.Platform.Automation.Components.Conditions.conlen+'" class="col-sm-4">'+u+'<\/label><label id="OperatorValue_'+n.Platform.Automation.Components.Conditions.conlen+'" class="hidden">'+t[i].OperatorType+'<\/label><label id="Value_'+n.Platform.Automation.Components.Conditions.conlen+'" class="col-sm-3">'+t[i].FromValue+'<\/label><label id="hf_RuleConditionId_'+n.Platform.Automation.Components.Conditions.conlen+'" class="hidden">'+t[i].RuleConditionId+'<\/label><span class="pull-right"><a id="btnEdit_'+n.Platform.Automation.Components.Conditions.conlen+'" onclick="Unibase.Platform.Automation.Components.Conditions.Instance().EditRow('+n.Platform.Automation.Components.Conditions.conlen+');"> <i class="fa fa-pencil mr-5"><\/i><\/a><a id="btn_'+n.Platform.Automation.Components.Conditions.conlen+'" onclick="Unibase.Platform.Automation.Components.Conditions.Instance().DeleteRow('+n.Platform.Automation.Components.Conditions.conlen+","+t[i].RuleConditionId+');"> <i class="fa fa-trash text-danger"><\/i><\/a><\/span><div>';n.Platform.Automation.Components.Conditions.conditionArray.push({AttributeName:t[i].PropertyName,ConditionName:t[i].Operatortype,Value:t[i].FromValue});$("#AddActionCondition").append(r);n.Platform.Automation.Components.Conditions.isCreate=1}}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}i.conlen=0;i.conditionArray=[];i.isCreate=0;i.conflag=0;t.Conditions=i})(i=t.Components||(t.Components={}))})(i=t.Automation||(t.Automation={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));