Kürzlich habe ich ein Benutzerverwaltungssystem erstellt, das Projektanforderungen hat und die Verwendung von JS zur Generierung eines Formulars mit Einrückung erfordert. Das stumpft mich wirklich. Diese Funktion wird durch die Suche nach relevanten Informationen realisiert. Der folgende Editor nimmt Notizen an den Implementierungscode, der für zukünftige Suchanfragen geeignet ist. Gleichzeitig hoffe ich auch, dass Freunde, die die gleichen Bedürfnisse wie ich haben, eine Referenz machen können. Wenn es eine bessere Methode gibt, hinterlassen Sie mir eine Nachricht, danke!
JS macht die folgende Form:
JSON
[{"id": 302, "serviceId": 15, "name": "data", "type": "jsonObject", "paramdesc": "return query Informationen "," Wert ":" "," Kommentar ":" "," ParentID ":-1," ChildhsParam ": [{" ID ": 305," serviceId ": 15," Name ":" Info "," Typ ":" JsonObject "," Paramdesc ":" Abfrage Inhalt "," Wert ":" "," Kommentar ":" "," ParentID ": 302," ChildrenParam ": [{" ID ": 312," Service -ID ": 15," Name ":" EntInvlist "," Typ ":" Liste "," Paramdesc ":" Enterprise Fremd Investment Situation "," Wert ":" "," Kommentar ":" "," ParentId ": 305," ChildrenParam ": [{" ID ": 343," serviceId ": 15," Name ":" Regno "," Typ ":" String "," Paramdesc ":" Registrierung Nummer "," Wert ":" "," Kommentar ":" "," ParentId ": 312," ChildhsParam ": null}, {" id ": 342," serviceId ": 15," name ":" r egcapcur "," Typ ":" String "," Paramdesc ":" Registriertes Kapital Währung "," Wert ":" "," Kommentar ":" "," ParentId ": 312," Childhsparam ": null}, {" id ": 341," serviceId ": 15," name ":" regCap "," Typ ":" String "," Paramdesc ":" Regcap (10.000) yuan), "Wert": "", "Kommentar": "", "Parentid": 312, "Childrenparam": null}, {"id": 340, "serviceId": 15, "name": "ent_nam e", "Typ": "String", "Paramdesc": "gesetzliche Vertretung Name "," Wert ":" "," Kommentar ":" "," ParentId ": 312," Childhsparam ": null}, {" id ": 339," serviceId ": 15," name ":" fundDratio "," Typ ":" String "," Paramdesc ":" Beitrag Ratio "," Wert ":" "," Kommentar ":" "," ParentId ": 312," Childhsparam ": null}, {" id ": 338," serviceId ": 15," name ":" Esdate "," Typ E ":" String "," Paramdesc ":" Öffnen Datum "," Wert ":" "," Kommentar ":" "," ParentId ": 312," ChildhsParam ": null}, {" id ": 337," serviceId ": 15," name ":" error "," type ":" string "," paramdesc ":" abonniertes Kapital (10.000) yuan) "," Wert ":" "," Kommentar ":" "," ParentId ": 312," ChildrenParam ": null}, {" id ": 336," serviceId ": 15," Name ":" Enttype "," Typ ":" Strin G "," Paramdesc ":" Enterprise (Institution) (Institution). Geben Sie "," Wert ":" "," Kommentar ":" "," ParentId ": 312," Childlaram ": null}, {" ID ": 345," serviceId ": 15," Name ":" Revdate "," Typ ":" String "," paramdesc ":" revod Datum "," Wert ":" "," Kommentar ":" "," ParentId ": 312," ChildhsParam ": null}, {" id ": 344," serviceId ": 15," name ":" Regorg "," Typ ":" String "," Paramd ESC ":" Registrierung Autorität "," Wert ":" "," Kommentar ":" "," ParentId ": 312," Childlaram ": null}, {" ID ": 334," serviceId ": 15," Name ":" Währung "," Typ ":" String "," Paramdesc ":" abonniertes Kapital Währung "," Wert ":" "," Kommentar ":" "," Parentid ": 312," Kindersparam ": null}, {" id ": 335," serviceId ": 15," name ":" entstatus "," type ":" String "," Paramdesc ":" EntentStatus "," Typ ":" Paramdesc ":": ":": ":": "entccompany": "paramdesc": "entccompany": "paramdesc" Status "," Wert ":" "," Kommentar ":" "," ParentID ": 312," Childhsparam ": null}, {" id ": 333," serviceId ": 15," name ":" candate "," type ":" string "," paramdesc ":" login Datum "," Wert ":" "," Kommentar ":" "," parentId ": 312," childlyParam ": null}]}, {" id ": 346," serviceId ": 15," name ":" ent_Name "," type ":" string "," paramdesc ":" Entname "," Wert "," Wert " ":" "," Kommentar ":" "," ParentId ": 305," Childlaram ": null}, {" id ": 311," serviceId ": 15," name ":" basic "," type ":" jsonObject "," paramdesc ":" Basic Informationen "," Wert ":" "," Kommentar ":" "," ParentID ": 305," ChildhsParam ": [{" ID ": 326," serviceId ": 15," name ":" opScope "," Typ ":" String "," Paramdesc ":" Business (Business) Scope "," Wert "," ":" "," "," "," "," "," Com ment ":" "," parentId ": 311," childharparam ": null}, {" id ": 327," serviceId ": 15," name ":" opto "," type ":" string "," paramdesc ":" operation term YYYY-MM-DD","value":"","comment":"","parentId":311,"childrenParam":null},{"id":324,"serviceId":15,"name":"industryPhy","type":"String","paramDesc":"National Economic Industry Code","value":"",""," Kommentar ":" "," ParentID ": 311," ChildrenParam ": Null}, {" ID ": 325," serviceId ": 15," Name ":" opfrom "," Typ ":" String "," Paramdesc ":" Operation Term von stammt von YYYY-MM-DD","value":"","comment":"","parentId":311,"childrenParam":null},{"id":322,"serviceId":15,"name":"frName","type":"String","paramDesc":"Determined as the name of the representative is the legal representative, and the self-employed is negative The person in charge was Namen "," Wert ":", "Kommentar": "", "ParentID": 311, "ChildrenParam": null}, {"id": 323, "serviceId": 15, "name": "branchen", "type": "string", "paramdesc": "Branchenkategorie code","value":"","comment":"","parentId":311,"childrenParam":null},{"id":320,"serviceId":15,"name":"entType","type":"String","paramDesc":"Enterprise (institution) type has Limited liability companies, usw. "," Wert ":", "Kommentar": "", "ParentId": 311, "Childrenparam": null}, {"id": 321, "serviceId": 15, "name": "Esdate", "Typ": "String", "Paramdesc": "Öffnungsdatum Yyyy-mm-dd "," value ":" "," comment ":" "," parentId ": 311," childharparam ": null}, {" id ": 332," serviceId ": 15," name ":" revdate "," type ":" string "," paramdesc ":" revokedes Datum Yyyy-mm-dd "," value ":" "," comment ":" "," parentId ": 311," childharparam ": null}, {" id ": 330," serviceId ": 15," name ":" regno "," type ":" string "," paramdesc ":" Registrierung Nummer "," Wert ":" "," Kommentar ":" "," ParentId ": 311," ChildrenParam ": null}, {" ID ": 331," serviceId ": 15," Name ":" Regorg "," Typ ":" String "," Paramdesc ":" Registrierungsbehörde "," Va lue ":" "," comment ":" "," parentId ": 311," childlyparam ": null}, {" id ": 328," serviceId ": 15," name ":" regcap "," type ":" String "," Paramdesc ":" Registrierte Kapitaleinheit: 10.000 yuan","value":"","comment":"","parentId":311,"childrenParam":null},{"id":329,"serviceId":15,"name":"regCapCur","type":"String","paramDesc":"currency RMB, US dollar, etc.","valu E ":" "," Kommentar ":" "," ParentId ": 311," ChildhsParam ": null}, {" id ": 313," serviceId ": 15," name ":" opscoandform "," Typ ":" String "," Paramdesc ":" Scope and Operation Method (Business) "," Wert ":" "," Kommentar ":" "," Parentid ": 311," Kindersparam ": null}, {" id ": 315," serviceId ": 15," Name ":" Ancheyear "," Typ ":" String "," Paramdesc ":" Letzte jährliche Inspektion yjjyjyjear "," Wert ":" "," Kommentar ":" "," ParentId ": 311," Childrenparam ": null}, {" id ": 314," serviceId ": 15," Name ":" Abuitem "," Typ ":" String "," Paramdesc ":" Lizenziertes Geschäft Projekt "," Wert ":" "," Kommentar ":" "," ParentId ": 311," ChildrenParam ": null}, {" ID ": 317," Ser Vizeid ": 15," Name ":" CBuitem "," Typ ":" String "," Paramdesc ":" Allgemeines Geschäft Projekt "," Wert ":" "," Kommentar ":" "," parentId ": 311," childharAlam ": null}, {" id ": 316," serviceId ": 15," name ":" candate "," type ":" string "," paramdesc ":" logout date yyyymm-mm-dd "," val ue":"","comment":"","parentId":311,"childrenParam":null},{"id":319,"serviceId":15,"name":"entStatus","type":"String","paramDesc":"operation status in operation, revocation, cancellation, Andere "," Wert ":" "," Kommentar ":" "," ParentId ": 311," ChildrenParam ": null}, {" id ": 318 , "serviceId": 15, "name": "dom", "type": "string", "paramdesc": "adresse", "Wert": "", "comment": "", "parentId": 311, "childharparam Ergebnis "," Wert ":" Match | not_match | Not_found "," Kommentar ":" "," parentId ": 302," childlyparam ": null}, {" id ": 303," serviceId ": 15," name ":" Status "," Typ ":" boolean "," paramdesc ":" Schnittstellenrückgabe Status "," Wert ":" "," Kommentar ":" "," parentId ": 302," childlyParam ": null}]}, {" id ": 306," serviceId ": 15," name ":" api_status "," type ":" jsonObject "," paramdesc ":" return status return status Code "," Wert ":" "," Kommentar ":" "," ParentId ":-1," ChildhsParam ": [{" ID ": 307," serviceId ": 15," name ":" Status "," Typ ":" boolean "," Paramdesc ":" Interface Return Status "," Wert ":" Wert ":", ",", ",", ",", ",", ",", ",", ",", "," Pare "," Pare ",", ",", "," ",", ",", ",", "," Pare "," Pare ntid ": 306," childharparam ": null}, {" id ": 309," serviceId ": 15," name ":" Beschreibung "," Typ ":" String "," ParamDesc ":" Rückgabestatus Beschreibung "," Wert ":" "," Kommentar ":" "," ParentId ": 306," Childhsparam ": null}, {" id ": 308," serviceId ": 15," name ":" code "," type ":" st Ring "," paramdesc ":" Status Code "," Wert ":" "," Kommentar ":" "," ParentID ": 306," Childhsparam ": null}, {" ID ": 310," serviceId ": 15," name ":" serial_no "," Typ ":" String "," Paramdesc ":" Flow Nummer "," Wert ":" "," Kommentar ":" "," ParentID ": 306," ChildrenParam ": null}]}]JS
// API -Seite Ausgabe Parameter Beschreibung var apitoHtml_outparamfn = Funktion (JSON, returnExample) {var html = '' var musarr = ['Erforderlich', 'optional'] var paramhtml = '' var data = $ .Parsejson (JSON); console.log (Data) // NAMETER: Parameter -Name: Parameter -Name: Parameter -Name: Parameter -Name: Parameter -Typ: Parameter -Name: Parameter -Name: Parameter -Name: Parameter -Name: Parameter -Name: Parameter -Name: Parameter -Name: Parameter -Name: Parameter -Name: Parameter -Name: Parameter -Name: Parameter -Name: Parameter -Typ: Parameter -Name: Parameter -Name: Parameter -Name: Parameter: Parameterzuweisung Beschreibung // Kommentar: Parameter Andere Beschreibung // Childrenparam: Child Parameterliste console.log ('---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- c = [] dataFormatfn2 (Daten, Flagi) // Statistik Die Anzahl der Unterklassen // Jeder Knoten fügt das LEN -Attribut hinzu, um die Summe des untergeordneten Knotens und der untergeordneten Knotenfunktion DataFormatfn2 (Daten) {for (var i = 0; i <Data.Length; I ++) zu zählen. {bbb [i] = 0bbb [i] = dataFormatfn (data [i], 0, bbb [i], c)}; // Daten an htmlparamhtml = jsontohtml (Data, 0); Data.Childrenparam.Length) || 1 // Debugger // console.log (Daten) c = c || [] if (data.Childrenparam) {für (var i = 0; i <data.Childrenparam.Length; i ++) {b ++ data.len+= dataformatfn (data. Data.len} else {return (data.Childrenparam && data.Childrenparam.length) || 0}} console.log (BBB) console.log (data) var flagi = 0 // Nach dem Verschieben auf DataFormatAfn2, Execute // paramhtml = jsonToHTML (DataFormAfn2); JSONTOHTML (Daten, 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> '] für (var 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{span = (10-flagI)}paramHtml += '<tr>/'+ str2 + '/<td colspan = "' + span + '"> <nobr>' + nbarr [flagi] + data [i] .name + '</nobr> </td>/<td>' + data [i] .type + '</td>/<td>' + data [i] .Paramdesc + '</td>/</<td>/<i]. +'</td>/<td>'+ data[i].comment +'</td>/</tr>'if(data[i].childrenParam){paramHtml += jsontohtml(data[i].childrenParam,flagI+1,data[i].len)}else{flagI}}return ParamHtml} Konsole colspan="10"><nobr>Parameter English name</nobr></th>/<th><nobr>Parameter type</nobr></th>/<th><nobr>Chinese definition</nobr></th>/<th><nobr>Parameter assignment description</nobr></th>/<th><nobr>Other Anweisungen </nobr> </th>/</tr>/</thead>/<tbody>/' + paramhtml +'/</tbody>/</table>/</div>/</dd> '$ ('#outParam dl '). charset = "utf-8"> <title> js generiert eine eingestellte Tabelle </title> </head> <body> <div id = "outparam"> <dl> </dl> </div> </body> </html> vollständiger Code: <! docType html> <html langwang = "en" < Tabelle </title> <link rel = "styleSheet" type = "text/css" media = "screen" href = "http://cdn.bootcs.com/bootstrap/3.6/css/bootstrap.min src="http://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script><script>var json='[{"id":302,"serviceId":15,"name":"data","type":"JsonObject","paramDesc":"Return query Informationen "," Wert ":" "," Kommentar ":" "," ParentID ":-1," ChildhsParam ": [{" ID ": 305," serviceId ": 15," Name ":" Info "," Typ ":" JsonObject "," Paramdesc ":" Abfrage Inhalt "," Wert ":" "," Kommentar ":" "," Parentid ": 302," Childrenparam ": [{" ID ": 312," Se rviceid ": 15," Name ":" EntInvlist "," Typ ":" List "," Paramdesc ":" Enterprise Fremd Investment investment Situation "," Wert ":" "," Kommentar ":" "," ParentId ": 305," ChildrenParam ": [{" ID ": 343," serviceId ": 15," Name ":" Regno "," Typ ":" String "," Paramdesc ":" Registrierung Nummer "," Wert ":" "," Kommentar ":" "," ParentId ": 312," ChildrenParam ": null}, {" ID ": 342," serviceId ": 15," nam e":"regCapCur","type":"String","paramDesc":"regcapCurrent","value":"","comment":"","parentId":312,"childrenParam":null},{"id":341,"serviceId":15,"name":"regCap","type":"String","paramDesc":"regcap (10,000 yuan), "Wert": "", "Kommentar": "", "ParentId": 312, "Childrenparam": null}, {"id": 340, "serviceId": 15, "name": "en t_name", "Typ": "String", "Paramdesc": "gesetzlicher Vertretung Name "," Wert ":" "," Kommentar ":" "," ParentId ": 312," Childhsparam ": null}, {" id ": 339," serviceId ": 15," name ":" fundDratio "," Typ ":" String "," Paramdesc ":" Beitrag Ratio "," Wert ":" "," Kommentar ":" "," ParentId ": 312," Childhsparam ": null}, {" id ": 338," serviceId ": 15," name ":" Esdate "," Typ ":" String "," Paramdesc ":" Öffnen Datum "," Wert ":" "," Kommentar ":" "," ParentId ": 312," ChildhsParam ": null}, {" id ": 337," serviceId ": 15," name ":" error "," type ":" string "," paramdesc ":" abonniertes Kapital (10.000) yuan) "," Wert ":" "," Kommentar ":" "," ParentId ": 312," Childrenparam ": null}, {" id ": 336," serviceId ": 15," name ":" enttype "," type ":" s twist "," paramdesc ":" Enterprise (institutional) (institutional) Geben Sie "," Wert ":" "," Kommentar ":" "," ParentId ": 312," Childlaram ": null}, {" ID ": 345," serviceId ": 15," Name ":" Revdate "," Typ ":" String "," paramdesc ":" revod Datum "," Wert ":" "," Kommentar ":" "," ParentId ": 312," Childhsparam ": null}, {" ID ": 344," serviceId ": 15," name ":" Regorg "," Typ ":" String "," PA Ramdesc ":" Registrierung Autorität "," Wert ":" "," Kommentar ":" "," ParentId ": 312," Childlaram ": null}, {" ID ": 334," serviceId ": 15," Name ":" Währung "," Typ ":" String "," Paramdesc ":" abonniertes Kapital Währung "," Wert ":" "," Kommentar ":" "," ParentId ": 312," ChildrenParam ": null}, {" ID ": 335," serviceId ": 15," Name ":" Entstatus "," Typ ":" String "," Paramdesc " : "ent_Name", "type": "paramdesc": "", "parentId": 312, "childlyParam": null}, {"id": 333, "serviceId": 15, "name": "candate", "type": "string", "paramdesc": "login Datum "," Wert ":" "," Kommentar ":" "," parentId ": 312," childlyParam ": null}]}, {" id ": 346," serviceId ": 15," name ":" ent_Name "," type ":" string "," paramdesc ":" entname "," va lue ":" "," comment ":" "," parentId ": 305," childharparam ": null}, {" id ": 311," serviceId ": 15," name ":" basic "," type ":" jsonObject "," paramdesc ":" Enterprise Informationen "," Wert ":" "," Kommentar ":" "," ParentID ": 305," Childhsparam ": [{" ID ": 326," serviceId ": 15," name ":" opScope "," Typ ":" String "," Paramdesc ":" Operation (Business) Scope "," Wert "," Wert ":" "," c oment ":" "," parentId ": 311," childharparam ": null}, {" id ": 327," serviceId ": 15," name ":" opto "," type ":" string "," paramdesc ":" operation Term to Yyyy-mm-dd "," Wert ":" "," Kommentar ":" "," Parentid ": 311," Kindersparam " Code "," Wert ":" "" "" "" Wert ": """""" Sehrs "S"""" " """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" , "Kommentar": "", "ParentId": 311, "ChildrenParam": Null}, {"ID": 325, "serviceId": 15, "Name": "opfrom", "Typ": "String", "Paramdesc": "Operation Term von YYYY-MM-DD","value":"","comment":"","parentId":311,"childrenParam":null},{"id":322,"serviceId":15,"name":"frName","type":"String","paramDesc":"Determined as the name of the representative, the enterprise is the legal representative, and the self-employed The person in charge is the last Name "," Wert ":" "," Kommentar ":" "," ParentId ": 311," ChildrenParam ": null}, {" id ": 323," serviceId ": 15," name ":" branchen "," type ":" string "," paramdesc ":" Branchenkategorie code","value":"","comment":"","parentId":311,"childrenParam":null},{"id":320,"serviceId":15,"name":"entType","type":"String","paramDesc":"entent(institution) type Limited liability companies, usw. "," Wert ":", "Kommentar": "", "ParentId": 311, "Childrenparam": null}, {"id": 321, "serviceId": 15, "name": "Esdate", "Typ": "String", "Paramdesc": "Öffnungsdatum Yyyy-mm-dd "," value ":" "," comment ":" "," parentId ": 311," childharParam ": null}, {" id ": 332," serviceId ": 15," name ":" revdate "," type ":" string "," paramdesc ":" hang Sales Date Yyyy-mm-dd "," value ":" "," comment ":" "," parentId ": 311," childharparam ": null}, {" id ": 330," serviceId ": 15," name ":" regno "," type ":" string "," paramdesc ":" Registrierung Nummer "," Wert ":" "," Kommentar ":" "," ParentId ": 311," ChildrenParam ": null}, {" id ": 331," serviceId ": 15," name ":" Regorg "," Typ ":" String "," Paramdesc ":" Registrierungsbehörde ", v Alaue ":" "," Kommentar ":" "," ParentId ": 311," ChildrenParam ": Null}, {" ID ": 328," serviceId ": 15," Name ":" Regcap "," Typ ":" String "," Paramdesc ":" Regcap Unit: 10.000 yuan","value":"","comment":"","parentId":311,"childrenParam":null},{"id":329,"serviceId":15,"name":"regCapCur","type":"String","paramDesc":"currency RMB, US dollar, etc.","val UE ":" "," Kommentar ":" "," ParentId ": 311," ChildrenParam ": Null}, {" ID ": 313," serviceId ": 15," Name ":" Opscoandform "," Typ ":" String "," Paramdesc ":" Scope and Operation Method (Business) "," Wert ":" "," Kommentar ":" "," Parentid ": 311," Kindersparam ": null}, {" id ": 315," serviceId ": 15," Name ":" Ancheyear "," Typ ":" String "," Paramdesc ":" Letzte jährliche Inspektion YJJJJs "," String "," Paramdesc ":" Letzte jährliche Inspektion YJJJJs "," String "," Paramdesc ":" Letzte jährliche Inspektion YJJJJs "," String "," Paramdesc ":" Letzte jährliche Inspektion YJJJJs, "type": "String", "Paramdesc": "Letzte jährliche YJJJJs. "," Wert ":" "," Kommentar ":" "," ParentId ": 311," Childrenparam ": null}, {" id ": 314," serviceId ": 15," Name ":" Abuitem "," Typ ":" String "," Paramdesc ":" Lizenziertes Geschäft Projekt "," Wert ":" "," Kommentar ":" "," ParentId ": 311," ChildrenParam ": null}, {" ID ": 317," Ser Vizeid ": 15," Name ":" CBuitem "," Typ ":" String "," Paramdesc ":" Allgemeines Geschäft Projekt "," Wert ":" "," Kommentar ":" "," parentId ": 311," childharAlam ": null}, {" id ": 316," serviceId ": 15," name ":" candate "," type ":" string "," paramdesc ":" logout date yyyymm-mm-dd "," val ue":"","comment":"","parentId":311,"childrenParam":null},{"id":319,"serviceId":15,"name":"entStatus","type":"String","paramDesc":"operation status in operation, revocation, cancellation, Andere "," Wert ":" "," Kommentar ":" "," ParentId ": 311," ChildrenParam ": null}, {" id ": 318 , "serviceId": 15, "name": "dom", "type": "string", "paramdesc": "adresse", "Wert": "", "comment": "", "parentId": 311, "childharparam Ergebnis "," Wert ":" Übereinstimmung | Status "," Wert ":" "," Kommentar ":" "," parentId ": 302," childlyParam ": null}]}, {" id ": 306," serviceId ": 1 5," name ":" api_status "," type ":" jsonObject "," paramdesc ":" return status zurück code","value":"","comment":"","parentId":-1,"childrenParam":[{"id":307,"serviceId":15,"name":"status","type":"Boolean","paramDesc":"interface return status","value":"","comment":"","parent ID ": 306," childharparam ": null}, {" id ": 309," serviceId ": 15," name ":" Beschreibung "," Typ ":" String "," ParamDesc ":" Rückgabestatus Beschreibung "," Wert ":" "," Kommentar ":" "," ParentID ": 306," Childhsparam ": null}, {" ID ": 308," serviceId ": 15," Name ":" Code "," Typ ":" Strin G "," Paramdesc ":" Status Code "," Wert ":" "," Kommentar ":" "," ParentID ": 306," Childhsparam ": null}, {" ID ": 310," serviceId ": 15," name ":" serial_no "," Typ ":" String "," Paramdesc ":" Flow Nummer "," Wert ":" "," Kommentar ":" "," parentId ": 306," childlyparam ": null}]}] '; // API -Seite Ausgabe Parameter Beschreibung var apitohtml_outparamfn $ .Parsejson (JSON); console.log (Daten) // Name: Parameter Englisch Name // Typ: Parameter Typ // Paramdesc: Parameter Chinesische Definition // Wert: Parameterzuweisung Beschreibung // Kommentar: Parameter Andere Beschreibung console.log ('-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- c = [] dataFormatfn2 (Daten, Flagi) // Statistik Die Anzahl der Unterklassen // Jeder Knoten fügt das LEN -Attribut hinzu, um die Summe des untergeordneten Knotens und der untergeordneten Knotenfunktion DataFormatfn2 (Daten) {for (var i = 0; i <Data.Length; I ++) zu zählen. {bbb [i] = 0bbb [i] = dataFormatfn (data [i], 0, bbb [i], c)}; // Daten an htmlparamhtml = jsontohtml (Data, 0); Data.Childrenparam.Length) || 1 // Debugger // console.log (Daten) c = c || [] if (data.Childrenparam) {für (var i = 0; i <data.Childrenparam.Length; i ++) {b ++ data.len+= dataformatfn (data. Data.len} else {return (data.Childrenparam && data.Childrenparam.length) || 0}} Konsole.log (bbb) console.log (data) var flagi = 0 // Ausführen von DataFormatafn2 // paramhtml = jsonToHtml (DataFormatafn2 // paramhtml (data, data, data, firma); paramhtml = ''; var nbsparr = ['', '<b> ⅰ </b>', '<b> ⅱ </b>', '<b> ⅲ </b>', '<b> ⅵ </b>', '<b> ⅴ </b>', ',', ',', ',', ',', ',', ',', ',', ',', ',', ',', ',', ',', ',', ' <b> ⅵ </b> ',' <b> ⅶ </b> ',' <b> ⅷ </b> ',' <b> ⅸ </b> ',' <b> ⅹ </b> '] für (var 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{span = (10-flagI)}paramHtml += '<tr>/'+ str2 + '/<td colspan = "' + span + '"> <nobr>' + nbarr [flagi] + data [i] .name + '</nobr> </td>/<td>' + data [i] .type + '</td>/<td>' + data [i] .paramdesc + '</td>/</<td>/<i]. +'</td>/<td>'+ data[i].comment +'</td>/</tr>'if(data[i].childrenParam){paramHtml += jsontohtml(data[i].childrenParam,flagI+1,data[i].len)}else{flagI}}return paramHtml}console.log('----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- colspan="10"><nobr>Parameter English name</nobr></th>/<th><nobr>Parameter type</nobr></th>/<th><nobr>Chinese definition</nobr></th>/<th><nobr>Parameter assignment description</nobr></th>/<th><nobr>Other Anweisungen </nobr> </th>/</tt>/</t>/</thead>/<tbody>/' + paramhtml +'/</tbody>/</table>/</div>/</dd> '$ ('#Outparam dl ')