

/**
 *
 * author: water
 * data: 2019.7.8
 * */

// path:路由的路径
// address:vue组件所在的位置，默认从components文件开始
// url：页面内需要跳转的路径
// title:页面注释
// children: 子路由

//所有页面跳转路劲
let path = {

    //  首页
    home:{
        path:"",
        adddress:'homes/home',
        url:'this.$path.home.path',
        title:"首页",
    },
    //  规章制度
    system:{
        path:"system/system",
        adddress:'system/system',
        url:'this.$path.system.path',
        title:"规章制度",
    },
    //  责任分工
    division:{
        path:"division/division",
        adddress:'division/division',
        url:'this.$path.division.path',
        title:"公司细则",
    },
    divisionDetail:{
      path:"division/divisionDetail",
      adddress:'division/divisionDetail',
      url:'this.$path.divisionDetail.path',
      title:"责任分工详情",
    },
    //  风险点
    riskpoint:{
        path:"riskpoint/riskpoint",
        adddress:'riskpoint/riskpoint',
        url:'this.$path.riskpoint.path',
        title:"风险点",
    },
    //  隐患
    hiddendanger:{
        path:"hiddendanger/hiddendanger",
        adddress:'hiddendanger/hiddendanger',
        url:'this.$path.hiddendanger.path',
        title:"隐患",
    },
    //  风险预警
    riskwarning:{
      path:"riskwarning/riskwarning",
      adddress:'riskWarning/riskwarning',
      // url:'this.$path.riskwarning.path',
      title:"风险预警",
    },    
    //  隐患
    // dangerReport:{
    //   path:"hiddendanger/report",
    //   adddress:'hiddendanger/report',
    //   title:"隐患上报",
    // },    
    //  文件
    // file:{
    //     path:"file/file",
    //     adddress:'file/file',
    //     url:'this.$path.file.path',
    //     title:"文件",
    // },

    // 目标职责

    /* targetduty: {
      path: "menuhome/menuhome",
      adddress: 'menuhome/menuhome',
      url: 'this.$path.menuhome.path',
      title: "目标职责",
      children: [
        {
          path: '',
          adddress: 'menuhome/targetduty/targetduty'
        },
        {
          path: 'menuhome/menuhome/jigouduty',
          adddress: 'menuhome/targetduty/jigouduty',
        }
      ]
    } */
};


let url = {}
function arrFn(path){
  for (let [key, val] of Object.entries(path)) {
    url[key] =  path[key].path;
    if(path[key].children){
      arrFn(path[key].children);
    }
  }
}
arrFn(path);


export default {
  path,
  url,
}
