Commit 5f4eaabe authored by prumde's avatar prumde

Updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174354 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2bd2bb0d
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input } from '@angular/core';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import {Store} from '@ngrx/store';
import { EcmStoreModel } from '../ecm-store/ecm-store.model';
interface IBreadcrumb { interface IBreadcrumb {
label: string; label: string;
...@@ -16,13 +18,19 @@ export class EcmBreadcrumbsComponent implements OnInit { ...@@ -16,13 +18,19 @@ export class EcmBreadcrumbsComponent implements OnInit {
@Input() pageName; @Input() pageName;
breadcrumbs:IBreadcrumb[] = []; breadcrumbs:IBreadcrumb[] = [];
constructor( private _location: Location) { } constructor( private _location: Location, private store: Store<EcmStoreModel>) { }
ngOnInit() { console.log(this.pageName); ngOnInit() {
if(this.pageName == 'SUB_CATEGORY') if(this.pageName == 'SUB_CATEGORY')
{ {
//this.breadcrumb = "Home / " + category.shDescr; let storeCategory;
let category_shDescr=localStorage.getItem('CATEGORY_SH_DESCR'); let category_shDescr;
this.store.select('category').forEach(
value => storeCategory=value
);
category_shDescr = storeCategory.shDescr
this.breadcrumbs = []; this.breadcrumbs = [];
this.breadcrumbs.push( { this.breadcrumbs.push( {
label: 'Home', label: 'Home',
...@@ -32,13 +40,32 @@ export class EcmBreadcrumbsComponent implements OnInit { ...@@ -32,13 +40,32 @@ export class EcmBreadcrumbsComponent implements OnInit {
label: category_shDescr, label: category_shDescr,
url: 'javascript:void(0)' url: 'javascript:void(0)'
} ); } );
} }
if(this.pageName == 'ITEMS') if(this.pageName == 'ITEMS')
{ {
let catCode = localStorage.getItem('CATEGORY_CAT_CODE'); let storeCategory;
let catShDescr = localStorage.getItem('CATEGORY_SH_DESCR'); let storeSubCategory;
let subcatShDescr = localStorage.getItem('SUBCATEGORY_SH_DESCR');
let catCode;
let catShDescr;
let subcatShDescr;
this.store.select('subCategory').forEach(
value => storeSubCategory = value
);
catCode = storeSubCategory.catCode;
subcatShDescr = storeSubCategory.shDescr;
console.log("Breadcrumbs==>");
console.log(catCode);
this.store.select('category').forEach(
value => storeCategory=value
);
catShDescr = storeCategory.shDescr;
this.breadcrumbs = []; this.breadcrumbs = [];
this.breadcrumbs.push( { this.breadcrumbs.push( {
label: 'Home', label: 'Home',
...@@ -53,9 +80,7 @@ export class EcmBreadcrumbsComponent implements OnInit { ...@@ -53,9 +80,7 @@ export class EcmBreadcrumbsComponent implements OnInit {
url: 'javascript:void(0)' url: 'javascript:void(0)'
} ); } );
//[ '/list','SUB_CATEGORY',category.catCode]
//this.breadcrumb = "Home / " + catShDescr + subcategory.shDescr;
//Use for Detail Page //Use for Detail Page
/* /*
this.breadcrumbs.push( { this.breadcrumbs.push( {
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<a class="ecm-card-action top share" routerLink="/share" routerLinkActive="active"></a> <a class="ecm-card-action top share" routerLink="/share" routerLinkActive="active"></a>
--> -->
<a *ngIf="category.catLink" class="ecm-card-action" [routerLink]="['link', category.shDescr]">Open</a> <a *ngIf="category.catLink" class="ecm-card-action" [routerLink]="['link', category.shDescr]">Open</a>
<a *ngIf="!category.catLink" class="ecm-card-action" [routerLink]="[ '/list','SUB_CATEGORY',category.catCode]">View</a> <a *ngIf="!category.catLink" class="ecm-card-action" (click)="storeCategory()">View</a>
<a *ngIf="!category.catLink" class="ecm-card-action top share" [routerLink]="[ '/share','SUB_CATEGORY',category.catCode]"></a> <a *ngIf="!category.catLink" class="ecm-card-action top share" [routerLink]="[ '/share','SUB_CATEGORY',category.catCode]"></a>
</div> </div>
</div> </div>
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<a class="ecm-card-action top share" routerLink="/share" routerLinkActive="active"></a> <a class="ecm-card-action top share" routerLink="/share" routerLinkActive="active"></a>
--> -->
<a *ngIf="subcategory.catLink" class="ecm-card-action" [routerLink]="['link', subcategory.shDescr]">Open</a> <a *ngIf="subcategory.catLink" class="ecm-card-action" [routerLink]="['link', subcategory.shDescr]">Open</a>
<a *ngIf="!subcategory.catLink" class="ecm-card-action" [routerLink]="[ '/list', 'ITEMS',subcategory.scatCode]">View</a> <a *ngIf="!subcategory.catLink" class="ecm-card-action" (click)="storeSubCategory()">View</a>
<a *ngIf="!subcategory.catLink" class="ecm-card-action top share" [routerLink]="[ '/share','ITEMS',subcategory.scatCode]"></a> <a *ngIf="!subcategory.catLink" class="ecm-card-action top share" [routerLink]="[ '/share','ITEMS',subcategory.scatCode]"></a>
</div> </div>
</div> </div>
......
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { ECMCard } from './card-model'; import { ECMCard } from './card-model';
import { Category, SubCategory, Item } from '../ecm-category/category-model'; import { Category, SubCategory, Item } from '../ecm-category/category-model';
import { Router } from '@angular/router';
@Component({ @Component({
selector: 'ecm-card', selector: 'ecm-card',
...@@ -14,21 +15,32 @@ export class ECMCardComponent implements OnInit { ...@@ -14,21 +15,32 @@ export class ECMCardComponent implements OnInit {
@Input() itemData: Item; @Input() itemData: Item;
@Input() extraParam: any; @Input() extraParam: any;
constructor() { } @Output() storeData = new EventEmitter();
constructor(private router: Router) { }
ngOnInit() { ngOnInit() {
} }
openItem() openItem() {
{
alert(this.itemData.itemCode); alert(this.itemData.itemCode);
} }
createRatings(ratings){ createRatings(ratings){
var rating: number[] = []; var rating: number[] = [];
for(var i = 1; i <= ratings; i++){ for(var i = 1; i <= ratings; i++){
rating.push(i); rating.push(i);
}
return rating;
}
storeCategory(){
this.storeData.emit(this.category);
this.router.navigate([ '/list','SUB_CATEGORY',this.category.catCode]);
}
storeSubCategory(){
this.storeData.emit(this.subcategory);
this.router.navigate([ '/list', 'ITEMS',this.subcategory.scatCode]);
} }
return rating;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment