Browse Source

modify code

tags/v1.21.12.1
Gitea 3 years ago
parent
commit
beddae3ae5
2 changed files with 55 additions and 21 deletions
  1. +54
    -20
      web_src/js/components/ProAnalysis.vue
  2. +1
    -1
      web_src/js/components/UserAnalysis.vue

+ 54
- 20
web_src/js/components/ProAnalysis.vue View File

@@ -153,7 +153,7 @@
</div>
<div id ="pro_detail" style="display:none;width: 100%;">
<div style="margin-top: 10px;">
<b class="pro_item">{{this.ownerName}}/{{this.pro_name}}</b> <span class="update_time">数据更新时间:</span><span style="font-size: 12px;">{{tableDataIDTotal.lastUpdatedTime}}&nbsp/&nbsp从{{tableDataIDTotal.recordBeginTime}}开始</span>
<b class="pro_item">{{this.ownerName}}&nbsp/&nbsp{{this.pro_name}}</b> <span class="update_time">数据更新时间:</span><span style="font-size: 12px;">{{tableDataIDTotal.lastUpdatedTime}}&nbsp/&nbsp从{{tableDataIDTotal.recordBeginTime}}开始</span>
</div>
<div style="margin-top: 10px;">
项目描述:{{tableDataIDTotal.description | discriptionFun}}
@@ -402,6 +402,9 @@
var nowMonth = now.getMonth(); // 当前月
var nowYear = now.getFullYear(); // 当前年
var today = this.saveFormatDate(nowYear,nowMonth+1,nowDay);
var tmp = new Date(now.setTime(now.getTime()-24*60*60*1000));
var yesterday = this.saveFormatDate(tmp.getFullYear(),tmp.getMonth()+1,tmp.getDate());
var yesterday_tmp = this.formatDate(tmp.getFullYear(),tmp.getMonth()+1,tmp.getDate())

