List.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /**
  2. * 出入校记录
  3. */
  4. Ext.define('school.view.interaction.access.List', {
  5. extend: 'school.view.core.base.BasePanel',
  6. xtype: 'interaction-access-list',
  7. // dataUrl: 'http://10.1.80.180:9520/api/school/record/list',
  8. dataUrl: '/api/school/record/list',
  9. initComponent: function () {
  10. var me = this;
  11. Ext.apply(this, {
  12. searchField: [{
  13. xtype: 'textfield',
  14. name: 'keyword',
  15. fieldLabel: '姓名'
  16. }, {
  17. xtype: 'gradecombo',
  18. name: 'grade_name',
  19. fieldLabel: '年级',
  20. listeners: {
  21. select: function (combo, record, eOpts) {
  22. combo.up('form').getForm().findField('clazz_name').setValue(null);
  23. }
  24. }
  25. }, {
  26. xtype: 'classcombo',
  27. name: 'clazz_name',
  28. fieldLabel: '班级',
  29. listeners: {
  30. expand: function (combo, eOpts) {
  31. combo.store.clearFilter();
  32. var gradeCombo = combo.up('form').getForm().findField('grade_name');
  33. var gradeName = gradeCombo.getValue();
  34. var filter = new Ext.util.Filter({
  35. property: 'gradeName',
  36. value: gradeName
  37. });
  38. if (!!gradeName) {
  39. combo.store.setFilters([filter]);
  40. }
  41. },
  42. select: function (combo, record, eOpts) {
  43. combo.up('form').getForm().findField('grade_name').setValue(record.get('gradeName'));
  44. }
  45. }
  46. }],
  47. caller: null,
  48. _formXtype: null,
  49. _title: null,
  50. _deleteUrl: null,
  51. _batchOpenUrl: null,
  52. _batchCloseUrl: null,
  53. _batchDeleteUrl: null,
  54. gridConfig: {
  55. idField: null,
  56. codeField: null,
  57. statusCodeField: null,
  58. dataUrl: me.dataUrl,
  59. caller: null,
  60. rootProperty: 'data.list',
  61. totalProperty: 'data.total',
  62. actionColumn: [],
  63. selModel: {
  64. type: 'cellmodel'
  65. },
  66. hiddenTools: true,
  67. disableDetail: true,
  68. toolBtns: [],
  69. columns: [{
  70. text: 'id',
  71. dataIndex: 'record_id',
  72. hidden: true
  73. }, {
  74. text: '类型',
  75. dataIndex: 'record_name'
  76. }, {
  77. text: '学号',
  78. dataIndex: 'stu_number'
  79. }, {
  80. text: '姓名',
  81. dataIndex: 'stu_name'
  82. }, {
  83. text: '年级',
  84. dataIndex: 'grade_name'
  85. }, {
  86. text: '班级',
  87. dataIndex: 'clazz_name'
  88. }, {
  89. text: '时间',
  90. dataIndex: 'in_date',
  91. xtype: 'datecolumn',
  92. format: 'Y-m-d H:i:s',
  93. width: 150,
  94. renderer: function(v, m, r) {
  95. if(r.get('record_name') == '入校记录') {
  96. return r.get('in_date');
  97. }else {
  98. return r.get('out_date');
  99. }
  100. }
  101. }]
  102. },
  103. });
  104. this.callParent(arguments);
  105. }
  106. });