123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- define(function (require) {
- return function (context) {
- var $dlg, $form;
- //获取平台列表
- function getSysList() {
- var _datas = [];
- $.yvan.ajax({
- url: api('/sys/system/query'),
- data: {status: 1},
- method: 'post',
- async: false,
- success: function (data) {
- if (data.data != null && data.data != undefined) {
- for (var i = 0; i < data.data.length; i++) {
- _datas.push({
- "id": data.data[i].sysId,
- "text": data.data[i].sysName
- })
- }
- }
- }
- });
- return _datas;
- }
- return {
- xtype: 'dialog',
- dialogId: 'dialogApp',
- title: '应用程序信息',
- width: 650,
- height: 400,
- onOpen: function () {
- $dlg = $(this);
- if (context.isEdit) {
- $.yvan.ajax({
- loadingMask: false,
- url: api('/sys/sysApp/getById'),
- type: 'GET',
- data: {
- appId: context.appId
- },
- success: function (data) {
- $dlg.find('form');
- if (!isNotNull(data) || !isNotNull(data.data)) {
- return;
- }
- $form.formSet(data.data);
- }
- });
- } else {
- $form.formSet({
- beActive: 'Y',
- status: 1,
- sysId: context.sysId
- });
- }
- },
- center: {
- items: {
- xtype: 'formgroup',
- onRender: function () {
- $form = $(this);
- },
- items: [{name: 'appId', xtype: 'hidden'},
- [{
- name: 'sysId',
- label: '所属平台',
- xtype: 'yvselect',
- required: true,
- width: 350,
- //disabled: context.isEdit ? "disabled" : "",
- data: getSysList()
- }],
- {name: 'appName', label: '程序名称', required: true, span: 2},
- [{name: 'appCode', label: '程序编码', required: true, span: 2}],
- [{
- name: 'appType', label: '程序类型', xtype: 'yvselect', required: true,
- data: $.yvan.bizDict('appType').combo()
- }, {
- name: 'status', label: '启用状态', xtype: 'yvselect', required: true,
- data: $.yvan.bizDict('status').combo()
- }],
- [{name: 'appExe', label: '文件名'}, {name: 'appKey', label: 'key'}],
- {name: 'appDesp', label: '文件描述', span: 2, height: '90px', multiline: true},
- ]
- }
- },
- buttons: [
- {
- text: "保存", iconCls: "fa fa-save", onClick: function () {
- $.yvan.postForm($form, {
- url: (context.isEdit ? api('/sys/sysApp/update') : api('/sys/sysApp/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');
- }
- }
- ]
- };
- };
- });
|