flowInsDataConf.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. var typeIdSelect2 = null;
  2. $(function() {
  3. // alert(window.screen.height);
  4. // alert(window.screen.availHeight);
  5. // alert(document.body.clientHeight);
  6. // alert(document.body.offsetHeight);
  7. // alert(document.body.scrollHeight);
  8. // alert(window.innerHeight);
  9. // alert(document.documentElement.scrollHeight );
  10. // alert($(window).height());
  11. // alert($(document).height());
  12. $("#footer").css("margin-top", window.screen.height - 215);
  13. // $("#footer").css("margin-top", window.innerHeight-150);
  14. // $("#footer").css("margin-bottom", 50);
  15. $("#center").height(window.screen.height - 295);
  16. // 提示
  17. $('.badge-success').tooltip();
  18. // 长度验证
  19. // $('[maxlength]').maxlength({
  20. // alwaysShow: true,
  21. // threshold: 10,
  22. // warningClass: "label label-info",
  23. // limitReachedClass: "label label-warning",
  24. // placement: 'top',
  25. // message: '%charsTyped%/%charsTotal%'
  26. // });
  27. // 表单验证配置
  28. // $("#form2").validate({
  29. // rules: {
  30. // isViewLimitValue:{
  31. // required: "select[name='isViewLimit'] option[value='0']:selected"
  32. // },
  33. // deptname1:{
  34. // required: "select[name='limitUseType'] option[value='0']:selected"
  35. // },
  36. // username1:{
  37. // required: "select[name='limitUseType'] option[value='1']:selected"
  38. // },
  39. // position:{
  40. // required: "select[name='limitUseType'] option[value='2']:selected"
  41. // },
  42. // limitPositionDeptNames:{
  43. // required: "select[name='limitPositionType'] option[value='0']:selected"
  44. // }
  45. // }
  46. // });
  47. });
  48. // 保存流程模版
  49. var validator;
  50. function saveForm(to, modelId, confId) {
  51. var bool = false;
  52. if (to == undefined) {// 保存不验证
  53. bool = true;
  54. } else {
  55. bool = $("#form2").validate().element($("#flowModelId"));
  56. }
  57. // var bool = $("#form2").valid();
  58. if (bool) {
  59. // $("#saveModelBtn").attr("disabled","disabled");
  60. $(document).progressDialog.showDialog("正在保存,请稍后...");
  61. var x = $("#form2").serializeArray();
  62. // $.each(x, function(i, field) {
  63. // field.value = encodeURI(field.value);
  64. // });
  65. $
  66. .ajax({
  67. url : "bpmFlowInsDataConfAction.do?task=saveInsDataConf&time="
  68. + new Date(),
  69. async : true,
  70. type : "post",
  71. dataType : 'json',
  72. data : x,
  73. success : function(data) {
  74. $(document).progressDialog.hideDialog();
  75. if (data) {
  76. if (to == undefined) {
  77. // $("#saveModelBtn").removeAttr("disabled");
  78. alert("保存成功!");
  79. } else if (to == "next") {
  80. location = 'bpmGraphConfigAction.do?task=toGraph&modelId='
  81. + modelId;
  82. } else {
  83. toConfigStep(to, modelId, confId);
  84. }
  85. } else {
  86. // $("#saveModelBtn").removeAttr("disabled");
  87. alert("保存失败!");
  88. }
  89. },
  90. error : function() {
  91. $(document).progressDialog.hideDialog();
  92. alert("数据处理失败,请检查网络重新登录或联系管理员!");
  93. }
  94. });
  95. }
  96. }
  97. function arrayIndexOf() {
  98. if (!Array.prototype.indexOf) {
  99. Array.prototype.indexOf = function(elt /* , from */) {
  100. var len = this.length >>> 0;
  101. var from = Number(arguments[1]) || 0;
  102. from = (from < 0) ? Math.ceil(from) : Math.floor(from);
  103. if (from < 0)
  104. from += len;
  105. for (; from < len; from++) {
  106. if (from in this && this[from] === elt)
  107. return from;
  108. }
  109. return -1;
  110. };
  111. }
  112. }