ionic-vhframeworks 8.2.7 → 8.2.9
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.
|
@@ -1773,6 +1773,53 @@ export declare class VhImage {
|
|
|
1773
1773
|
* vcode === 4 : import file ảnh không đúng định dạng
|
|
1774
1774
|
*/
|
|
1775
1775
|
getImageFromDesktop(file: any, path: any, oldthumbnailURL?: any, maxSize?: any): Promise<any>;
|
|
1776
|
+
/**
|
|
1777
|
+
* @example:Lấy hình ảnh từ Desktop đẩy lên server với kích thước hình theo options truyền vào
|
|
1778
|
+
* onUpload(e?) {
|
|
1779
|
+
const file = e.target.files[0];
|
|
1780
|
+
this.vhImage.getImageFromDesktop_Autoweb(file,"images/database/categories", options)
|
|
1781
|
+
.then((rsp:any)=>{
|
|
1782
|
+
console.log('rsp', rsp);
|
|
1783
|
+
if(rsp.vcode === 0){
|
|
1784
|
+
if(options.compress_type == 'no-compress-all'){
|
|
1785
|
+
|
|
1786
|
+
}else if(options.compress_type == 'no-compress-one'){
|
|
1787
|
+
|
|
1788
|
+
}else if(options.compress_type == 'compress-sreen'){
|
|
1789
|
+
|
|
1790
|
+
}else if(options.compress_type == 'compress-frame'){
|
|
1791
|
+
|
|
1792
|
+
}
|
|
1793
|
+
}else if(rsp.vcode === 1){
|
|
1794
|
+
|
|
1795
|
+
}else if(rsp.vcode === 2){
|
|
1796
|
+
|
|
1797
|
+
}else if(rsp.vcode === 3){
|
|
1798
|
+
|
|
1799
|
+
}
|
|
1800
|
+
this.vhComponent.showToast(2000, (this.languageService.translate("Image was loaded successfully")));
|
|
1801
|
+
},error => {
|
|
1802
|
+
this.vhComponent.showToast(2000, (this.languageService.translate("Image was failed")));
|
|
1803
|
+
}
|
|
1804
|
+
);
|
|
1805
|
+
}
|
|
1806
|
+
* @param file
|
|
1807
|
+
* @param path: 'images/database/categories' or 'images/database/categories/products'
|
|
1808
|
+
* @param options: {compress_type, resolution}
|
|
1809
|
+
* @field compress_type:
|
|
1810
|
+
* + 'no-compress-all': Không nén ảnh sau khi tải lên, 1 ảnh dùng chung cho tất cả các thiết bị (platform)
|
|
1811
|
+
* + 'no-compress-one': Không nén ảnh sau khi tải lên, mỗi thiết bị upload lên server 1 ảnh riêng
|
|
1812
|
+
* + 'compress-sreen': Nén ảnh sau khi tải lên, nén ảnh theo tỉ lệ màn hình của mỗi thiết bị
|
|
1813
|
+
* + 'compress-frame': Nén ảnh sau khi tải lên, nén ảnh theo tỉ lệ màn hình của mỗi khung hình thiết bị
|
|
1814
|
+
* @field resolution: {desktop: {width, height}, mobile_landscape: {}, mobile_portrait:{}, tablet_landscape:{}, tablet_portrait:{}}
|
|
1815
|
+
* @returns Object => obj = {vcode, message, data, error}
|
|
1816
|
+
* vcode === 0 : upload ảnh thành công
|
|
1817
|
+
* vcode === 1 : lỗi import file ảnh
|
|
1818
|
+
* vcode === 2 : lỗi upload file ảnh
|
|
1819
|
+
* vcode === 3 : không thể upload file ảnh lớn hơn maxSize (byte)
|
|
1820
|
+
* vcode === 4 : import file ảnh không đúng định dạng
|
|
1821
|
+
*/
|
|
1822
|
+
getImageFromDesktop_Autoweb(file: any, path: any, options: any): Promise<any>;
|
|
1776
1823
|
/**
|
|
1777
1824
|
* @example:Lấy hình file bất kỳ từ Desktop đẩy lên server với kích thước ko thay đổi
|
|
1778
1825
|
* onUpload(e?) {
|
|
@@ -12451,6 +12498,98 @@ export declare class VhQueryAutoWeb {
|
|
|
12451
12498
|
* @return Object => obj = {} hoặc null
|
|
12452
12499
|
*/
|
|
12453
12500
|
getUnit_byRatio(units: any, ratio: number): any;
|
|
12501
|
+
/**
|
|
12502
|
+
* @example:
|
|
12503
|
+
* let data = {
|
|
12504
|
+
* name: 'TCL',
|
|
12505
|
+
* code_type: 10,
|
|
12506
|
+
* type: 1
|
|
12507
|
+
* }
|
|
12508
|
+
* this.vhQueryAutoWeb.addEWADocument(data)
|
|
12509
|
+
.then((EWAdocument)=>{
|
|
12510
|
+
console.log('addEWADocument', EWAdocument);
|
|
12511
|
+
},(error:any)=>{
|
|
12512
|
+
console.log('error', error);
|
|
12513
|
+
})
|
|
12514
|
+
* @param id_EWAdocument
|
|
12515
|
+
* @param data : {}
|
|
12516
|
+
* @return Promise => obj = {} /error
|
|
12517
|
+
* Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
|
|
12518
|
+
*/
|
|
12519
|
+
addEWADocument(data: object): Promise<unknown>;
|
|
12520
|
+
/**
|
|
12521
|
+
* @example:
|
|
12522
|
+
* let data = {
|
|
12523
|
+
* name: 'TCL',
|
|
12524
|
+
* code_type: 10,
|
|
12525
|
+
* type: 1
|
|
12526
|
+
* }
|
|
12527
|
+
* this.vhQueryAutoWeb.addEWADocument_byID('5fb6780ca2148e09806c5b01', data)
|
|
12528
|
+
.then((EWAdocument)=>{
|
|
12529
|
+
console.log('addEWADocument_byID', EWAdocument);
|
|
12530
|
+
},(error:any)=>{
|
|
12531
|
+
console.log('error', error);
|
|
12532
|
+
})
|
|
12533
|
+
* @param id_EWAdocument
|
|
12534
|
+
* @param data : {}
|
|
12535
|
+
* @return Promise => obj = {} /error
|
|
12536
|
+
* Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
|
|
12537
|
+
*/
|
|
12538
|
+
addEWADocument_byID(id_EWAdocument: string, data: object): Promise<unknown>;
|
|
12539
|
+
/**
|
|
12540
|
+
* @example:
|
|
12541
|
+
* this.vhQueryAutoWeb.updateEWADocument('5fb6780ca2148e09806c5b01', {code_type: 9})
|
|
12542
|
+
.then(()=>{
|
|
12543
|
+
console.log('updateEWADocument');
|
|
12544
|
+
}, error=>{
|
|
12545
|
+
console.log('error');
|
|
12546
|
+
})
|
|
12547
|
+
* @param id_EWAdocument
|
|
12548
|
+
* @param value : {}
|
|
12549
|
+
* @return Promise => response = undefined / error
|
|
12550
|
+
*/
|
|
12551
|
+
updateEWADocument(id_EWAdocument: string, value: object): Promise<unknown>;
|
|
12552
|
+
/**
|
|
12553
|
+
* @example:
|
|
12554
|
+
* this.vhQueryAutoWeb.deleteEWADocument('5fb67fda87c0f21d484cbdf3')
|
|
12555
|
+
.then(()=>{
|
|
12556
|
+
console.log('deleteEWADocument');
|
|
12557
|
+
})
|
|
12558
|
+
* @param id_EWAdocument
|
|
12559
|
+
* @return Promise => response = undefined / error
|
|
12560
|
+
*/
|
|
12561
|
+
deleteEWADocument(id_EWAdocument: string): Promise<unknown>;
|
|
12562
|
+
/**
|
|
12563
|
+
* @example
|
|
12564
|
+
* this.vhQueryAutoWeb.getEWADocument('5fb67fda87c0f21d484cbdf3')
|
|
12565
|
+
.then((EWAdocument)=>{
|
|
12566
|
+
console.log('getEWADocument', EWAdocument);
|
|
12567
|
+
},(error:any)=>{
|
|
12568
|
+
console.log('error', error);
|
|
12569
|
+
})
|
|
12570
|
+
* @param id_EWAdocument
|
|
12571
|
+
* @return Promise => response ={} or null / error
|
|
12572
|
+
*/
|
|
12573
|
+
getEWADocument(id_EWAdocument: string): Promise<unknown>;
|
|
12574
|
+
/**
|
|
12575
|
+
* @example
|
|
12576
|
+
* this.vhQueryAutoWeb.getEWADocuments_byfields({name:{$eq:'name abc'}}, {},{},0)
|
|
12577
|
+
.then(response=>{
|
|
12578
|
+
console.log('response', response);
|
|
12579
|
+
if(response.vcode === 0){
|
|
12580
|
+
//-----------your code-----------
|
|
12581
|
+
let products = response.data;
|
|
12582
|
+
}
|
|
12583
|
+
},(error:any)=>{
|
|
12584
|
+
console.log('error', error)
|
|
12585
|
+
})
|
|
12586
|
+
* @param query
|
|
12587
|
+
* @param projection — đang tìm hiểu, tạm thời để giá trị là {}
|
|
12588
|
+
* @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
|
|
12589
|
+
* @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
|
|
12590
|
+
* @return Promise => array(object) = [{},{},..]
|
|
12591
|
+
*/
|
|
12592
|
+
getEWADocuments_byfields(query: object, projection?: object, sort?: object, limit?: number): Promise<unknown>;
|
|
12454
12593
|
/**
|
|
12455
12594
|
* @example:
|
|
12456
12595
|
* this.vhQueryAutoWeb.addBranch({name:'Chi nhánh 2'})
|