ui update, init to consumer statistics and manage pos user types
This commit is contained in:
@@ -3,13 +3,26 @@ import { PageLoadingComponent } from '@/shared/components/page-loading.component
|
||||
import { JalaliDateDirective } from '@/shared/directives';
|
||||
import { Component, computed, inject } from '@angular/core';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
import { MenuItem } from 'primeng/api';
|
||||
import { ButtonDirective } from 'primeng/button';
|
||||
import { Card } from 'primeng/card';
|
||||
import { Menu } from 'primeng/menu';
|
||||
import images from 'src/assets/images';
|
||||
import { PosStore } from '../pos.store';
|
||||
import { PosChooseCardsComponent } from './choose-pos.component';
|
||||
|
||||
@Component({
|
||||
selector: 'pos-layout',
|
||||
templateUrl: './layout.component.html',
|
||||
imports: [PageLoadingComponent, RouterOutlet, JalaliDateDirective],
|
||||
imports: [
|
||||
PageLoadingComponent,
|
||||
RouterOutlet,
|
||||
JalaliDateDirective,
|
||||
Menu,
|
||||
ButtonDirective,
|
||||
Card,
|
||||
PosChooseCardsComponent,
|
||||
],
|
||||
})
|
||||
export class PosLayoutComponent {
|
||||
constructor() {}
|
||||
@@ -19,8 +32,26 @@ export class PosLayoutComponent {
|
||||
|
||||
readonly loading = computed(() => this.store.loading());
|
||||
readonly posInfo = computed(() => this.store.entity());
|
||||
readonly error = computed(() => this.store.error());
|
||||
readonly userInfo = computed(() => this.authService.currentAccount());
|
||||
|
||||
logout = () => {
|
||||
this.authService.logout();
|
||||
};
|
||||
|
||||
profileMenuItems: MenuItem[] = [
|
||||
{
|
||||
label: 'راهنمای سامانه',
|
||||
icon: 'pi pi-question-circle',
|
||||
disabled: true,
|
||||
},
|
||||
{
|
||||
label: 'خروج',
|
||||
icon: 'pi pi-sign-out',
|
||||
command: this.logout,
|
||||
},
|
||||
];
|
||||
|
||||
placeholderLogo = images.placeholders.logo;
|
||||
|
||||
now = new Date();
|
||||
@@ -29,6 +60,10 @@ export class PosLayoutComponent {
|
||||
this.store.getData().subscribe();
|
||||
}
|
||||
|
||||
onChoosePos() {
|
||||
this.getData();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getData();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user