RoadFlow2.1 临时演示

Default.aspx 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebForm.Default" %>
  2. <!DOCTYPE html>
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head runat="server">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  6. <title>工作流管理系统</title>
  7. <style type="text/css">
  8. html,body {overflow:hidden; }
  9. </style>
  10. </head>
  11. <body>
  12. <form id="form1" runat="server">
  13. <div class="mainTop">
  14. <div class="mainTopLeft"></div>
  15. <div class="mainTopRight">
  16. <div style="height:9px;"></div>
  17. <div style="padding-right:20px;">
  18. <div>
  19. <span class="indexwelcome">欢迎您:<asp:Literal ID="UserName" runat="server"></asp:Literal></span>
  20. <span style="margin-right:6px;"></span>
  21. <span style="margin-right:6px;"><select id="roleselect" onchange="roleChange(this.value)" class="roleselect"><asp:Literal ID="RoleOptions" runat="server"></asp:Literal></select></span>
  22. <span style="margin-right:6px;">日期:<span id="CurrentDateTimeSpan"><asp:Literal ID="CurrentTime" runat="server"></asp:Literal></span></span>
  23. <span style="">主题:</span>
  24. <span class="mainTheme_blue" onclick="changeTheme('Blue', true);"></span>
  25. <span class="mainTheme_green" onclick="changeTheme('Green', true);"></span>
  26. <span class="mainTheme_gray" onclick="changeTheme('Gray', true);"></span>
  27. </div>
  28. <div style="margin-top:4px;">
  29. <%--<span style="margin-right:4px;"><a href="http://www.cqroad.cn" class="white" target="_blank">官方网站</a></span>
  30. <span style="margin-right:6px;">|</span>--%>
  31. <span style="margin-right:6px;"><a href="javascript:void(0);" onclick="openApp('Platform/Home/Default.aspx',0,'首页','index'); return false;" class="white" >平台首页</a></span>
  32. <span style="margin-right:6px;">|</span>
  33. <span style="margin-right:6px;"><a href="javascript:void(0);" onclick="openApp('Platform/UserInfo/EditPass.aspx',2,'修改密码','index_editpass',500,210); return false;" class="white" >修改密码</a></span>
  34. <span style="margin-right:6px;">|</span>
  35. <span style="margin-right:4px;"><a href="javascript:void(0);" onclick="if(confirm('您真的要退出系统吗?')){window.location='Logout.ashx';} return false;" class="white" >退出系统</a></span>
  36. </div>
  37. </div>
  38. </div>
  39. <div style="clear:both;"></div>
  40. </div>
  41. <div class="mainDiv">
  42. <table cellpadding="0" cellspacing="0" width="100%" border="0" style="table-layout:fixed;">
  43. <tr>
  44. <td class="mainMenutd" id="mainMenutd" >
  45. <div class="menuDiv">
  46. <div class="menuDivLeft">
  47. <div id="menuDiv0">
  48. </div>
  49. <div id="menuDiv1"></div>
  50. <div id="menuDiv2">
  51. <!--
  52. <div menuid="quit" type="system" onclick="if(confirm('您真的要退出系统吗?')){window.location='Login/Quit';}">
  53. <div style="height:5px;"></div>
  54. <div class="menuDivLeftIco" style="background-image:url(Images/ico/direction.png)"></div>
  55. <div class="menuDivLeftTitle">退出系统</div>
  56. <div class="menuDivLeftSplit"></div>
  57. </div>
  58. -->
  59. </div>
  60. </div>
  61. <div class="menuDivRight">
  62. <div style="padding:10px 1px 1px 10px; overflow:auto;">
  63. <div id="treeDiv" style="margin:0; overflow:auto;"></div>
  64. </div>
  65. </div>
  66. </div>
  67. </td>
  68. <td class="mainSplittd" id="mainSplittd">
  69. <div class="mainSplittdImg" onclick="switchMenu(this);"></div>
  70. </td>
  71. <td style="vertical-align:top;">
  72. <div class="tab_top"></div>
  73. <div id="mainTabDiv" class="mainTabDiv"></div>
  74. </td>
  75. </tr>
  76. </table>
  77. </div>
  78. </form>
  79. <script type="text/javascript">
  80. var mainTab = null;
  81. var mainTree = null;
  82. var mainDialog = new RoadUI.Window();
  83. var defaultRoleID = "<%=DefaultRoleID%>";
  84. var currentDateTimeSpan = $("#CurrentDateTimeSpan");
  85. var rolesLength = <%=RoleLength%>;
  86. var userID = '<%=CurrentUserID%>';
  87. var rootdir = '<%=SitePath%>';
  88. $(function ()
  89. {
  90. var windowheight=$(window).height()-58;
  91. $('#mainTabDiv').height(windowheight-3);
  92. $('.menuDivLeft').height(windowheight);
  93. $('.menuDivRight').height(windowheight);
  94. $('.menuDivRight>div>div').height(windowheight-11);
  95. $(window).bind('resize', function ()
  96. {
  97. var height=$(window).height()-58;
  98. $('#mainTabDiv').height(height-3);
  99. $('.menuDivLeft').height(height);
  100. $('.menuDivRight').height(height);
  101. $('.menuDivRight>div>div').height(height-11);
  102. mainTab.topResize(height);
  103. });
  104. mainTab = new RoadUI.Tab({ id: "mainTabDiv", replace: true });
  105. roleChange(defaultRoleID);
  106. openApp("Platform/Home/Default.aspx", 0, "首页", "index");
  107. //初始化主题按钮样式
  108. var theme = $.cookies.get("theme_platform") || "Blue";
  109. changeTheme(theme, false);
  110. });
  111. function update()
  112. {
  113. $.ajax({ url: "", cache: false, async: true, success: function (txt)
  114. {
  115. currentDateTimeSpan.html(txt);
  116. window.setTimeout(update, 10000);
  117. },
  118. error: function ()
  119. {
  120. window.setTimeout(update, 20000);
  121. }
  122. });
  123. }
  124. function treeClick(json)
  125. {
  126. if (json)
  127. {
  128. openApp(json.link, json.model, json.title, json.id, parseInt(json.width), parseInt(json.height), true);
  129. }
  130. }
  131. function openApp(url, model, title, id, width, height, isAppendParams)
  132. {
  133. if (!url || url.toString().length == 0)
  134. {
  135. return;
  136. }
  137. if (!id)
  138. {
  139. id = RoadUI.Core.newid();
  140. }
  141. if (width == 0) width = undefined;
  142. if (height == 0) height = undefined;
  143. if (isAppendParams)
  144. {
  145. url += url.indexOf('?') >= 0 ? "&appid=" + id : "?appid=" + id;
  146. }
  147. url = url.substr(0,1) == "/" ? url : rootdir + url;
  148. switch (parseInt(model))
  149. {
  150. case 0:
  151. mainTab.addTab({ id: "tab_" + id.replaceAll('-', ''), title: title, src: url });
  152. break;
  153. case 1:
  154. mainDialog.open({ id: "window_" + id.replaceAll('-', ''), title: title, url: url, width: width || 800, height: height || 460, ismodal: false });
  155. break;
  156. case 2:
  157. mainDialog.open({ id: "window_" + id.replaceAll('-', ''), title: title, url: url, width: width || 800, height: height || 460, ismodal: true });
  158. break;
  159. case 3:
  160. RoadUI.Core.open(url,width || 800,height || 460, title);
  161. break;
  162. case 4:
  163. window.showModalDialog(url,null,"dialogWidth="+(width || 800)+"px;dialogHeight="+(height || 460)+"px;center=1");
  164. break;
  165. case 5:
  166. window.open(url);
  167. break;
  168. }
  169. }
  170. function switchMenu(div)
  171. {
  172. var flag="mainSplittdImg"==$(div).attr("class");
  173. if (flag)
  174. {
  175. $("#mainMenutd").hide(200);
  176. $(div).removeClass().addClass("mainSplittdImg1");
  177. }
  178. else
  179. {
  180. $("#mainMenutd").show(200);
  181. $(div).removeClass().addClass("mainSplittdImg");
  182. }
  183. }
  184. function roleChange(roleID)
  185. {
  186. $("#treeDiv").html("");
  187. $.ajax({url: rootdir + "/Platform/Home/Menu.ashx?roleid=" + roleID + "&userid=" + userID, async:false, cache:true, dataType:"json", success:function(json){
  188. if(json && json.loginstatus && -1 == json.loginstatus)
  189. {
  190. login();
  191. return;
  192. }
  193. if(json.length>0 && json[0].childs)
  194. {
  195. var html='';
  196. for(var i=0;i<json[0].childs.length;i++)
  197. {
  198. var child=json[0].childs[i];
  199. html+='<div '+(i==0?'class="menuDivLeft1"':'')+' type="menu" menuid="'+child.id+'" onclick="loadMenu(\''+child.id+'\',\''+roleID+'\', this); '+(child.url&&$.trim(child.url).length>0?'openApp(\''+child.url+'\', '+child.model+', \''+child.title+'\', \''+child.id+'\', parseInt('+child.width+'), parseInt('+child.height+'), true);"':'"')+'>';
  200. html+='<div style="height:5px;font-size:0px;"></div>';
  201. html+='<div class="menuDivLeftIco" '+(child.ico&&$.trim(child.ico).length>0?'style="background-image:url('+child.ico+')"':'')+'></div>';
  202. html+='<div class="menuDivLeftTitle">'+child.title+'</div>';
  203. html+='<div class="menuDivLeftSplit"></div>';
  204. html+='</div>';
  205. }
  206. $("#menuDiv1").html(html);
  207. mainTree = new RoadUI.Tree({ id: "treeDiv", path: rootdir + "/Platform/Home/MenuRefresh.ashx?roleid=" + roleID + "&userid=" + userID + "&refreshid="+json[0].childs[0].id, refreshpath: rootdir + "/Platform/Home/MenuRefresh.ashx?roleid=" + roleID + "&userid=" + userID, showroot: true, showline:true, onclick: treeClick });
  208. }
  209. }});
  210. }
  211. function loadMenu(id, roleID, div)
  212. {
  213. if($(div).attr('class')=="menuDivLeft1")
  214. {
  215. return false;
  216. }
  217. $("#menuDiv1>div,#menuDiv2>div").each(function(){
  218. $(this).removeClass();
  219. });
  220. $(div).removeClass().addClass("menuDivLeft1");
  221. mainTree = new RoadUI.Tree({ id: "treeDiv", path: rootdir + "/Platform/Home/MenuRefresh.ashx?roleid=" + roleID + "&userid=" + userID + "&refreshid=" + id, refreshpath: rootdir + "/Platform/Home/MenuRefresh.ashx?roleid=" + roleID + "&userid=" + userID, showroot: true, showline:true, onclick: treeClick });
  222. }
  223. function changeTheme(themeName, isCng)
  224. {
  225. if (!themeName || themeName.toString().trim().length == 0)
  226. {
  227. themeName = $.cookies.get("theme_platform")
  228. }
  229. $("span[class^='mainTheme_']").each(function ()
  230. {
  231. var cssName = $(this).attr("class");
  232. $(this).removeClass().addClass(cssName.replace("1", ""));
  233. });
  234. try
  235. {
  236. themeName=themeName.toLowerCase();
  237. var current=$(".mainTheme_" + themeName)||$(".mainTheme_" + themeName+"1");
  238. current.removeClass().addClass("mainTheme_" + themeName + "1");
  239. }
  240. catch(e){}
  241. if(isCng)
  242. {
  243. RoadUI.Core.allFrames = [];
  244. RoadUI.Core.getAllFrames();
  245. for (var i = 0; i < RoadUI.Core.allFrames.length; i++)
  246. {
  247. $("#style_style", RoadUI.Core.allFrames[i].document).attr("href", rootdir + "/Themes/" + themeName + "/Style/style.css");
  248. $("#style_ui", RoadUI.Core.allFrames[i].document).attr("href", rootdir + "/Themes/" + themeName + "/Style/ui.css");
  249. }
  250. $.cookies.set("theme_platform", themeName, { expiresAt: new Date(2099, 1, 1) });
  251. }
  252. }
  253. function login()
  254. {
  255. openApp(rootdir + "/Login1.aspx?session=1",1,"用户登录","login",400,230);
  256. }
  257. </script>
  258. </body>
  259. </html>