From 7e59e7d873aba343199fc27f344c132ca3e42eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=9C=B2=E5=B0=A7?= Date: Wed, 19 Oct 2022 20:30:10 +0800 Subject: [PATCH] =?UTF-8?q?2022=E5=B9=B4=E5=BA=A6=E7=94=AC=E6=B1=9F?= =?UTF-8?q?=E6=9D=AF=E6=8A=95=E7=A5=A8=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ewide.Web.Entry/Views/Manage/Index.cshtml | 48 ++- .../Ewide.Web.Entry/Views/Vote/Index.cshtml | 315 ++++++++++++------ .../ExcelTemplate/2022年度甬江杯投票.xlsx | Bin 0 -> 16974 bytes .../ApiController/ProjectsService.cs | 42 ++- .../Vote.Services/Dto/ProjectsInput.cs | 3 +- .../Vote.Services/Entities/Projects.cs | 230 ++++++------- .../Vote.Services/Tools/ExcelHelper.cs | 16 +- 20220330_Vote/Vote.Services/Vote.Services.xml | 2 +- 8 files changed, 398 insertions(+), 258 deletions(-) create mode 100644 20220330_Vote/Ewide.Web.Entry/wwwroot/ExcelTemplate/2022年度甬江杯投票.xlsx diff --git a/20220330_Vote/Ewide.Web.Entry/Views/Manage/Index.cshtml b/20220330_Vote/Ewide.Web.Entry/Views/Manage/Index.cshtml index 87f22f8..d840c9f 100644 --- a/20220330_Vote/Ewide.Web.Entry/Views/Manage/Index.cshtml +++ b/20220330_Vote/Ewide.Web.Entry/Views/Manage/Index.cshtml @@ -20,7 +20,24 @@

2021年度宁波市“甬江建设杯”选票结果

- + + + + + + + + + + + + + + + @* @@ -103,8 +120,8 @@ - - + *@ + @**@

@@ -125,6 +142,7 @@ el: '#app', data: function () { return { + tableData: [], tableData0: [], tableData1: [], tableData2: [], @@ -146,7 +164,7 @@ location = '/gb/yjb/manage/expert' }, export_excel() { - this.download('/gb/yjb/api/projects/download', this.dateFormat("YYYYmmddHHMMss", new Date()) + "-2021年度甬江杯投票.xlsx", this.loading_false); + this.download('/gb/yjb/api/projects/download', this.dateFormat("YYYYmmddHHMMSS", new Date()) + "-2022年度甬江杯投票.xlsx", this.loading_false); }, check_login() { this.token = window.sessionStorage.getItem('__TOKEN'); @@ -167,13 +185,21 @@ Authorization: 'Bearer ' + _this.token } }).then(function (response) { - _this.tableData0 = response.data.data.data0 - _this.tableData1 = response.data.data.data1 - _this.tableData2 = response.data.data.data2 - _this.tableData3 = response.data.data.data3 - _this.tableData4 = response.data.data.data4 - _this.tableData5 = response.data.data.data5 - console.log(_this.tableData0) + console.log(response) + var _data = response.data.data.data + var typeList = response.data.data.typeList + for (var i = 0; i < typeList.length; i++) { + var _p = _data.filter(a => { return a.type == i; }); + _this.tableData.push({ name: typeList[i], data: _p }) + } + console.log(_this.tableData) + //_this.tableData0 = response.data.data.data0 + //_this.tableData1 = response.data.data.data1 + //_this.tableData2 = response.data.data.data2 + //_this.tableData3 = response.data.data.data3 + //_this.tableData4 = response.data.data.data4 + //_this.tableData5 = response.data.data.data5 + //console.log(_this.tableData0) _this.loading = false; }).catch(function (error) { console.log(error) diff --git a/20220330_Vote/Ewide.Web.Entry/Views/Vote/Index.cshtml b/20220330_Vote/Ewide.Web.Entry/Views/Vote/Index.cshtml index 9958614..596f303 100644 --- a/20220330_Vote/Ewide.Web.Entry/Views/Vote/Index.cshtml +++ b/20220330_Vote/Ewide.Web.Entry/Views/Vote/Index.cshtml @@ -18,75 +18,10 @@
-

2021年度宁波市“甬江建设杯”选票

+

2022年度宁波市“甬江建设杯”选票

- - - {{project.serial_number}}:{{project.name}} - - - - - - - - {{project.serial_number}}:{{project.name}} - - - - - - - - {{project.serial_number}}:{{project.name}} - - - - - - - - {{project.serial_number}}:{{project.name}} - - - - - - - - {{project.serial_number}}:{{project.name}} - - - - - - - + + {{project.serial_number}}:{{project.name}}