SchoolNotice.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /**
  2. * 学校通知
  3. */
  4. Ext.define('school.view.interaction.notice.SchoolNotice', {
  5. extend: 'school.view.core.form.FormPanel',
  6. xtype: 'interaction-notice-schoolnotice',
  7. controller: 'interaction-notice-schoolnotice',
  8. // viewModel: 'purchase-purchase-formpanel',
  9. //字段属性
  10. _title: '学校通知',
  11. _idField: 'notify_id',
  12. _codeField: null,
  13. // _readUrl: 'http://10.1.80.180:9520/api/school/notice/read',
  14. _readUrl: '/api/school/notice/read',
  15. // _saveUrl: 'http://10.1.80.180:9520/api/school/notice/save',
  16. _saveUrl: '/api/school/notice/save',
  17. _deleteUrl: '/api/school/notice/delete',
  18. initId: 0,
  19. initComponent: function () {
  20. Ext.apply(this, {
  21. defaultItems: [{
  22. xtype: 'hidden',
  23. name: 'notify_id',
  24. fieldLabel: 'id'
  25. }, {
  26. xtype: "textfield",
  27. name: "notify_creator",
  28. fieldLabel: "发布人id",
  29. columnWidth: 0.5,
  30. defaultValue: school.util.BaseUtil.getCurrentUser().id,
  31. hidden: true
  32. }, {
  33. xtype: "textfield",
  34. name: "creator",
  35. fieldLabel: "发布人",
  36. columnWidth: 0.5,
  37. defaultValue: school.util.BaseUtil.getCurrentUser().username,
  38. readOnly: true
  39. }, {
  40. xtype: 'combobox',
  41. name: 'notify_status',
  42. fieldLabel: '发布状态',
  43. displayField: 'name',
  44. valueField: 'value',
  45. editable: false,
  46. readOnly: true,
  47. defaultValue: 2,
  48. store: Ext.create('Ext.data.ArrayStore', {
  49. fields: ['name', 'value'],
  50. data: [['未发布', 2], ['已发布', 1]]
  51. }),
  52. minChars: 0,
  53. queryMode: 'local'
  54. }, {
  55. xtype: 'datefield',
  56. name: 'publish_date',
  57. fieldLabel: '发布时间',
  58. readOnly: true,
  59. format: 'Y-m-d H:i:s',
  60. defaultValue: new Date(),
  61. readOnly: true
  62. }, {
  63. xtype: "textfield",
  64. name: "notify_title",
  65. fieldLabel: "标题",
  66. columnWidth: 1,
  67. allowBlank: false
  68. }, {
  69. xtype: "textareafield",//文本域
  70. name: 'notify_details',
  71. fieldLabel: "内容",
  72. height: 300,
  73. columnWidth: 1,
  74. allowBlank: false
  75. }, {
  76. xtype: 'mfilefield',
  77. name: 'accessory',
  78. fieldLabel: '附件'
  79. }],
  80. applyBtns: [{
  81. apply: true,
  82. text: '保存',
  83. bind: {
  84. hidden: '{!showSaveBtn || notify_status == 1}',
  85. disabled: '{!base.valid}'
  86. }
  87. }],
  88. toolBtns: [{
  89. xtype: 'button',
  90. text: '发布',
  91. hidden: true,
  92. bind: {
  93. hidden: '{!notify_id || notify_status == 1}'
  94. },
  95. handler: 'onPublish'
  96. }]
  97. });
  98. this.callParent();
  99. },
  100. listeners: {
  101. load: function(form, data) {
  102. let fileField = form.down('mfilefield');
  103. fileField.value = data.main.accessory
  104. fileField.renderMF(fileField);
  105. }
  106. }
  107. });