123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 |
- 'use strict';
- /**
- * Config for the router
- */
- app.config(['$httpProvider', '$stateProvider', '$urlRouterProvider', '$controllerProvider', '$compileProvider', '$filterProvider', '$provide', '$ocLazyLoadProvider', 'JS_REQUIRES',
- function($httpProvider, $stateProvider, $urlRouterProvider, $controllerProvider, $compileProvider, $filterProvider, $provide, $ocLazyLoadProvider, jsRequires) {
- app.controller = $controllerProvider.register;
- app.directive = $compileProvider.directive;
- app.filter = $filterProvider.register;
- app.factory = $provide.factory;
- app.service = $provide.service;
- app.constant = $provide.constant;
- app.value = $provide.value;
- $ocLazyLoadProvider.config({
- debug: false,
- events: true,
- modules: jsRequires.modules
- });
- // setup an abstract state for the tabs directive
- $stateProvider.state('tab', {
- url: '/tab',
- abstract: true,
- resolve: loadSequence('mainCtrl'),
- templateUrl: 'assets/views/weChat/tabs.html',
- controller: 'mainCtrl'
- })
- .state('tab.index', {
- url: '/index',
- resolve: loadSequence('indexCtrl'),
- templateUrl: 'assets/views/weChat/tab-index.html',
- controller: 'indexCtrl'
- // views: {
- // 'tab-index': {
- // templateUrl: 'assets/views/weChat/tab-index.html',
- // controller: 'loginCtrl'
- // }
- // }
- })
- .state('login', {
- url: '/login',
- resolve: loadSequence('loginCtrl'),
- templateUrl: 'assets/views/weChat/tab-login.html',
- controller: 'loginCtrl',
- cache: false,
- })
- //
- .state('tab.chats', {
- url: '/chats',
- resolve: loadSequence('customformCtrl'),
- views: {
- 'tab-chats': {
- templateUrl: 'assets/views/weChat/customForm/customFormIndex.html',
- controller: 'CustomformCtrl'
- }
- }
- // resolve: loadSequence('aa'),
- // views: {
- // 'tab-chats': {
- // templateUrl: 'ionic/templates/tab-chats.html',
- // controller: 'aa'
- // }
- // }
- })
- //我的事件
- // .state('tab.myIncident', {
- // url: '/myIncident',
- // resolve: loadSequence('myIncidentCtrl'),
- // views: {
- // 'tab-myIncident': {
- // templateUrl: 'assets/views/weChat/myIncident/myIncident.html',
- // controller: 'myIncidentCtrl'
- // }
- // }
- // })
- //请求人列表
- .state('tab.myIncident', {
- url: '/myIncident',
- resolve: loadSequence('ngAside', 'myIncidentCtrl'),
- templateUrl: 'assets/views/weChat/myIncident/myIncident.html',
- controller: 'myIncidentCtrl'
- })
- //请求人详情
- .state('tab.myIncidentDetail', {
- url: '/myIncidentDetail/{item}',
- resolve: loadSequence('moment', 'angularMoment', 'Timeline', 'myIncidentDetailCtrl'),
- templateUrl: 'assets/views/weChat/myIncident/myIncidentDetail.html',
- controller: 'myIncidentDetailCtrl'
- })
- //请求人表单创建
- .state('tab.customFormIndex', {
- url: '/customFormIndex/{formKey}',
- templateUrl: "assets/views/weChat/customForm/customFormIndex.html",
- resolve: loadSequence( 'jilian', 'directnewscroll', 'ngAside', 'swiper', 'angularFileUpload', 'customFormIndexCtrl'),
- pdKey: 'weChatApplyStart',
- // formKey: 'requestMobileEditor',
- controller: 'customFormIndexCtrl'
- })
- //请求人表单查看
- .state('tab.customFormDetail', {
- url: '/customFormDetail/{formKey}/{pdKey}/{dataId}/{taskId}/{processInstanceId}',
- resolve: loadSequence('customFormIndexCtrl', 'customFormDetailCtrl'),
- templateUrl: 'assets/views/weChat/customForm/customFormDetail.html',
- controller: 'customFormDetailCtrl'
- })
- //请求人满意的评价
- .state('tab.requesterDegree', {
- url: '/customFormIndex/{formKey}/{incidentid}',
- templateUrl: "assets/views/weChat/customForm/customFormIndex.html",
- resolve: loadSequence('customFormIndexCtrl', 'ui.select', 'angularFileUpload'),
- pdKey: 'weChatApplySave',
- // formKey: 'requestMobileEditor',
- controller: 'customFormIndexCtrl'
- })
- //处理人列表
- .state('tab.incidentHandler', {
- url: '/incidentHandler',
- resolve: loadSequence('ngAside', 'incidentHandlerCtrl'),
- templateUrl: 'assets/views/weChat/myIncident/incidentHandler.html',
- controller: 'incidentHandlerCtrl'
- })
- //处理人表单查看
- .state('tab.incidentHandlerCustomFormDetail', {
- url: '/incidentHandlerCustomFormDetail/{formKey}/{pdKey}/{dataId}/{taskId}/{processInstanceId}',
- templateUrl: "assets/views/weChat/customForm/customFormDetail.html",
- resolve: loadSequence('customFormIndexCtrl', 'moment', 'angularMoment', 'Timeline', 'customFormDetailCtrl'),
- pdKey: 'bpm_incident',
- controller: 'customFormDetailCtrl'
- })
- //处理人表单操作
- .state('tab.incidentHandlerCustomFormIndex', {
- // url: '/incidentHandlerCustomFormIndex',
- // templateUrl: "assets/views/weChat/customForm/customFormIndex.html",
- // resolve: loadSequence('customFormIndexCtrl'),
- // pdKey: 'bpm_incident',
- resolve: loadSequence('customFormIndexCtrl', 'multi.select.tree', 'ionicclose', 'uiSwitch', 'groupzhipai', 'knowfenlei', 'renyuan', 'fenlei', 'jilian', 'directnewscroll', 'ngAside', 'swiper', 'angularFileUpload', 'ui.select'),
- url: '/incidentHandlerCustomFormIndex/{taskId}/{processInstanceId}',
- templateUrl: "assets/views/weChat/customForm/customFormIndex.html",
- pdKey: 'bpm_incident',
- controller: 'customFormIndexCtrl'
- })
- //处理人建单
- .state('tab.incidentHandlerNew', {
- url: '/incidentHandlerNew',
- resolve: loadSequence('customFormIndexCtrl', 'multi.select.tree', 'ionicclose', 'renyuan', 'fenlei', 'jilian', 'directnewscroll', 'ngAside', 'swiper', 'angularFileUpload', 'ui.select', 'angularFileUpload'),
- templateUrl: "assets/views/weChat/customForm/customFormIndex.html",
- pdKey: 'bpm_incident',
- controller: 'customFormIndexCtrl'
- })
- //知识库
- .state('tab.myKnowledge', {
- url: '/myKnowledge',
- resolve: loadSequence('myKnowledgeCtrl'),
- templateUrl: 'assets/views/weChat/myKnowledge/myKnowledge.html',
- controller: 'myKnowledgeCtrl'
- })
- //知识库查看
- .state('tab.myKnowledgeDetail', {
- url: '/myKnowledgeDetail/{item}',
- resolve: loadSequence('myKnowledgeDetailCtrl'),
- templateUrl: 'assets/views/weChat/myKnowledge/myKnowledgeDetail.html',
- controller: 'myKnowledgeDetailCtrl'
- })
- //知识库评论
- // .state('myKnowledge', {
- // abstract: true,
- // url: '/myKnowledge',
- // // resolve: loadSequence('myKnowledgeDetailCtrl'),
- // templateUrl: 'assets/views/weChat/myKnowledge/myKnowledgeTab.html',
- // // controller: 'myKnowledgeDetailCtrl'
- // })
- //知识库评论列表
- // .state('tab.myKnowledgeList', {
- // url: '/myKnowledgeList',
- // resolve: loadSequence('myKnowledgeListCtrl'),
- // templateUrl: 'assets/views/weChat/myKnowledge/myKnowledgeList.html',
- // controller: 'myKnowledgeListCtrl'
- // })
- //知识库评论列表
- .state('tab.myKnowledgeList', {
- url: '/myKnowledgeList/{item}',
- resolve: loadSequence('myKnowledgeListCtrl'),
- templateUrl: 'assets/views/weChat/myKnowledge/myKnowledgeList.html',
- controller: 'myKnowledgeListCtrl'
- })
- //知识库评论提交
- .state('tab.myKnowledgeComment', {
- url: '/myKnowledgeComment/{item}',
- resolve: loadSequence('ionic-ratings', 'myKnowledgeCommentCtrl'),
- templateUrl: 'assets/views/weChat/myKnowledge/myKnowledgeComment.html',
- controller: 'myKnowledgeCommentCtrl'
- })
- //知识库评论提交
- // .state('myKnowledge.comment', {
- // url: '/myKnowledge/comment',
- // resolve: loadSequence('customFormIndexCtrl', 'ui.select', 'angularFileUpload'),
- // templateUrl: "assets/views/weChat/customForm/customFormIndex.html",
- // controller: 'customFormIndexCtrl'
- // })
- //公告列表
- .state('tab.myNotice', {
- url: '/myNotice',
- resolve: loadSequence('myNoticeCtrl'),
- templateUrl: 'assets/views/weChat/myNotice/myNotice.html',
- controller: 'myNoticeCtrl'
- })
- //公告详情
- .state('tab.myNoticeDetail', {
- url: '/myNoticeDetail/{item}',
- resolve: loadSequence('myNoticeDetailCtrl'),
- templateUrl: 'assets/views/weChat/myNotice/myNoticeDetail.html',
- controller: 'myNoticeDetailCtrl'
- })
- //巡检列表
- .state('tab.inspect', {
- url: '/inspect',
- resolve: loadSequence('ngAside', 'inspectCtrl'),
- templateUrl: 'assets/views/weChat/inspect/inspect.html',
- controller: 'inspectCtrl'
- })
- //巡检编辑
- .state('tab.reServiceCustomFormIndex', {
- url: '/reServiceCustomFormIndex/{pdKey}/{taskId}/{processInstanceId}/{formUiEdit}',
- templateUrl: "assets/views/weChat/customForm/customFormIndex.html",
- resolve: loadSequence('customFormIndexCtrl', 'uiSwitch', 'ui.select', 'angularFileUpload'),
- pdKey: 'weChatApplyStart',
- // formKey: 'requestMobileEditor',
- controller: 'customFormIndexCtrl'
- })
- //巡检查看
- .state('tab.reServiceCustomFormDetail', {
- url: '/reServiceCustomFormDetail/{pdKey}/{taskId}/{processInstanceId}/{formKey}',
- resolve: loadSequence('customFormIndexCtrl', 'uiSwitch', 'customFormDetailCtrl'),
- templateUrl: 'assets/views/weChat/customForm/customFormDetail.html',
- controller: 'customFormDetailCtrl'
- })
- //仪表盘
- .state('tab.handlerDashboard', {
- url: '/handlerDashboard',
- resolve: loadSequence('handlerDashboardCtrl'),
- templateUrl: 'assets/views/weChat/dashboard/handlerDashboard.html',
- controller: 'handlerDashboardCtrl'
- })
- .state('tab.requesterDashboard', {
- url: '/requesterDashboard',
- resolve: loadSequence('moment', 'angularMoment', 'requesterDashboardCtrl'),
- templateUrl: 'assets/views/weChat/dashboard/requesterDashboard.html',
- controller: 'requesterDashboardCtrl'
- })
- //服务指南
- .state('tab.serviceInformation', {
- url: '/serviceInformation',
- resolve: loadSequence('serviceInformationCtrl'),
- templateUrl: 'assets/views/weChat/myServiceInformation/serviceInformation.html',
- controller: 'serviceInformationCtrl'
- })
- //验证错误页面
- .state('err', {
- url: '/err',
- resolve: loadSequence('errorCtrl'),
- templateUrl: 'assets/views/weChat/err.html',
- controller: 'errorCtrl'
- })
- //测试
- .state('tab.aa', {
- url: '/aa',
- template: 'aa123',
- })
- $urlRouterProvider.otherwise('/login');
- // Generates a resolve object previously configured in constant.JS_REQUIRES (config.constant.js)
- function loadSequence() {
- var _args = arguments;
- return {
- deps: ['$ocLazyLoad', '$q',
- function($ocLL, $q) {
- var promise = $q.when(1);
- for (var i = 0, len = _args.length; i < len; i++) {
- promise = promiseThen(_args[i]);
- }
- return promise;
- function promiseThen(_arg) {
- if (typeof _arg == 'function')
- return promise.then(_arg);
- else
- return promise.then(function() {
- var nowLoad = requiredData(_arg);
- if (!nowLoad)
- return $.error('Route resolve: Bad resource name [' + _arg + ']');
- return $ocLL.load(nowLoad);
- });
- }
- function requiredData(name) {
- if (jsRequires.modules)
- for (var m in jsRequires.modules)
- if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)
- return jsRequires.modules[m];
- return jsRequires.scripts && jsRequires.scripts[name];
- }
- }
- ]
- };
- }
- }
- ]);
|