12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- define(function (require) {
- return function (context) {
- var $dlg, $form;
- return {
- xtype: 'dialog',
- dialogId: 'dialog5',
- title: '文件信息',
- width: 650,
- height: 350,
- onOpen: function () {
- $dlg = $(this);
- if (context.isEdit) {
- $.yvan.ajax({
- loadingMask: false,
- url: api('/sys/sysAppFile/getById'),
- type: 'GET',
- data: {
- fileId: context.fileId
- // verId: context.verId,
- // appId: context.appId
- },
- success: function (data) {
- $dlg.find('form');
- // 日期格式化
- $form.formSet(data.data);
- //$('body').item('appName').textbox('setValue', curSysApp.appName);
- }
- });
- } else {
- //文件上传这里没有新增的情况
- }
- },
- center: {
- items: {
- xtype: 'formgroup',
- onRender: function () {
- $form = $(this);
- },
- items: [
- {name: 'fileId', xtype: 'hidden'},
- {name: 'verId', xtype: 'hidden'},
- {name: 'appName', label: '程序名称', xtype: 'hidden', readonly: true},
- {name: 'appId', label: '程序编号', xtype: 'hidden'},
- [{name: 'fileName', label: '文件名称', span: 2, readonly: true}],
- [{name: 'fileMd5', label: 'MD5', span: 2, readonly: true}],
- [{
- name: 'fileSize', label: '大小(字节)', readonly: true, formatter: function (value) {
- return value;
- }
- }],
- [{name: 'fileUrl', label: '文件下载路径', span: 2, required: true}],
- [{name: 'filePath', label: '文件存放路径', span: 2, required: true}],
- // {
- // name: 'verType',
- // label: '文件类型',
- // xtype: 'yvselect',
- // required: true,
- // data: $.yvan.bizDict('appFileType').combo()
- // },
- //{name: 'timeCreate', label: '新增时间', readonly: true},
- ]
- }
- },
- buttons: [
- {
- text: "提交", iconCls: "fa fa-save", onClick: function () {
- $.yvan.postForm($form, {
- url: api('/sys/sysAppFile/update'),
- success: function () {
- $.yvan.msg('操作成功');
- $dlg.window('close');
- if ($.type(context.confirm) === 'function') {
- context.confirm();
- }
- }
- });
- }
- }, {
- text: "关闭", iconCls: "fa fa-times", onClick: function () {
- $dlg.dialog('close');
- }
- }
- ]
- };
- };
- });
|