define(function (require) { return function (context) { var $dlg, $form; return { xtype: 'dialog', dialogId: 'dialogImport', title: 'Excel导入信息', width: 650, height: 350, onOpen: function () { loadingMask: false, $dlg = $(this); if (context.isEdit) { $.yvan.ajax({ type: 'GET', url: api('/sys/sysImport/getById'), data: { importId: context.importId }, success: function (data) { $dlg.find('form'); $form.formSet(data.data); } }); } else { // 点击新增按钮时操作: /*$(this).up('power').down('formgroup').formSet({ // bcuId: context.bcuId, userId: context.userId, userName: context.userName });*/ } }, center: { items: { xtype: 'formgroup', subLabelWidth: '100', subControlWidth: '200', onRender: function () { $form = $(this); }, items: [[ {name: 'id', xtype: 'hidden'}, { label: '表名', name: 'tbName', ff: 500, xtype: 'yvselect', required: true, data: $.yvan.sysDict('tbName').combo() },// 需要在字典管理菜单设置值 {label: '启用状态', name: 'status', xtype: 'hidden', value: 0}// 通过value赋值提供下拉框默认值 ]] } }, buttons: [ { text: "提交", iconCls: "fa fa-save", onClick: function () { $.yvan.postForm($form, { url: (context.isEdit ? api('/sys/sysImport/updateCaoGao') : api('/sys/sysImport/insert')), success: function () { $.yvan.msg('操作成功'); $dlg.window('close'); if ($.type(context.confirm) === 'function') { context.confirm(); } } }); } }, { text: "关闭", iconCls: "fa fa-times", onClick: function () { $dlg.dialog('close'); } } ] }; }; });