|
@ -1,19 +1,33 @@
|
|
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
|
|
|
<%@include file="/WEB-INF/ehr/commons/jsp/commonInclude.jsp" %>
|
|
|
<script src="${staticRoot}/lib/ligerui/plugins/ligerComboBox.js"></script>
|
|
|
<script src="${staticRoot}/lib/ehrjs/customCombo.js"></script>
|
|
|
<script src="${staticRoot}/lib/plugin/scrollbar/jquery.mCustomScrollbar.js"></script>
|
|
|
<script src="${staticRoot}/lib/ehrjs/formFieldTools.js"></script>
|
|
|
<script src="${staticRoot}/lib/ehrjs/toolBar.js"></script>
|
|
|
<script src="${staticRoot}/lib/module/ajax.js"></script>
|
|
|
<script src="${staticRoot}/lib/module/baseObject.js"></script>
|
|
|
<script src="${staticRoot}/lib/module/dataModel.js"></script>
|
|
|
|
|
|
<style>
|
|
|
.m-form-inline .m-form-group label{ width: 130px; }
|
|
|
.update-footer{right: 10px;bottom: 0;}
|
|
|
.add-image{margin-top: 4px;}
|
|
|
.m-form-group{margin-left: 20px !important;}
|
|
|
</style>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
var urls = {
|
|
|
update: "${contextRoot}/app/api/update",
|
|
|
create: "${contextRoot}/app/api/create",
|
|
|
existence: "${contextRoot}/app/api/existence",
|
|
|
apiEdit: "${contextRoot}/app/api/edit",
|
|
|
list: "${contextRoot}/app/api/list",
|
|
|
appCombo: "${contextRoot}/app/platform/list"
|
|
|
appCombo: "${contextRoot}/app/getAppList"
|
|
|
}
|
|
|
var model = ${model};
|
|
|
var mode = '${mode}';
|
|
|
//todo cyx 从上个页面获取信息
|
|
|
//var extParms = getEditParms();//其他信息
|
|
|
var extParms = parent.em.params;
|
|
|
var hasChildType;
|
|
|
var getChild = function (){
|
|
|
if(mode=='modify' || mode=='view' || extParms.upType==-1)
|
|
@ -47,7 +61,7 @@
|
|
|
var field = $(elm).attr('id');
|
|
|
var val = $('#' + field).val();
|
|
|
if(field=='ipt_api_name' && val!=model.name){
|
|
|
return uniqValid4List(urls.existence, "name="+val+" g1;parentId="+ model.parentId, "该应用代码已存在!");
|
|
|
return uniqValid4List(urls.existence, "name="+val+";parentId="+ model.parentId, "该应用代码已存在!");
|
|
|
}
|
|
|
});
|
|
|
|
|
@ -57,8 +71,8 @@
|
|
|
var initForm = function () {
|
|
|
var vo = [
|
|
|
{type: 'text', id: 'ipt_api_description', opts: {height: 100}},
|
|
|
{type: 'select', id: 'ipt_api_type', dictId: 46, opts: {disabled: mode=='modify', onSuccess: function (data) {
|
|
|
if(mode=='new'){
|
|
|
{type: 'select', id: 'ipt_api_type', dictId: 'APP_API_TYPE', opts: {disabled: mode=='modify', onSuccess: function (data) {
|
|
|
if(mode=='add'){
|
|
|
var newData = [];
|
|
|
switch (parseInt(extParms.upType)){
|
|
|
case -1: $.each(data, function (i, v) {if(v.code==2) newData.push(v);}); break;
|
|
@ -97,9 +111,9 @@
|
|
|
validator.reset();
|
|
|
}
|
|
|
}},
|
|
|
{type: 'select', id: 'ipt_api_openLevel', dictId: 40, opts:{initVal: mode=='new'? '1': undefined}},
|
|
|
{type: 'select', id: 'ipt_api_auditLevel', dictId: 41, opts:{initVal: mode=='new'? '1': undefined}},
|
|
|
{type: 'select', id: 'ipt_api_activityType', dictId: 43},
|
|
|
{type: 'select', id: 'ipt_api_openLevel', dictId: 'OPEN_LEVEL', opts:{initVal: mode=='add'? '1': undefined}},
|
|
|
{type: 'select', id: 'ipt_api_auditLevel', dictId: 'AUDIT_STATUS', opts:{initVal: mode=='add'? '1': undefined}},
|
|
|
{type: 'select', id: 'ipt_api_activityType', dictId: 'APP_STATUS'},
|
|
|
{type: 'text', id: 'ipt_api_version'},
|
|
|
{type: 'select', id: 'ipt_api_protocol', dictId: 44},
|
|
|
{type: 'select', id: 'ipt_api_method', dictId: 45},
|
|
@ -109,7 +123,7 @@
|
|
|
if(extParms.upType==-1 || model.type==2)
|
|
|
appCombo = $('#ipt_api_name').customCombo(
|
|
|
urls.appCombo, {fields: 'id,name', filters: 'sourceType=1'}, function (id, name) {
|
|
|
if(mode=='new')
|
|
|
if(mode=='add')
|
|
|
$('#ipt_api_name').blur();
|
|
|
if(appCombo.getLigerComboBox().getSelected())
|
|
|
$('#appId').val(appCombo.getLigerComboBox().getSelected().id);
|
|
@ -119,7 +133,7 @@
|
|
|
var parms = g.grid.get("parms");
|
|
|
parms.filters = 'sourceType=1;';
|
|
|
if(searchParm)
|
|
|
parms.filters += 'name?'+searchParm+' g1';
|
|
|
parms.filters += 'name?'+searchParm;
|
|
|
g.grid.set({
|
|
|
parms: parms,
|
|
|
newPage: 1
|
|
@ -134,31 +148,32 @@
|
|
|
var initBtn = function () {
|
|
|
initValidation();
|
|
|
$('#btn_save').click(function () {
|
|
|
saveForm({url: urls.update, $form: $form, modelName: 'model', validator: validator,
|
|
|
saveForm({url: urls.create, $form: $form, modelName: 'model', validator: validator,
|
|
|
onSuccess: function (data) {
|
|
|
data.obj.openLevelName = $('#ipt_api_openLevel').ligerGetComboBoxManager().findTextByValue(data.obj.openLevel);
|
|
|
if(data.obj.type==1){
|
|
|
$.Notice.confirm("保存成功,是否继续编辑接口详细信息?", function (y) {
|
|
|
if(y){
|
|
|
var url = urls.apiEdit + '?treePid=1&treeId=11&mode=modify';
|
|
|
closeDialog();
|
|
|
debugger
|
|
|
parent.em.closeDialog();
|
|
|
$("#contentPage").empty();
|
|
|
$("#contentPage").load(url, data.obj);
|
|
|
}else
|
|
|
closeDialog(undefined, data);
|
|
|
})
|
|
|
}else
|
|
|
closeDialog("保存成功!", data);
|
|
|
parent.em.closeDialog("保存成功!", data);
|
|
|
}});
|
|
|
});
|
|
|
|
|
|
$('#btn_cancel').click(function () {
|
|
|
closeDialog();
|
|
|
parent.em.dialog.close();
|
|
|
});
|
|
|
};
|
|
|
|
|
|
var init = function () {
|
|
|
if(mode=='new'){
|
|
|
if(mode=='add'){
|
|
|
model.parentId = extParms.upId;
|
|
|
model.appId = extParms.appId;
|
|
|
}
|