dbfind.jsp 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <%@ page language="java" contentType="text/html; charset=utf-8"
  2. pageEncoding="utf-8"%>
  3. <%
  4. String path = request.getContextPath();
  5. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  6. %>
  7. <!DOCTYPE html>
  8. <html>
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  11. <link rel="stylesheet" type="text/css" href="<%=basePath %>resource/ext/resources/css/ext-all-gray.css"/>
  12. <link rel="stylesheet" href="<%=basePath %>resource/css/main.css" type="text/css"></link>
  13. <style>
  14. .custom-grid-autoheight .x-grid-row, .custom-grid-autoheight .x-grid-row .x-grid-cell,.custom-grid-autoheight .x-grid-cell-inner {
  15. height: auto !important;
  16. white-space: normal;
  17. }
  18. </style>
  19. <script type="text/javascript" src="<%=basePath %>resource/ext/ext-all.js"></script>
  20. <script type="text/javascript" src="<%=basePath %>resource/i18n/i18n.js"></script>
  21. <script type="text/javascript" src="<%=basePath %>resource/ux/grid/GridHeaderFilters.js"></script>
  22. <script type="text/javascript" src="<%=basePath %>resource/ux/data/PagingMemoryProxy.js"></script>
  23. <script type="text/javascript">
  24. Ext.Loader.setConfig({
  25. enabled: true
  26. });//开启动态加载
  27. var key = getUrlParam('key');
  28. var keyValue = getUrlParam('keyValue');
  29. if(!Ext.isEmpty(keyValue)) {
  30. keyValue = keyValue.toUpperCase();
  31. } else
  32. keyValue = '';
  33. if(keyValue == 0 || keyValue == '0') {
  34. keyValue = '';
  35. }
  36. var caller = '';
  37. var keyField = '';
  38. var dbkind=getUrlParam('dbkind'), dbOrderby = getUrlParam('ob');
  39. var condition = dbkind || Ext.isEmpty(keyValue) ? "1=1" : 'upper(' + key + ") like '%" + keyValue.replace(/\'/g,"''") + "%'";
  40. var dbfind = getUrlParam('dbfind');
  41. var which = 'form';
  42. var triggerId = getUrlParam('trigger');
  43. var trigger = parent.Ext.getCmp(triggerId);
  44. var dbCondition = getUrlParam('dbCondition');
  45. var dbBaseCondition = getUrlParam('dbBaseCondition');
  46. var dbGridCondition = getUrlParam('dbGridCondition');
  47. if(!trigger || trigger.column || !trigger.ownerCt || trigger.hidden){//如果是grid的dbfind
  48. which = 'grid';
  49. caller = dbfind.split('|')[0];
  50. keyField = dbfind.split('|')[1];
  51. condition = Ext.isEmpty(keyValue)?"1=1":'upper(' + keyField + ") like '%" + keyValue.replace(/\'/g,"''") + "%'";
  52. if(dbGridCondition){
  53. condition=condition+" AND "+ decodeURIComponent(dbGridCondition).replace(/\s{1}IS\s{1}/g, '=');
  54. }
  55. } else {
  56. caller = getUrlParam('caller');
  57. }
  58. if(dbCondition){
  59. condition=condition+" AND "+ decodeURIComponent(dbCondition).replace(/\s{1}IS\s{1}/g, '=');
  60. }
  61. if(dbBaseCondition){
  62. condition=condition+" AND "+decodeURIComponent(dbBaseCondition).replace(/\s{1}IS\s{1}/g, '=').replace(/@/g,'%');
  63. }
  64. var page = 1;
  65. var value = 0;
  66. var total = 0;
  67. var dataCount = 0;
  68. var msg = '';
  69. var height = window.innerHeight;
  70. if(Ext.isIE){//ie不支持window.innerHeight;document.documentElement.clientHeight == 0
  71. height = screen.height*0.6;
  72. }
  73. var pageSize = parseInt(height*0.7/24);
  74. var dbfinds = [];
  75. Ext.application({
  76. name: 'erp',//为应用程序起一个名字,相当于命名空间
  77. appFolder: basePath+'app',//app文件夹所在路径
  78. controllers: [//声明所用到的控制层
  79. 'common.Dbfind'
  80. ],
  81. launch: function() {
  82. Ext.create('erp.view.common.dbfind.Viewport');
  83. }
  84. });
  85. //加上ctrl+alt+s键盘事件,自动跳转配置界面
  86. function onKeyDown(){
  87. if(Ext.isIE){
  88. document.body.attachEvent('onkeydown', function(){//ie的事件名称不同,也不支持addEventListener
  89. if(window.event.altKey && window.event.ctrlKey && window.event.keyCode == 83){
  90. openTable('Dbfind维护(' + caller + ')', "jsps/ma/dbFindSet.jsp?formCondition=ds_callerIS'" + caller + "'" +
  91. "&gridCondition=dd_callerIS'" + caller + "'");
  92. }
  93. });
  94. } else {
  95. document.body.addEventListener("keydown", function(e){
  96. if(Ext.isFF5){//firefox不支持window.event
  97. e = e || window.event;
  98. }
  99. if(e.altKey && e.ctrlKey && e.keyCode == 83){
  100. openTable('Dbfind维护(' + caller + ')', "jsps/ma/dbFindSet.jsp?formCondition=ds_callerIS'" + caller + "'" +
  101. "&gridCondition=dd_callerIS'" + caller + "'");
  102. }
  103. });
  104. }
  105. }
  106. function openTable(title, url){
  107. var panel = Ext.getCmp('datalist' + caller);
  108. var main = parent.Ext.getCmp("content-panel");
  109. if(!panel){
  110. panel = {
  111. title : caller,
  112. tag : 'iframe',
  113. tabConfig:{tooltip: title},
  114. frame : true,
  115. border : false,
  116. layout : 'fit',
  117. iconCls : 'x-tree-icon-tab-tab',
  118. html : '<iframe id="iframe_maindetail_pageSet" src="' + basePath + url + '" height="100%" width="100%" frameborder="0" scrolling="no"></iframe>',
  119. closable : true,
  120. listeners : {
  121. close : function(){
  122. main.setActiveTab(main.getActiveTab().id);
  123. }
  124. }
  125. };
  126. var p = main.add(panel);
  127. main.setActiveTab(p);
  128. }else{
  129. main.setActiveTab(panel);
  130. }
  131. }
  132. </script>
  133. </head>
  134. <body onload="onKeyDown();">
  135. </body>
  136. </html>