From df9870add308622433715b295ea7c57be9741c93 Mon Sep 17 00:00:00 2001 From: fanwensheng Date: Sun, 16 Jan 2022 17:56:22 +0800 Subject: [PATCH] Update --- 04.系统编码/App/App.csproj | 1 + .../App/Content/json/beijing/check.json | 4 +++ .../Content/scripts/beijing/realtime-panel.js | 29 ++++++++++++------- 3 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 04.系统编码/App/Content/json/beijing/check.json diff --git a/04.系统编码/App/App.csproj b/04.系统编码/App/App.csproj index d00fd91..6d28926 100644 --- a/04.系统编码/App/App.csproj +++ b/04.系统编码/App/App.csproj @@ -337,6 +337,7 @@ + diff --git a/04.系统编码/App/Content/json/beijing/check.json b/04.系统编码/App/Content/json/beijing/check.json new file mode 100644 index 0000000..f715fa4 --- /dev/null +++ b/04.系统编码/App/Content/json/beijing/check.json @@ -0,0 +1,4 @@ +{ + "code": 200, + "num": 202111060851610 +} \ No newline at end of file diff --git a/04.系统编码/App/Content/scripts/beijing/realtime-panel.js b/04.系统编码/App/Content/scripts/beijing/realtime-panel.js index 8dc0bac..3f4fd72 100644 --- a/04.系统编码/App/Content/scripts/beijing/realtime-panel.js +++ b/04.系统编码/App/Content/scripts/beijing/realtime-panel.js @@ -141,13 +141,18 @@ // Close details this.ResultList.Reset(); - // Submit task + // Prepare task info this.TaskInfo = { Id: this.CreateId(), Result: null, CreateTime: new Date() }; - this.SubmitTask(this.TaskInfo.Id); + + // Submit task + if (Config.InProductionMode) + this.SubmitTask(this.TaskInfo.Id); + else + this.TestModel('202111060851610', 100.9, 36.94); }; this.OnResetButtonClick = function () { @@ -183,7 +188,7 @@ $.ajax({ type: "GET", dataType: 'json', - url: this.getJsonUrl(this.TaskInfo.Id), + url: this.getCheckUrl(this.TaskInfo.Id), success: function (result) { this.TaskInfo.Result = result; @@ -200,15 +205,22 @@ }); }; - this.getJsonUrl = function (taskId) { + this.getCheckUrl = function (taskId) { if (Config.InProductionMode) return 'http://{0}/bj/check?num={1}'.format(Config.ApiRoot, taskId); else - return '/Content/json/beijing/{0}.json'.format(taskId); + return '/Content/json/beijing/check.json'.format(taskId); }; + this.getJsonUrl = function (taskId) { + if (Config.InProductionMode) + return "http://{0}/bj/getresult/{1}.json".format(Config.ApiRoot, taskId); + else + return '/Content/json/beijing/{0}.json'.format(taskId); + } + this.LoadData = function (result) { - $.getJSON("http://{0}/bj/getresult/{1}.json".format(Config.ApiRoot, result.num), function (data) { + $.getJSON(this.getJsonUrl(result.num), function (data) { var param = this.GetTaskParams(this.TaskInfo.Id); this.Parent.Map.LoadAverageData('realtime-layer', { ReleaseTime: param.releaseTime, @@ -300,9 +312,6 @@ var partten = 'http://{0}/bj/{1}?lon={2}&lat={3}&num={4}&hgt={5}&rlen={6}&tlen={7}&tpoint={8}&rlen2={9}&tlen2={10}&fac={11}'; var url = partten.format(Config.ApiRoot, 'backward', params.lon, params.lat, params.num, params.hgt, params.rlen, params.tlen, params.tpoint, params.rlen2, params.tlen2, params.pullGround); - this.TestModel('202111060851610', parseFloat(params.lat), parseFloat(params.lon)); - return; - $.ajax({ type: "GET", dataType: 'json', @@ -325,7 +334,7 @@ $.ajax({ type: "GET", dataType: 'json', - url: this.getJsonUrl(taskId), + url: this.getCheckUrl(taskId), success: function (result) { this.TaskInfo.Id = taskId; this.TaskInfo.Result = result;