dialogAppFileInfo.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. define(function (require) {
  2. return function (context) {
  3. var $dlg, $form;
  4. return {
  5. xtype: 'dialog',
  6. dialogId: 'dialog5',
  7. title: '文件信息',
  8. width: 650,
  9. height: 350,
  10. onOpen: function () {
  11. $dlg = $(this);
  12. if (context.isEdit) {
  13. $.yvan.ajax({
  14. loadingMask: false,
  15. url: api('/sys/sysAppFile/getById'),
  16. type: 'GET',
  17. data: {
  18. fileId: context.fileId
  19. // verId: context.verId,
  20. // appId: context.appId
  21. },
  22. success: function (data) {
  23. $dlg.find('form');
  24. // 日期格式化
  25. $form.formSet(data.data);
  26. //$('body').item('appName').textbox('setValue', curSysApp.appName);
  27. }
  28. });
  29. } else {
  30. //文件上传这里没有新增的情况
  31. }
  32. },
  33. center: {
  34. items: {
  35. xtype: 'formgroup',
  36. onRender: function () {
  37. $form = $(this);
  38. },
  39. items: [
  40. {name: 'fileId', xtype: 'hidden'},
  41. {name: 'verId', xtype: 'hidden'},
  42. {name: 'appName', label: '程序名称', xtype: 'hidden', readonly: true},
  43. {name: 'appId', label: '程序编号', xtype: 'hidden'},
  44. [{name: 'fileName', label: '文件名称', span: 2, readonly: true}],
  45. [{name: 'fileMd5', label: 'MD5', span: 2, readonly: true}],
  46. [{
  47. name: 'fileSize', label: '大小(字节)', readonly: true, formatter: function (value) {
  48. return value;
  49. }
  50. }],
  51. [{name: 'fileUrl', label: '文件下载路径', span: 2, required: true}],
  52. [{name: 'filePath', label: '文件存放路径', span: 2, required: true}],
  53. // {
  54. // name: 'verType',
  55. // label: '文件类型',
  56. // xtype: 'yvselect',
  57. // required: true,
  58. // data: $.yvan.bizDict('appFileType').combo()
  59. // },
  60. //{name: 'timeCreate', label: '新增时间', readonly: true},
  61. ]
  62. }
  63. },
  64. buttons: [
  65. {
  66. text: "提交", iconCls: "fa fa-save", onClick: function () {
  67. $.yvan.postForm($form, {
  68. url: api('/sys/sysAppFile/update'),
  69. success: function () {
  70. $.yvan.msg('操作成功');
  71. $dlg.window('close');
  72. if ($.type(context.confirm) === 'function') {
  73. context.confirm();
  74. }
  75. }
  76. });
  77. }
  78. }, {
  79. text: "关闭", iconCls: "fa fa-times", onClick: function () {
  80. $dlg.dialog('close');
  81. }
  82. }
  83. ]
  84. };
  85. };
  86. });