AW-5071 refactor some parts
This commit is contained in:
@@ -8,6 +8,7 @@ import { IItemTask } from '../models/itemTask';
|
||||
import { HttpClient, HttpParams,HttpHeaders } from "@angular/common/http";
|
||||
import { AppConfig } from "../shared/app.config";
|
||||
import {ItemTypeService} from './itemtype.service';
|
||||
import {IListItem} from '../models/list.item';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@@ -84,7 +85,7 @@ export class ItemService {
|
||||
}
|
||||
|
||||
getChildItemList(parentcode: string, itemType: string, dataFilter?: any, level = 1, deep = true,
|
||||
startDate?: Date, endDate?: Date): Observable<IItem[]> {
|
||||
startDate?: Date, endDate?: Date, skip?: number, take?: number): Observable<IItem[]> {
|
||||
let params = new HttpParams();
|
||||
if(itemType != null) {
|
||||
params = params.append("it", itemType);
|
||||
@@ -96,6 +97,9 @@ export class ItemService {
|
||||
params = params.append("deep", deep.toString());
|
||||
if (startDate) params = params.append("sDate", startDate.toISOString());
|
||||
if (endDate) params = params.append("eDate", endDate.toISOString());
|
||||
|
||||
if(skip) params = params.append("skip", skip);
|
||||
if(take) params = params.append("take", take);
|
||||
return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/${parentcode}/children`, { params: params });
|
||||
}
|
||||
|
||||
@@ -181,4 +185,8 @@ export class ItemService {
|
||||
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/items/${itemCode}/value/layer/${layerIndex}?c=${x},${y}&crs=${crs}`);
|
||||
}
|
||||
|
||||
getBreadcrumbs(itemCode: string): Observable<IListItem[]> {
|
||||
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/items/${itemCode}/breadcrumbs`);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user