Commit 667292d4 authored by wangqinghua's avatar wangqinghua

common的注释

parent 89e53fff
...@@ -21,6 +21,13 @@ export class CommonService implements OnInit { ...@@ -21,6 +21,13 @@ export class CommonService implements OnInit {
return false; return false;
} }
/**
* list一层数组转为树形结构的数组
* @param myId 父级ID
* @param pId 子级ID
* @param list
* @returns {any[]}
*/
listToTree(myId,pId,list){ listToTree(myId,pId,list){
const nodes = []; const nodes = [];
for(let i=0; i<list.length; i++){ for(let i=0; i<list.length; i++){
...@@ -52,6 +59,11 @@ export class CommonService implements OnInit { ...@@ -52,6 +59,11 @@ export class CommonService implements OnInit {
return nodes; return nodes;
} }
/**
* JSON格式数据转化为字符串 接口调用
* @param data json格式的数据
* @returns {string}
*/
toQuery(data){ toQuery(data){
let str = ''; let str = '';
for (let key in data) { for (let key in data) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment