| <!DOCTYPE html> | 
| <html> | 
|   | 
| <head> | 
|     <meta charset="utf-8"> | 
|     <title>添加接口信息</title> | 
|     <meta name="renderer" content="webkit"> | 
|     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 
|     <meta name="viewport" | 
|         content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> | 
|     <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all"> | 
|     <style type="text/css"> | 
|         .layui-table-cell, | 
|         .layui-table-box { | 
|             overflow: visible; | 
|         } | 
|   | 
|         td .layui-form-select { | 
|             margin-top: -10px; | 
|             margin-left: -15px; | 
|             margin-right: -15px; | 
|         } | 
|         .layui-table-mend{ | 
|             position: relative; | 
|         } | 
|     </style> | 
| </head> | 
|   | 
| <body> | 
|     <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list"> | 
|         <div class="layui-form-item" style="padding: 20px 30px 0 0;">             | 
|             <div class="layui-inline"> | 
|                 <label class="layui-form-label">接口编号</label> | 
|                 <div class="layui-input-inline"> | 
|                     <input type="text" id="InterfaceNo" name="InterfaceNo" autocomplete="off" class="layui-input"> | 
|                 </div>                 | 
|             </div> | 
|              | 
|             <div class="layui-inline"> | 
|                 <label class="layui-form-label">接口名称</label> | 
|                 <div class="layui-input-inline"> | 
|                     <input type="text" id="InterfaceName" name="InterfaceName" autocomplete="off" class="layui-input"> | 
|                 </div>                 | 
|             </div> | 
|              | 
|             <div class="layui-inline"> | 
|                 <label class="layui-form-label">接口方向</label> | 
|                 <div class="layui-input-inline"> | 
|                     <select name="Direction" id="Direction" lay-filter="Direction" lay-search> | 
|                         <option value=""></option> | 
|                         <option value="0">WMS=》SAP</option> | 
|                         <option value="1">WMS=》ERP</option> | 
|                         <option value="2">WMS=》MES</option> | 
|                         <option value="3">WMS=》CRM</option> | 
|                         <option value="4">WMS=》OA</option> | 
|                     </select> | 
|                 </div>                 | 
|             </div> | 
|              | 
|             <div class="layui-inline"> | 
|                 <label class="layui-form-label">传输方式</label> | 
|                 <div class="layui-input-inline"> | 
|                     <select name="TransmissionMode" id="TransmissionMode" lay-filter="TransmissionMode" lay-search> | 
|                         <option value=""></option> | 
|                         <option value="0">Http+Json</option> | 
|                         <option value="1">Http+Xml</option> | 
|                     </select> | 
|                 </div>                 | 
|             </div> | 
|              | 
|             <div class="layui-inline"> | 
|                 <label class="layui-form-label">数据来源</label> | 
|                 <div class="layui-input-inline"> | 
|                     <input type="text" id="DataSources" name="DataSources" autocomplete="off" class="layui-input"> | 
|                 </div>                 | 
|             </div> | 
|   | 
|             <div class="layui-inline"> | 
|                 <label class="layui-form-label">接口地址</label> | 
|                 <div class="layui-input-inline"> | 
|                     <input type="text" id="Url" name="Url" autocomplete="off" class="layui-input"> | 
|                 </div>                 | 
|             </div> | 
|   | 
|             <div class="layui-inline"> | 
|                 <label class="layui-form-label">接口说明</label> | 
|                 <div class="layui-input-inline"> | 
|                     <input type="text" id="Remark" name="Remark" autocomplete="off" class="layui-input"> | 
|                 </div>                 | 
|             </div>          | 
|   | 
|             <div class="layui-inline" style="margin-left: 10px;"> | 
|                 <button class="layui-btn layui-btn-sm layuiadmin-btn-list" data-type="add">添加明细</button> | 
|                 <button type="submit" class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit="" | 
|                     lay-filter="form1">立即提交</button> | 
|             </div> | 
|         </div> | 
|   | 
|         <div class="layui-form-item" style="margin-bottom: 0;"> | 
|             <div class="layui-card"> | 
|                 <div class="layui-card-body"> | 
|                     <div style="width: 100%;right: 0;"> | 
|                         <table id="LAY-app-content-list" name="LAY-app-content-list" lay-filter="LAY-app-content-list"></table> | 
|   | 
|                         <script type="text/html" id="templetIsNull">                             | 
|                             {{# function GetBtn(d){ | 
|                                     var html = '';  | 
|                                     html+= '<select name="IsNull" lay-filter="SelctIsNull" data-value="'+d.IsNull+'">'+ | 
|                                     '<option value="0">是</option>'+ | 
|                                     '<option value="1">否</option>'+ | 
|                                     '</select>'; | 
|                                     return html; | 
|                                 } | 
|                             }} | 
|                             {{ GetBtn(d) }} | 
|                         </script> | 
|   | 
|                         <script type="text/html" id="templetFieldType">                             | 
|                             {{# function GetBtn1(d){ | 
|                                     var html = '';  | 
|                                     html+= '<select name="FieldType" lay-filter="SelctFieldType" data-value="'+d.FieldType+'">'+ | 
|                                     '<option value="String">String</option>'+ | 
|                                     '<option value="Int">Int</option>'+ | 
|                                     '<option value="DateTime">DateTime</option>'+ | 
|                                     '<option value="Decimal">Decimal</option>'+ | 
|                                     '</select>'; | 
|                                     return html; | 
|                                 } | 
|                             }} | 
|                             {{ GetBtn1(d) }} | 
|                         </script> | 
|   | 
|                         <script type="text/html" id="templetDataType">                             | 
|                             {{# function GetBtn2(d){ | 
|                                     var html = '';  | 
|                                     html+= '<select name="DataType" lay-filter="SelctDataType" data-value="'+d.DataType+'">'+ | 
|                                     '<option value="0">表头</option>'+ | 
|                                     '<option value="1">行</option>'+ | 
|                                     '</select>'; | 
|                                     return html; | 
|                                 } | 
|                             }} | 
|                             {{ GetBtn2(d) }} | 
|                         </script> | 
|                     </div>                     | 
|   | 
|                     <script type="text/html" id="table-content-list"> | 
|                         <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"> <i class="layui-icon layui-icon-delete"></i>删除</a> | 
|                     </script> | 
|                 </div> | 
|             </div> | 
|         </div> | 
|     </div> | 
|   | 
|     <script src="../../layuiadmin/layui/layui.js"></script> | 
|     <script src="../../js/public.js"></script> | 
|     <script src="../../js/jquery-3.5.1.min.js"></script> | 
|     <script src="../../js/jquery.cookie.js"></script> | 
|     <script> | 
|         layui.config({ | 
|             base: '../../layuiadmin/' //静态资源所在路径 | 
|         }).extend({ | 
|             index: 'lib/index' //主入口模块 | 
|         }).use(['index', 'form', 'layer', 'laydate', 'table'], function () { | 
|             var $ = layui.$, form = layui.form, laydate = layui.laydate, | 
|                 table = layui.table, layer = layui.layer; | 
|             laydate.render({ | 
|                 elem: '#ProductionDate' | 
|                 , format: 'yyyy-MM-dd' //可任意组合 | 
|             }); | 
|             laydate.render({ | 
|                 elem: '#ExpirationDate' | 
|                 , format: 'yyyy-MM-dd' //可任意组合 | 
|             }); | 
|             var TypeValue=$("#Type").val(); | 
|   | 
|             // table 基本设置 | 
|             var infoOptions = { | 
|                 elem: '#LAY-app-content-list', | 
|                 height: 'full-160', | 
|                 id: 'LAY-app-content-list', | 
|                 page: true, | 
|                 limit: 30, | 
|                 limits: pageLimits, | 
|                 cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增 | 
|                 done: function(){     | 
|                     //选中下拉框的值         | 
|                     layui.each($('select'), function (index, item) { | 
|                         var elem = $(item); | 
|                         if(elem.data('value')!='' && elem.data('value')!=undefined){ | 
|                             elem.val(elem.data('value')).parents('table.layui-table-cell').css('overflow', 'visible'); | 
|                         }                             | 
|                     }); | 
|                     form.render(); | 
|                 },  | 
|                 cols: [ | 
|                     [{ | 
|                         title: '序号', | 
|                         type: 'numbers', | 
|                         width: 50, | 
|                         align: 'center', | 
|                         fixed: 'left' | 
|                     },{ | 
|                         field: 'Id', | 
|                         title: 'Id', | 
|                         align: 'center', | 
|                         hide:true, | 
|                         width: 100, | 
|                         edit: 'text' | 
|                     }, | 
|                     { | 
|                         field: 'InterfaceNo', | 
|                         title: '接口编号', | 
|                         align: 'center', | 
|                         width: 140 | 
|                     }, | 
|                     { | 
|                         field: 'ExtField', | 
|                         title: '外系统字段', | 
|                         align: 'center', | 
|                         width: 180, | 
|                         edit: 'text' | 
|                     }, { | 
|                         field: 'MapField', | 
|                         title: '映射字段', | 
|                         align: 'center', | 
|                         width: 180, | 
|                         edit: 'text' | 
|                     }, { | 
|                         field: 'Field', | 
|                         title: '本系统字段', | 
|                         align: 'center', | 
|                         width: 180, | 
|                         edit: 'text' | 
|                     },{ | 
|                         field: 'FieldType', | 
|                         title: '字段类型', | 
|                         align: 'center', | 
|                         width: 100, | 
|                         templet: '#templetFieldType' | 
|                     }, { | 
|                         field: 'DataType', | 
|                         title: '数据类型', | 
|                         align: 'center', | 
|                         width: 100, | 
|                         templet: '#templetDataType' | 
|                     },{ | 
|                         field: 'FieldFather', | 
|                         title: '父级字段', | 
|                         align: 'center', | 
|                         width: 100, | 
|                         edit: 'text' | 
|                     },  | 
|                     { | 
|                         field: 'IsNull', | 
|                         title: '允许为空', | 
|                         align: 'center', | 
|                         width: 100, | 
|                         templet: '#templetIsNull' | 
|                     }, | 
|                     { | 
|                         field: 'Remark', | 
|                         title: '说明', | 
|                         align: 'center', | 
|                         width: 180, | 
|                         edit: 'text' | 
|                     },{ | 
|                         field: 'CreateUserName', | 
|                         title: '创建人', | 
|                         align: 'center', | 
|                         hide:true, | 
|                         width: 100, | 
|                         edit: 'text' | 
|                     }, | 
|                     { | 
|                         field: 'CreateTime', | 
|                         title: '创建时间', | 
|                         align: 'center', | 
|                         hide:true, | 
|                         width: 160, | 
|                         templet: function (d) { | 
|                             return formatDate(d.CreateTime); | 
|                         } | 
|                     }, | 
|                     { | 
|                         field: 'UpdateUserName', | 
|                         title: '修改人', | 
|                         align: 'center', | 
|                         hide:true, | 
|                         width: 150, | 
|                     }, | 
|                     { | 
|                         field: 'UpdateTime', | 
|                         title: '修改时间', | 
|                         align: 'center', | 
|                         hide:true, | 
|                         width: 150, | 
|                         templet: function (d) { | 
|                             return formatDate(d.UpdateTime); | 
|                         } | 
|                     },  | 
|                     { | 
|                         title: '操作', | 
|                         fixed: 'right', | 
|                         width: 120, | 
|                         align: 'center', | 
|                         templet: '#table-content-list' | 
|                     }] | 
|                 ] | 
|             }; | 
|             // 渲染Table | 
|             refreshTable(null); | 
|             // 渲染table | 
|             function refreshTable(data) { | 
|                 $.extend(infoOptions, { | 
|                     data: data | 
|                 }); | 
|                 infoOptions.page = { | 
|                     curr: 1 | 
|                 } | 
|                 table.render(infoOptions); | 
|             } | 
|   | 
|             // 添加编辑明细  | 
|             var id = getQueryString('id'); | 
|             if (id != null) { | 
|                 // 编辑 | 
|                 var param = { | 
|                     InterfaceNo: id | 
|                 }; | 
|                 sendData(IP + "/Basis/GetInterfaceList", param, 'post', function (res) { | 
|                     if (res.code == 0) { | 
|                         $("input[name='InterfaceNo']").val(res.data[0].InterfaceNo); | 
|                         $("input[name='InterfaceName']").val(res.data[0].InterfaceName); | 
|                         $("#Direction option[value = '" + res.data[0].Direction + "']").prop("selected", true); | 
|                         $("#TransmissionMode option[value = '" + res.data[0].TransmissionMode + "']").prop("selected", true); | 
|                         $("input[name='Remark']").val(res.data[0].Remark); | 
|                         $("input[name='Url']").val(res.data[0].Url); | 
|                         $("input[name='DataSources']").val(res.data[0].DataSources); | 
|   | 
|                         $("#InterfaceNo").attr("disabled", "disabled"); | 
|   | 
|                         var paramDetail = { | 
|                             InterfaceNo:id | 
|                         }; | 
|                         sendData(IP + "/Basis/GetInterfaceDetailList", paramDetail, 'post', function (res) { | 
|                             if (res.code == 0) { //成功 | 
|                                 var data = res.data; | 
|                                 //页面赋值 | 
|                                 $.extend(infoOptions, { | 
|                                     data: data | 
|                                 }); | 
|                                 infoOptions.page = { | 
|                                     curr: 1 | 
|                                 } | 
|                                 table.render(infoOptions); | 
|                                 form.render('select'); | 
|                             } else { //不成功 | 
|                                 layer.msg(res.msg, { | 
|                                     icon: 2, | 
|                                     time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                                 }, function () { }); | 
|                             } | 
|                         }); | 
|                     } else { //不成功 | 
|                         layer.msg(res.msg, { | 
|                             icon: 2, | 
|                             time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                         }, function () { }); | 
|                     } | 
|                 }); | 
|             } | 
|             else { | 
|                 // 添加 | 
|             } | 
|   | 
|             // 删除接口明细 | 
|             table.on('tool(LAY-app-content-list)', function (obj) { | 
|                 if (obj.event == 'del') { | 
|                     layer.confirm('确定删除接口明细?', function (index) { | 
|                         var menu = layui.table.cache["LAY-app-content-list"]; | 
|                         menu.splice(obj.tr.data('index'),1); | 
|                         table.reload('LAY-app-content-list',{data : menu}); | 
|                         layer.close(index) | 
|                     }); | 
|                 } | 
|             }); | 
|             //添加接口明细 | 
|             var MapFieldNum=0;             | 
|             var $ = layui.$, | 
|             active = { | 
|                 add: function () {                     | 
|                     var InterfaceNo=$('#InterfaceNo').val(); | 
|                     if(InterfaceNo==''){ | 
|                         layer.msg("请输入接口编号!", { | 
|                             icon: 2, | 
|                             time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                         }, function () { | 
|   | 
|                         }); | 
|                         return; | 
|                     } | 
|                     var menu = layui.table.cache["LAY-app-content-list"]; | 
|                      | 
|                     if(MapFieldNum==0){ | 
|                         if(menu!=undefined){ | 
|                             var menuLength=menu.length-1; | 
|                             var lastNum=menu[menuLength].MapField.replace('Field',''); | 
|                             MapFieldNum=parseInt(lastNum)+1; | 
|                         } | 
|                         else{ | 
|                             MapFieldNum=MapFieldNum+1; | 
|                         } | 
|                     } | 
|                     else{ | 
|                         MapFieldNum=MapFieldNum+1; | 
|                     } | 
|                     if(menu==undefined) | 
|                     { | 
|                         menu=[] | 
|                     } | 
|                     var newRow={InterfaceNo:InterfaceNo,MapField:'Field'+MapFieldNum,IsNull:'0'}; | 
|                     menu.push(newRow); | 
|                     refreshTable(menu); | 
|                 } | 
|             }; | 
|             $('.layui-btn').on('click', function () { | 
|                 var type = $(this).data('type'); | 
|                 active[type] ? active[type].call(this) : ''; | 
|             }); | 
|             window.success = function (data) { | 
|                 refreshTable(data) | 
|             }; | 
|   | 
|             //监听修改IsNull下拉框update到表格中 | 
|             form.on('select(SelctIsNull)', function (data) { | 
|                 var elem = $(data.elem); | 
|                 var trElem = elem.parents('tr'); | 
|                 var tableData = table.cache['LAY-app-content-list']; | 
|                 // 更新到表格的缓存数据中,才能在获得选中行等等其他的方法中得到更新之后的值 | 
|                 tableData[trElem.data('index')][elem.attr('name')] = data.value; | 
|             }); | 
|             //监听修改DataType下拉框update到表格中 | 
|             form.on('select(SelctDataType)', function (data) { | 
|                 var elem = $(data.elem); | 
|                 var trElem = elem.parents('tr'); | 
|                 var tableData = table.cache['LAY-app-content-list']; | 
|                 // 更新到表格的缓存数据中,才能在获得选中行等等其他的方法中得到更新之后的值 | 
|                 tableData[trElem.data('index')][elem.attr('name')] = data.value; | 
|             }); | 
|             //监听修改FieldType下拉框update到表格中 | 
|             form.on('select(SelctFieldType)', function (data) { | 
|                 var elem = $(data.elem); | 
|                 var trElem = elem.parents('tr'); | 
|                 var tableData = table.cache['LAY-app-content-list']; | 
|                 // 更新到表格的缓存数据中,才能在获得选中行等等其他的方法中得到更新之后的值 | 
|                 tableData[trElem.data('index')][elem.attr('name')] = data.value; | 
|             }); | 
|   | 
|             // 保存接口信息 | 
|             form.on('submit(form1)', function (data) { | 
|                 var InterfaceNo=$('#InterfaceNo').val(); | 
|                 if (InterfaceNo == "" || InterfaceNo ==undefined) { | 
|                     layer.msg("请输入接口编号!", { | 
|                         icon: 2, | 
|                         time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                     }); | 
|                     return; | 
|                 } | 
|                 var InterfaceName=$('#InterfaceName').val(); | 
|                 if (InterfaceName == "" || InterfaceName ==undefined) { | 
|                     layer.msg("请输入接口名称!", { | 
|                         icon: 2, | 
|                         time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                     }); | 
|                     return; | 
|                 } | 
|                 var Direction=$('#Direction').val(); | 
|                 if (Direction == "" || Direction ==undefined) { | 
|                     layer.msg("请选择接口方向!", { | 
|                         icon: 2, | 
|                         time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                     }); | 
|                     return; | 
|                 } | 
|                 var TransmissionMode=$('#TransmissionMode').val(); | 
|                 if (TransmissionMode == "" || TransmissionMode ==undefined) { | 
|                     layer.msg("请选择传输方式!", { | 
|                         icon: 2, | 
|                         time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                     }); | 
|                     return; | 
|                 } | 
|                 var DataSources=$('#DataSources').val(); | 
|                 if (DataSources == "" || DataSources ==undefined) { | 
|                     layer.msg("请输入数据来源!", { | 
|                         icon: 2, | 
|                         time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                     }); | 
|                     return; | 
|                 } | 
|                 var Url=$('#Url').val(); | 
|                 if (Url == "" || Url ==undefined) { | 
|                     layer.msg("请输入接口地址!", { | 
|                         icon: 2, | 
|                         time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                     }); | 
|                     return; | 
|                 } | 
|                 var menu = layui.table.cache["LAY-app-content-list"]; | 
|                 if (menu.length == 0) { | 
|                     layer.msg("请添加明细!", { | 
|                         icon: 2, | 
|                         time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                     }, function () { | 
|   | 
|                     }); | 
|                     return; | 
|                 } | 
|                 SetInterface(); | 
|             }); | 
|             //#region 事件方法 | 
|              | 
|             // 添加接口信息 | 
|             var doing = true; | 
|             function SetInterface(data) { | 
|                 var item2 = getInterfaceInfo(); | 
|                 if (item2 !=-1) {                 | 
|                     if (doing) { | 
|                         doing = false; | 
|                         if (id == null) { | 
|                             // 添加 | 
|                             sendData(IP + "/Basis/AddInterface", item2, 'post', function (res) { | 
|                                 if (res.code == 0) { //成功 | 
|                                     layer.msg(res.msg, { | 
|                                         icon: 1, | 
|                                         time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                                     }, function () { | 
|                                         parent.location.reload(); | 
|                                         parent.layer.close(layer.index); | 
|                                         doing = true | 
|                                     }); | 
|                                 } else { //不成功 | 
|                                     layer.msg(res.msg, { | 
|                                         icon: 2, | 
|                                         time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                                     }, function () { doing = true }); | 
|                                 } | 
|                             }); | 
|                         } | 
|                         else { | 
|                             // 编辑 | 
|                             sendData(IP + "/Basis/EditInterface", item2, 'post', function (res) { | 
|                                 if (res.code == 0) { //成功 | 
|                                     layer.msg(res.msg, { | 
|                                         icon: 1, | 
|                                         time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                                     }, function () { | 
|                                         parent.location.reload(); | 
|                                         parent.layer.close(layer.index); | 
|                                         doing = true | 
|                                     }); | 
|                                 } else { //不成功 | 
|                                     layer.msg(res.msg, { | 
|                                         icon: 2, | 
|                                         time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                                     }, function () { doing = true }); | 
|                                 } | 
|                             }); | 
|                         } | 
|   | 
|                         return false; | 
|                     } | 
|                     else { | 
|                         layer.msg("已提交数据,请等待!", { | 
|                             icon: 2, | 
|                             time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                         }, function () { doing = true }); | 
|                     } | 
|                 }     | 
|             } | 
|   | 
|             // 提交获取接口信息 | 
|             function getInterfaceInfo() { | 
|                 var DataList = []; | 
|                 var menu = layui.table.cache["LAY-app-content-list"]; | 
|                 for (var i in menu) { | 
|                     if(menu[i]==[]){ | 
|                         continue; | 
|                     } | 
|                     if (menu[i].InterfaceNo == "" || menu[i].InterfaceNo ==undefined) { | 
|                         layer.msg("请输入接口编号!", { | 
|                             icon: 2, | 
|                             time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                         }); | 
|                         return -1; | 
|                     } | 
|                     if (menu[i].ExtField == "" || menu[i].ExtField ==undefined) { | 
|                         layer.msg("请输入外系统字段!", { | 
|                             icon: 2, | 
|                             time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                         }); | 
|                         return -1; | 
|                     }     | 
|                     if (menu[i].MapField == "" || menu[i].MapField ==undefined) { | 
|                         layer.msg("请输入映射字段!", { | 
|                             icon: 2, | 
|                             time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                         }); | 
|                         return -1; | 
|                     } | 
|                     if (menu[i].Field == "" || menu[i].Field ==undefined) { | 
|                         layer.msg("请输入本系统字段!", { | 
|                             icon: 2, | 
|                             time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                         }); | 
|                         return -1; | 
|                     } | 
|                     if (menu[i].FieldType == "" || menu[i].FieldType ==undefined) { | 
|                         layer.msg("请选择字段类型!", { | 
|                             icon: 2, | 
|                             time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                         }); | 
|                         return -1; | 
|                     } | 
|                     if (menu[i].DataType == "" || menu[i].DataType ==undefined) { | 
|                         layer.msg("请选择数据类型!", { | 
|                             icon: 2, | 
|                             time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                         }); | 
|                         return -1; | 
|                     } | 
|                     if (menu[i].IsNull == "" || menu[i].IsNull ==undefined) { | 
|                         layer.msg("请选择允许为空!", { | 
|                             icon: 2, | 
|                             time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|                         }); | 
|                         return -1; | 
|                     }                 | 
|   | 
|                     var item = { | 
|                         Id:menu[i].Id, | 
|                         InterfaceNo: menu[i].InterfaceNo, | 
|                         ExtField: menu[i].ExtField, | 
|                         MapField: menu[i].MapField, | 
|                         Field: menu[i].Field, | 
|                         FieldFather: menu[i].FieldFather, | 
|                         FieldType: menu[i].FieldType, | 
|                         DataType: menu[i].DataType, | 
|                         IsNull: menu[i].IsNull, | 
|                         Remark: menu[i].Remark | 
|                     }; | 
|                     DataList.push(item); //属性 | 
|                 } | 
|                  | 
|                 var item2 = { | 
|                     InterfaceNo: $("#InterfaceNo").val(), | 
|                     InterfaceName: $("#InterfaceName").val(), | 
|                     Direction: $("#Direction").val(), | 
|                     TransmissionMode: $("#TransmissionMode").val(), | 
|                     Remark: $("#Remark").val(), | 
|                     Url: $("#Url").val(), | 
|                     DataSources:$("#DataSources").val(), | 
|                     InterfaceDetail: DataList | 
|                 } | 
|                 return item2; | 
|             } | 
|   | 
|             // 获取主页面传递的参数 | 
|             function getQueryString(name) { | 
|                 var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); | 
|                 var r = window.location.search.substr(1).match(reg); | 
|                 if (r != null) return unescape(r[2]); | 
|                 return null; | 
|             } | 
|             //#endregion | 
|         }) | 
|     </script> | 
| </body> | 
|   | 
| </html> |