From 9d8636881eaac78d1b8575e49a476a5b327d2925 Mon Sep 17 00:00:00 2001 From: falcon <9504402@qq.com> Date: Fri, 19 Mar 2021 10:38:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E9=80=9A=E8=BF=87=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E9=93=BE=E6=8E=A5=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ReportService/Properties/launchSettings.json | 1 - ReportService/ReportService.csproj | 5 ++ ReportService/Startup.cs | 3 +- ReportService/appsettings.json | 2 +- ReportService/wwwroot/js/site.js | 28 +++++++ ReportService/wwwroot/report/报表1.html | 86 -------------------- 6 files changed, 35 insertions(+), 90 deletions(-) delete mode 100644 ReportService/wwwroot/report/报表1.html diff --git a/ReportService/Properties/launchSettings.json b/ReportService/Properties/launchSettings.json index e96524b..09bbeef 100644 --- a/ReportService/Properties/launchSettings.json +++ b/ReportService/Properties/launchSettings.json @@ -11,7 +11,6 @@ "FalconIIS": { "commandName": "IISExpress", "environmentVariables": { - "DbConnStr": "Server=.\\SQLSERVER2008R2;Database=ReportService;User ID=sa;Password=111", "ASPNETCORE_ENVIRONMENT": "Development" } }, diff --git a/ReportService/ReportService.csproj b/ReportService/ReportService.csproj index 6e433a6..fb0991d 100644 --- a/ReportService/ReportService.csproj +++ b/ReportService/ReportService.csproj @@ -5,8 +5,13 @@ bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + + + + + diff --git a/ReportService/Startup.cs b/ReportService/Startup.cs index fcf8c59..13f28c0 100644 --- a/ReportService/Startup.cs +++ b/ReportService/Startup.cs @@ -20,8 +20,7 @@ namespace ReportService // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - var connStr = Environment.GetEnvironmentVariable("DbConnStr") - ??this.Configuration.GetValue("Database:ReportService"); + var connStr = this.Configuration.GetValue("Database:ReportService"); services.AddDbContext(b => { b.UseSqlServer(connStr); }); diff --git a/ReportService/appsettings.json b/ReportService/appsettings.json index 8062512..34ba3dd 100644 --- a/ReportService/appsettings.json +++ b/ReportService/appsettings.json @@ -8,7 +8,7 @@ }, "AllowedHosts": "*", "Database": { - "ReportService": "Server=.\\SQLSERVER2008R2;Database=ReportService;User ID=sa;Password=111" + "ReportService": "Server=.\\SQLSERVER2008R2;Database=EASY_HEALTHRECORDS;User ID=sa;Password=111" }, "urls": "http://*:9000;https://*:9001" } diff --git a/ReportService/wwwroot/js/site.js b/ReportService/wwwroot/js/site.js index 2b04b92..d4640f8 100644 --- a/ReportService/wwwroot/js/site.js +++ b/ReportService/wwwroot/js/site.js @@ -115,4 +115,32 @@ var myjs = { window.open(this.uri + this.base64(this.format(this.template, ctx))); }, }, + + getUrlKey: function (name) { + return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null + }, + runSql: function (sqlStr, success) { + var option = { + method: "post", + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ sql: sqlStr, }) + }; + fetch("/RunSql", option) + .then(function (res) { return res.json(); }) + .then(function (d) { success(d) }) + .catch(function (r) { }); + }, + formatTimeToStr: function (times, pattern) { + if (times == null || times == "") { + return ""; + } + if (pattern) { + var d = new Date(times).Format(pattern); + } else { + var d = new Date(times).Format("yyyy-MM-dd hh:mm:ss"); + } + return d.toLocaleString(); + }, }; \ No newline at end of file diff --git a/ReportService/wwwroot/report/报表1.html b/ReportService/wwwroot/report/报表1.html deleted file mode 100644 index 0f2da4e..0000000 --- a/ReportService/wwwroot/report/报表1.html +++ /dev/null @@ -1,86 +0,0 @@ -
-
- - - - - - - -