Index.cshtml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. @{
  2. ViewBag.Title = "发起流程";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <script>
  6. $(function () {
  7. InitialPage();
  8. GetSchemeType();
  9. GetGrid();
  10. GetList();
  11. });
  12. //初始化页面
  13. function InitialPage() {
  14. //resize重设(表格、树形)宽高
  15. $(window).resize(function (e) {
  16. window.setTimeout(function () {
  17. $("#taskblock").height($(window).height() - 83);
  18. $("#itemTree").height($(window).height() - 52);
  19. }, 200);
  20. e.stopPropagation();
  21. });
  22. }
  23. //加载树
  24. function GetSchemeType() {
  25. $.SetForm({
  26. url: "../../SystemManage/DataItemDetail/GetDataItemTreeJson",
  27. param: { EnCode: "FlowSort" },
  28. success: function (data) {
  29. $.each(data, function (id,item) {
  30. var row = '<li><a data-value="' + item.id + '">' + item.text + '</a></li>';
  31. $('#SchemeType').find('ul').append(row);
  32. });
  33. $('#SchemeType').find('li>a').click(function () {
  34. var id = $(this).attr('data-value');
  35. var text = $(this).html();
  36. var queryJson = { SchemeType: id };
  37. GetList({ queryJson: JSON.stringify(queryJson) });
  38. $('#SchemeType').find('.dropdown-text').html(text);
  39. });
  40. }
  41. })
  42. }
  43. //加载模板列表
  44. function GetList(param) {
  45. $.SetForm({
  46. url: "../../FlowManage/FlowDesign/GetListJson",
  47. param: param,
  48. success: function (data) {
  49. var $flowlist = $("#flowlist");
  50. $flowlist.html("");
  51. if (data.length > 0) {
  52. $('.no-data').hide();
  53. }
  54. else {
  55. $('.no-data').show();
  56. }
  57. $.each(data, function (i,item) {
  58. var _listhtml = '<li><div style="width: 160px; line-height: 38px;margin-top:11px; float: right;"><a class="btn btn-success createmodel" style="margin-right:4px;">快速新建</a><a class="btn btn-warning previewmodel">模板预览</a></div>';
  59. _listhtml += '<div style="float: left;">';
  60. _listhtml += '<span class="item-text">' + item.schemecode + '/' + item.schemename + '</span>';
  61. _listhtml += '<div><span class=\"label label-success-learun\" data-toggle="tooltip" data-placement="top" title="流程分类" >' + item.schemetypename + '</span>';
  62. _listhtml += '<span style="margin-left:5px;" class=\"label label-inverse-learun\" data-toggle="tooltip" data-placement="top" title="版本" >' + item.schemeversion + '</span>';
  63. _listhtml += '</div><p>By.' + (item.modifyusername == null ? item.createusername : item.modifyusername) + '-' + (item.modifydate == null ? item.createdate : item.modifydate) + (item.description == null ? '' : (' | 备注:' + item.description)) + '</p>';
  64. _listhtml += '</div></li>';
  65. var $_listhtml = $(_listhtml);
  66. $_listhtml.find('.previewmodel')[0].wfschemeInfoId = item.id;
  67. $_listhtml.find('.previewmodel')[0].schemeVersion = item.schemeversion;
  68. $_listhtml.find('.previewmodel')[0].schemename = item.schemecode + '/' + item.schemename;
  69. $_listhtml.find('.createmodel')[0].wfschemeInfoId = item.id;
  70. $_listhtml.find('.createmodel')[0].schemename = item.schemecode + '/' + item.schemename;
  71. $flowlist.append($_listhtml);
  72. });
  73. $('[data-toggle="tooltip"]').tooltip();
  74. //快速新建
  75. $('.createmodel').click(function () {
  76. var $_btn = $(this).context;
  77. var _wfschemeInfoId = $_btn.wfschemeInfoId;
  78. var _schemename = $_btn.schemename;
  79. dialogOpen({
  80. id: "FlowProcessBuider",
  81. title: '快速新建【' + _schemename + '】',
  82. url: '/FlowManage/FlowLaunch/FlowProcessNewForm?keyValue=' + _wfschemeInfoId,
  83. width: "1100px",
  84. height: "700px",
  85. btn: null,
  86. callBack: function (iframeId) {
  87. }
  88. });
  89. });
  90. //模板预览
  91. $('.previewmodel').click(function () {
  92. var $_btn = $(this).context;
  93. var _wfschemeInfoId = $_btn.wfschemeInfoId;
  94. var _schemeVersion = $_btn.schemeVersion;
  95. var _schemename = $_btn.schemename;
  96. top.tablist.newTab({ id: _wfschemeInfoId + _schemeVersion, title: '流程预览【' + _schemename + '】', closed: true, icon: "fa fa fa-eye", url: top.contentPath + '/FlowManage/FlowLaunch/PreviewIndex?keyValue=' + _wfschemeInfoId + "&schemeVersion=" + _schemeVersion });
  97. });
  98. }
  99. });
  100. }
  101. //加载表格
  102. function GetGrid() {
  103. $("#taskblock").height($(window).height() - 83);
  104. //查询事件
  105. $("#btn_Search").click(function () {
  106. var queryJson = { Keyword: $("#txt_Keyword").val() };
  107. GetList({ queryJson: JSON.stringify(queryJson) });
  108. });
  109. }
  110. </script>
  111. <div class="titlePanel">
  112. <div class="title-search">
  113. <table>
  114. <tr>
  115. <td>
  116. <div id="SchemeType" class="btn-group">
  117. <a class="btn btn-default dropdown-text" data-toggle="dropdown">选择流程分类</a>
  118. <a class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>
  119. <ul class="dropdown-menu"></ul>
  120. </div>
  121. </td>
  122. <td style="padding-left: 5px;">
  123. <input id="txt_Keyword" type="text" class="form-control" placeholder="请输入要查询关键字" style="width: 200px;" />
  124. </td>
  125. <td style="padding-left: 5px;">
  126. <a id="btn_Search" class="btn btn-primary"><i class="fa fa-search"></i>&nbsp;查询</a>
  127. </td>
  128. </tr>
  129. </table>
  130. </div>
  131. <div class="toolbar">
  132. <div class="btn-group">
  133. <a id="lr-replace" class="btn btn-default" onclick="reload();"><i class="fa fa-refresh"></i>&nbsp;刷新</a>
  134. </div>
  135. </div>
  136. </div>
  137. <div class="taskblockPanel">
  138. <div id="taskblock" class="taskblock">
  139. <ul id="flowlist"></ul>
  140. </div>
  141. <div class="no-data"></div>
  142. </div>