Pressure.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. Ext.define('erp.view.plm.test.Pressure',{
  2. extend: 'Ext.Viewport',
  3. layout: 'border',
  4. hideBorders: true,
  5. initComponent : function(){
  6. var me = this;
  7. Ext.apply(me, {
  8. items: [{
  9. xtype: 'erpTreePanel',
  10. tbar: null,
  11. width: '25%',
  12. dockedItems: null
  13. },{
  14. xtype: 'panel',
  15. id: 'testpage',
  16. region: 'center',
  17. bodyStyle: 'background:#f1f1f1;',
  18. html: '<iframe id="iframe_test" src="' + basePath + 'resource/images/screens/noselect.png" height="100%" width="100%" frameborder="0" style="border-width: 0px;" scrolling="auto"></iframe>'
  19. },{
  20. xtype: 'form',
  21. id: 'testcontent',
  22. region: 'east',
  23. width: '25%',
  24. layout: 'column',
  25. bodyStyle: 'background:#f1f1f1;',
  26. items: [{
  27. xtype: 'displayfield',
  28. fieldLabel: '测试页面',
  29. labelWidth: 70,
  30. columnWidth: 1,
  31. id: 't_page',
  32. name: 't_page',
  33. fieldStyle: 'color:blue;'
  34. },{
  35. xtype: 'fieldcontainer',
  36. fieldLabel: '压力指数',
  37. labelWidth: 70,
  38. columnWidth: 1,
  39. layout: 'column',
  40. items: [{
  41. xtype: 'combobox',
  42. id: 't_count',
  43. editable: false,
  44. value: 10,
  45. columnWidth: 0.35,
  46. store: Ext.create('Ext.data.Store', {
  47. fields: ['display', 'value'],
  48. data : [
  49. {"display": 10, "value": 10},
  50. {"display": 20, "value": 20},
  51. {"display": 50, "value": 50},
  52. {"display": 100, "value": 100},
  53. {"display": 200, "value": 200},
  54. {"display": 500, "value": 500},
  55. {"display": 1000, "value": 1000}
  56. ]
  57. }),
  58. displayField: 'display',
  59. valueField: 'value',
  60. queryMode: 'local',
  61. listeners: {
  62. change: function(f){
  63. switch(f.value){
  64. /*case 10:
  65. Ext.getCmp('t_level').setValue('※');break;
  66. case 20:
  67. Ext.getCmp('t_level').setValue('※ ※');break;
  68. case 50:
  69. Ext.getCmp('t_level').setValue('※ ※ ※');break;
  70. case 100:
  71. Ext.getCmp('t_level').setValue('※ ※ ※ ※');break;
  72. case 200:
  73. Ext.getCmp('t_level').setValue('※ ※ ※ ※ ※');break;
  74. case 1000:
  75. Ext.getCmp('t_level').setValue('※ ※ ※ ※ ※ ');break;*/
  76. }
  77. }
  78. }
  79. },{
  80. xtype: 'displayfield',
  81. columnWidth: 0.65,
  82. value: '※',
  83. id: 't_level',
  84. fieldStyle: 'color:red;'
  85. }]
  86. },{
  87. xtype: 'button',
  88. text: '生成模拟数据',
  89. id: 't_input',
  90. columnWidth: 0.8,
  91. iconCls: 'x-button-icon-download',
  92. },{
  93. xtype: 'displayfield',
  94. columnWidth: 0.2,
  95. value: '※',
  96. id: 't_level1',
  97. fieldStyle: 'color:red;'
  98. },{
  99. xtype: 'button',
  100. text: '保存',
  101. id: 't_save',
  102. columnWidth: 1/3,
  103. iconCls: 'x-button-icon-save'
  104. },{
  105. xtype: 'button',
  106. text: '提交',
  107. disabled:true,
  108. id: 't_submit',
  109. columnWidth: 1/3,
  110. iconCls: 'x-button-icon-submit'
  111. },{
  112. xtype: 'button',
  113. text: '审核',
  114. disabled:true,
  115. id: 't_audit',
  116. columnWidth: 1/3,
  117. iconCls: 'x-button-icon-check'
  118. },{
  119. xtype: 'button',
  120. text: '清空结果',
  121. columnWidth: 0.5,
  122. iconCls: 'x-button-icon-delete',
  123. handler: function(btn){
  124. btn.ownerCt.down('#t_result').setValue('测试结果:');
  125. }
  126. },{
  127. xtype: 'button',
  128. text: '清除测试数据',
  129. columnWidth: 0.5,
  130. iconCls: 'x-button-icon-close',
  131. id: 't_clear'
  132. },{
  133. xtype: 'textarea',
  134. height: 480,
  135. columnWidth: 1,
  136. id: 't_result',
  137. value: '测试结果:',
  138. readOnly: true
  139. },{
  140. xtype: 'hidden',
  141. id: 'codeString'
  142. }],
  143. buttonAlign: 'center',
  144. buttons: [{
  145. text: '分析测试结果',
  146. width: 100,
  147. cls: 'x-btn-gray',
  148. id: 't_analyse'
  149. },{
  150. text: '生成测试报告',
  151. width: 100,
  152. cls: 'x-btn-gray',
  153. id: 't_report'
  154. }]
  155. }]
  156. });
  157. me.callParent(arguments);
  158. }
  159. });