Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.21.12.1
zouap 4 years ago
parent
commit
900f664da5
4 changed files with 31 additions and 27 deletions
  1. +1
    -0
      options/locale/locale_en-US.ini
  2. +1
    -0
      options/locale/locale_zh-CN.ini
  3. +28
    -26
      routers/repo/user_data_analysis.go
  4. +1
    -1
      web_src/js/components/UserAnalysis.vue

+ 1
- 0
options/locale/locale_en-US.ini View File

@@ -406,6 +406,7 @@ static.sheetname=User Analysis
static.id=ID
static.name=User Name
static.codemergecount=PR Count
static.commitcount=Commit Count
static.issuecount=Issue Count
static.commentcount=Comment Count
static.focusrepocount=Focus Repo Count


+ 1
- 0
options/locale/locale_zh-CN.ini View File

@@ -409,6 +409,7 @@ static.sheetname=用户分析
static.id=ID
static.name=用户名
static.codemergecount=PR数
static.commitcount=commit次数
static.issuecount=提出任务数
static.commentcount=评论数
static.focusrepocount=关注项目数


+ 28
- 26
routers/repo/user_data_analysis.go View File

@@ -73,19 +73,20 @@ func QueryUserStaticDataPage(ctx *context.Context) {
"A1": ctx.Tr("user.static.id"),
"B1": ctx.Tr("user.static.name"),
"C1": ctx.Tr("user.static.codemergecount"),
"D1": ctx.Tr("user.static.issuecount"),
"E1": ctx.Tr("user.static.commentcount"),
"F1": ctx.Tr("user.static.focusrepocount"),
"G1": ctx.Tr("user.static.starrepocount"),
"H1": ctx.Tr("user.static.logincount"),
"I1": ctx.Tr("user.static.watchedcount"),
"J1": ctx.Tr("user.static.commitcodesize"),
"K1": ctx.Tr("user.static.solveissuecount"),
"L1": ctx.Tr("user.static.encyclopediascount"),
"M1": ctx.Tr("user.static.createrepocount"),
"N1": ctx.Tr("user.static.openiindex"),
"O1": ctx.Tr("user.static.registdate"),
"P1": ctx.Tr("user.static.countdate"),
"D1": ctx.Tr("user.static.commitcount"),
"E1": ctx.Tr("user.static.issuecount"),
"F1": ctx.Tr("user.static.commentcount"),
"G1": ctx.Tr("user.static.focusrepocount"),
"H1": ctx.Tr("user.static.starrepocount"),
"I1": ctx.Tr("user.static.logincount"),
"J1": ctx.Tr("user.static.watchedcount"),
"K1": ctx.Tr("user.static.commitcodesize"),
"L1": ctx.Tr("user.static.solveissuecount"),
"M1": ctx.Tr("user.static.encyclopediascount"),
"N1": ctx.Tr("user.static.createrepocount"),
"O1": ctx.Tr("user.static.openiindex"),
"P1": ctx.Tr("user.static.registdate"),
"Q1": ctx.Tr("user.static.countdate"),
}
for k, v := range dataHeader {
//设置单元格的值
@@ -98,19 +99,20 @@ func QueryUserStaticDataPage(ctx *context.Context) {
xlsx.SetCellValue(sheetName, "A"+rows, userRecord.ID)
xlsx.SetCellValue(sheetName, "B"+rows, userRecord.Name)
xlsx.SetCellValue(sheetName, "C"+rows, userRecord.CodeMergeCount)
xlsx.SetCellValue(sheetName, "D"+rows, userRecord.IssueCount)
xlsx.SetCellValue(sheetName, "E"+rows, userRecord.CommentCount)
xlsx.SetCellValue(sheetName, "F"+rows, userRecord.FocusRepoCount)
xlsx.SetCellValue(sheetName, "G"+rows, userRecord.StarRepoCount)
xlsx.SetCellValue(sheetName, "H"+rows, userRecord.LoginCount)
xlsx.SetCellValue(sheetName, "I"+rows, userRecord.WatchedCount)
xlsx.SetCellValue(sheetName, "J"+rows, userRecord.CommitCodeSize)
xlsx.SetCellValue(sheetName, "K"+rows, userRecord.SolveIssueCount)
xlsx.SetCellValue(sheetName, "L"+rows, userRecord.EncyclopediasCount)
xlsx.SetCellValue(sheetName, "M"+rows, userRecord.CreateRepoCount)
xlsx.SetCellValue(sheetName, "N"+rows, userRecord.OpenIIndex)
xlsx.SetCellValue(sheetName, "O"+rows, userRecord.RegistDate.Format("2006-01-02"))
xlsx.SetCellValue(sheetName, "P"+rows, time.Unix(userRecord.CountDate, 0).Format("2006-01-02"))
xlsx.SetCellValue(sheetName, "D"+rows, userRecord.CommitCount)
xlsx.SetCellValue(sheetName, "E"+rows, userRecord.IssueCount)
xlsx.SetCellValue(sheetName, "F"+rows, userRecord.CommentCount)
xlsx.SetCellValue(sheetName, "G"+rows, userRecord.FocusRepoCount)
xlsx.SetCellValue(sheetName, "H"+rows, userRecord.StarRepoCount)
xlsx.SetCellValue(sheetName, "I"+rows, userRecord.LoginCount)
xlsx.SetCellValue(sheetName, "J"+rows, userRecord.WatchedCount)
xlsx.SetCellValue(sheetName, "K"+rows, userRecord.CommitCodeSize)
xlsx.SetCellValue(sheetName, "L"+rows, userRecord.SolveIssueCount)
xlsx.SetCellValue(sheetName, "M"+rows, userRecord.EncyclopediasCount)
xlsx.SetCellValue(sheetName, "N"+rows, userRecord.CreateRepoCount)
xlsx.SetCellValue(sheetName, "O"+rows, userRecord.OpenIIndex)
xlsx.SetCellValue(sheetName, "P"+rows, userRecord.RegistDate.Format("2006-01-02"))
xlsx.SetCellValue(sheetName, "Q"+rows, time.Unix(userRecord.CountDate, 0).Format("2006-01-02"))
}

//设置默认打开的表单


+ 1
- 1
web_src/js/components/UserAnalysis.vue View File

@@ -29,7 +29,7 @@
<a style="display:inline-block;margin-left: 20px; " id = 'download'>
<i class="el-icon-download"></i>
<!--<span ><a @click="exportData()">下载报告</a> </span> -->
<span ><a :href= "'/tool/query_user_static_page/?startDate=2021-11-01&endDate=2021-11-16&IsReturnFile=true'">下载报告</a> </span>
<span ><a :href= "'/tool/query_user_static_page/?startDate=2021-11-01&endDate=2021-11-16&IsReturnFile=true&page=1&pageSize=10&userName=zou'">下载报告</a> </span>
</a>
<span style="display:inline-block;margin-left: 20px; ">
<el-input size="small" placeholder="输入用户名搜索" v-model="search" class="input-with-select" @keyup.enter.native="searchName() "><i slot="suffix" class="el-input__icon el-icon-search"></i>


Loading…
Cancel
Save