최근에 프로젝트 요구 사항이 있으며 압입 양식을 생성하기 위해 JS를 사용해야하는 사용자 관리 시스템을 만들었습니다. 이것은 정말로 나를 막습니다. 이 기능은 관련 정보를 찾아서 실현됩니다. 다음 편집자는 구현 코드에 메모를 가져옵니다.이 코드는 향후 검색에 편리합니다. 동시에, 나와 같은 요구를 가진 친구들이 참조 할 수 있기를 바랍니다. 더 나은 방법이 있다면 메시지를 남겨주세요. 감사합니다!
JS는 다음 양식을 만듭니다.
JSON
[{ "id": 302, "serviceid": 15, "name": "data", "type": "jsonobject", "paramdesc": "return query 정보 ","value ":" ","comment ":" ","parentid ":-1,"childrenparam ": [{"id ": 305,"serviceid ":"name ":"info ","type ":"jsonobject ","paramdesc ":"query 내용 ","value ":" ","comment ":" ","parentid ": 302,"childrenparam ": [{"id ": 312,"service id ":"name ":"entinvlist ","type ":"paramdesc ":"엔터프라이즈 외국인 투자 상황 ","value ":" ","comment ":" ","parentid ": 305,"childrenparam ": [{"id ": 343,"serviceid ":"name ":"regno ","type ":"string ","paramdesc ":"reggistration 숫자 ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}, {"id ": 342,"service ": 15,"name ":"r egcapcur ","type ":"string ","paramdesc ":"Registered Capital Currency ","Value ":" ","Comment ":" ","Parentid ": 312,"ChildrenParam ": null}, {"id ": 341,"service ": 15,"name ":"regcap ","type ":"string ","paramdesc ":"regcap (10,000 Yuan), "value": "", "comment": "", "parentid": 312, "childrenparam": null}, { "id": 340, "service": 15, "name": "Ent_nam e", "type": "string", "paramdesc": "법적 대표자 이름 ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}, {"id ": 339,"service ": 15,"name ":"FundedRatio ","type ":"string ","paramdesc ":"기여. " 비율 ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}, {"id ": 338,"service ": 15,"name ":"esdate ","type e ":"string ","paramdesc ":"개방 날짜 ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}, {"id ": 337,"service ": 15,"name ":"error ","type ":"string ","paramdesc ":"구독 자본 (10,000 YUAN) ","value ":" "", "댓글": "", "parentid": 312, "childrenparam": null}, { "id": 336, "service": 15, "name": "Enttype", "type": "strin g", "paramdesc": "Enterprise (Institution) type ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}, {"id ": 345,"service ": 15,"name ":"Revdate ","type ":"paramdesc ":"Revod 날짜 ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}, {"id ": 344,"service ": 15,"name ":"regorg ","type ":"paramd esc ":"등록 권위 ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}, {"id ": 334,"service ": 15,"name ":"currency ","type ":"paramdesc ":"구독 자본 통화 ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}, {"id ": 335,"service ": 15,"name ":"entstatus ","type ":"string ","ententstatus ","type ":"paramdesc ":"entcompany 상태 ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}, {"id ": 333,"service ": 15,"name ":"candate ","type ":"paramdesc ":"login 날짜 ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}]}, {"id ": 346,"service ": 15,"name ":"Ent_name ","type ":"string ","ent name ","value " ":" ","comment ":" ","parentid ": 305,"childrenparam ": null}, {"id ": 311,"serviceId ": 15,"name ":"basic ","type ":"jsonobject ","paramdesc ":"Basic 정보 ","value ":" ","comment ":" ","parentid ": 305,"childrenparam ": [{"id ": 326,"serviceid ": 15,"name ":"opscope ","type ":"string ","paramdesc ":"비즈니스 (비즈니스) 스코프 ","value ":" ","com ment ":" ","parentid ": 311,"childrenparam ": null}, {"id ": 327,"serviceid ": 15,"name ":"opto ","type ":"string ","paramdesc ":"작동 용어로 yyyy-mm-dd ":" ","value ":" "," ","parentid ": 311,"childrenparam ": null}, {"id ": 324,"serviceid ": 15,"name ":"industryphy ","type ":"string ","paramdesc ":"value ":" "", "", "" "," "", "" "," " 주석 ":" "," ","parentid ": 311,"childrenparam ": null}, {"id ": 325,"serviceid ": 15,"name ":"opfrom ","type ":"string ","paramdesc ":"작업 용어는 yyyy-mm-dd ":" ","value ":" ","parentid ": 311,"childrenparam ":"childrenparam ": null}, {"id ": 322,"serviceid ": 15,"name ":"frname ","type ":"string ","paramdesc ":"합법적 인 사람으로 결정되었으며, 자체적으로 자체적으로 판단되었다. "이름,"value ":", "comment": "", "parentid": 311, "childrenparam": null}, { "id": 323, "service": 15, "name": "industryco", "type": "paramdesc": "산업 범주 코드 ","value ":" ","comment ":" ","parentid ": 311,"childrenparam ": null}, {"id ": 320,"service ": 15,"name ":"enttype ","type ":"paramdesc ":"Paramdest "유형은 제한된 책임 회사가 있습니다. 등. ","value ":", "hamon": "" ","parentid ": 311,"childrenparam ": null}, {"id ": 321,"service ":"name ":"esdate ","type ":"paramdesc ":"개방 날짜 yyyy-mm-dd ","value ":" "", "comment": "", "parentid": 311, "childrenparam": null}, { "id": 332, "service": "name": "Revdate", "type": "String", "paramdesc": "취소 된 날짜 yyyy-mm-dd ","value ":" "", "comment": "", "parentid": 311, "childrenparam": null}, { "id": 330, "serviceid": 15, "name": "regno", "type": "string", "paramdesc": "Registration 숫자 ","value ":" ","comment ":" ","parentid ": 311,"childrenparam ": null}, {"id ": 331,"service ": 15,"name ":"regorg ","type ":"string ":"Registration Authority ","VA lue ":" ","comment ":" ","parentid ": 311,"childrenparam ": null}, {"id ": 328,"serviceid ": 15,"name ":"regcap ","type ":"string ","paramdesc ":"등록 된 자본 단위 : 10,000 Yuan ","Value ":" ","Comment ":" ","Parentid ": 311,"ChildrenParam ": null}, {"id ": 329,"service ": 15,"name ":"regcapcur ","type ":"string ","Currency Rmb, US Dolar 등 ","Valu " e ":" "," "" "," "", "parentid": 311, "childrenparam": null}, { "id": 313, "serviceid": 15, "name": "opscoandform", "type": "string", "paramdesc": "스코프 및 작동 방법 (Business) ","Value ":" "", "Comment": "", "Parentid": 311, "ChildrenParam": null}, { "id": 315, "service": 15, "name": "ancheyear", "type": "paramdesc": "마지막 연례 검사 Yyyyy ","value ":" ","comment ":" ","parentid ": 311,"childrenparam ": null}, {"id ": 314,"serviceid ": 15,"name ":"abuitem ","type ":"paramdesc ":"라이센스 사업 Project ","Value ":" ","Comment ":" ","Parentid ": 311,"Childrenparam ": null}, {"id ": 317,"ser vice ":"name ":"cbuitem ","type ":"paramdesc ":"일반 사업 프로젝트 ","value ":" ","comment ":" ","parentid ": 311,"childrenparam ": null}, {"id ": 316,"service ": 15,"name ":"candate ","type ":"paramdesc ":"logout yyyy-mm-dd ","val ue ":" ","comment ":" "", "parentid": 311, "childrenparam": null}, { "id": 319, "serviceid": 15, "name": "entstatus", "type": "string", "paramdesc": "작동 상태, 취소, 취소,"파라 데스크 " 기타 ","value ":" ","comment ":" ","parentid ": 311,"childrenparam ": null}, {"id ": 318 , "serviceid": "name": "dom", "type": "string", "paramdesc": "add 결과 ","value ":"일치 | not_match | NOT_FOUND ","COMMING ":" "", "PARENTID": 302, "ChildrenParam": null}, { "id": 303, "serviceId": 15, "name": "status", "type": "boolean", "paramdesc": "인터페이스 리턴 상태 ","value ":" ","comment ":" ","parentid ": 302,"childrenparam ": null}]}, {"id ": 306,"service ": 15,"name ":"api_status ","type ":"jsonobject ","paramdesc ":"반환 상태 코드 ","value ":" ","comment ":" ","parentid ":-1,"childrenparam ": [{"id ": 307,"serviceid ": 15,"name ":"status ","type ":"boolean ","paramdesc ":"인터페이스 리턴 상태 ","value ":" "댓글" ","pare ntid ": 306,"childrenparam ": null}, {"id ": 309,"service ": 15,"name ":"description ","type ":"String ","paramdesc ":"return status 설명 ","value ":" ","comment ":" ","parentid ": 306,"childrenparam ": null}, {"id ": 308,"service ": 15,"name ":"code ","type ":"paramdesc ":"status 코드 ","value ":" ","comment ":" ","parentid ": 306,"childrenparam ": null}, {"id ": 310,"service ": 15,"name ":"serial_no ","type ":"string ","paramdesc ":"flow 숫자 ","value ":" ","comment ":" ","parentid ": 306,"childrenparam ": null}]}]JS
// api 페이지 출력 매개 변수 설명 var apitohtml_outparamfn = function (json, returnexample) {var html = ''var mustar = [ 'requiredar = ['required ','옵션 '] var paramhtml =' 'var data = $ .parsejson (json); console.log (data) // parameter type // parameter parameter // remance : 매개 변수 할당 설명 // 댓글 : 매개 변수 기타 설명 // childrenparam : Child 매개 변수 목록 console.log('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- bbb = []var c = [] dataformatfn2 (data, flagi) // 통계 하위 클래스 수 // 각 노드 각 노드는 하위 노드의 합을 계산하기 위해 Len 속성을 추가하여 하위 노드 기능 dataformatfn2 (data) {for (var i = 0; i <data.length; i ++)를 계산합니다. {bbb [i] = 0bbb [i] = dataformatfn (data [i], 0, bbb [i], c)}; // htmlparamhtml = jsontohtml (data, 0);} function dataformatfn (data, flagi, b, c) {data.len = (data.children = children). data.childrenparam.length) || 1 // debugger // console.log (data) c = c || [] if (data.childrenparam) {for (var i = 0; i <data.childrenparam.length; i ++) {b ++ data.len+= dataformatfn (data.childrenparam [i], b [i], b, c, b. data.len} else {return (data.childrenparam && data.childrenparam.length) || 0}} console.log (bbb) console.log (data) var flagi = 0 // execute // paramhtml = jsontohtml (datai); jsontohtml (data, flagi, len) {var paramhtml = ''; var nbsparr = [ '', '<b> </b>', '<b> </b>', '<b> </b>', '<b> </b>', '<b> </b>', ' <b> </b> ','<b> </b> ','<b> </b> ','<b> </b> ','<b> </b> ']] i = 0; i <data.length; i ++) {var str2 = ''var span = 1if (i == 0 && flagi> 0 && len> 1) {span = (10 -flagi) str2 = '<td rowspan = "'+(len)+'"> </td>'} else {10-flagi)} paramhtml+= '} + '/<td colspan = "' + span + '"> <bobr>' + nbsparr [flagi] + data [i] .name + '</namr> </td>/<td>' + data [i] .type + '</td>/<td>' + data [i] .paramdesc + '</td>/<td>' + data [i] ' + data [i]. +'</td>/<td>' +data [i] .comment +'</td>/</tr>'if (data [i] .childrenparam) {paramhtml += jsontohtml (data [i] .childrenparam, flagi +1, data [i] .len)} else {flagi}}}}}}} paramHtml}console.log('--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- colspan = "10"> <bobr> 매개 변수 영어 이름 </nobr> </th>/<th> <bobr> 매개 변수 유형 </nobr> </th>/<th> <th> <bobr> 중국 정의 </nobr> </th>/<th> <bobr> 매개 변수 할당 설명 </nobr> </th>/<th> <bobr> 기타 지침 </nobr> </th>/</tr>/</thead>/<tbody>/' + paramhtml +'/</tbody>/</table>/</div>/</dd> '$ ('#outparam dl '). html (html);} html <! durtype html> <html lang = "en"> <head> <meta charset = "utf-8"> <title> js는 들여 쓰기 테이블을 생성합니다. charset = "utf-8"> <title> js는 들여 쓰기 테이블을 생성합니다 >/dl> </div> <script src = "http://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"> </script> <cript> var json = '[{ "id": 302, "serviceId": 15, "name": "jsonobdes", ""qualdes ":"jsonob " 정보 ","value ":" ","comment ":" ","parentid ":-1,"childrenparam ": [{"id ": 305,"serviceid ":"name ":"info ","type ":"jsonobject ","paramdesc ":"query 내용 ","value ":" ","comment ":" ","parentid ": 302,"childrenparam ": [{"id ": 312,"se rviceid ": 15,"name ":"entinvlist ","type ":"paramdesc ":"Enterprise 외국인 투자 상황 ","value ":" ","comment ":" ","parentid ": 305,"childrenparam ": [{"id ": 343,"serviceid ":"name ":"regno ","type ":"string ","paramdesc ":"reggistration 숫자 ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}, {"id ": 342,"serviceid ": 15, nam e ":"regcapcur ","type ":"string ","paramdesc ":"regcapcurrent ","value ":" "," ","댓글 ":" ","parentid ":"childresparam ":"null}, { "id": 341, "service": 15, "name": "regcap", "tape", "regcap", "regcap": "regcap": "regcap": Yuan), "value": "", "comment": "", "parentid": 312, "childrenparam": null}, { "id": 340, "service": 15, "name": "en t_name", "type": "string", "paramdesc": "법적 대표 이름 ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}, {"id ": 339,"service ": 15,"name ":"FundedRatio ","type ":"string ","paramdesc ":"기여. " 비율 ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}, {"id ": 338,"service ": 15,"name ":"esdate ","type ":"string ","paramdesc ":"열기 날짜 ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}, {"id ": 337,"service ": 15,"name ":"error ","type ":"string ","paramdesc ":"구독 자본 (10,000 Yuan) ","value ":" "", "comment": "", "parentid": 312, "childrenparam": null}, { "id": 336, "service": 15, "name": "Enttype", "type": "s twist", "paramdesc": "Enterprise (기관). type ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}, {"id ": 345,"service ": 15,"name ":"Revdate ","type ":"paramdesc ":"Revod 날짜 ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}, {"id ": 344,"service ": 15,"name ":"regorg ","type ":"pa ramdesc ":"등록 권위 ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}, {"id ": 334,"service ": 15,"name ":"currency ","type ":"paramdesc ":"구독 자본 Currency ","Value ":" ","Comment ":" "", "Parentid": 312, "ChildrenParam": null}, { "id": 335, "service": 15, "name": "entstatus", "type": "string", "paramdesc" : "Ent_name", "type": "paramdesc": "", "parentid": 312, "childrenparam": null}, { "id": "service": "15,"name ":"candate ","type ":"string ","paramdesc ":"login 날짜 ","value ":" ","comment ":" ","parentid ": 312,"childrenparam ": null}]}, {"id ": 346,"service ": 15,"name ":"Ent_name ","type ":"string ","paramdesc ":"ent name ","va lue ":" ","comment ":" ","parentid ": 305,"childrenparam ": null}, {"id ": 311,"serviceid ": 15,"name ":"basic ","type ":"jsonobject ","paramdesc ":"Enterprise 정보 ","value ":" ","comment ":" ","parentid ": 305,"childrenparam ": [{"id ": 326,"serviceid ":"name ":"opscope ","type ":"string ","paramdesc ":"Operation (비즈니스) 스코프 ","value ":" ","c oment ":" "," ","parentid ": 311,"childrenparam ": null}, {"id ": 327,"serviceid ": 15,"name ":"opto ","type ":"string ","paramdesc ":"Operation term to yyyy-mm-dd ":" "value": "", "댓글": "", "parentid": 311, "childrenparam": null}, { "id": 324, "service": "name": "IndustryPhy", "type": "String", "Paramdesc": "국가 경제 산업 코드 ","value ":" "" "" "" "" ""value ": """"""""" 관한다는다는 것에 """"""""""" 붙재 """"""""""""" 붙재 """"""""""""징새재". "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""광" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" """광 "" "" "" "" "" "" "" "" "" "" "" "" """광 "" "" "" "" "" """준 "" "" "" "" "" "" "" "" "" ""른" "" "" "" "" "" "" "" "" "않았 것이다한다한다한다" "" ""이다 것이다한다했다 "" "" ""이다 것이다한다 않다 않다 "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""광" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" """광 "" "" "" "" "" "" "" "" "" "" "" "" """광 "" "" "" "" "" """준 "" "" "" "" "" "" "" "" "" ""른" "" "" "" "" "" "" "" "" "않았 것이다한다한다한다" "" ""이다 것이다한다했다 "" "" ""이다 것이다한다 않다 않다 "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" """광 "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" """광 "" "" "" "" "" "" "" "" "" "" "" "" """광 "" "" "" "" """색 "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""광" "" "" "" "" "않았른" "" "" "" "" ""이다이다한다이다이다 이다속 의h이다 " , "댓글": "", "parentid": 311, "childrenparam": null}, { "id": "serviceid": 15, "name": "opfrom", "type": "string", "paramdesc": "작업 용어는 yyyy-mm-dd ":" ","value ":" ","댓글 ":" ","parentid ": 311,"childrenparam ": null}, {"id ": 322,"serviceid ": 15,"name ":"frname ","type ":"string ","paramdesc ":"Enterprise는 합법적 인 사람으로 결정되었습니다. 이름 ","value ":" ","comment ":" ","parentid ": 311,"childrenparam ": null}, {"id ": 323,"service ": 15,"name ":"industryco ","type ":"paramdesc ":"산업 범주 코드 ","value ":" ","comment ":" "", "parentid": 311, "childrenparam": null}, { "id": 320, "service": 15, "name": "enttype", "type": "string", "entent (기관) 유형 제한 책임 회사," 등. ","value ":", "hamon": "" ","parentid ": 311,"childrenparam ": null}, {"id ": 321,"service ":"name ":"esdate ","type ":"paramdesc ":"개방 날짜 yyyy-mm-dd ","value ":" "", "comment": "", "parentid": 311, "childrenparam": null}, { "id": 332, "serviceid": "name": "Revdate", "type": "String", "paramdesc": "행 판매 날짜 yyyy-mm-dd ","value ":" "", "comment": "", "parentid": 311, "childrenparam": null}, { "id": 330, "serviceid": 15, "name": "regno", "type": "string", "paramdesc": "Registration 숫자 ","value ":" ","comment ":" ","parentid ": 311,"childrenparam ": null}, {"id ": 331,"service ": 15,"name ":"regorg ","type ":"paramdesc ":"등록 기관 ","v Alaue ":" ","Comment ":" ","Parentid ": 311,"Childrenparam ": null}, {"id ": 328,"service ": 15,"name ":"regcap ","type ":"string ","paramdesc ":"Regcap Unit : 10,000 Yuan ","Value ":" ","Comment ":" ","Parentid ": 311,"ChildrenParam ": null}, {"id ": 329,"service ": 15,"name ":"regcapcur ","type ":"string ","Currency Rmb, US Dolar 등 ","Val. ","Val. " ue ":" ","comment ":" ","parentid ": 311,"childrenparam ": null}, {"id ": 313,"serviceid ": 15,"name ":"opscoandform ","type ":"string ","paramdesc ":"범위 및 작동 방법 (비즈니스) ","value ":" ","comment ":" ","parentid ": 311,"childrenparam ": null}, {"id ": 315,"service ": 15,"name ":"ancheyear ","type ":"paramdesc ":"마지막 연례 검사 Yyyy ","value ":" ","comment ":" ","parentid ": 311,"childrenparam ": null}, {"id ": 314,"serviceid ": 15,"name ":"abuitem ","type ":"paramdesc ":"라이센스 사업 Project ","Value ":" ","Comment ":" ","Parentid ": 311,"Childrenparam ": null}, {"id ": 317,"ser vice ":"name ":"cbuitem ","type ":"paramdesc ":"일반 사업 프로젝트 ","value ":" ","comment ":" ","parentid ": 311,"childrenparam ": null}, {"id ": 316,"service ": 15,"name ":"candate ","type ":"paramdesc ":"logout yyyy-mm-dd ","val ue ":" ","comment ":" "", "parentid": 311, "childrenparam": null}, { "id": 319, "serviceid": 15, "name": "entstatus", "type": "string", "paramdesc": "작동 상태, 취소, 취소,"파라 데스크 " 기타 ","value ":" ","comment ":" ","parentid ": 311,"childrenparam ": null}, {"id ": 318 , "serviceid": "name": "dom", "type": "string", "paramdesc": "add 결과 ","value ":"not_match | 상태 ","value ":" ","comment ":" ","parentid ": 302,"childrenparam ": null}]}, {"id ": 306,"service ": 1 5,"name ":"api_status ","type ":"jsonobject ","paramdesc ":"반환 상태 코드 ","value ":" ","comment ":" ","parentid ":-1,"childrenparam ": [{"id ": 307,"serviceid ": 15,"name ":"status ","type ":"boolean ","paramdesc ":"interface Retation ","value ":"댓글 "", "부모 id ": 306,"childrenparam ": null}, {"id ": 309,"service ": 15,"name ":"description ","type ":"string ","paramdesc ":"return status 설명 ","value ":" ","comment ":" ","parentid ": 306,"childrenparam ": null}, {"id ": 308,"service ": 15,"name ":"code ","type ":"paramdesc ":"status 코드 ","value ":" ","comment ":" ","parentid ": 306,"childrenparam ": null}, {"id ": 310,"service ": 15,"name ":"serial_no ","type ":"string ","paramdesc ":"flow 숫자 ","value ":" ","comment ":" ","parentid ": 306,"childrenparam ": null}]}]; // api 페이지 출력 매개 변수 설명 var apitohtml_outparamfn = function (json) {var html = 'var mustarar = ['required ','옵션 '' 'var data =' ''var data = $ .parsejson (json); console.log (data) // 이름 : 매개 변수 영어 이름 // 유형 : 매개 변수 유형 // paramdesc : 매개 변수 중국어 정의 // 값 : 매개 변수 할당 설명 // 댓글 : 파라미터 기타 설명 // Childer Parameter List console.log('----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- c = [] dataformatfn2 (data, flagi) // 통계 하위 클래스 수 // 각 노드 각 노드는 하위 노드의 합을 계산하기 위해 Len 속성을 추가하여 하위 노드 기능 dataformatfn2 (data) {for (var i = 0; i <data.length; i ++)를 계산합니다. {bbb [i] = 0bbb [i] = dataformatfn (data [i], 0, bbb [i], c)}; // htmlparamhtml = jsontohtml (data, 0);} function dataformatfn (data, flagi, b, c) {data.len = (data.children). data.childrenparam.length) || 1 // debugger // console.log (data) c = c || [] if (data.childrenparam) {for (var i = 0; i <data.childrenparam.length; i ++) {b ++ data.len+= dataformatfn (data.childrenparam [i], b [i], b, c, b. data.len} else {return (data.childrenparam && data.childrenparam.length) || 0}} console.log (bbb) console.log (data) var flagi = 0 // dataformatafn2 // paramhtml = jsontohtml (data, len); function jsontohtml (data, and and a, and and and and) paramhtml = ''; var nbsparr = [ '', '<b> </b>', '<b> </b>', '<b> </b>', '<b> </b>', '<b> </b>', ' <b> </b> ','<b> </b> ','<b> </b> ','<b> </b> ','<b> </b> ']] i = 0; i <data.length; i ++) {var str2 = ''var span = 1if (i == 0 && flagi> 0 && len> 1) {span = (10 -flagi) str2 = '<td rowspan = "'+(len)+'"> </td>'} else {10-flagi)} paramhtml+= '} + '/<td colspan = "' + span + '"> <bobr>' + nbsparr [flagi] + data [i] .name + '</namr> </td>/<td>' + data [i] .type + '</td>/<td>' + data [i] .paramdesc + '</td>/<td>' + data [i] ' + data [i]. +'</td>/<td>' +data [i] .comment +'</td>/</tr>'if (data [i] .childrenparam) {paramhtml += jsontohtml (data [i] .childrenparam, flagi +1, data [i] .len)} else {flagi}}}}}}} paramHtml}console.log('----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- colspan = "10"> <bobr> 매개 변수 영어 이름 </nobr> </th>/<th> <bobr> 매개 변수 유형 </nobr> </th>/<th> <th> <bobr> 중국 정의 </nobr> </th>/<th> <bobr> 매개 변수 할당 설명 </nobr> </th>/<th> <bobr> 기타 지침 </nobr> </th>/</tt>/</tt>/</thead>/<tbody>/' + paramhtml +'/</tbody>/</div>/</div>/</dd> '$ ('#outparam dl '). html (html);} apitohtml_outparamfn (json) </script> </body> </html>