easyuiextend.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. try {
  2. $.fn.panel.defaults.onBeforeDestroy = function() {/* tab关闭时回收内存 */
  3. var frame = $('iframe', this);
  4. if (frame.length > 0) {
  5. frame[0].contentWindow.document.write('');
  6. frame[0].contentWindow.close();
  7. frame.remove();
  8. if ($.browser.msie) {
  9. CollectGarbage();
  10. }
  11. } else {
  12. $(this).find('.combo-f').each(function() {
  13. var panel = $(this).data().combo.panel;
  14. panel.panel('destroy');
  15. });
  16. }
  17. };
  18. $.parser.onComplete = function() {/* 页面所有easyui组件渲染成功后,隐藏等待信息 */
  19. if ($.browser.msie && $.browser.version < 7) {/* 解决IE6的PNG背景不透明BUG */
  20. }
  21. window.setTimeout(function() {
  22. try {
  23. window.top.$.messager.progress('close');
  24. } catch (e) {
  25. }
  26. }, 200);
  27. };
  28. /**
  29. * 部署流程图
  30. *
  31. * @param deploymentId
  32. * @param resourceName
  33. */
  34. function deploymentimg(deploymentId, resourceName,title) {
  35. if (typeof (title) == 'undefined') {
  36. title = "";
  37. }
  38. openwindow('流程部署详细图--'+title, 'activitiController.do?openProcessPic&tag=deployment&deploymentId=' + deploymentId + '&resourceName=' + resourceName);
  39. }
  40. /**
  41. * 下载流程xml
  42. *
  43. * @param deploymentId
  44. * @param resourceName
  45. */
  46. function downloadXml(deploymentId, resourceName,title) {
  47. if (typeof (title) == 'undefined') {
  48. title = "";
  49. }
  50. window.location.href='activitiController.do?processBpmXmlByDeploy&tag=deployment&deploymentId=' + deploymentId + '&resourceName=' + resourceName;
  51. }
  52. /**
  53. * 办理过程流程图
  54. *
  55. * @param taskId
  56. */
  57. function processimg(taskId, title) {
  58. if (typeof (title) == 'undefined') {
  59. title = "";
  60. }
  61. openwindow('流程进度--当前节点:' + title, 'activitiController.do?openProcessPic&tag=task&taskId=' + taskId);
  62. }
  63. /**
  64. * 项目列表流程图查看
  65. * @param taskId
  66. * @param title
  67. * @param width
  68. * @param height
  69. */
  70. function progress(busKey, title) {
  71. if (typeof (title) == 'undefined') {
  72. title = "";
  73. }
  74. openwindow('流程进度--当前节点:' + title, 'activitiController.do?openProcessPic&tag=project&businessKey='+ busKey);
  75. }
  76. /**
  77. * 打开流程办理页面
  78. */
  79. function openhandle(taskId, title, width, height) {
  80. if (typeof (width) == 'undefined') {
  81. width = "auto";
  82. }
  83. if (typeof (height) == 'undefined') {
  84. height = "auto";
  85. }
  86. if (typeof (title) == 'undefined') {
  87. title = "";
  88. }
  89. var url = 'activitiController.do?openProcessHandle&taskId=' + taskId;
  90. $.dialog({
  91. content: 'url:'+url,
  92. title : '流程办理--当前环节:' + title,
  93. lock : true,
  94. opacity : 0.3,
  95. button : [ {
  96. name : '同意',
  97. callback : function() {
  98. iframe = this.iframe.contentWindow;
  99. var inputvar = $("[vartype]", iframe.document);
  100. setvar(true, inputvar, iframe);
  101. saveObj();
  102. return false;
  103. },
  104. focus : true
  105. }, {
  106. name : '驳回',
  107. callback : function() {
  108. iframe = this.iframe.contentWindow;
  109. var inputvar = $("[vartype]", iframe.document);
  110. setvar(false, inputvar, iframe);
  111. saveObj();
  112. return false;
  113. }
  114. } ]
  115. });
  116. }
  117. /**
  118. * 设置流程变量
  119. *
  120. * @param flag
  121. * 操作标示
  122. * @param varobj//作为流程变量的对象集合
  123. * @param iframe//页面对象
  124. */
  125. function setvar(flag, varobj, iframe) {
  126. var keys = "opt,", values = flag + ",", types = "B,", tag = "";
  127. if (!flag) {
  128. // tag="Back";//驳回操作时变量添加后缀
  129. }
  130. varobj.each(function() {
  131. var value = this.value;
  132. if (value == "") {
  133. if (flag) {
  134. value = "同意";
  135. } else {
  136. value = "不同意";
  137. }
  138. }
  139. keys += this.id + tag + ",";
  140. values += value + ",";
  141. types += $("#" + this.id, iframe.document).attr("vartype") + ",";
  142. });
  143. $("#keys", iframe.document).val(keys);
  144. $("#values", iframe.document).val(values);
  145. $("#types", iframe.document).val(types);
  146. }
  147. /**
  148. * 打开流程办理页面 - New (新的流程办理页面包括"表单信息","任务处理","流程跟踪")
  149. */
  150. function openhandleMix(taskId, title, width, height) {
  151. //update-begin--author: scott Date: 20170307 for: 我的任务,历史任务弹出页面大小----
  152. if (typeof (width) == 'undefined' || width < 500) {
  153. width = window.top.document.body.offsetWidth - 300;
  154. }
  155. if (typeof (height) == 'undefined') {
  156. height = window.top.document.body.offsetHeight-100;
  157. }
  158. //update-end--author: scott Date: 20170307 for: 我的任务,历史任务弹出页面大小----
  159. if (typeof (title) == 'undefined') {
  160. title = "";
  161. }
  162. $.ajax({
  163. url : 'taskController.do?checktaskId&taskId='+ taskId,
  164. type : 'POST',
  165. cache : false,
  166. success : function(data) {
  167. var d = data; // ------ $.parseJSON(data);
  168. if (d.success) {
  169. var url = 'taskController.do?goTaskTab&taskId=' + taskId;
  170. $.dialog({
  171. content: 'url:'+url,
  172. title : '流程办理--当前环节: ' + title,
  173. lock : true,
  174. zIndex: getzIndex(),
  175. opacity : 0.3,
  176. width: width,
  177. height: height,
  178. button : [{
  179. name : '关闭',
  180. callback : function() {
  181. iframe = this.iframe.contentWindow;
  182. return true;
  183. }
  184. } ]
  185. });
  186. }else{
  187. tip(d.msg);
  188. try{
  189. reloadTable();
  190. }catch(e){
  191. }
  192. }
  193. }
  194. });
  195. }
  196. /**
  197. * 打开流程办理页面 - New (新的流程办理页面包括"表单信息","任务处理","流程跟踪")
  198. */
  199. function goProcessHisTab(processInstanceId, title, width, height,taskId) {
  200. //update-begin--author: scott Date: 20170307 for: 我的任务,历史任务弹出页面大小----
  201. if (typeof (width) == 'undefined' || width < 500) {
  202. width = window.top.document.body.offsetWidth - 300;
  203. }
  204. if (typeof (height) == 'undefined' || height<100) {
  205. height = window.top.document.body.offsetHeight-100;
  206. }
  207. //update-end--author: scott Date: 20170307 for: 我的任务,历史任务弹出页面大小----
  208. if (typeof (title) == 'undefined'||(title) == 'undefined') {
  209. title = "";
  210. }else{
  211. title = "--当前环节 : "+title;
  212. }
  213. var url = 'taskController.do?goProcessHisTab&processInstanceId=' + processInstanceId+"&taskId="+taskId;
  214. $.dialog({
  215. content: 'url:'+url,
  216. title : '流程历史' + title,
  217. lock : true,
  218. zIndex: getzIndex(),
  219. opacity : 0.3,
  220. width: width,
  221. height: height,
  222. button : [{
  223. name : '关闭',
  224. callback : function() {
  225. iframe = this.iframe.contentWindow;
  226. return true;
  227. }
  228. } ]
  229. });
  230. }
  231. /**
  232. * 打开流程办理页面 - New (新的流程办理页面包括"表单信息","任务处理","流程跟踪")
  233. */
  234. function openhandleMixTab(taskId, title, width, height) {
  235. if (typeof (width) == 'undefined') {
  236. width = "auto";
  237. }
  238. if (typeof (height) == 'undefined') {
  239. height = "auto";
  240. }
  241. if (typeof (title) == 'undefined') {
  242. title = "";
  243. }
  244. var url = 'taskController.do?goTaskTab&taskId=' + taskId;
  245. addOneTab('任务办理-:'+title,url);
  246. }
  247. /**
  248. * 选择委托人
  249. *
  250. * @param taskId
  251. */
  252. function selectEntruster(taskId, title) {
  253. if (typeof (title) == 'undefined') {
  254. title = "";
  255. }
  256. createwindow('选择委托人' + title, 'activitiController.do?goEntrustAdd&tag=task&taskId=' + taskId,700,150);
  257. }
  258. } catch (e) {
  259. }