@ningboyz/types 1.1.112 → 1.1.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
科目分类
|
|
3
3
|
/gams/tk0km/
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
import { construct, destruct } from "@aximario/json-tree";
|
|
6
|
+
import _ from "lodash";
|
|
6
7
|
import { IDictResponse } from "../core";
|
|
7
8
|
|
|
8
9
|
export interface IGamsK0kmResponse {
|
|
@@ -85,4 +86,12 @@ export class TGamsK0kmResponse implements IGamsK0kmResponse {
|
|
|
85
86
|
|
|
86
87
|
/** 系统字典.列表 */
|
|
87
88
|
listDict: IDictResponse[] = [];
|
|
89
|
+
|
|
90
|
+
public static toTree(listK0km: IGamsK0kmResponse[]) {
|
|
91
|
+
return construct(_.cloneDeep(listK0km), { id: "k0kmKmid", pid: "parentID", children: "children" }) as IGamsK0kmResponse[];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
public static toList(treeK0km: IGamsK0kmResponse[]) {
|
|
95
|
+
return destruct(_.cloneDeep(treeK0km), { id: "k0kmKmid", pid: "parentID", children: "children" }) as IGamsK0kmResponse[];
|
|
96
|
+
}
|
|
88
97
|
}
|