let lastMonthDate = new Date(); // 上月日期
lastMonthDate.setDate(1);
@@ -413,16 +416,22 @@
var saveFileName = ''
if (typeof this.paramsID.type=="undefined" || this.paramsID.type=="null" || this.paramsID.type==""){
startDate= this.saveFormatDate(this.create_time_pro[0].getFullYear(),this.create_time_pro[0].getMonth() + 1,this.create_time_pro[0].getDate());
// startDate= this.saveFormatDate(this.create_time_pro[0].getFullYear(),this.create_time_pro[0].getMonth() + 1,this.create_time_pro[0].getDate());
endDate = this.saveFormatDate(this.create_time_pro[1].getFullYear(),this.create_time_pro[1].getMonth() + 1,this.create_time_pro[1].getDate());
var tmp = this.formatDate(this.create_time_pro[0].getFullYear(),this.create_time_pro[0].getMonth() + 1,this.create_time_pro[0].getDate())
startDate = this.comparedate(tmp,this.recordBeginTime)

console.log("comparedate:"+startDate)
saveFileName = this.pro_name+"_"+startDate+'_'+endDate
}else{
switch(this.paramsID.type){
case "yesterday":{
var now = new Date();
var tmp = new Date(now.setTime(now.getTime()-24*60*60*1000));
startDate = this.saveFormatDate(tmp.getFullYear(),tmp.getMonth()+1,tmp.getDate());
endDate = today
startDate = this.comparedate(yesterday_tmp,this.recordBeginTime)
endDate = startDate
saveFileName = this.pro_name+"_"+startDate+'_'+ endDate
break
}
@@ -430,42 +439,53 @@
var now = new Date(); // 当前日期
var nowDayOfWeek = now.getDay(); // 今天本周的第几天
var day = nowDayOfWeek || 7;
startDate = this.saveFormatDate(now.getFullYear(), nowMonth+1, nowDay + 1 - day);
endDate = today
startDate = this.formatDate(now.getFullYear(), nowMonth+1, nowDay + 1 - day);
startDate = this.comparedate(startDate,this.recordBeginTime)

endDate = yesterday
saveFileName = this.pro_name+"_"+startDate+'_'+ endDate
break
}
case "current_month":{
startDate = this.saveFormatDate(nowYear,nowMonth+1,1);
endDate = today
startDate = this.formatDate(nowYear,nowMonth+1,1);
startDate = this.comparedate(startDate,this.recordBeginTime)

endDate = yesterday
saveFileName = this.pro_name+"_"+startDate+'_'+ endDate
break
}
case "last_month":{
startDate=this.saveFormatDate(nowYear, lastMonth+1, 1);
endDate=this.saveFormatDate(nowYear, lastMonth+1, this.saveFormatDate(nowYear,lastMonth));
endDate = today
startDate=this.formatDate(nowYear, lastMonth+1, 1);
startDate = this.comparedate(startDate,this.recordBeginTime)

endDate=this.saveFormatDate(nowYear, lastMonth+1, this.saveFormatDate(nowYear,lastMonth));
saveFileName = this.pro_name+"_"+startDate+'_'+ endDate
break

}
case "monthly":{
var temp=new Date(now - 1000 * 60 * 60 * 24 * 30)
startDate = this.saveFormatDate(temp.getFullYear(),temp.getMonth()+1,temp.getDate());
endDate = today
startDate = this.formatDate(temp.getFullYear(),temp.getMonth()+1,temp.getDate());
startDate = this.comparedate(startDate,this.recordBeginTime)

endDate = yesterday
saveFileName = this.pro_name+"_"+startDate+'_'+ endDate
break
}
case "current_year":{
startDate = this.saveFormatDate(now.getFullYear(), 1, 1);
endDate = today
startDate = this.formatDate(now.getFullYear(), 1, 1);
startDate = this.comparedate(startDate,this.recordBeginTime)

endDate = yesterday
saveFileName = this.pro_name+"_"+startDate+'_'+ endDate
break
}
case "all":{
console.log("e:"+today)
startDate = 'all'
endDate = today
endDate = yesterday
saveFileName = this.pro_name+'_所有'
break
}
@@ -958,7 +978,21 @@
this.echartsSelectData.setOption(this.option);
// });

}
},
comparedate(date1,date2){
console.log("date1:"+date1)
console.log("date1:"+date2)
var oDate1 = new Date(date1);
var oDate2 = new Date(date2);
if(oDate1.getTime() < oDate2.getTime()){
var data = date2.split('-')
return data[0]+''+data[1]+''+data[2]
} else {
var data = date1.split('-')
return data[0]+''+data[1]+''+data[2]
}
},

},
filters:{



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

@@ -171,7 +171,7 @@
value_time: '',
search:'',
data:'',
columns: [{title: 'ID',key: 'ID'},{title: '用户名',key: 'Name'},{title: 'PR数',key: 'CodeMergeCount'},{title: 'cimmit数',key:'CommitCount'},{title: '提出任务数',key: 'IssueCount'},{title: '评论数',key: 'CommentCount'},{title: '关注项目数',key: 'FocusRepoCount'},{title: '点赞项目数',key: 'StarRepoCount'},{title: '登录次数',key: 'LoginCount'},{title:'关注者数',key:'WatchedCount'},{title:'commit代码行数',key:'CommitCodeSize'},{title:'已解决任务数',key:'SolveIssueCount'},{title:'百科页面贡献次数',key:'EncyclopediasCount'},{title:'创建项目',key:'CreateRepoCount'},{title:'用户注册时间',key:'RegistDate'},{title:'系统统计时间',key:'CountDate'}],
columns: [{title: 'ID',key: 'ID'},{title: '用户名',key: 'Name'},{title: 'PR数',key: 'CodeMergeCount'},{title: 'commit数',key:'CommitCount'},{title: '提出任务数',key: 'IssueCount'},{title: '评论数',key: 'CommentCount'},{title: '关注项目数',key: 'FocusRepoCount'},{title: '点赞项目数',key: 'StarRepoCount'},{title: '登录次数',key: 'LoginCount'},{title:'关注者数',key:'WatchedCount'},{title:'commit代码行数',key:'CommitCodeSize'},{title:'已解决任务数',key:'SolveIssueCount'},{title:'百科页面贡献次数',key:'EncyclopediasCount'},{title:'创建项目',key:'CreateRepoCount'},{title:'用户注册时间',key:'RegistDate'},{title:'系统统计时间',key:'CountDate'}],
blob:'',
fileName:'',
dynamic:7,


Loading…
Cancel
Save