ionic-vhframeworks 8.7.5 → 8.7.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.
@@ -235,7 +235,7 @@ export declare class VhAlgorithm {
235
235
  <input type="file" class="form-control" (change)="addfile($event)" placeholder="Upload file" accept=".csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
236
236
  </div>
237
237
  const file = event.target.files[0];
238
- this.vhAlgorithmimportXLSX(file)
238
+ this.vhAlgorithm.importXLSX(file)
239
239
  .then(obj=>{
240
240
  console.log('obj', obj);
241
241
  })
@@ -245,7 +245,7 @@ export declare class VhAlgorithm {
245
245
  importXLSX(file: any): Promise<unknown>;
246
246
  /**
247
247
  * @example:
248
- * this.vhAlgorithmexportXLSX(arrayData, name).then(() => this.status = false).catch(err => this.status = false);
248
+ * this.vhAlgorithm.exportXLSX(arrayData, name).then(() => this.status = false).catch(err => this.status = false);
249
249
  * @param arrayData => format [{field_a1: val_a1, field_a2: val_a2, field_a3: val_a3}
250
250
  * {field_b1: val_b1, field_b2: val_b2, field_b3: val_b3}
251
251
  * {field_c1: val_c1, field_c2: val_c2, field_c3: val_c3}]
@@ -256,7 +256,7 @@ export declare class VhAlgorithm {
256
256
  /**
257
257
  * @example:
258
258
  const file = e.target.files[0];
259
- this.vhAlgorithmimportCSV(file)
259
+ this.vhAlgorithm.importCSV(file)
260
260
  .then(obj=>{
261
261
  console.log('obj', obj);
262
262
  })
@@ -271,15 +271,10 @@ export declare class VhAlgorithm {
271
271
  */
272
272
  exportCSV(headerRow: any, csvData: any, filename: any): void;
273
273
  waitingStack(): Promise<unknown>;
274
- /**
275
- * Hàm trả về mảng có đối tượng trong array_list thỏa điều kiện tìm kiếm
276
- * @param value : giá trị cần search
277
- * @param array_list : mảng các đối tượng
278
- * @param array_field : mảng các trường của đối tượng sẽ đc search
279
- * @returns Array
280
- */
281
274
  searchList(value: any, array_list: any, array_field: any): any[];
282
275
  /**
276
+ * @example:
277
+ * this.vhAlgorithm.changeAlias(alias);
283
278
  * Ham đổi chuỗi alias có dấu thành không dấu
284
279
  */
285
280
  changeAlias(alias: any): any;
@@ -12752,6 +12747,19 @@ export declare class VhQueryAutoWeb {
12752
12747
  * @return Promise => array(object) = [{},{},..]
12753
12748
  */
12754
12749
  getEWADocuments_byfields(query: object, projection?: object, sort?: object, limit?: number): Promise<unknown>;
12750
+ /**
12751
+ * @example:
12752
+ * this.vhQueryAutoWeb.createIndexes('atw_products', {name_textsearch:'text'})
12753
+ .then((obj:any)=>{
12754
+ console.log('createIndexes', obj);
12755
+ }, error=>{
12756
+ reject(error)
12757
+ })
12758
+ * @param colname
12759
+ * @param index
12760
+ * @return null or object
12761
+ */
12762
+ createIndexes(colname: string, index: any): Promise<unknown>;
12755
12763
  /**
12756
12764
  * @example:
12757
12765
  * this.vhQueryAutoWeb.addBranch({name:'Chi nhánh 2'})
@@ -13362,13 +13370,13 @@ export declare class VhQueryAutoWeb {
13362
13370
  console.log('error', error);
13363
13371
  })
13364
13372
  * @param id_product
13365
- * @param data
13373
+ * @param value
13366
13374
  * @return Promise object => rsp ={vcode, msg, data(undefined)} / error
13367
13375
  * @notice : hàm này chỉ add được dữ liệu sau khi khách hàng hoặc nhân viên đã đăng nhập
13368
13376
  * vcode == 0: success
13369
13377
  * vcode == 11: 'not logged in
13370
13378
  */
13371
- updateProduct(id_product: string, data: object): Promise<unknown>;
13379
+ updateProduct(id_product: string, value: any): Promise<unknown>;
13372
13380
  /**
13373
13381
  * @example:
13374
13382
  * this.vhQueryAutoWeb.deleteProduct('5fb67fda87c0f21d484cbdf3')
@@ -13399,6 +13407,16 @@ export declare class VhQueryAutoWeb {
13399
13407
  * @return Promise => obj ={} or null
13400
13408
  */
13401
13409
  getProduct(id_product: string): Promise<unknown>;
13410
+ /**
13411
+ * @example
13412
+ * this.vhQueryAutoWeb.getProduct_byIDsubproduct('5fb67fda87c0f21d484cbdf3')
13413
+ .then((product)=>{
13414
+ console.log('getProduct_byIDsubproduct', product);
13415
+ })
13416
+ * @param id_product
13417
+ * @return Promise => obj ={} or null
13418
+ */
13419
+ private getProduct_byIDsubproduct;
13402
13420
  /**
13403
13421
  * @example:
13404
13422
  * this.vhQueryAutoWeb.getProducts_byFields({name:{$eq:'name abc'}}, {},{},6,1)
@@ -13686,7 +13704,7 @@ export declare class VhQueryAutoWeb {
13686
13704
  * vcode == 0: success
13687
13705
  * vcode == 11: 'not logged in
13688
13706
  */
13689
- updateFood(id_food: string, data: object): Promise<unknown>;
13707
+ updateFood(id_food: string, value: any): Promise<unknown>;
13690
13708
  /**
13691
13709
  * @example:
13692
13710
  * this.vhQueryAutoWeb.deleteFood('5fb67fda87c0f21d484cbdf3')
@@ -13715,6 +13733,16 @@ export declare class VhQueryAutoWeb {
13715
13733
  */
13716
13734
  getFood(id_food: string): Promise<unknown>;
13717
13735
  /**
13736
+ * @example
13737
+ * this.vhQueryAutoWeb.getFood_byIDsubfood('5fb67fda87c0f21d484cbdf3')
13738
+ .then((food)=>{
13739
+ console.log('getFood_byIDsubfood', food);
13740
+ })
13741
+ * @param id_subfood
13742
+ * @return Promise => obj ={} or null
13743
+ */
13744
+ private getFood_byIDsubfood;
13745
+ /**
13718
13746
  * @example:
13719
13747
  * this.vhQueryAutoWeb.getFoods_byFields({name:{$eq:'name abc'}}, {},{},6,1)
13720
13748
  .then(response=>{
@@ -14097,7 +14125,7 @@ export declare class VhQueryAutoWeb {
14097
14125
  * vcode == 0: success
14098
14126
  * vcode == 11: 'not logged in
14099
14127
  */
14100
- updateService(id_service: string, data: object): Promise<unknown>;
14128
+ updateService(id_service: string, value: any): Promise<unknown>;
14101
14129
  /**
14102
14130
  * @example:
14103
14131
  * this.vhQueryAutoWeb.deleteService('5fb67fda87c0f21d484cbdf3')
@@ -14639,26 +14667,37 @@ export declare class VhQueryAutoWeb {
14639
14667
  */
14640
14668
  getRecruitments_byFields(query: object, projection?: object, sort?: object, limit?: number, page?: number): Promise<unknown>;
14641
14669
  /**
14670
+ * Hàm tìm kiếm textsearch:
14671
+ + colname = 'products': value tìm trong trường 'name'
14672
+ + colname = 'foods': value tìm trong trường 'name'
14673
+ + colname = 'services': value tìm trong trường 'name'
14674
+ + colname = 'newss': value tìm trong trường 'title' và 'content'
14642
14675
  * @example
14643
- * this.vhQueryAutoWeb.searchList('atw_products',["name", "describe"], 'Điện Thoại', 20, 1)
14676
+ * this.vhQueryAutoWeb.searchList('products', 'Điện Thoại', {price: {$gte: 10000}}, {price:1})
14644
14677
  .then(response=>{
14645
14678
  console.log('response', response);
14646
14679
  if(response.vcode === 0){
14647
- //-----------your code-----------
14648
- let array_searched_data = response.data;
14680
+ let data_searched = response.data;
14681
+ let limit = 20;
14682
+ let page = 1;
14683
+ let data_page = new Array(); //mảng dữ liệu phân theo page
14684
+ for(let i=0; i<data_searched.length;i++){
14685
+ if((i>=limit*(page-1))&&(i<limit*page)) data_page.push(data_searched[i]);
14686
+ }
14687
+ let totalpages = Math.ceil(data_searched.length/limit); // tổng số page
14649
14688
  }
14650
14689
  },(error:any)=>{
14651
14690
  console.log('error', error)
14652
14691
  })
14653
14692
  * @param colname
14654
- * @param array_field
14693
+ * @param query
14655
14694
  * @param value
14656
14695
  * @param sort null hoặc {}:không sắp xếp; {date:1}: sắp xếp date theo ASC; {date:-1}: sắp xếp date theo DESC
14657
14696
  * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
14658
14697
  * @param page — null hoặc 0 hoặc 1: get về trang đầu tiên; 2: get về trang thứ 2
14659
14698
  * @return Promise object => response = {vcode, msg, data(array), limit, page, totalpages}
14660
14699
  */
14661
- searchList(colname: string, array_field: any, value: string, sort: object, limit: number, page: number): Promise<unknown>;
14700
+ searchList(colname: string, value: any, query?: any, sort?: object): Promise<unknown>;
14662
14701
  /**
14663
14702
  * @example
14664
14703
  * this.vhQueryAutoWeb.searchList_PatternBlock_Thumbnail('mùa xuân',["name", "describe"], 20, 1)
@@ -14881,7 +14920,7 @@ export declare class VhQueryAutoWeb {
14881
14920
  * vcode == 0: success
14882
14921
  * vcode == 11: 'not logged in
14883
14922
  */
14884
- updateNews(id_news: string, data: object): Promise<unknown>;
14923
+ updateNews(id_news: string, value: any): Promise<unknown>;
14885
14924
  /**
14886
14925
  * @example:
14887
14926
  * this.vhQueryAutoWeb.deleteNews('5fb67fda87c0f21d484cbdf3')
@@ -18270,6 +18309,19 @@ export declare class VhBuildAutoWeb {
18270
18309
  * @returns
18271
18310
  */
18272
18311
  localStorageGET(name: string): any;
18312
+ /**
18313
+ * @example:
18314
+ * this.vhBuildAutoWeb.createIndexes('atw_products', {name_textsearch:'text'})
18315
+ .then((obj:any)=>{
18316
+ console.log('createIndexes', obj);
18317
+ }, error=>{
18318
+ reject(error)
18319
+ })
18320
+ * @param colname
18321
+ * @param index
18322
+ * @return null or object
18323
+ */
18324
+ createIndexes(colname: string, index: any): Promise<unknown>;
18273
18325
  /**
18274
18326
  * @example:
18275
18327
  * this.vhBuildAutoWeb.addBranch({name:'Chi nhánh 2'})
@@ -18729,9 +18781,9 @@ export declare class VhBuildAutoWeb {
18729
18781
  */
18730
18782
  /**
18731
18783
  * @example
18732
- * this.vhBuildAutoWeb.dynamic_getDetailFood_fromService('categories', '5fb67fda87c0f21d484cbdf3')
18784
+ * this.vhBuildAutoWeb.dynamic_getDetailFood('categories', '5fb67fda87c0f21d484cbdf3')
18733
18785
  .then(response=>{
18734
- console.log('response', response);
18786
+ console.log('dynamic_getDetailFood', response);
18735
18787
  if(response.vcode === 0){
18736
18788
  //-----------your code-----------
18737
18789
  let product = response.data;
@@ -18742,7 +18794,7 @@ export declare class VhBuildAutoWeb {
18742
18794
  * @param id_sub_or_food
18743
18795
  * @return Promise object => response = {vcode, msg, data(object)}
18744
18796
  */
18745
- dynamic_getDetailFood_fromService(id_sub_or_food: any): Promise<unknown>;
18797
+ dynamic_getDetailFood(id_sub_or_food: any): Promise<unknown>;
18746
18798
  /**
18747
18799
  * @example
18748
18800
  * this.vhBuildAutoWeb.searchList('atw_products',["name", "describe"], 'Điện Thoại', 20, 1)
@@ -18763,7 +18815,7 @@ export declare class VhBuildAutoWeb {
18763
18815
  * @param page — null hoặc 0 hoặc 1: get về trang đầu tiên; 2: get về trang thứ 2
18764
18816
  * @return Promise object => response = {vcode, msg, data(array), limit, page, totalpages}
18765
18817
  */
18766
- searchList(colname: string, array_field: any, value: string, sort: object, limit: number, page: number): Promise<unknown>;
18818
+ searchList(colname: string, value: string, query?: object, sort?: object): Promise<unknown>;
18767
18819
  static ɵfac: i0.ɵɵFactoryDeclaration<VhBuildAutoWeb, never>;
18768
18820
  static ɵprov: i0.ɵɵInjectableDeclaration<VhBuildAutoWeb>;
18769
18821
  }
@@ -19479,6 +19531,19 @@ export declare class VhDesignAutoWeb {
19479
19531
  * @returns
19480
19532
  */
19481
19533
  localStorageGET(name: string): any;
19534
+ /**
19535
+ * @example:
19536
+ * this.vhDesignAutoWeb.createIndexes('atw_products', {name_textsearch:'text'})
19537
+ .then((obj:any)=>{
19538
+ console.log('createIndexes', obj);
19539
+ }, error=>{
19540
+ reject(error)
19541
+ })
19542
+ * @param colname
19543
+ * @param index
19544
+ * @return null or object
19545
+ */
19546
+ createIndexes(colname: string, index: any): Promise<unknown>;
19482
19547
  /**
19483
19548
  * @example:
19484
19549
  * this.vhDesignAutoWeb.addBranch({name:'Chi nhánh 2'})
@@ -19817,9 +19882,9 @@ export declare class VhDesignAutoWeb {
19817
19882
  dynamic_getDetailProduct(id_sub_or_product: any): Promise<unknown>;
19818
19883
  /**
19819
19884
  * @example
19820
- * this.vhDesignAutoWeb.dynamic_getDetailFood_fromService('categories', '5fb67fda87c0f21d484cbdf3')
19885
+ * this.vhDesignAutoWeb.dynamic_getDetailFood('categories', '5fb67fda87c0f21d484cbdf3')
19821
19886
  .then((doc)=>{
19822
- console.log('dynamic_getDetailFood_fromService', doc);
19887
+ console.log('dynamic_getDetailFood', doc);
19823
19888
  },(error:any)=>{
19824
19889
  console.log('error', error)
19825
19890
  })
@@ -20002,7 +20067,7 @@ export declare class VhDesignAutoWeb {
20002
20067
  * @param page — null hoặc 0 hoặc 1: get về trang đầu tiên; 2: get về trang thứ 2
20003
20068
  * @return Promise object => response = {vcode, msg, data(array), limit, page, totalpages}
20004
20069
  */
20005
- searchList(colname: string, array_field: any, value: string, sort: object, limit: number, page: number): Promise<unknown>;
20070
+ searchList(colname: string, value: string, query?: object, sort?: object): Promise<unknown>;
20006
20071
  /**
20007
20072
  * @example:
20008
20073
  * this.vhDesignAutoWeb.isCloneBlockOrObject(block_or_object)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ionic-vhframeworks",
3
- "version": "8.7.5",
3
+ "version": "8.7.7",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^12.2.0",
6
6
  "@angular/core": "^12.2.0"