Add selecttemporalitemssuccess
This commit is contained in:
parent
3094170cc2
commit
8e29e479de
@ -5,6 +5,7 @@ import { IItemLayer } from '../models/item.layer';
|
|||||||
import { IQueryState } from '@farmmaps/common';
|
import { IQueryState } from '@farmmaps/common';
|
||||||
import { IItem } from '@farmmaps/common';
|
import { IItem } from '@farmmaps/common';
|
||||||
import { Feature,Style } from 'ol';
|
import { Feature,Style } from 'ol';
|
||||||
|
import { IListItem } from 'dist/common/public-api';
|
||||||
|
|
||||||
export const SETSTATE = '[Map] SetState';
|
export const SETSTATE = '[Map] SetState';
|
||||||
export const SETMAPSTATE = '[Map] MapState';
|
export const SETMAPSTATE = '[Map] MapState';
|
||||||
@ -16,6 +17,7 @@ export const STARTSEARCHSUCCESS = '[Map] StartSearchSuccess';
|
|||||||
export const SELECTFEATURE = '[Map] SelectFeature';
|
export const SELECTFEATURE = '[Map] SelectFeature';
|
||||||
export const SELECTITEM = '[Map] SelectItem';
|
export const SELECTITEM = '[Map] SelectItem';
|
||||||
export const SELECTITEMSUCCESS = '[Map] SelectItemSuccess';
|
export const SELECTITEMSUCCESS = '[Map] SelectItemSuccess';
|
||||||
|
export const SELECTTEMPORALITEMSSUCCESS = '[Map] SelectTemporalItemsSuccess';
|
||||||
export const ADDFEATURESUCCESS = '[Map] AddFeatureSuccess';
|
export const ADDFEATURESUCCESS = '[Map] AddFeatureSuccess';
|
||||||
export const UPDATEFEATURESUCCESS = '[Map] UpdateFeatureSuccess';
|
export const UPDATEFEATURESUCCESS = '[Map] UpdateFeatureSuccess';
|
||||||
export const EXPANDSEARCH = '[Map] ExpandSearch';
|
export const EXPANDSEARCH = '[Map] ExpandSearch';
|
||||||
@ -97,6 +99,12 @@ export class SelectItemSuccess implements Action {
|
|||||||
constructor(public item: IItem) { }
|
constructor(public item: IItem) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class SelectTemporalItemsSuccess implements Action {
|
||||||
|
readonly type = SELECTTEMPORALITEMSSUCCESS;
|
||||||
|
|
||||||
|
constructor(public temporalItems: IListItem[]) { }
|
||||||
|
}
|
||||||
|
|
||||||
export class AddFeatureSuccess implements Action {
|
export class AddFeatureSuccess implements Action {
|
||||||
readonly type = ADDFEATURESUCCESS;
|
readonly type = ADDFEATURESUCCESS;
|
||||||
|
|
||||||
@ -224,6 +232,7 @@ export type Actions = SetMapState
|
|||||||
| SelectFeature
|
| SelectFeature
|
||||||
| SelectItem
|
| SelectItem
|
||||||
| SelectItemSuccess
|
| SelectItemSuccess
|
||||||
|
| SelectTemporalItemsSuccess
|
||||||
| AddFeatureSuccess
|
| AddFeatureSuccess
|
||||||
| UpdateFeatureSuccess
|
| UpdateFeatureSuccess
|
||||||
| ExpandSearch
|
| ExpandSearch
|
||||||
|
@ -172,6 +172,20 @@ export class MapEffects {
|
|||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@Effect()
|
||||||
|
selectItemSuccessTemporal$: Observable<Action> = this.actions$.pipe(
|
||||||
|
ofType(mapActions.SELECTITEMSUCCESS),
|
||||||
|
switchMap((action:mapActions.SelectItemSuccess) => {
|
||||||
|
if(action.item.itemType == "vnd.farmmaps.itemtype.temporal") {
|
||||||
|
return this.itemService$.getChildItemList(action.item.code,null).pipe(
|
||||||
|
map((items) => new mapActions.SelectTemporalItemsSuccess(items )),
|
||||||
|
catchError(error => of(new commonActions.Fail(error))));
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
));
|
||||||
|
|
||||||
@Effect()
|
@Effect()
|
||||||
uploadedItemClick$: Observable<Action> = this.actions$.pipe(
|
uploadedItemClick$: Observable<Action> = this.actions$.pipe(
|
||||||
ofType(commonActions.UPLOADEDFILECLICK),
|
ofType(commonActions.UPLOADEDFILECLICK),
|
||||||
|
@ -77,7 +77,9 @@ export class ItemService {
|
|||||||
|
|
||||||
getChildItemList(parentcode: string, itemType: string, dataFilter?: any, level: number = 1, deep: boolean = true): Observable<IItem[]> {
|
getChildItemList(parentcode: string, itemType: string, dataFilter?: any, level: number = 1, deep: boolean = true): Observable<IItem[]> {
|
||||||
var params = new HttpParams();
|
var params = new HttpParams();
|
||||||
|
if(itemType != null) {
|
||||||
params = params.append("it", itemType);
|
params = params.append("it", itemType);
|
||||||
|
}
|
||||||
if (dataFilter != null) {
|
if (dataFilter != null) {
|
||||||
params = params.append("df", JSON.stringify(dataFilter));
|
params = params.append("df", JSON.stringify(dataFilter));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user