/*
 * @Author: XianKaiQun
 * @Date: 2020-04-28 10:31:21
 * @LastEditors: XianKaiQun
 * @LastEditTime: 2020-04-28 10:31:35
 * @Descripttion: 
 */

class OrganTreeModel {
  String? id;
  String? label;
  String? type;
  bool? disabled;
  List<ChildrenOfOrganTreeModel>? children;
  num? count;

  OrganTreeModel({
    this.id,
    this.label,
    this.type,
    this.disabled,
    this.children,
    this.count,
  });

  OrganTreeModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    id = map['id'];
    label = map['label'];
    type = map['type'];
    disabled = map['disabled'];
    children = List<ChildrenOfOrganTreeModel>.from((map["children"] ?? [])
        .map((x) => ChildrenOfOrganTreeModel.fromJson(x)));
    count = map['count'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['id'] = this.id;
    json['label'] = this.label;
    json['type'] = this.type;
    json['disabled'] = this.disabled;
    json['children'] =
        List<dynamic>.from((children ?? []).map((x) => x.toJson()));
    json['count'] = this.count;

    return json;
  }
}

class ChildrenOfOrganTreeModel {
  String? id;
  String? label;
  String? type;
  bool? disabled;
  List<ChildrenOfOrganTreeModel>? children;
  num? count;

  ChildrenOfOrganTreeModel({
    this.id,
    this.label,
    this.type,
    this.disabled,
    this.children,
    this.count,
  });

  ChildrenOfOrganTreeModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    id = map['id'];
    label = map['label'];
    type = map['type'];
    disabled = map['disabled'];
    children = List<ChildrenOfOrganTreeModel>.from((map["children"] ?? [])
        .map((x) => ChildrenOfOrganTreeModel.fromJson(x)));
    count = map['count'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['id'] = this.id;
    json['label'] = this.label;
    json['type'] = this.type;
    json['disabled'] = this.disabled;
    json['children'] =
        List<dynamic>.from((children ?? []).map((x) => x.toJson()));
    json['count'] = this.count;

    return json;
  }
}
