Deployment 26.4 v1.3

This commit is contained in:
Nguyen Ha Khue
2023-04-26 18:51:48 +07:00
parent f2def98469
commit 357ee61b54
26 changed files with 198 additions and 636 deletions
-4
View File
@@ -10,13 +10,11 @@ import { DashboardModule } from './components/dashboard/dashboard.module';
import { SharedModule } from './shared/shared.module';
import { ProductsModule } from './components/products/products.module';
import { SalesModule } from './components/sales/sales.module';
import { CouponsModule } from './components/coupons/coupons.module';
import { MenusModule } from './components/menus/menus.module';
import { VendorsModule } from './components/vendors/vendors.module';
import { UsersModule } from './components/users/users.module';
import { AccountModule } from './components/account/account.module';
import { SettingModule } from './components/setting/setting.module';
import { ReportsModule } from './components/reports/reports.module';
import { AuthModule } from './components/auth/auth.module';
import { HTTP_INTERCEPTORS, HttpClientModule } from "@angular/common/http";
import { ModalModule } from "ngx-bootstrap/modal";
@@ -37,13 +35,11 @@ import { AuthInterceptor } from "./shared/inceptor/auth-interceptor";
DashboardModule,
AccountModule,
SettingModule,
ReportsModule,
AuthModule,
SharedModule,
ProductsModule,
SalesModule,
VendorsModule,
CouponsModule,
MenusModule,
UsersModule,
AgGridModule,
@@ -0,0 +1,19 @@
:host {
::ng-deep {
.pagination {
&>li {
&.page-item {
&.active {
&>a {
&.page-link {
&>span {
display: none;
}
}
}
}
}
}
}
}
}
@@ -1,34 +0,0 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ListCouponComponent } from './list-coupon/list-coupon.component';
import { CreateCouponComponent } from './create-coupon/create-coupon.component';
const routes: Routes = [
{
path: '',
children: [
{
path: 'list-coupons',
component: ListCouponComponent,
data: {
title: "List Coupons",
breadcrumb: "List Coupons"
}
},
{
path: 'create-coupons',
component: CreateCouponComponent,
data: {
title: "Create Coupon",
breadcrumb: "Create Coupons"
}
}
]
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class CouponsRoutingModule { }
@@ -1,21 +0,0 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { CouponsRoutingModule } from './coupons-routing.module';
import { ListCouponComponent } from './list-coupon/list-coupon.component';
import { CreateCouponComponent } from './create-coupon/create-coupon.component';
import { SharedModule } from 'src/app/shared/shared.module';
@NgModule({
declarations: [ListCouponComponent, CreateCouponComponent],
imports: [
CommonModule,
CouponsRoutingModule,
NgbModule,
ReactiveFormsModule,
SharedModule,
FormsModule
]
})
export class CouponsModule { }
@@ -1,184 +0,0 @@
<!-- Container-fluid starts-->
<div class="container-fluid">
<div class="card">
<div class="card-header">
<h5>Discount Coupon Details</h5>
</div>
<div class="card-body tab2-card">
<ul ngbNav #nav="ngbNav" [(activeId)]="active" class="nav-tabs">
<li [ngbNavItem]="1">
<a ngbNavLink>General</a>
<ng-template ngbNavContent>
<form [formGroup]="generalForm" class="needs-validation" novalidate="">
<h4>General</h4>
<div class="row">
<div class="col-sm-12">
<div class="form-group row">
<div class="col-xl-3 col-md-4">
<label for="validationCustom0"><span>*</span>
Coupan Title</label>
</div>
<div class="col-md-7">
<input class="form-control" formControlName="name"
id="validationCustom0" type="text" required="">
</div>
</div>
<div class="form-group row">
<div class="col-xl-3 col-md-4">
<label for="validationCustom1"><span>*</span>
Coupan Code</label>
</div>
<div class="col-md-7">
<input class="form-control" formControlName="code"
id="validationCustom1" type="text" required="">
</div>
<div class="valid-feedback">Please Provide a Valid Coupon Code.</div>
</div>
<div class="form-group row">
<div class="col-xl-3 col-md-4">
<label>Start Date</label>
</div>
<div class="col-md-7 ">
<div class="input-group input-grp-p">
<input class="datepicker-here form-control digits" ngbDatepicker
formControlName="start_date" #f="ngbDatepicker">
<div class="input-group-append">
<button class="btn calendar" (click)="f.toggle()" type="button"><i
class="fa fa-calendar"></i></button>
</div>
</div>
</div>
</div>
<div class="form-group row">
<div class="col-xl-3 col-md-4">
<label>End Date</label>
</div>
<div class="col-md-7">
<div class="input-group input-grp-p">
<input class="datepicker-here form-control digits" ngbDatepicker
formControlName="end_date" #c="ngbDatepicker">
<div class="input-group-append">
<button class="btn calendar" (click)="c.toggle()" type="button"><i
class="fa fa-calendar"></i></button>
</div>
</div>
</div>
</div>
<div class="form-group row">
<div class="col-xl-3 col-md-4">
<label>Free Shipping</label>
</div>
<div class="col-md-7">
<div class="checkbox checkbox-primary">
<input id="checkbox-primary-1" type="checkbox"
formControlName="free_shipping" data-original-title="" title="">
<label for="checkbox-primary-1">Allow Free Shipping</label>
</div>
</div>
</div>
<div class="form-group row">
<div class="col-xl-3 col-md-4"><label>Quantity</label></div>
<div class="col-md-7">
<input class="form-control" formControlName="quantity" type="number"
required="">
</div>
</div>
<div class="form-group row">
<div class="col-xl-3 col-md-4"><label>Discount Type</label></div>
<div class="col-md-7">
<select class="custom-select form-select" required="">
<option value="">--Select--</option>
<option value="1">Percent</option>
<option value="2">Fixed</option>
</select>
</div>
</div>
<div class="form-group row">
<div class="col-xl-3 col-md-4">
<label>Status</label>
</div>
<div class="col-md-7">
<div class="checkbox checkbox-primary">
<input id="checkbox-primary-2" formControlName="status" type="checkbox"
data-original-title="" title="">
<label for="checkbox-primary-2">Enable the Coupon</label>
</div>
</div>
</div>
</div>
</div>
</form>
</ng-template>
</li>
<li [ngbNavItem]="2">
<a ngbNavLink>Restriction</a>
<ng-template ngbNavContent>
<form [formGroup]="restrictionForm" class="needs-validation" novalidate="">
<h4>Restriction</h4>
<div class="form-group row">
<div class="col-xl-3 col-md-4"><label for="validationCustom3">Products</label></div>
<div class="col-md-7"><input class="form-control" formControlName="products" id="validationCustom3"
type="text" required="">
</div>
<div class="valid-feedback">Please Provide a Product Name.</div>
</div>
<div class="form-group row">
<div class="col-xl-3 col-md-4"><label>Category</label></div>
<div class="col-md-7">
<select class="custom-select form-select" formControlName="category" required="">
<option value="">--Select--</option>
<option value="1">Electronics</option>
<option value="2">Clothes</option>
<option value="2">Shoes</option>
<option value="2">Digital</option>
</select>
</div>
</div>
<div class="form-group row">
<div class="col-xl-3 col-md-4"><label for="validationCustom4">Minimum Spend</label></div>
<div class="col-md-7">
<input class="form-control" formControlName="min" id="validationCustom4"
type="number">
</div>
</div>
<div class="form-group row">
<div class="col-xl-3 col-md-4">
<label for="validationCustom5">Maximum Spend</label>
</div>
<div class="col-md-7">
<input class="form-control" formControlName="max" id="validationCustom5"
type="number">
</div>
</div>
</form>
</ng-template>
</li>
<li [ngbNavItem]="3">
<a ngbNavLink>Usage</a>
<ng-template ngbNavContent>
<form [formGroup]="usageForm" class="needs-validation" novalidate="">
<h4>Usage Limits</h4>
<div class="form-group row">
<div class="col-xl-3 col-md-4"><label for="validationCustom6">Per Limit</label></div>
<div class="col-md-7"><input class="form-control" formControlName="limit" id="validationCustom6"
type="number">
</div>
</div>
<div class="form-group row">
<div class="col-xl-3 col-md-4"><label for="validationCustom7">Per Customer</label></div>
<div class="col-md-7"><input class="form-control" formControlName="customer" id="validationCustom7"
type="number">
</div>
</div>
</form>
</ng-template>
</li>
</ul>
<div [ngbNavOutlet]="nav" class="mt-2"></div>
<div class="pull-right">
<button type="button" class="btn btn-primary">Save</button>
</div>
</div>
</div>
</div>
<!-- Container-fluid Ends-->
@@ -1,61 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { NgbDateStruct, NgbDate, NgbCalendar, NgbDatepickerConfig } from '@ng-bootstrap/ng-bootstrap';
@Component({
selector: 'app-create-coupon',
templateUrl: './create-coupon.component.html',
styleUrls: ['./create-coupon.component.scss']
})
export class CreateCouponComponent implements OnInit {
public generalForm: UntypedFormGroup;
public restrictionForm: UntypedFormGroup;
public usageForm: UntypedFormGroup;
public model: NgbDateStruct;
public date: { year: number, month: number };
public modelFooter: NgbDateStruct;
public active = 1;
constructor(private formBuilder: UntypedFormBuilder, private calendar: NgbCalendar) {
this.createGeneralForm();
this.createRestrictionForm();
this.createUsageForm();
}
selectToday() {
this.model = this.calendar.getToday();
}
createGeneralForm() {
this.generalForm = this.formBuilder.group({
name: [''],
code: [''],
start_date: [''],
end_date: [''],
free_shipping: [''],
quantity: [''],
discount_type: [''],
status: [''],
});
}
createRestrictionForm() {
this.restrictionForm = this.formBuilder.group({
products: [''],
category: [''],
min: [''],
max: ['']
})
}
createUsageForm() {
this.usageForm = this.formBuilder.group({
limit: [''],
customer: ['']
})
}
ngOnInit() {
}
}
@@ -1,48 +0,0 @@
<!-- Container-fluid starts-->
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-header">
<h5>Products Category</h5>
</div>
<div class="card-body">
<div class="custom-datatable">
<button class="btn btn-primary me-1 mb-3" style="float: right;">Delete</button>
<div class="clearfix"></div>
<table class="table table-striped">
<thead>
<tr>
<th scope="col" sortable="title" (sort)="onSort($event)">Title</th>
<th scope="col" sortable="code" (sort)="onSort($event)">Code</th>
<th scope="col" sortable="discount" (sort)="onSort($event)">Discoount</th>
<th scope="col" sortable="status" (sort)="onSort($event)">Status</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of tableItem$ | async ">
<th scope="row">
<input type="checkbox" name="title_select" onclick="onSelect(item.id)">
{{ item.title }}
</th>
<td>
{{item.code}}
</td>
<td>{{item.discount}}</td>
<td><i class="fa fa-circle {{item.status}} f-12"></i></td>
</tr>
</tbody>
</table>
<div class="d-flex justify-content-center p-2">
<ngb-pagination
[collectionSize]="(total$ | async)!" [(page)]="service.page" [pageSize]="service.pageSize">
</ngb-pagination>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Container-fluid Ends-->
@@ -1,51 +0,0 @@
import {DecimalPipe} from '@angular/common';
import {Component, OnInit, QueryList, ViewChildren} from '@angular/core';
import {Observable} from 'rxjs';
import {NgbdSortableHeader, SortEvent} from 'src/app/shared/directives/NgbdSortableHeader';
import {TableService} from 'src/app/shared/service/table.service';
import {LISTCOUPLEDB, ListCouponsDB} from 'src/app/shared/tables/list-coupon';
@Component({
selector: 'app-list-coupon',
templateUrl: './list-coupon.component.html',
styleUrls: ['./list-coupon.component.scss'],
providers: [TableService, DecimalPipe]
})
export class ListCouponComponent implements OnInit {
public selected = [];
public tableItem$: Observable<ListCouponsDB[]>;
public searchText;
total$: Observable<number>;
constructor(public service: TableService) {
this.tableItem$ = service.tableItem$;
this.total$ = service.total$;
this.service.setUserData(LISTCOUPLEDB);
}
@ViewChildren(NgbdSortableHeader) headers: QueryList<NgbdSortableHeader>;
onSort({column, direction}: SortEvent) {
// resetting other headers
this.headers.forEach((header) => {
if (header.sortable !== column) {
header.direction = '';
}
});
this.service.sortColumn = column;
this.service.sortDirection = direction;
}
onSelect({selected}) {
this.selected.splice(0, this.selected.length);
this.selected.push(...selected);
}
ngOnInit() {
}
}
@@ -1,3 +1,25 @@
th, td {
th,
td {
text-align: center;
}
:host {
::ng-deep {
.pagination {
&>li {
&.page-item {
&.active {
&>a {
&.page-link {
&>span {
display: none;
}
}
}
}
}
}
}
}
}
@@ -86,7 +86,7 @@
width: 60px;
height: 60px;
}
.discount-text {
position: absolute;
top: 18px;
@@ -103,3 +103,22 @@
}
}
:host {
::ng-deep {
.pagination {
&>li {
&.page-item {
&.active {
&>a {
&.page-link {
&>span {
display: none;
}
}
}
}
}
}
}
}
}
@@ -1,21 +0,0 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ReportsComponent } from './reports.component';
const routes: Routes = [
{
path: '',
component: ReportsComponent,
data: {
title: "Reports",
breadcrumb: "Reports"
}
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class ReportsRoutingModule { }
@@ -1,110 +0,0 @@
<!-- Container-fluid starts-->
<div class="container-fluid">
<div class="row">
<div class="col-xl-8 col-md-6">
<div class="card">
<div class="card-header">
<h5>Sales Summary</h5>
</div>
<div class="card-body sell-graph">
<canvas baseChart id="myGraph" [datasets]="salesChartData" [labels]="salesChartLabels"
[options]="salesChartOptions" [legend]="salesChartLegend"
[type]="salesChartType"></canvas>
</div>
</div>
</div>
<div class="col-xl-4 col-md-6">
<div class="card report-employee">
<div class="card-header">
<h2>75%</h2>
<h6 class="mb-0">Employees Satisfied</h6>
</div>
<div class="card-body p-0 o-hidden">
<div class="ct-4 flot-chart-container report-full">
<x-chartist [type]="chart5.type" [data]="chart5.data" [options]="chart5.options"></x-chartist>
</div>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="card">
<div class="card-header">
<h5>Transfer Report</h5>
</div>
<div class="card-body">
<div id="batchDelete" class="custom-datatable">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th scope="col" sorted="name" (sort)="onSort($event)">Name</th>
<th scope="col" sorted="id" (sort)="onSort($event)">Transaction Id</th>
<th scope="col" sortable="date" (sort)="onSort($event)">Date</th>
<th scope="col" sortable="total" (sort)="onSort($event)">Total</th>
<th scope="col" >Actions</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of tableItem$ | async ">
<td scope="row">
<span>{{item.name}}</span>
</td>
<td>
{{item.id}}
</td>
<td>{{item.date}}</td>
<td>{{item.total}}</td>
<td>
<a href="javascript:void(0)"><i class='fa fa-edit f-12'></i></a>&nbsp;
<a href="javascript:void(0)"><i class="fa fa-trash-o"></i></a>
</td>
</tr>
</tbody>
</table>
<div class="d-flex justify-content-center p-2">
<ngb-pagination
[collectionSize]="(total$ | async)!" [(page)]="service.page" [pageSize]="service.pageSize">
</ngb-pagination>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h5>Expenses</h5>
</div>
<div class="card-body expense-chart">
<div class="chart-overflow" id="area-chart1">
<google-chart [data]="areaChart1"></google-chart>
</div>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h5> Sales / Purchase</h5>
</div>
<div class="card-body">
<div class="sales-chart">
<google-chart [data]="columnChart1"></google-chart>
</div>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="card">
<div class="card-header">
<h5> Sales / Purchase Return</h5>
</div>
<div class="card-body sell-graph">
<google-chart [data]="lineChart"></google-chart>
</div>
</div>
</div>
</div>
</div>
<!-- Container-fluid Ends-->
@@ -1,60 +0,0 @@
import { Component, OnInit, QueryList, ViewChildren } from '@angular/core';
import * as chartData from '../../shared/data/chart';
import { ReportDB, REPORTDB } from 'src/app/shared/tables/report';
import { Observable } from 'rxjs';
import { TableService } from 'src/app/shared/service/table.service';
import { NgbdSortableHeader, SortEvent } from 'src/app/shared/directives/NgbdSortableHeader';
import { DecimalPipe } from '@angular/common';
@Component({
selector: 'app-reports',
templateUrl: './reports.component.html',
styleUrls: ['./reports.component.scss'],
providers: [TableService, DecimalPipe]
})
export class ReportsComponent implements OnInit {
// lineChart
public salesChartData = chartData.salesChartData;
public salesChartLabels = chartData.salesChartLabels;
public salesChartOptions = chartData.salesChartOptions;
public salesChartColors = chartData.salesChartColors;
public salesChartLegend = chartData.salesChartLegend;
public salesChartType = chartData.salesChartType;
public areaChart1 = chartData.areaChart1;
public columnChart1 = chartData.columnChart1;
public lineChart = chartData.lineChart;
public chart5 = chartData.chart6
public tableItem$: Observable<ReportDB[]>;
public searchText;
total$: Observable<number>;
constructor(public service: TableService) {
this.tableItem$ = service.tableItem$;
this.total$ = service.total$;
this.service.setUserData(REPORTDB)
}
@ViewChildren(NgbdSortableHeader) headers: QueryList<NgbdSortableHeader>;
onSort({ column, direction }: SortEvent) {
// resetting other headers
this.headers.forEach((header) => {
if (header.sortable !== column) {
header.direction = '';
}
});
this.service.sortColumn = column;
this.service.sortDirection = direction;
}
ngOnInit() {
}
}
@@ -1,25 +0,0 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReportsRoutingModule } from './reports-routing.module';
import { ReportsComponent } from './reports.component';
import { NgChartsModule } from 'ng2-charts';
import { Ng2GoogleChartsModule } from 'ng2-google-charts';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import { ChartistModule } from 'ng-chartist'
import { SharedModule } from 'src/app/shared/shared.module';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
@NgModule({
declarations: [ReportsComponent],
imports: [
CommonModule,
NgChartsModule,
Ng2GoogleChartsModule,
NgxChartsModule,
ChartistModule,
ReportsRoutingModule,
SharedModule,
NgbModule
]
})
export class ReportsModule { }
@@ -1,8 +1,10 @@
th, td {
th,
td {
text-align: center;
}
.modal-change-status {
// width: 1000px;
.modal-confirm-text {
text-align: center;
@@ -35,12 +37,14 @@ th, td {
}
.modal-confirm-delete {
// width: 1000px;
.modal-confirm-text {
text-align: center;
padding: 20px 8px;
font-weight: 600;
}
.modal-btn-option {
width: 100%;
display: flex;
@@ -56,4 +60,25 @@ th, td {
.modal-confirm-text {
font-weight: 600;
}
:host {
::ng-deep {
.pagination {
&>li {
&.page-item {
&.active {
&>a {
&.page-link {
&>span {
display: none;
}
}
}
}
}
}
}
}
}
@@ -60,4 +60,25 @@ td {
.modal-confirm-text {
font-weight: 600;
}
:host {
::ng-deep {
.pagination {
&>li {
&.page-item {
&.active {
&>a {
&.page-link {
&>span {
display: none;
}
}
}
}
}
}
}
}
}
@@ -1,10 +1,12 @@
.modal-confirm-delete {
// width: 1000px;
.modal-confirm-text {
text-align: center;
padding: 20px 8px;
font-weight: 600;
}
.modal-btn-option {
width: 100%;
display: flex;
@@ -22,6 +24,28 @@
font-weight: 600;
}
th, td {
th,
td {
text-align: center;
}
:host {
::ng-deep {
.pagination {
&>li {
&.page-item {
&.active {
&>a {
&.page-link {
&>span {
display: none;
}
}
}
}
}
}
}
}
}
@@ -0,0 +1,19 @@
:host {
::ng-deep {
.pagination {
&>li {
&.page-item {
&.active {
&>a {
&.page-link {
&>span {
display: none;
}
}
}
}
}
}
}
}
}
@@ -1,4 +1,25 @@
th,
td {
text-align: center;
}
:host {
::ng-deep {
.pagination {
&>li {
&.page-item {
&.active {
&>a {
&.page-link {
&>span {
display: none;
}
}
}
}
}
}
}
}
}
@@ -1,7 +1,29 @@
th, td {
th,
td {
text-align: center;
}
.text-size {
font-size: 12px;
}
:host {
::ng-deep {
.pagination {
&>li {
&.page-item {
&.active {
&>a {
&.page-link {
&>span {
display: none;
}
}
}
}
}
}
}
}
}
-11
View File
@@ -26,13 +26,6 @@ export const content: Routes = [
breadcrumb: "Đơn hàng"
}
},
{
path: 'coupons',
loadChildren: () => import('../../components/coupons/coupons.module').then(m => m.CouponsModule),
data: {
breadcrumb: "Coupons"
}
},
// {
// path: 'pages',
// loadChildren: () => import('../../components/pages/pages.module').then(m => m.PagesModule),
@@ -72,10 +65,6 @@ export const content: Routes = [
// breadcrumb: "Localization"
// }
// },
{
path: 'reports',
loadChildren: () => import('../../components/reports/reports.module').then(m => m.ReportsModule),
},
{
path: 'settings',
loadChildren: () => import('../../components/setting/setting.module').then(m => m.SettingModule),
+1
View File
@@ -1,5 +1,6 @@
$btn-padding : 0.5rem 1.5rem;
/**=====================
Admin CSS Start
==========================**/
-1
View File
@@ -1 +0,0 @@
/* You can add global styles to this file, and also import other style files */