1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- define(function (require) {
- return function (context) {
- var $dlg;
- return {
- xtype: 'dialog',
- dialogId: 'dialogDictList',
- title: '添加字典详情',
- width: 360,
- height: 400,
- onOpen: function () {
- $dlg = $(this);
- $dlg.formSet(context.row);
- },
- center: {
- items: {
- xtype: 'form',
- items: [
- [{name: 'dictCode', xtype: 'hidden'}],
- [{label: '字典内容', name: 'dictList', required: true}],
- [{label: '字典值', name: 'dictValue', required: true}],
- [{label: '自定义1', name: 'udf1'}],
- [{label: '自定义2', name: 'udf2'}],
- [{label: '自定义3', name: 'udf3'}]
- ]
- }
- },
- buttons: [
- {
- text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
- $dlg.window('close');
- }
- },
- {
- text: '保存', iconCls: 'fa fa-save', onClick: function () {
- var newData = $dlg.formGet();
- if (newData.dictValue == null || newData.dictValue === '') {
- $.yvan.msg('字典值必填');
- return;
- }
- if (newData.dictList == null || newData.dictList === '') {
- $.yvan.msg('字典内容必填');
- return
- }
- $.yvan.ajax({
- url: api('/sys/dict/addList'),
- contentType: 'application/json; charset=utf-8',
- data: JSON.stringify(newData),
- method: 'post',
- success: function (data) {
- $.yvan.msg(data.msg);
- $dlg.window('close');
- context.confirm();
- },
- error: function (data) {
- $.yvan.msg(data.msg);
- }
- })
- }
- }
- ]
- }
- }
- });
|