123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- define(function (require) {
- return function (context) {
- var $dlg, $form;
- var curSysApp;
- return {
- xtype: 'dialog',
- dialogId: 'dialogAppVer',
- title: '程序版本信息',
- width: 650,
- height: 400,
- onOpen: function () {
- $dlg = $(this);
- if (context.isEdit) {
- $.yvan.ajax({
- loadingMask: false,
- url: api('/sys/sysAppVer/getById'),
- type: 'GET',
- data: {
- verId: context.verId
- },
- success: function (data) {
- if (!isNotNull(data) || !isNotNull(data.data)) {
- return;
- }
- curSysApp = data.data.sysApp;
- console.log(curSysApp);
- $dlg.find('form');
- // 日期格式化
- data.data.timeTest = $.yvan.ts(data.data.timeTest);
- data.data.timePublish = $.yvan.ts(data.data.timePublish);
- $form.formSet(data.data);
- $('body').item('appName').textbox('setValue', curSysApp.appName);
- }
- });
- } else {
- //$('body').item('appId').textbox('setValue', context.appId);
- $.yvan.ajax({
- loadingMask: false,
- url: api('/sys/sysAppVer/getNewAppVer'),
- type: 'GET',
- data: {
- appId: context.appId
- },
- success: function (data) {
- curSysApp = data.data.sysApp;
- console.log(curSysApp);
- $dlg.find('form');
- $form.formSet(data.data);
- $('body').item('appName').textbox('setValue', curSysApp.appName);
- }
- });
- }
- },
- center: {
- items: {
- xtype: 'formgroup',
- onRender: function () {
- $form = $(this);
- },
- items: [
- {name: 'verId', xtype: 'hidden'},
- {name: 'appId', label: '程序编号', xtype: 'hidden'},
- [{name: 'appName', label: '程序名称', span: 2, readonly: true}],
- [{name: 'guid', label: 'guid', xtype: 'hidden', readonly: true, span: 2}],
- [{name: 'verCode', label: '版本编码', required: true},
- {name: 'verNo', label: '版本号', required: true, maxlength: 9,disabled: context.isEdit ? "disabled" : "",}],
- [{
- name: 'verType',
- label: '版本类型',
- xtype: 'yvselect',
- required: true,
- data: $.yvan.bizDict('appVerType').combo()
- },
- {
- name: 'status',
- label: '发布状态',
- xtype: 'yvselect',
- required: true,
- data: $.yvan.bizDict('appVerStatus').combo()
- }],
- {name: 'comVer', label: '通用组件', xtype: 'hidden'},
- // [{
- // name: 'comVer', label: '通用组件', xtype: 'searchbox', width: '400px',
- // widget: {
- // url: '/app/sys/app/dialogAppVerBindCom.js',
- // bind: {
- // matcQc: 'matcId',
- // matcName: 'matcName'
- // },
- // queryParams: {matcBusi: MATC_BUSI_检验}
- // },
- // labelWidth: '120px',
- // width: '350px',
- // }],
- [{name: 'timeTest', label: '内测时间', xtype: 'datebox', labelWidth: '120px'},
- {name: 'timePublish', label: '发布时间', xtype: 'datebox', labelWidth: '120px'}],
- [{name: 'verDesp', label: '版本介绍', span: 2, height: '60px', multiline: true}]
- ]
- }
- },
- buttons: [
- {
- text: "保存", iconCls: "fa fa-save", onClick: function () {
- $.yvan.postForm($form, {
- url: (context.isEdit ? api('/sys/sysAppVer/update') : api('/sys/sysAppVer/insert')),
- success: function () {
- $.yvan.msg('保存成功');
- $dlg.window('close');
- if ($.type(context.confirm) === 'function') {
- context.confirm();
- }
- },
- error: function (data) {
- }
- });
- }
- }, {
- text: "关闭", iconCls: "fa fa-times", onClick: function () {
- $dlg.dialog('close');
- }
- }
- ]
- };
- };
- });
|