From e1a0f898b52d02dbfd89fc1e826d112c340900b5 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 18 Apr 2022 11:27:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=94=A8=E6=88=B7=E5=88=86?= =?UTF-8?q?=E6=9E=90=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/user_data_analysis.go | 43 ++++++++++++-------------- web_src/js/components/UserAnalysis.vue | 19 ++++++------ 2 files changed, 29 insertions(+), 33 deletions(-) diff --git a/routers/repo/user_data_analysis.go b/routers/repo/user_data_analysis.go index f8a036feb..8bc9dc458 100755 --- a/routers/repo/user_data_analysis.go +++ b/routers/repo/user_data_analysis.go @@ -54,11 +54,11 @@ func queryUserDataPage(ctx *context.Context, tableName string, queryObj interfac "N1": ctx.Tr("user.static.encyclopediascount"), "O1": ctx.Tr("user.static.createrepocount"), "P1": ctx.Tr("user.static.openiindex"), - "Q1": ctx.Tr("user.static.registdate"), - "R1": ctx.Tr("user.static.CloudBrainTaskNum"), - "S1": ctx.Tr("user.static.CloudBrainRunTime"), - "T1": ctx.Tr("user.static.CommitDatasetNum"), - "U1": ctx.Tr("user.static.CommitModelCount"), + "Q1": ctx.Tr("user.static.CloudBrainTaskNum"), + "R1": ctx.Tr("user.static.CloudBrainRunTime"), + "S1": ctx.Tr("user.static.CommitDatasetNum"), + "T1": ctx.Tr("user.static.CommitModelCount"), + "U1": ctx.Tr("user.static.registdate"), "V1": ctx.Tr("user.static.countdate"), } for k, v := range dataHeader { @@ -91,14 +91,12 @@ func queryUserDataPage(ctx *context.Context, tableName string, queryObj interfac xlsx.SetCellValue(sheetName, "N"+rows, userRecord.EncyclopediasCount) xlsx.SetCellValue(sheetName, "O"+rows, userRecord.CreateRepoCount) xlsx.SetCellValue(sheetName, "P"+rows, fmt.Sprintf("%.2f", userRecord.OpenIIndex)) - + xlsx.SetCellValue(sheetName, "Q"+rows, userRecord.CloudBrainTaskNum) + xlsx.SetCellValue(sheetName, "R"+rows, fmt.Sprintf("%.2f", float64(userRecord.CloudBrainRunTime)/3600)) + xlsx.SetCellValue(sheetName, "S"+rows, userRecord.CommitDatasetNum) + xlsx.SetCellValue(sheetName, "T"+rows, userRecord.CommitModelCount) formatTime := userRecord.RegistDate.Format("2006-01-02 15:04:05") - xlsx.SetCellValue(sheetName, "Q"+rows, formatTime[0:len(formatTime)-3]) - - xlsx.SetCellValue(sheetName, "R"+rows, userRecord.CloudBrainTaskNum) - xlsx.SetCellValue(sheetName, "S"+rows, fmt.Sprintf("%.2f", float64(userRecord.CloudBrainRunTime)/3600)) - xlsx.SetCellValue(sheetName, "T"+rows, userRecord.CommitDatasetNum) - xlsx.SetCellValue(sheetName, "U"+rows, userRecord.CommitModelCount) + xlsx.SetCellValue(sheetName, "U"+rows, formatTime[0:len(formatTime)-3]) formatTime = userRecord.DataDate xlsx.SetCellValue(sheetName, "V"+rows, formatTime) } @@ -255,11 +253,11 @@ func QueryUserStaticDataPage(ctx *context.Context) { "N1": ctx.Tr("user.static.encyclopediascount"), "O1": ctx.Tr("user.static.createrepocount"), "P1": ctx.Tr("user.static.openiindex"), - "Q1": ctx.Tr("user.static.registdate"), - "R1": ctx.Tr("user.static.CloudBrainTaskNum"), - "S1": ctx.Tr("user.static.CloudBrainRunTime"), - "T1": ctx.Tr("user.static.CommitDatasetNum"), - "U1": ctx.Tr("user.static.CommitModelCount"), + "Q1": ctx.Tr("user.static.CloudBrainTaskNum"), + "R1": ctx.Tr("user.static.CloudBrainRunTime"), + "S1": ctx.Tr("user.static.CommitDatasetNum"), + "T1": ctx.Tr("user.static.CommitModelCount"), + "U1": ctx.Tr("user.static.registdate"), "V1": ctx.Tr("user.static.countdate"), } for k, v := range dataHeader { @@ -286,13 +284,12 @@ func QueryUserStaticDataPage(ctx *context.Context) { xlsx.SetCellValue(sheetName, "N"+rows, userRecord.EncyclopediasCount) xlsx.SetCellValue(sheetName, "O"+rows, userRecord.CreateRepoCount) xlsx.SetCellValue(sheetName, "P"+rows, fmt.Sprintf("%.2f", userRecord.OpenIIndex)) - + xlsx.SetCellValue(sheetName, "Q"+rows, userRecord.CloudBrainTaskNum) + xlsx.SetCellValue(sheetName, "R"+rows, fmt.Sprintf("%.2f", float64(userRecord.CloudBrainRunTime)/3600)) + xlsx.SetCellValue(sheetName, "S"+rows, userRecord.CommitDatasetNum) + xlsx.SetCellValue(sheetName, "T"+rows, userRecord.CommitModelCount) formatTime := userRecord.RegistDate.Format("2006-01-02 15:04:05") - xlsx.SetCellValue(sheetName, "Q"+rows, formatTime[0:len(formatTime)-3]) - xlsx.SetCellValue(sheetName, "R"+rows, userRecord.CloudBrainTaskNum) - xlsx.SetCellValue(sheetName, "S"+rows, fmt.Sprintf("%.2f", float64(userRecord.CloudBrainRunTime)/3600)) - xlsx.SetCellValue(sheetName, "T"+rows, userRecord.CommitDatasetNum) - xlsx.SetCellValue(sheetName, "U"+rows, userRecord.CommitModelCount) + xlsx.SetCellValue(sheetName, "U"+rows, formatTime[0:len(formatTime)-3]) formatTime = userRecord.DataDate xlsx.SetCellValue(sheetName, "V"+rows, formatTime) } diff --git a/web_src/js/components/UserAnalysis.vue b/web_src/js/components/UserAnalysis.vue index d7a8f1f81..596ecd602 100755 --- a/web_src/js/components/UserAnalysis.vue +++ b/web_src/js/components/UserAnalysis.vue @@ -134,15 +134,6 @@ label="创建项目" align="center"> - - - - + + +