如何解决表的计数器返回负值
我的数据网格显示了我的服务的数据,但现在 ID 列包含负数
服务
ListarPaginaPersonas = ( filters: any) => {
const params = ConvertObjectToGetParams({
...filters
});
return this.http.get <IServerResponse < any[]>>(
`${this.url}/getpersonas`,{ params }); };
html
<div *ngIf="showme">
<lib-grid [loading]="state.loading"
[deFinition]="state.gridPersona.deFinition"
controlName="IdPersona2"
[formGroup]="form"
[source]="state.gridPersona.source.items">
</lib-grid>
</div>
ngOnInit
ngOnInit(): void {
this.buildForm();
this.store.dispatch(new ContainerActions.ListarPaginaPersona(null));
}
动作
export class ListarPaginaPersona {
static readonly type = '[FORM-ACTIVIDAD-SOL-CONTAINER] ListarPaginaPersona';
constructor(public payload: { nrodocId:any}) { }
}
状态
listarPaginaPersonasBegin = (
ctx: StateContext<FormActividadContainerModel> ) => {
const state = ctx.getState();
ctx.patchState({
gridPersona: {
...state.gridPersona,loading: true},});} listarPaginaPersonasSuccess = (
ctx: StateContext<FormActividadContainerModel> ) => (items: any[]) => {
const state = ctx.getState();
ctx.patchState({
gridPersona: {
...state.gridPersona,loading: false,source: {
...state.gridPersona.source,items,pageSize: items.length,total: items.length,} },});} listarPaginaPersonasError = (
ctx: StateContext<FormActividadContainerModel> ) => (error) => {
const state = ctx.getState();
ctx.patchState({
gridPersona: {...state.gridPersona,loading: false},});} @Action(ContainerActions.ListarPaginaPersona) asyncListarPaginaPersonas(
ctx: StateContext<FormActividadContainerModel>,{ payload }: ContainerActions.ListarPaginaPersona ) {
this.listarPaginaPersonasBegin(ctx);
return this.personaService.ListarPaginaPersonas(payload).pipe(
tap(response => {
this.listarPaginaPersonasSuccess(ctx)(response.data || [] );}),catchError(err => {
this.listarPaginaPersonasError(ctx)(err);
return throwError(err);}));}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。