dialogAppVer.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. define(function (require) {
  2. return function (context) {
  3. var $dlg, $form;
  4. var curSysApp;
  5. return {
  6. xtype: 'dialog',
  7. dialogId: 'dialogAppVer',
  8. title: '程序版本信息',
  9. width: 650,
  10. height: 400,
  11. onOpen: function () {
  12. $dlg = $(this);
  13. if (context.isEdit) {
  14. $.yvan.ajax({
  15. loadingMask: false,
  16. url: api('/sys/sysAppVer/getById'),
  17. type: 'GET',
  18. data: {
  19. verId: context.verId
  20. },
  21. success: function (data) {
  22. if (!isNotNull(data) || !isNotNull(data.data)) {
  23. return;
  24. }
  25. curSysApp = data.data.sysApp;
  26. console.log(curSysApp);
  27. $dlg.find('form');
  28. // 日期格式化
  29. data.data.timeTest = $.yvan.ts(data.data.timeTest);
  30. data.data.timePublish = $.yvan.ts(data.data.timePublish);
  31. $form.formSet(data.data);
  32. $('body').item('appName').textbox('setValue', curSysApp.appName);
  33. }
  34. });
  35. } else {
  36. //$('body').item('appId').textbox('setValue', context.appId);
  37. $.yvan.ajax({
  38. loadingMask: false,
  39. url: api('/sys/sysAppVer/getNewAppVer'),
  40. type: 'GET',
  41. data: {
  42. appId: context.appId
  43. },
  44. success: function (data) {
  45. curSysApp = data.data.sysApp;
  46. console.log(curSysApp);
  47. $dlg.find('form');
  48. $form.formSet(data.data);
  49. $('body').item('appName').textbox('setValue', curSysApp.appName);
  50. }
  51. });
  52. }
  53. },
  54. center: {
  55. items: {
  56. xtype: 'formgroup',
  57. onRender: function () {
  58. $form = $(this);
  59. },
  60. items: [
  61. {name: 'verId', xtype: 'hidden'},
  62. {name: 'appId', label: '程序编号', xtype: 'hidden'},
  63. [{name: 'appName', label: '程序名称', span: 2, readonly: true}],
  64. [{name: 'guid', label: 'guid', xtype: 'hidden', readonly: true, span: 2}],
  65. [{name: 'verCode', label: '版本编码', required: true},
  66. {name: 'verNo', label: '版本号', required: true, maxlength: 9,disabled: context.isEdit ? "disabled" : "",}],
  67. [{
  68. name: 'verType',
  69. label: '版本类型',
  70. xtype: 'yvselect',
  71. required: true,
  72. data: $.yvan.bizDict('appVerType').combo()
  73. },
  74. {
  75. name: 'status',
  76. label: '发布状态',
  77. xtype: 'yvselect',
  78. required: true,
  79. data: $.yvan.bizDict('appVerStatus').combo()
  80. }],
  81. {name: 'comVer', label: '通用组件', xtype: 'hidden'},
  82. // [{
  83. // name: 'comVer', label: '通用组件', xtype: 'searchbox', width: '400px',
  84. // widget: {
  85. // url: '/app/sys/app/dialogAppVerBindCom.js',
  86. // bind: {
  87. // matcQc: 'matcId',
  88. // matcName: 'matcName'
  89. // },
  90. // queryParams: {matcBusi: MATC_BUSI_检验}
  91. // },
  92. // labelWidth: '120px',
  93. // width: '350px',
  94. // }],
  95. [{name: 'timeTest', label: '内测时间', xtype: 'datebox', labelWidth: '120px'},
  96. {name: 'timePublish', label: '发布时间', xtype: 'datebox', labelWidth: '120px'}],
  97. [{name: 'verDesp', label: '版本介绍', span: 2, height: '60px', multiline: true}]
  98. ]
  99. }
  100. },
  101. buttons: [
  102. {
  103. text: "保存", iconCls: "fa fa-save", onClick: function () {
  104. $.yvan.postForm($form, {
  105. url: (context.isEdit ? api('/sys/sysAppVer/update') : api('/sys/sysAppVer/insert')),
  106. success: function () {
  107. $.yvan.msg('保存成功');
  108. $dlg.window('close');
  109. if ($.type(context.confirm) === 'function') {
  110. context.confirm();
  111. }
  112. },
  113. error: function (data) {
  114. }
  115. });
  116. }
  117. }, {
  118. text: "关闭", iconCls: "fa fa-times", onClick: function () {
  119. $dlg.dialog('close');
  120. }
  121. }
  122. ]
  123. };
  124. };
  125. });