'use strict';
angular.module('qrzk')
.constant('userType',{
	teacher: 10,
	secretary: 11,
	inputer: 12,
	other: 0
})
.config(function($stateProvider, $urlRouterProvider,$httpProvider) {
	
  $stateProvider
  .state('users', {
      abstract: true,
      url: "/users",
      templateUrl: "resources/app/common/top.html"
    })
  .state('users.list', {
  	url: "/list",
  	templateUrl: "resources/app/user/list.html",
  	ncyBreadcrumb: {
  		label: '用户管理'    		
  	}
  })
  .state('users.add', {
	url: "/add",
	templateUrl: "resources/app/user/add.html",
	ncyBreadcrumb: {
		label: '添加用户',
		parent: 'users.list'
	}
  })
  .state('users.edit', {
	  url: "/edit/:id",
	  params: {id:null},
	  templateUrl: "resources/app/user/add.html",
	  ncyBreadcrumb: {
		  label: '编辑用户',
		  parent: 'users.list'
	  }
  })
  .state('users.import', {
	  url: "/import",
	  templateUrl: "resources/app/user/import.html",
	  ncyBreadcrumb: {
		  label: '导入用户',
		  parent: 'users.list'
	  }
  })
   .state('userMng', {
	  abstract: true,
	  url: "/userMng",
	  templateUrl: "resources/app/common/top.html"
  })
  .state('userMng.category', {
      url: "/category",
      templateUrl: "resources/app/user/category.html",
      ncyBreadcrumb: {
    	    label: '用户管理'
    	  }
    })
    
  /** 命题教师管理 **/
  .state('userMng.teachersList', {
	  url: "/teachersList",
	  params:{userType: 10},
	  templateUrl: "resources/app/user/list.html",
	  ncyBreadcrumb: {
		  label: '命题教师管理',
		  parent: 'userMng.category'
	  }
  })
  .state('userMng.teachersAdd', {
	  url: "/teachersAdd",
	  params:{userType: 10},
	  templateUrl: "resources/app/user/add.domesticConsumer.html",
	  ncyBreadcrumb: {
		  label: '添加',
		  parent: 'userMng.teachersList'
	  }
  })
  .state('userMng.teachersEdit', {
	  url: "/edit/:id",
	  params: {id:null,userType: 10},
	  templateUrl: "resources/app/user/add.domesticConsumer.html",
	  ncyBreadcrumb: {
		  label: '编辑',
		  parent: 'userMng.teachersList'
	  }
  })
  
  /** 学科秘书管理 **/
  .state('userMng.secretaryList', {
	  url: "/secretaryList",
	  params:{userType: 11},
	  templateUrl: "resources/app/user/list.html",
	  ncyBreadcrumb: {
		  label: '学科秘书管理',
		  parent: 'userMng.category'
	  }
  })
  .state('userMng.secretaryAdd', {
	  url: "/secretaryAdd",
	  params:{userType: 11},
	  templateUrl: "resources/app/user/add.domesticConsumer.html",
	  ncyBreadcrumb: {
		  label: '添加',
		  parent: 'userMng.secretaryList'
	  }
  })
  .state('userMng.secretaryEdit', {
	  url: "/edit/:id",
	  params: {id:null,userType: 11},
	  templateUrl: "resources/app/user/add.domesticConsumer.html",
	  ncyBreadcrumb: {
		  label: '编辑',
		  parent: 'userMng.secretaryList'
	  }
  })
  
  /** 录入员管理 **/
  .state('userMng.inputersList', {
	  url: "/inputersList",
	  params:{userType: 12},
	  templateUrl: "resources/app/user/list.html",
	  ncyBreadcrumb: {
		  label: '录入员管理',
		  parent: 'userMng.category'    		
	  }
  })
  .state('userMng.inputersAdd', {
	  url: "/inputersAdd",
	  params:{userType: 12},
	  templateUrl: "resources/app/user/add.domesticConsumer.html",
	  ncyBreadcrumb: {
		  label: '添加',
		  parent: 'userMng.inputersList'
	  }
  })
  .state('userMng.inputersEdit', {
	  url: "/edit/:id",
	  params: {id:null,userType: 12},
	  templateUrl: "resources/app/user/add.domesticConsumer.html",
	  ncyBreadcrumb: {
		  label: '编辑',
		  parent: 'userMng.inputersList'
	  }
  })
  
});

