1 |
- var _projectConfig=new ProjectConfig,activitiPrefix=_projectConfig.activitiServiceConfig.gatewayRoute+_projectConfig.activitiServiceConfig.adminPath,requestUrlPrefix=_projectConfig.proxyPath+activitiPrefix,processedUserTaskInstListContent=new Vue({el:"#processedUserTaskInstListContent",data:function(){return{pageLoading:!0}},created:function(){},methods:{},mounted:function(){var i={view:{removeHoverDom:removeHoverDom,selectedMulti:!1,fontCss:setFontCss},data:{simpleData:{enable:!0}},callback:{beforeDrag:beforeNodeDrag,onClick:onNodeClick}},o=[];function e(){$("#userTaskInstSearchForm #procInstName").val(""),$("#userTaskInstSearchForm #actiName").val("")}$.get(requestUrlPrefix+"/activiti/flowType/getProcTypeTree?pId=0",function(e){$.fn.zTree.init($("#flowTypeTree"),i,e);var t=$.fn.zTree.getZTreeObj("flowTypeTree"),r=t.getNodes();0<r.length?(t.selectNode(r[0]),t.expandNode(r[0],!0),t.setting.callback.onClick(null,t.setting.treeId,r[0])):toastr.error("树加载失败或数据不存在","树加载提醒")}),$("#flowTypeSearchBtn").click(function(){var e=$.fn.zTree.getZTreeObj("flowTypeTree"),t=$("#flowTypeSearchName").val();if(!$.isEmptyObject(t)){var r=e.getNodesByParamFuzzy("name",t);if(null!==o&&0<o.length)for(var i=0;i<o.length;i++){(n=o[i]).highlight=!1,e.updateNode(n)}if(null!==(o=r)&&0<r.length)for(var n,i=0;i<r.length;i++){(n=r[i]).highlight=!0,e.updateNode(n),e.expandNode(n.getParentNode(),!0),n.isParent&&e.expandNode(n,!0)}}}),$("#userTaskInstTable").on("post-body.bs.table",function(){$(this).find(".dropdown-toggle").off("click").dropdown()}),$("#viewTaskBtn").click(viewProcessDetail),e();var t=$("#userTaskInstSearchBtn"),r=$("#userTaskInstResetBtn");t.click(refreshTable),r.click(function(){e(),refreshTable()})}});function fix_height(){var e=$(window).height(),t=$(".ibox:first"),r=$(".ibox:last"),i=t.height(),n=r.height();(n<i?i:n)<=e||$(window).width()>=t.width()+r.width()?($(".ibox").css("min-height",e-30+"px"),$(".ibox-content").css("min-height",e-50+"px")):($(".ibox").css("min-height",""),$(".ibox-content").css("min-height",""))}function operateFormatter(e,t,r){return"<div style='position:relative;' class='btn-group-xs'><button title='撤回' style='margin:1px' class='recallTask btn btn-primary btn-xs'><i class='fa fa-reply fa-fw'></i></button></div>"}function onNodeClick(e,t,r,i){refreshTable()}function refreshTable(){var e=requestUrlPrefix+"/activiti/userTaskInst/getUserTaskInstList?",t=$.fn.zTree.getZTreeObj("flowTypeTree");null!=t&&0<t.getSelectedNodes().length&&(""==t.getSelectedNodes()[0].parentIds?e+="procDefId="+t.getSelectedNodes()[0].id+"&":e+="flowTypeId="+t.getSelectedNodes()[0].id+"&"),$("#userTaskInstTable").bootstrapTable("refresh",{url:e+"hideInTodo=0&"+$("#userTaskInstSearchForm").serialize()})}function setFontCss(e,t){return t.highlight?{color:"#A60000","font-weight":"bold"}:{color:"#333","font-weight":"normal"}}function beforeNodeDrag(){return!1}function removeHoverDom(e,t){$("#addBtn_"+t.tId).unbind().remove()}function viewProcessDetail(){var e,t=$("#userTaskInstTable").bootstrapTable("getSelections");0!==t.length?1<t.length?toastr.warning("请至多选择一条数据"):(e=getRelativePath()+"userTaskInstForm.html?editType=view&id="+t[0].id+"&procInstId="+t[0].procInstId,openDialogView("查看用户任务实例",e,{width:"900px",height:"580px",full:!1})):toastr.warning("请至少选择一条数据")}window.operateEvents={"click .recallTask":function(e,t,r,i){$.ajax({type:"get",url:requestUrlPrefix+"/activiti/userTaskInst/recallTask?userTaskInstId="+r.id+"×tamps="+(new Date).getTime(),success:function(e){"success"===e.type?(toastr.success(e.message||"撤回任务成功!"),$("#userTaskInstTable").bootstrapTable("refresh")):toastr.error(e.message||"撤回任务失败!")}})}};
|