123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=8;" />
- <link rel="stylesheet" href="../../js/xheditor-1.1.14/common.css" type="text/css"></link>
- <script language="javascript" src="../../easyui/all.js"></script>
- <script type="text/javascript" src="../../easyui/easyui-validate.js"></script>
- <script type="text/javascript" src="../../easyui/datagrid-detailview.js"></script>
- <script type="text/javascript" src="../../easyui/upload.js"></script>
- <script type="text/javascript" src="../../yihu_js/common.js"></script>
- <script type="text/javascript" src="../../commons/js/common.js"></script>
- <style>
- pre,html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,a,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%
- }
- body {
- line-height: 1;
- color: #555;
- background:white;
- font: 12px/1.5 Helvetica,Arial,sans-serif
- }
- ul,ol,li {
- list-style: none outside
- }
- /*table {
- border-collapse: collapse;
- border-spacing: 0;
- }*/
- a {
- text-decoration: none;
- color: #39c;
- outline: 0 none
- }
- a:hover {
- text-decoration: underline
- }
- .colmain {
- width: 1000px;
- *width: auto;
- *float: left;
- padding: 25px 35px;
- display: table-cell;
- max-width: 1000px;
- /* width: auto; */
- }
- .pre_1{
- overflow-x: auto;
- margin: 0px;
- padding: 0px;
- }
- .pre_2{
- overflow-x: auto;
- max-width: 1000px;
- }
- .colmain .bd {
- padding: 15px 0 15px 15px
- }
- .doc {
- width: 98%;
- line-height: 20px;
- font-size: 13px/15
- }
- .doc .doc-tit h2 {
- font-weight: bold;
- padding: 0 0 10px 3px;
- font-size: 15px
- }
- .doc .part-tit h2 {
- font-weight: bold;
- font-size: 15px
- }
- .doc .doc-basic {
- border: 1px solid #dbdbdb;
- background-color: #f8f7f7;
- padding: 15px 0 15px 15px
- }
- .doc .part-tit {
- background-color: #fef1df;
- line-height: 35px;
- height: 35px;
- padding: 0 0 0 15px
- }
- .doc-part {
- /* padding-bottom: 20px */
- }
- .doc-part .bd li {
- padding-bottom: 5px
- }
- /*.doc-part th {
- text-align: center;
- font-weight: bolder;
- border: 1px solid #ccc;
- line-height: 20px;
- background-color: #f8f7f7
- }*/
- td pre {
- /* width: 95%; */
- /* padding: 1em; */
- /* border: 1px dashed #2f6fab; */
- /* color: black; */
- /* background-color: #f9f9f9; */
- /* line-height: 1.1em; */
- /* overflow-y: hidden; */
- overflow-x: auto;
- max-width: 400px;
- }
- .doc-footer .issue {
- border-top: 1px solid #e5e5e5;
- text-align: right;
- width: 100%
- }
- .doc-part .list-disc li {
- list-style: disc;
- margin-left: 15px
- }
- .box-wrap{
- z-index:1000000;
- background-color:#f7f7f7;
- padding-left: 30px;
- height: 20px;
- /* position: absolute; */
- border: 1px solid #e0e0e0;
- line-height: 20px
- }
- .box-wrap li{
- float: left;
- height: 20px;
- padding: 0 22px;
- *padding: 0 20px;
- margin-left: -1px;
- /* position: relative; */
- font-size: 14px;
- border-left: 1px solid #e0e0e0
- }
- .box-wrap li a{
- color:#ff8400;
- font-weight: bold;
-
- }
- .tr_json{
- /* background-color: #d4ecd3;//#bbeb71; */
- color: black;
- }
- .tr_json_body{
- /* background-color: #fdfdc9;//#fff6b1; */
- font-style: oblique;
- color: black;
- /* font-family: Times, TimesNR, 'New Century Schoolbook', Georgia, 'New York', serif; */
- font-weight: 500;
- }
- </style>
- </head>
- <script>
- var hosId = $.getUrlParam("hosId");
- var api = $.getUrlParam("api");
- var apiName = $.getUrlParam("apiName");
- var retDataType = $.getUrlParam("retDataType");
- var createTime = $.getUrlParam("createTime");
- var paramTypeData = [{id:'Int',text:'Int'},{id:'Boolean',text:'Boolean'},{id:'Object',text:'Object'},
- {id:'String',text:'String'},{id:'Long',text:'Long'},{id:'Double',text:'Double'},{id:'String_Json',text:'String_Json'}];
- var isData = [{id:'0',text:'否'},{id:'1',text:'是'}];
- var editIndex = undefined;
- $(function(){
- $("#apiName").html(apiName);
- $("#methodname").html(api);
- $("#methodresulttype").html(retDataType);
- $("#createdate").html(createTime);
-
- initWidget();
- });
- function initWidget(){
- $("#apiInParamGrid").datagrid({
- title : '',
- url:$.common.urlByBizAction("ApiAction_querySysMethodParam"),
- onBeforeLoad: function(param){
- param.api = api;
- param.hosId = hosId;
- param.isOut = 0;//入参
- },
- fitColumns : true,
- singleSelect: true,
- onClickRow:function(index){
- endEditing('apiInParamGrid');
- },
- onDblClickRow:function(index, rowData){
- if (editIndex != index){
- if (endEditing('apiInParamGrid')){
- $(this).datagrid('selectRow', index)
- .datagrid('beginEdit', index);
- editIndex = index;
- } else {
- $(this).datagrid('selectRow', editIndex);
- }
- }
- },
- onAfterEdit:function(rowIndex, rowData, changes){
- rowData.HosId = hosId;
- var retData = Commonjs.ajax("./ApiAction_saveSysMethodParam.action",rowData,false);
- //$('#apiInParamGrid').datagrid('reload');
- },
- columns:[[
- {field:'Pid',title:'父主键',hidden:true},
- {field:'ParamId',title:'主键',hidden:true},
- {field:'IsOut',title:'入参',hidden:true},
- {field:'Api',title:'api',hidden:true},
- {field:'ParamName',title:'参数',width:170,editor:{type:'validatebox',options:{required:true}}},
- {field:'ParamType',title:'类型',width:100,editor:{type:'combobox',
- options:{
- valueField:'id',
- textField:'text',
- required:true,
- editable:false,
- data:paramTypeData
- }}},
- {field:'ParamMeaning',title:'参数名称',width:230,editor:{type:'validatebox',options:{required:true}}},
- {field:'IsNeed',title:'必输',width:100,formatter:isNeedFormatter,editor:{type:'combobox',
- options:{
- valueField:'id',
- textField:'text',
- required:true,
- editable:false,
- data:isData
- }}},
- {field:'Remark',title:'备注',width:310,editor:'text'}
- ]],
- toolbar:[
- {
- text:'增加',
- iconCls:'icon-add',
- handler:function(){
- if (endEditing('apiInParamGrid')){
- $('#apiInParamGrid').datagrid('appendRow',{IsOut:0,Api:api,Pid:-1});
- editIndex = $('#apiInParamGrid').datagrid('getRows').length-1;
- $('#apiInParamGrid').datagrid('selectRow', editIndex)
- .datagrid('beginEdit', editIndex);
- }
- }
- },'-',{
- text:'删除',
- iconCls:'icon-remove',
- handler:function(){
- var selectedRow = $('#apiInParamGrid').datagrid('getSelected');
- if( selectedRow == null ){
- $.messager.alert('提示','请选择一条记录再删除!','info');
- }else{
-
- if( selectedRow.ParamId != null ){//删除
- $.messager.confirm('提示','是否确认删除该参数?',function(r){
- if (r){
- var param = {};
- param.paramId = selectedRow.ParamId;
- param.hosId = hosId;
- param.api = api;
- param.paramName = selectedRow.ParamName;
- var retData = Commonjs.ajax("./ApiAction_deleteSysMethodParam.action",param,false);
- $('#apiInParamGrid').datagrid('reload');
- }
- });
- }else{
- $.messager.confirm('提示','是否放弃新增记录?',function(r){
- if (r){
- $('#apiInParamGrid').datagrid('reload');
- }
- });
- }
-
- }
- }
- },'-',{
- text:'刷新',
- iconCls:'icon-reload',
- handler:function(){
- $('#apiInParamGrid').datagrid('reload');
- }
- },'-',{
- text:'保存',
- iconCls:'icon-save',
- handler:function(){
- endEditing('apiInParamGrid');
- }
- }
- ],
- });
-
- $("#apiOutParamGrid").datagrid({
- title : '',
- url:$.common.urlByBizAction("ApiAction_querySysMethodParam"),
- onBeforeLoad: function(param){
- param.api = api;
- param.hosId = hosId;
- param.isOut = 1;//入参
- },
- fitColumns : true,
- singleSelect: true,
- onClickRow:function(index){
- endEditing('apiOutParamGrid');
- },
- onDblClickRow:function(index, rowData){
- if (editIndex != index){
- if (endEditing('apiOutParamGrid')){
- $(this).datagrid('selectRow', index)
- .datagrid('beginEdit', index);
- editIndex = index;
- } else {
- $(this).datagrid('selectRow', editIndex);
- }
- }
- },
- onAfterEdit:function(rowIndex, rowData, changes){
- rowData.HosId = hosId;
- var retData = Commonjs.ajax("./ApiAction_saveSysMethodParam.action",rowData,false);
- //$('#apiInParamGrid').datagrid('reload');
- },
- columns:[[
- {field:'Pid',title:'父主键',hidden:true},
- {field:'ParamId',title:'主键',hidden:true},
- {field:'IsOut',title:'入参',hidden:true},
- {field:'Api',title:'api',hidden:true},
- {field:'ParamName',title:'参数',width:170,editor:{type:'validatebox',options:{required:true}}},
- {field:'ParamType',title:'类型',width:100,editor:{type:'combobox',
- options:{
- valueField:'id',
- textField:'text',
- required:true,
- editable:false,
- data:paramTypeData
- }}},
- {field:'ParamMeaning',title:'参数名称',width:230,editor:{type:'validatebox',options:{required:true}}},
- {field:'IsNeed',title:'必输',width:100,formatter:isNeedFormatter,editor:{type:'combobox',
- options:{
- valueField:'id',
- textField:'text',
- required:true,
- editable:false,
- data:isData
- }}},
- {field:'Remark',title:'备注',width:310,editor:'text'}
- ]],
- toolbar:[
-
- {
- text:'增加',
- iconCls:'icon-add',
- handler:function(){
- if (endEditing('apiOutParamGrid')){
- $('#apiOutParamGrid').datagrid('appendRow',{IsOut:1,Api:api,Pid:-1});
- editIndex = $('#apiOutParamGrid').datagrid('getRows').length-1;
- $('#apiOutParamGrid').datagrid('selectRow', editIndex)
- .datagrid('beginEdit', editIndex);
- }
- }
- },'-',{
- text:'删除',
- iconCls:'icon-remove',
- handler:function(){
- var selectedRow = $('#apiOutParamGrid').datagrid('getSelected');
- if( selectedRow == null ){
- $.messager.alert('提示','请选择一条记录再删除!','info');
- }else{
-
- if( selectedRow.ParamId != null ){//删除
- $.messager.confirm('提示','是否确认删除该参数?',function(r){
- if (r){
- var param = {};
- param.paramId = selectedRow.ParamId;
- param.hosId = hosId;
- param.api = api;
- param.paramName = selectedRow.ParamName;
- var retData = Commonjs.ajax("./ApiAction_deleteSysMethodParam.action",param,false);
- $('#apiOutParamGrid').datagrid('reload');
- }
- });
- }else{
- $.messager.confirm('提示','是否放弃新增记录?',function(r){
- if (r){
- $('#apiOutParamGrid').datagrid('reload');
- }
- });
- }
-
- }
- }
- },'-',{
- text:'刷新',
- iconCls:'icon-reload',
- handler:function(){
- $('#apiOutParamGrid').datagrid('reload');
- }
- },'-',{
- text:'保存',
- iconCls:'icon-add',
- handler:function(){
- endEditing('apiOutParamGrid');
- }
- }
- ],
- });
-
- }
- function isNeedFormatter(value,row,index){
- if (value == 1){
- return "是";
- } else {
- return "否";
- }
- }
- function endEditing(gridId){
- if (editIndex == undefined){return true}
- if ($('#'+gridId).datagrid('validateRow', editIndex)){
- $('#'+gridId).datagrid('endEdit', editIndex);
- editIndex = undefined;
- return true;
- } else {
- return false;
- }
- }
- </script>
- <body>
- <div class="colmain">
- <div class="doc">
- <div class="doc-part">
- <div class="doc-tit">
- <h2>API参数>> <span id="apiName"></span></h2>
- </div>
- <div class="doc-basic">
- <ul>
- <li>API名称:<span id="methodname"></span></li>
- <li>返回值数据格式:<span id="methodresulttype"></span></li>
- <li>创建时间:<span id="createdate"></span></li>
- </ul>
- </div>
- </div>
- <div id="J_tabcont" style="padding-top: 20px;">
- <a id="div_3" style="padding-top: 30px;"></a>
- <a id="div_1" style="padding-top: 30px;"></a>
- <div>
- <div class="doc-part">
- <div class="part-tit" >
- <h2>请求参数</h2>
- </div>
- <div class="bd">
- <table id="apiInParamGrid"></table>
- </div>
- </div>
- </div>
- <a id="div_2" style="padding-top: 30px;"></a>
- <div>
- <div class="doc-part">
- <div class="part-tit">
- <h2>返回结果</h2>
- </div>
- <div class="bd">
- <table id="apiOutParamGrid"></table>
- </div>
- </div>
- </div>
- <a id="div_6" style="padding-top: 30px;"></a>
- </div>
- </div>
- </div>
- </body>
- </html>
|