(function () { "use strict"; var name = 'adAdminTicketList'; angular.module('app.directive') .directive('adAdminTicketList', ['$rootScope', '$state', 'adminTicketBridge', 'translate', 'cfg', 'user', function ($rootScope, $state, adminTicketBridge, translate, cfg, user) { return { templateUrl: 'directive/' + name + '/' + name + '.html', scope: {}, controller: 'BaseListController', link: function (scope, element, attributes, controller) { cfg.debug && console.log(name); controller.bridge = adminTicketBridge; scope.statusInfo = null; scope.create = function () { $state.go('menu.' + user.roleId + '.ticket.create'); }; scope.edit = function (index) { var id = scope.data.list[index].id; $state.go('menu.' + user.roleId + '.ticket.edit', {id: id}); }; scope.file = function (index) { var id = scope.data.list[index].id; $state.go('menu.' + user.roleId + '.ticket.file', {id: id}); }; scope.remove = function (index) { controller.listAction('remove', scope.data.list[index].id); }; scope.setStatus = function (id, status) { controller.listAction('setStatus', id, status); }; controller.list().then(function () { adminTicketBridge.loadStatusInfo().then(function (data) { scope.statusInfo = data.statusInfo; scope.filterData = { statusList: data.statusList }; }, function () { scope.filterData = {}; }); }); } }; }]); })();