Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <reference path="../../../../_all.ts" />
- namespace app.personnel.employee.directory {
- import AbstractSearchController = incode.search.AbstractSearchController;
- import SearchCriteria = incode.search.ISearchCriteria;
- import Pager = incode.search.IPager;
- import SearchMetaData = incode.search.ISearchMetaData;
- import InputParameter = incode.search.IInputParameter;
- import Facet = incode.search.IFacet;
- import FacetType = incode.search.FacetType;
- import Bucket = incode.search.IBucket;
- export class DirectoryComponentController extends AbstractSearchController {
- searchEndpoint: string = "api/incode/personnel/EmployeeService/Search";
- isLoading: boolean = false;
- showFilter: boolean = false;
- criteria: SearchCriteria;
- pager: Pager;
- lastResult: incode.core.IExecutionResult<SearchCriteria>;
- searchMetadata: SearchMetaData = { chips: [], filter: [] };
- isAdvancedSearch: boolean = false;
- static $inject = ['$mdSidenav', '$mdDialog', 'appService'];
- constructor(
- $mdSidenav: angular.material.ISidenavService,
- $mdDialog: angular.material.IDialogService,
- appService: incode.app.IAppService) {
- super($mdSidenav, $mdDialog, appService);
- this.criteria = {
- From: 1,
- Size: 9,
- TotalHits: 0,
- IsAdvancedSearch: false,
- OrderBy: "LastName ASC",
- Parameters: [
- <InputParameter>{
- InputType: "text",
- Label: "Number",
- FieldId: "EmployeeNumber"
- },
- <InputParameter>{
- InputType: "text",
- Label: "First Name",
- FieldId: "FirstName"
- },
- <InputParameter>{
- InputType: "text",
- Label: "Last Name",
- FieldId: "LastName"
- },
- <InputParameter>{
- InputType: "text",
- Label: "Full Name",
- FieldId: "EmployeeFullName"
- },
- <InputParameter>{
- InputType: "text",
- Label: "Department",
- FieldId: "DepartmentDescription"
- }
- ],
- Facets: [
- <Facet>{
- IndexFieldName: "Department",
- Name: "Department",
- Type: FacetType.Multiselect
- },
- <Facet>{
- IndexFieldName: "BirthDate",
- Name: "Birth Date",
- Type: FacetType.DateRange
- },
- <Facet>{
- IndexFieldName: "HireDate",
- Name: "Hire Date",
- Type: FacetType.DateRange
- },
- <Facet>{
- IndexFieldName: "SexTypeValue",
- Name: "Gender",
- Type: FacetType.Multiselect
- }],
- Properties: [
- "EmployeeId",
- "EmployeeNumber",
- "FirstName",
- "LastName",
- "EmployeeFullName",
- "EmailAddress",
- "DepartmentId",
- "Department",
- "DepartmentDescription",
- "PhoneNumber",
- "PhoneNumberExt",
- "HireDate",
- "BirthDate",
- "SexTypeValue",
- "PrimaryPositionTitle",
- "DepartmentRowNum",
- "BirthMonthRowNum",
- "AnniversaryRowNum"]
- };
- this.pager = {
- pages: [],
- totalPages: 0,
- selectedPage: 1,
- maxPages: 5,
- previous: false,
- next: false,
- first: false,
- last: false
- };
- this.activate();
- }
- }
- export class DirectorySearchComponent implements ng.IComponentOptions {
- public templateUrl: string;
- public controller: any;
- public controllerAs: string = "directory";
- public transclude: boolean = true;
- constructor() {
- this.templateUrl = "employee/directory/directory.tmpl.html";
- this.controller = DirectoryComponentController;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement