167、层级数据结构示例

一、导航和权限管理

var menus = {
  balance1: {
    role: 'overview1',
    title: '资产信息1'
      subs: [{
      role: 'overview2',
      title: '资产信息2',
      state: 'balanceInfo',//000
      icon: make_menus_bg_position(1, 5),
      subs: [{
        role: 'overview2',
        title: '资产信息3',
        state: 'balanceInfo',//000
        url: '/balanceInfo',
        templateUrl: 'module/balance/' + base_dir + '/balanceInfo.html',
        controller: 'balanceInfoCtrl'
      }]
    }]
  },
  balance2: {
    role: 'overview1',
    title: '资产信息1'
      subs: [{
      role: 'overview2',
      title: '资产信息2',
      state: 'balanceInfo',//000
      icon: make_menus_bg_position(1, 5),
      subs: [{
        role: 'overview3',
        title: '资产信息3',
        state: 'balanceInfo',//000
        url: '/balanceInfo',
        templateUrl: 'module/balance/' + base_dir + '/balanceInfo.html',
        controller: 'balanceInfoCtrl'
      }, {
        role: 'overview4',
        title: '资产信息4',
        state: 'balanceInfo1',//111
        url: '/balanceInfo1',
        templateUrl: 'module/balance/' + base_dir + '/balanceInfo1.html',
        controller: 'balanceInfoCtrl1'
      }]
    }, {
      role: 'overview5',
      title: '资产信息5',
      state: 'balanceInfo2',//222
      icon: make_menus_bg_position(1, 5),
      subs: [{
        role: 'overview6',
        title: '资产信息6',
        state: 'balanceInfo2',//222
        url: '/balanceInfo2',
        templateUrl: 'module/balance/' + base_dir + '/balanceInfo2.html',
        controller: 'balanceInfoCtrl2'
      }, {
        role: 'overview7',
        title: '资产信息7',
        state: 'balanceInfo3',//333
        url: '/balanceInfo3',
        templateUrl: 'module/balance/' + base_dir + '/balanceInfo3.html',
        controller: 'balanceInfoCtrl3'
      }]
    }]
  }
};

二、行政区

var allDatas = {
  "北京市": {
    "市辖区": {
      "通州区": {
        "中仓街道办事处": {
          "滨河社区居委会": "110112001029",
          "运河湾社区居委会": "110112001030"
        },
        "漷县镇": {
          "后元化村委会": "110112106260",
          "前元化村委会": "110112106261"
        }
      },
      "昌平区": {
        "霍营街道办事处": {
          "蓝天园社区居委会": "110114010003",

        }
      }
    }
  }
};
var totalDatas = [
  {
    name: "选择省",
    sub: [
      {
        name: "选择市",
        sub: [{ name: "选择县" }]
      }
    ]
  },
  {
    name: "广东",
    sub: [
      {
        name: "选择市",
        sub: [{ name: "选择县" }]
      },
      {
        name: "广州",
        sub: [{ name: "选择县" }, { name: "越秀区" }, { name: "荔湾区" }, { name: "海珠区" }, { name: "天河区" }, { name: "白云区" }, { name: "黄埔区" }, { name: "番禺区" }, { name: "花都区" }, { name: "南沙区" }, { name: "萝岗区" }, { name: "增城市" }, { name: "从化市" }, { name: "其他" }]
      },
      {
        name: "深圳",
        sub: [{ name: "选择县" }, { name: "福田区" }, { name: "罗湖区" }, { name: "南山区" }, { name: "宝安区" }, { name: "龙岗区" }, { name: "盐田区" }, { name: "其他" }]
      }]

  }
]

猜你喜欢

转载自www.cnblogs.com/gushixianqiancheng/p/12055062.html