index.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. {% extends "base.html" %}
  2. {% block title %}
  3. 权限管理系统
  4. {% endblock %}
  5. {% block head %}
  6. <style type="text/css">
  7. .tree li {
  8. padding: 5px 0;
  9. }
  10. .sidebar-nav {
  11. padding: 9px 0;
  12. }
  13. </style>
  14. <link rel="stylesheet" href="{{ url_for('static', filename='BlueNileAamin/lib/bootstrap/css/bootstrap.css') }}"
  15. type="text/css">
  16. <link rel="stylesheet" href="{{ url_for('static', filename='BlueNileAamin/stylesheets/theme.css') }}"
  17. type="text/css">
  18. <link rel="stylesheet"
  19. href="{{ url_for('static', filename='BlueNileAamin/lib/font-awesome/css/font-awesome.css') }}"
  20. type="text/css">
  21. <script type="text/javascript" src="{{ url_for('static', filename='BlueNileAamin/lib/bootstrap/js/bootstrap.js') }}"
  22. charset="utf-8"></script>
  23. <script type="text/javascript">
  24. var mainMenu;
  25. var mainTabs;
  26. var index_tabsMenu;
  27. $(function () {
  28. var loginFun = function () {
  29. if ($('#loginDialog form').form('validate')) {
  30. $('#loginBtn').linkbutton('disable');
  31. $.post(sy.contextPath + '/base/syuser!doNotNeedSessionAndSecurity_login.action', $('#loginDialog form').serialize(), function (result) {
  32. if (result.success) {
  33. $('#loginDialog').dialog('close');
  34. } else {
  35. $.messager.alert('提示', result.msg, 'error', function () {
  36. $('#loginDialog form :input:eq(1)').focus();
  37. });
  38. }
  39. $('#loginBtn').linkbutton('enable');
  40. }, 'json');
  41. }
  42. };
  43. $('#loginDialog').show().dialog({
  44. modal: true,
  45. closable: false,
  46. iconCls: 'ext-icon-lock_open',
  47. buttons: [{
  48. id: 'loginBtn',
  49. text: '登录',
  50. handler: function () {
  51. loginFun();
  52. }
  53. }],
  54. onOpen: function () {
  55. $('#loginDialog form :input[name="data.pwd"]').val('');
  56. $('form :input').keyup(function (event) {
  57. if (event.keyCode == 13) {
  58. loginFun();
  59. }
  60. });
  61. }
  62. }).dialog('close');
  63. $('#passwordDialog').show().dialog({
  64. modal: true,
  65. closable: true,
  66. iconCls: 'ext-icon-lock_edit',
  67. buttons: [{
  68. text: '修改',
  69. handler: function () {
  70. if ($('#passwordDialog form').form('validate')) {
  71. $.post(sy.contextPath + '/base/syuser!doNotNeedSecurity_updateCurrentPwd.action', {
  72. 'data.pwd': $('#pwd').val()
  73. }, function (result) {
  74. if (result.success) {
  75. $.messager.alert('提示', '密码修改成功!', 'info');
  76. $('#passwordDialog').dialog('close');
  77. }
  78. }, 'json');
  79. }
  80. }
  81. }],
  82. onOpen: function () {
  83. $('#passwordDialog form :input').val('');
  84. }
  85. }).dialog('close');
  86. mainMenu = $('#mainMenu').tree({
  87. url: '/base/syresource!doNotNeedSecurity_getMainMenu.action',
  88. parentField: 'pid',
  89. onClick: function (node) {
  90. if (node.attributes.url) {
  91. var src = node.attributes.url;
  92. if (!sy.startWith(node.attributes.url, '/')) {
  93. src = node.attributes.url;
  94. }
  95. if (node.attributes.target && node.attributes.target.length > 0) {
  96. window.open(src, node.attributes.target);
  97. } else {
  98. var tabs = $('#mainTabs');
  99. var opts = {
  100. title: node.text,
  101. closable: true,
  102. iconCls: node.iconCls,
  103. content: sy.formatString('<iframe src="{0}" allowTransparency="true" style="border:0;width:100%;height:99%;" frameBorder="0"></iframe>', src),
  104. border: false,
  105. fit: true
  106. };
  107. if (tabs.tabs('exists', opts.title)) {
  108. tabs.tabs('select', opts.title);
  109. } else {
  110. tabs.tabs('add', opts);
  111. }
  112. }
  113. }
  114. }
  115. });
  116. $('#mainLayout').layout('panel', 'center').panel({
  117. onResize: function (width, height) {
  118. sy.setIframeHeight('centerIframe', $('#mainLayout').layout('panel', 'center').panel('options').height - 5);
  119. }
  120. });
  121. mainTabs = $('#mainTabs').tabs({
  122. fit: true,
  123. border: false,
  124. onContextMenu: function (e, title) {
  125. e.preventDefault();
  126. index_tabsMenu.menu('show', {
  127. left: e.pageX,
  128. top: e.pageY
  129. }).data('tabTitle', title);
  130. },
  131. tools: [{
  132. iconCls: 'ext-icon-arrow_up',
  133. handler: function () {
  134. mainTabs.tabs({
  135. tabPosition: 'top'
  136. });
  137. }
  138. }, {
  139. iconCls: 'ext-icon-arrow_left',
  140. handler: function () {
  141. mainTabs.tabs({
  142. tabPosition: 'left'
  143. });
  144. }
  145. }, {
  146. iconCls: 'ext-icon-arrow_down',
  147. handler: function () {
  148. mainTabs.tabs({
  149. tabPosition: 'bottom'
  150. });
  151. }
  152. }, {
  153. iconCls: 'ext-icon-arrow_right',
  154. handler: function () {
  155. mainTabs.tabs({
  156. tabPosition: 'right'
  157. });
  158. }
  159. }, {
  160. text: '刷新',
  161. iconCls: 'ext-icon-arrow_refresh',
  162. handler: function () {
  163. var panel = mainTabs.tabs('getSelected').panel('panel');
  164. var frame = panel.find('iframe');
  165. try {
  166. if (frame.length > 0) {
  167. for (var i = 0; i < frame.length; i++) {
  168. frame[i].contentWindow.document.write('');
  169. frame[i].contentWindow.close();
  170. frame[i].src = frame[i].src;
  171. }
  172. if (navigator.userAgent.indexOf("MSIE") > 0) {// IE特有回收内存方法
  173. try {
  174. CollectGarbage();
  175. } catch (e) {
  176. }
  177. }
  178. }
  179. } catch (e) {
  180. }
  181. }
  182. }, {
  183. text: '关闭',
  184. iconCls: 'ext-icon-cross',
  185. handler: function () {
  186. var index = mainTabs.tabs('getTabIndex', mainTabs.tabs('getSelected'));
  187. var tab = mainTabs.tabs('getTab', index);
  188. if (tab.panel('options').closable) {
  189. mainTabs.tabs('close', index);
  190. } else {
  191. $.messager.alert('提示', '[' + tab.panel('options').title + ']不可以被关闭!', 'error');
  192. }
  193. }
  194. }]
  195. });
  196. index_tabsMenu = $('#index_tabsMenu').menu({
  197. onClick: function (item) {
  198. var curTabTitle = $(this).data('tabTitle');
  199. var type = $(item.target).attr('title');
  200. if (type === 'refresh') {
  201. mainTabs.tabs('getTab', curTabTitle).panel('refresh');
  202. return;
  203. }
  204. if (type === 'close') {
  205. var t = mainTabs.tabs('getTab', curTabTitle);
  206. if (t.panel('options').closable) {
  207. mainTabs.tabs('close', curTabTitle);
  208. }
  209. return;
  210. }
  211. var allTabs = mainTabs.tabs('tabs');
  212. var closeTabsTitle = [];
  213. $.each(allTabs, function () {
  214. var opt = $(this).panel('options');
  215. if (opt.closable && opt.title != curTabTitle && type === 'closeOther') {
  216. closeTabsTitle.push(opt.title);
  217. } else if (opt.closable && type === 'closeAll') {
  218. closeTabsTitle.push(opt.title);
  219. }
  220. });
  221. for (var i = 0; i < closeTabsTitle.length; i++) {
  222. mainTabs.tabs('close', closeTabsTitle[i]);
  223. }
  224. }
  225. });
  226. });
  227. </script>
  228. {% endblock %}
  229. {% block body %}
  230. <body id="mainLayout" class="easyui-layout">
  231. <div data-options="region:'north',href:'{{ url_for('.north') }}'"
  232. style="height: 60px; overflow: hidden;background-color:#0070EA" class="logo"></div>
  233. <div data-options="region:'west',href:'{{ url_for('.west') }}',split:false"
  234. style="width: 200px;">
  235. <!-- <ul id="mainMenu"></ul> -->
  236. </div>
  237. <div data-options="region:'center'" style="overflow: hidden;">
  238. <div id="mainTabs">
  239. <div title="首页" data-options="iconCls:'ext-icon-house'">
  240. <iframe src="" allowTransparency="true"
  241. style="border: 0; width: 100%; height: 99%;" frameBorder="0"></iframe>
  242. </div>
  243. </div>
  244. </div>
  245. <div data-options="region:'south',href:'{{ url_for('.south') }}',border:false"
  246. style="height: 30px; overflow: hidden;"></div>
  247. <div id="index_tabsMenu" style="width: 120px; display: none;">
  248. <div title="refresh" data-options="iconCls:'transmit'">刷新</div>
  249. <div class="menu-sep"></div>
  250. <div title="close" data-options="iconCls:'delete'">关闭</div>
  251. <div title="closeOther" data-options="iconCls:'delete'">关闭其他</div>
  252. <div title="closeAll" data-options="iconCls:'delete'">关闭所有</div>
  253. </div>
  254. <div id="loginDialog" title="解锁登录" style="display: none;">
  255. <form method="post" class="form" onsubmit="return false;">
  256. <table class="table">
  257. <tr>
  258. <th width="50">登录名</th>
  259. <td>{{ current_user.LOGINNAME }}<input name="data.loginname" readonly="readonly"
  260. type="hidden"
  261. value="{{ current_user.LOGINNAME }}"/>
  262. </td>
  263. </tr>
  264. <tr>
  265. <th>密码</th>
  266. <td><input name="data.pwd" type="password" class="easyui-validatebox"
  267. data-options="required:true"/></td>
  268. </tr>
  269. </table>
  270. </form>
  271. </div>
  272. <div id="passwordDialog" title="修改密码" style="display: none;">
  273. <form method="post" class="form" onsubmit="return false;">
  274. <table class="table">
  275. <tr>
  276. <th>新密码</th>
  277. <td><input id="pwd" name="data.pwd" type="password" class="easyui-validatebox"
  278. data-options="required:true"/></td>
  279. </tr>
  280. <tr>
  281. <th>重复密码</th>
  282. <td><input type="password" class="easyui-validatebox"
  283. data-options="required:true,validType:'eqPwd[\'#pwd\']'"/></td>
  284. </tr>
  285. </table>
  286. </form>
  287. </div>
  288. </body>
  289. {% endblock %}