Skip to content

Commit 19f7c17

Browse files
hpyourdkmaster
authored andcommitted
[修复] 修复在transfer中给pagination设置属性错误
1 parent 446e533 commit 19f7c17

File tree

5 files changed

+25
-11
lines changed

5 files changed

+25
-11
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## v1.1.16 (2018-10-31)
2+
3+
### 新特性 / New Features
4+
-
5+
6+
### 破坏性修改 / Breaking Changes
7+
-
8+
9+
### 优化 / Modified
10+
-
11+
12+
### 修复 / Fixes
13+
- [修复] 修复在transfer中给pagination设置属性错误
14+
115
## v1.1.15 (2018-10-31)
216

317
### 新特性 / New Features

src/app/app.interceptor.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {PagingInfo} from "../jigsaw/core/data/component-data";
88
@Injectable()
99
export class AjaxInterceptor implements HttpInterceptor {
1010

11-
private static _usingRealRDK: boolean = true;
11+
private static _usingRealRDK: boolean = false;
1212
private static _processors: any[] = [];
1313

1414
public static registerProcessor(urlPattern: RegExp | string, processor: (req: HttpRequest<any>) => any, context?: any) {
@@ -50,11 +50,11 @@ export class AjaxInterceptor implements HttpInterceptor {
5050
const params = req.method.toLowerCase() == 'post' ? 'body' : 'params';
5151
const service = this.getParamValue(req, params, 'service');
5252
let paging = this.getParamValue(req, params, 'paging') ? this.getParamValue(req, params, 'paging') : null;
53-
paging = typeof paging === 'string' ? JSON.stringify(paging) : paging;
53+
paging = typeof paging === 'string' ? JSON.parse(paging) : paging;
5454
let filter = this.getParamValue(req, params, 'filter') ? this.getParamValue(req, params, 'filter') : null;
55-
filter = typeof filter === 'string' ? JSON.stringify(filter) : filter;
55+
filter = typeof filter === 'string' ? JSON.parse(filter) : filter;
5656
let sort = this.getParamValue(req, params, 'sort') ? this.getParamValue(req, params, 'sort') : null;
57-
sort = typeof sort === 'string' ? JSON.stringify(sort) : sort;
57+
sort = typeof sort === 'string' ? JSON.parse(sort) : sort;
5858
return PageableData.get({service, paging, filter, sort});
5959
}
6060

src/app/demo/transfer/pageable-array/demo.component.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@ import {TableData} from "jigsaw/core/data/table-data";
88
})
99
export class TransferPageableArrayComponent {
1010
constructor(private _http: HttpClient) {
11-
this.data = new PageableArray(_http, {
12-
url: '/rdk/service/app/example/server/my_service',
13-
method: 'post'
14-
});
11+
this.data = new PageableArray(_http, 'mock-data/countries');
1512
this.data.fromAjax();
1613

1714
this.selectedCountries = new ArrayCollection();
1815
this.selectedCountries.http = _http;
19-
this.selectedCountries.fromAjax('/rdk/service/app/example/server/my_service');
16+
this.selectedCountries.fromAjax('mock-data/countries');
2017
this.selectedCountries.dataReviser = (td: TableData) => TableData.toArray(td).slice(10,15);
2118
}
2219

src/jigsaw/component/transfer/transfer-list.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,8 @@
3232
</div>
3333
</div>
3434
<div class="jigsaw-transfer-foot" *ngIf="data && data.pagingInfo && data.pagingInfo.pageSize != _$infinity">
35-
<j-pagination [data]="data" mode="simple" (currentChange)="_$updateCurrentPageSelectedItems()"></j-pagination>
35+
<j-pagination [total]="data.pagingInfo.totalRecord"
36+
[pageSize]="data.pagingInfo.pageSize"
37+
[(current)]="data.pagingInfo.currentPage"
38+
mode="simple" (currentChange)="_$updateCurrentPageSelectedItems()"></j-pagination>
3639
</div>

src/jigsaw/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rdkmaster/jigsaw",
3-
"version": "1.1.15",
3+
"version": "1.1.16",
44
"description": "Jigsaw, the next generation component set for RDK",
55
"main": "./bundles/jigsaw.umd.js",
66
"module": "./@rdkmaster/jigsaw.es5.js",

0 commit comments

Comments
 (0)