SchoolNotice.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. readOnly: true
  61. }, {
  62. xtype: "textfield",
  63. name: "notify_title",
  64. fieldLabel: "标题",
  65. columnWidth: 1,
  66. allowBlank: false
  67. }, {
  68. xtype: "textareafield",//文本域
  69. name: 'notify_details',
  70. fieldLabel: "内容",
  71. height: 300,
  72. columnWidth: 1,
  73. allowBlank: false
  74. }, {
  75. xtype: 'mfilefield',
  76. name: 'accessory',
  77. fieldLabel: '附件'
  78. }],
  79. applyBtns: [{
  80. apply: true,
  81. text: '保存',
  82. bind: {
  83. hidden: '{!showSaveBtn || notify_status == 1}',
  84. disabled: '{!base.valid}'
  85. }
  86. }],
  87. toolBtns: [{
  88. xtype: 'button',
  89. text: '发布',
  90. hidden: true,
  91. bind: {
  92. hidden: '{!notify_id || notify_status == 1}'
  93. },
  94. handler: 'onPublish'
  95. }]
  96. });
  97. this.callParent();
  98. },
  99. listeners: {
  100. load: function(form, data) {
  101. let fileField = form.down('mfilefield');
  102. fileField.value = data.main.accessory
  103. fileField.renderMF(fileField);
  104. }
  105. }
  106. });