第二次按下按钮时淘汰赛失败的模型

问题描述

在 .net 中有一个需要很少新功能的旧项目。当第一次按下按钮时,我们有一个主要的问题是淘汰赛,一切正常,但是当它第二次按下时,它会停止。 错误

GeneratedCode.ts:5564 Uncaught TypeError: source.accountNumber is not a function
    at _Mapper.unwrapPnsBankReportListItem (GeneratedCode.ts:5564)
    at Function._Mapper.convert (GeneratedCode.ts:4673)
    at Function._Mapper.unwrapDlgBankReportviewmodel (GeneratedCode.ts:4714)
    at DlgBankReport.OnClickSearchButton (DlgBankReport.ts:102)
    at Object.eval (eval at createBindingsstringEvaluator (knockout-3.1.0.debug.js:2437),<anonymous>:3:101)
    at HTMLButtonElement.<anonymous> (knockout-3.1.0.debug.js:3108)
    at HTMLButtonElement.dispatch (jquery-2.1.0.js:4371)
    at HTMLButtonElement.elemData.handle (jquery-2.1.0.js:4057) 

cshtml 按钮

        <div class="col-md-3">
            <button type="button" class="btn btn-block click-by-enter btn-primary" 
                    data-bind="click: function (data,event) { $root._Dialog.OnClickSearchButton($root,function (r) { $root._mapviewmodel(r); }); }">Meklēt</button>
        </div>

ts

public OnClickSearchButton(modelObservable: Pns.Models.viewmodels.DlgBankReportviewmodelObservable,success: (r: Pns.Models.viewmodels.DlgBankReportviewmodel) => any): void {
            var focusElem = $(':focus');
            Pns.Instance.showPleaseWaitDlg();
            const obs = Pns.Models.viewmodels._Mapper.unwrapDlgBankReportviewmodel(modelObservable);
            DynamicLocator.CreateProxy("Pns.Business.Dialogs.DlgBankReport",null,(<any>window).PnsInstance._connection,function (dlg: Pns.Business.Dialogs.DlgBankReport) {
                $.ajax(Pns.Configuration.ApiRootUri + "AccountReport/rpc/ExecuteCreation",{
                    data: JSON.stringify(obs),dataType: 'json',contentType: 'application/json',type: 'POST',success: function (modelResult: Pns.Models.viewmodels.DlgBankReportviewmodel) {

                    },error: function () {

                    }
                });
            });
        }

它在 ts 中的这一行出现了上述错误

const obs = Pns.Models.viewmodels._Mapper.unwrapDlgBankReportviewmodel(modelObservable);

不知道为什么它不起作用,因为在其他任何地方它都可以正常工作。如果有人知道为什么以及如何解决它,请告诉我。生成模型,因此其中没有错误。 其他模型在列表中发生错误。它的映射也是代码生成的,可以在别处工作,这是它唯一崩溃的地方。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)