ionic-vhframeworks 4.1.4 → 4.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/ionic-vhframeworks.umd.js +1 -1
- package/bundles/ionic-vhframeworks.umd.js.map +1 -1
- package/bundles/ionic-vhframeworks.umd.min.js +1 -1
- package/bundles/ionic-vhframeworks.umd.min.js.map +1 -1
- package/fesm2015/ionic-vhframeworks.js.map +1 -1
- package/ionic-vhframeworks.metadata.json +1 -1
- package/lib/ionic-vhframeworks.service.d.ts +121 -26
- package/package.json +1 -1
|
@@ -29,6 +29,16 @@ export declare class VhAlgorithm {
|
|
|
29
29
|
private papa;
|
|
30
30
|
private dom;
|
|
31
31
|
constructor(platform: Platform, file: File, socialSharing: SocialSharing, papa: Papa, dom: DomSanitizer);
|
|
32
|
+
/**
|
|
33
|
+
* Hàm này kiểm tra ngày trên bill có phải là ngày hiện tại của thiết bị không
|
|
34
|
+
* @Example :
|
|
35
|
+
* if(this.vhAlgorithm.isToday(date)){
|
|
36
|
+
* //Your code
|
|
37
|
+
* }
|
|
38
|
+
* @param date : ngày trên bill
|
|
39
|
+
* @returns true: nếu ngày trên bill trùng với ngày của thiết bị; false: nếu ngày trên bill khác với ngày của thiết bị
|
|
40
|
+
*/
|
|
41
|
+
isToday(date: any): boolean;
|
|
32
42
|
/**
|
|
33
43
|
* Hàm này so sanh sâu 2 object bằng nhau
|
|
34
44
|
* @param object1
|
|
@@ -42,6 +52,11 @@ export declare class VhAlgorithm {
|
|
|
42
52
|
* @returns
|
|
43
53
|
*/
|
|
44
54
|
isObject(object: any): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Hàm này tạo chuỗi số, ký tự ngẫy nhiên có chiều dài là length
|
|
57
|
+
* @param length
|
|
58
|
+
* @returns
|
|
59
|
+
*/
|
|
45
60
|
ObjectId(length?: number): string;
|
|
46
61
|
/**
|
|
47
62
|
* @example:
|
|
@@ -85,7 +100,17 @@ export declare class VhAlgorithm {
|
|
|
85
100
|
*/
|
|
86
101
|
exportCSV(headerRow: any, csvData: any, filename: any): void;
|
|
87
102
|
waitingStack(): Promise<unknown>;
|
|
103
|
+
/**
|
|
104
|
+
* Hàm trả về mảng có đối tượng trong array_list thỏa điều kiện tìm kiếm
|
|
105
|
+
* @param value : giá trị cần search
|
|
106
|
+
* @param array_list : mảng các đối tượng
|
|
107
|
+
* @param array_field : mảng các trường của đối tượng sẽ đc search
|
|
108
|
+
* @returns Array
|
|
109
|
+
*/
|
|
88
110
|
searchList(value: any, array_list: any, array_field: any): any[];
|
|
111
|
+
/**
|
|
112
|
+
* Ham đổi chuỗi alias có dấu thành không dấu
|
|
113
|
+
*/
|
|
89
114
|
changeAlias(alias: any): any;
|
|
90
115
|
/**
|
|
91
116
|
* @example
|
|
@@ -139,13 +164,14 @@ export declare class VhAlgorithm {
|
|
|
139
164
|
sortNumberbyASC(array: any, field: any): any;
|
|
140
165
|
sortNumberbyDESC(array: any, field: any): any;
|
|
141
166
|
/**
|
|
142
|
-
*
|
|
167
|
+
* Hàm trả về số ngày trong tháng của một thời gian
|
|
143
168
|
* @param year
|
|
144
169
|
* @param month
|
|
145
170
|
*/
|
|
146
171
|
getNumberOfDaysInMonth(year: number, month: number): 31 | 29 | 28 | 30;
|
|
147
172
|
Compare(field: any, condition: any, value: any): boolean;
|
|
148
173
|
/**
|
|
174
|
+
* Hàm đổi chuỗi sang object
|
|
149
175
|
* @example: data = "{"field":1, "field2": "val"}";
|
|
150
176
|
* => data = {
|
|
151
177
|
* field1: 1,
|
|
@@ -156,6 +182,7 @@ export declare class VhAlgorithm {
|
|
|
156
182
|
*/
|
|
157
183
|
convert_STRING2OBJECT(string: any): any;
|
|
158
184
|
/**
|
|
185
|
+
* Hàm đổi object sang chuỗi
|
|
159
186
|
* @example:
|
|
160
187
|
* data = {
|
|
161
188
|
* field1: 1,
|
|
@@ -495,18 +522,54 @@ export declare class VhAuth {
|
|
|
495
522
|
* @return Promise => member={}
|
|
496
523
|
*/
|
|
497
524
|
signUpEndUser(email: string, password: string, phoneNumber: string, info: object): Promise<unknown>;
|
|
498
|
-
private
|
|
525
|
+
private getLocalMyPermission;
|
|
526
|
+
/**
|
|
527
|
+
* Hàm này chỉ dùng cho FW, Dev không dùng nhé
|
|
528
|
+
* @returns
|
|
529
|
+
*/
|
|
499
530
|
refreshLocalMyPermission(): Promise<unknown>;
|
|
500
531
|
/**
|
|
532
|
+
* Hàm này chỉ trả về kết quả chính xác khi mà các permission_name có giá trị trả về là kiểu boolean
|
|
533
|
+
* Hàm checkMyPermission tương đương hàm checkLocalMyPermissionName, sau này sẽ bỏ hàm checkMyPermission
|
|
501
534
|
* @example:
|
|
502
535
|
if(this.VhQuerySales.checkMyPermission('login_enable_login')){
|
|
503
536
|
this.login();
|
|
504
537
|
}
|
|
505
|
-
* @param
|
|
538
|
+
* @param permission_name
|
|
539
|
+
* @param message
|
|
540
|
+
* @return Boolean => true or false
|
|
541
|
+
*/
|
|
542
|
+
checkMyPermission(permission_name: any): boolean;
|
|
543
|
+
/**
|
|
544
|
+
* Hàm này chỉ trả về kết quả chính xác khi mà các permission_name có giá trị trả về là kiểu boolean
|
|
545
|
+
* @example:
|
|
546
|
+
if(this.VhQuerySales.checkLocalMyPermissionName('login_enable_login')){
|
|
547
|
+
this.login();
|
|
548
|
+
}
|
|
549
|
+
* @param permission_name
|
|
506
550
|
* @param message
|
|
507
551
|
* @return Boolean => true or false
|
|
508
552
|
*/
|
|
509
|
-
|
|
553
|
+
checkLocalMyPermissionName(permission_name: any): boolean;
|
|
554
|
+
/**
|
|
555
|
+
* Hàm này chỉ trả về kết quả khi mà permission_name mà có giá trị không phải kiểu boolean, nếu là kiểu boolean hàm sẽ không trả kết quả về
|
|
556
|
+
* @example:
|
|
557
|
+
* let mypermissionname = this.VhQuerySales.getLocalMyPermissionName('default_display_page');
|
|
558
|
+
* @param permission_name
|
|
559
|
+
* @return number/string/object
|
|
560
|
+
*/
|
|
561
|
+
getLocalMyPermissionName(permission_name: any): any;
|
|
562
|
+
/**
|
|
563
|
+
* @example:
|
|
564
|
+
this.VhQuerySales.updatePermission('2rVieBQTubQ2hjUnpwU4w7qSlD83',{login_enable_login: false, default_display_page: 'admin_display_page'})
|
|
565
|
+
.then((result)=>{
|
|
566
|
+
console.log(result);
|
|
567
|
+
})
|
|
568
|
+
* @format value = {login_enable_login:true} or value = {login_reset_password:true}
|
|
569
|
+
* @param value
|
|
570
|
+
* @return Promise Boolean => true or false
|
|
571
|
+
*/
|
|
572
|
+
updateMyPermission(value: object): Promise<unknown>;
|
|
510
573
|
/**
|
|
511
574
|
* @example:
|
|
512
575
|
this.VhQuerySales.updatePermission('2rVieBQTubQ2hjUnpwU4w7qSlD83',{login_enable_login: false})
|
|
@@ -517,17 +580,19 @@ export declare class VhAuth {
|
|
|
517
580
|
* @param value
|
|
518
581
|
* @return Promise Boolean => true or false
|
|
519
582
|
*/
|
|
520
|
-
updatePermission(id_employee:
|
|
583
|
+
updatePermission(id_employee: string, value: object): Promise<unknown>;
|
|
521
584
|
/**
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
console.log('
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
585
|
+
* Hàm này lấy về phân quyền của nhân viên
|
|
586
|
+
* Lưu ý không dùng hàm này cho Boss, vì Boss không bị giới hạn phân quyền
|
|
587
|
+
* @example:
|
|
588
|
+
this.vhAuth.getPermission('5fccf8b675b75a1fc84342e9')
|
|
589
|
+
.then((permission)=>{
|
|
590
|
+
console.log('permission', permission)
|
|
591
|
+
},error => {
|
|
592
|
+
console.log('error', error);
|
|
593
|
+
});
|
|
594
|
+
* @return Promise => permission = {} or null
|
|
595
|
+
*/
|
|
531
596
|
getPermission(id_employee: any): any;
|
|
532
597
|
publishObservableEventEmployees(): void;
|
|
533
598
|
private observableLocalEmployees;
|
|
@@ -3400,6 +3465,21 @@ export declare class VhQueryCafe {
|
|
|
3400
3465
|
* @return — Array -> array = [{},{},...]
|
|
3401
3466
|
*/
|
|
3402
3467
|
getBills(query: object, projection?: object, sort?: object, limit?: number): Promise<unknown>;
|
|
3468
|
+
/**
|
|
3469
|
+
* @example:
|
|
3470
|
+
* let time = new Date();
|
|
3471
|
+
* time.setDate(time.getDate()-7);
|
|
3472
|
+
* this.vhQueryCafe.getBills_byFields({date:{$gte:time}, {bill_type:{$eq:5}}, {},{date:1},0)
|
|
3473
|
+
.then((bills)=>{
|
|
3474
|
+
console.log('getBills', bills);
|
|
3475
|
+
})
|
|
3476
|
+
* @param query
|
|
3477
|
+
* @param projection — đang tìm hiểu, tạm thời để giá trị là {}
|
|
3478
|
+
* @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
|
|
3479
|
+
* @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
|
|
3480
|
+
* @return — Array -> array = [{},{},...]
|
|
3481
|
+
*/
|
|
3482
|
+
getBills_byFields(query: object, projection?: object, sort?: object, limit?: number): Promise<unknown>;
|
|
3403
3483
|
/**
|
|
3404
3484
|
* @example:
|
|
3405
3485
|
* this.vhQueryCafe.createBill({name:'Cuối tuần vui vẻ', type:2, active:true, date_start:new Date(), date_end: new Date()})
|
|
@@ -10859,6 +10939,21 @@ export declare class VhQuerySales {
|
|
|
10859
10939
|
* @return — Array -> array = [{},{},...]
|
|
10860
10940
|
*/
|
|
10861
10941
|
getBills(query: object, projection?: object, sort?: object, limit?: number): Promise<unknown>;
|
|
10942
|
+
/**
|
|
10943
|
+
* @example:
|
|
10944
|
+
* let time = new Date();
|
|
10945
|
+
* time.setDate(time.getDate()-7);
|
|
10946
|
+
* this.vhQuerySales.getBills_byFields({date:{$gte:time}, {bill_type:{$eq:5}}, {},{date:1},0)
|
|
10947
|
+
.then((bills)=>{
|
|
10948
|
+
console.log('getBills', bills);
|
|
10949
|
+
})
|
|
10950
|
+
* @param query
|
|
10951
|
+
* @param projection — đang tìm hiểu, tạm thời để giá trị là {}
|
|
10952
|
+
* @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
|
|
10953
|
+
* @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
|
|
10954
|
+
* @return — Array -> array = [{},{},...]
|
|
10955
|
+
*/
|
|
10956
|
+
getBills_byFields(query: object, projection?: object, sort?: object, limit?: number): Promise<unknown>;
|
|
10862
10957
|
/**
|
|
10863
10958
|
* @example:
|
|
10864
10959
|
* this.vhQuerySales.createBill({name:'Cuối tuần vui vẻ', type:2, active:true, date_start:new Date(), date_end: new Date()})
|
|
@@ -11404,7 +11499,7 @@ export declare class VhQuerySales {
|
|
|
11404
11499
|
getLocalAppSettingNameStations(): any[];
|
|
11405
11500
|
/**
|
|
11406
11501
|
* @example:
|
|
11407
|
-
let appsetting = this.vhQuerySales.getLocalAppSettingNameStation('info_header_footer_bill');
|
|
11502
|
+
let appsetting = this.vhQuerySales.getLocalAppSettingNameStation('info_header_footer_bill'); //printer_config_selling_page
|
|
11408
11503
|
console.log(appsetting);
|
|
11409
11504
|
* @param appsetting_name
|
|
11410
11505
|
* @return object => {title:'title',name:'name', quantity: 10}
|
|
@@ -11456,17 +11551,17 @@ export declare class VhQuerySales {
|
|
|
11456
11551
|
private publishObservableEventAppSettingNameBranchs;
|
|
11457
11552
|
private observableLocalAppSettingNameBranchs;
|
|
11458
11553
|
/**
|
|
11459
|
-
|
|
11460
|
-
|
|
11461
|
-
|
|
11462
|
-
|
|
11463
|
-
|
|
11464
|
-
|
|
11465
|
-
|
|
11466
|
-
|
|
11467
|
-
|
|
11468
|
-
|
|
11469
|
-
|
|
11554
|
+
* Các hàm AppSettingNameBranchs thêm, xóa, sửa thông tin (dạng object) riêng giữa các chi nhánh, như: thông tin cửa hang
|
|
11555
|
+
* @example:
|
|
11556
|
+
* this.observableAppSettingName = this.vhQuerySales.getObservableLocalAppSettingNameBranchs().subscribe(() => {
|
|
11557
|
+
let store_info = this.vhQuerySales.getLocalAppSettingNameBranch('store_info');
|
|
11558
|
+
console.log(store_info);
|
|
11559
|
+
})
|
|
11560
|
+
ngOnDestroy(){
|
|
11561
|
+
this.observableAppSettingName.unsubscribe();
|
|
11562
|
+
}
|
|
11563
|
+
* @returns Observerble (Array) => Array(object) => array = [{},{},...]
|
|
11564
|
+
*/
|
|
11470
11565
|
getObservableLocalAppSettingNameBranchs(): Observable<unknown>;
|
|
11471
11566
|
/**
|
|
11472
11567
|
*@example:
|