diff --git a/web_src/js/components/DataAnalysis.vue b/web_src/js/components/DataAnalysis.vue index 4c2657751..4d771dbb1 100755 --- a/web_src/js/components/DataAnalysis.vue +++ b/web_src/js/components/DataAnalysis.vue @@ -20,7 +20,7 @@ 项目分析 - + @@ -69,18 +69,22 @@ if(tab.name=="third"){ // document.getElementById('usr').style.display="block" // document.getElementById("pro").style.display='none' - this.$refs.UserAnalysis.getUserList("all_usr",7) - + this.reload() this.isSecond = false this.isThird = true + this.$refs.UserAnalysis.resetPage() + this.$refs.UserAnalysis.getUpdateTime() + this.$refs.UserAnalysis.getUserList("all_usr",7) + + } - }, + }, - reload () { - this.isRouterAlive = false - this.$nextTick(() => (this.isRouterAlive = true)) - } + reload () { + this.isRouterAlive = false + this.$nextTick(() => (this.isRouterAlive = true)) + } }, } diff --git a/web_src/js/components/ProAnalysis.vue b/web_src/js/components/ProAnalysis.vue index c9d44b3a6..882f610a4 100755 --- a/web_src/js/components/ProAnalysis.vue +++ b/web_src/js/components/ProAnalysis.vue @@ -153,7 +153,7 @@ @@ -161,17 +161,17 @@ type_val:'', recordBeginTime:'', lastUpdatedTime:'', - currentPage:1, + page:1, pageSize:10, - params:{startDate:'',endDate:''}, + params:{startDate:'',endDate:'',page:1,pageSize:10,userName:''}, tableData: [], - + totalNum:0, pickerOptions: { }, 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, @@ -200,8 +200,15 @@ return saveFileName }, - handleCurrentChange(currentPage){ - this.currentPage = currentPage; + handleCurrentChange(val){ + this.params.page = val + this.page = val + this.getUserList(this.type_val,this.dynamic) + + }, + resetPage(){ + this.page=1 + this.params.page = 1 }, formatDate(myyear,mymonth,myweekday) { // var myyear = this.date.getFullYear(); @@ -224,7 +231,14 @@ let days = (monthEndDate - monthStartDate)/(1000 * 60 * 60 * 24); return days; }, - + getUpdateTime(){ + this.$axios.get('../api/v1/projectboard/project',{ + params:this.params_pro + }).then((res)=>{ + this.recordBeginTime=res.data.recordBeginTime + this.lastUpdatedTime=res.data.lastUpdatedTime + }) + }, getUserList(type_val,index){ this.type_val = type_val this.dynamic = index; @@ -295,50 +309,63 @@ } case "all_usr":{ console.log("e:"+today) - this.params.startDate = this.recordBeginTime//this.formatDate(2000, 1, 1); // + this.params.startDate = 'all'//this.formatDate(2000, 1, 1); //this.recordBeginTime// this.params.endDate = today this.value_time=[] break } } }; - - this.$axios.get('../tool/query_user_static',{ + + this.$axios.get('../tool/query_user_static_page',{ params:this.params }).then((res)=>{ - this.currentPage = 1 - this.tableData = res.data - console.log(" this.tableData:", this.tableData.length) - for(var i=0;i{ - this.recordBeginTime=res.data.recordBeginTime - this.lastUpdatedTime=res.data.lastUpdatedTime + this.tableData = res.data.data + // console.log("res.data:"+res.data.data) + + this.totalNum = res.data.count + console.log("res.count:"+res.data.count) }) + // this.$axios.get('../tool/query_user_static',{ + // params:this.params + // }).then((res)=>{ + // this.currentPage = 1 + // this.tableData = res.data + // console.log(" this.tableData:", this.tableData.length) + // for(var i=0;i !search || data.Name.toLowerCase().includes(search.toLowerCase())) + // var search = this.search; + // this.getUserList("all_usr",7) + // this.tableData = this.tableData.filter(data => !search || data.Name.toLowerCase().includes(search.toLowerCase())) - }, - goToDetailPage(pro_id,pro_name){ - sessionStorage.setItem("pro_id",pro_id); - sessionStorage.setItem("pro_name",pro_name); - document.getElementById("pro_main").style.display="none"; - document.getElementById("pro_detail").style.display="block"; + this.params.userName = this.search + this.params.page = 1 + this.page=1 + this.getUserList(this.type_val, this.dynamic) }, + // goToDetailPage(pro_id,pro_name){ + // sessionStorage.setItem("pro_id",pro_id); + // sessionStorage.setItem("pro_name",pro_name); + // document.getElementById("pro_main").style.display="none"; + // document.getElementById("pro_detail").style.display="block"; + + // }, tableHeaderStyle({row,column,rowIndex,columnIndex}){ if(rowIndex===0){ @@ -351,6 +378,11 @@ return 'background:#f5f5f6;color:#606266' } }, + + + }, + filters:{ + transformTimestamp(timestamp){ console.log("timestamp",timestamp) let a = new Date(timestamp*1000); @@ -365,9 +397,6 @@ console.log('dateString', dateString); // > dateString 2021-07-06 14:23 return dateString; }, - - }, - filters:{ // transformTimestamp(timestamp){ // var dateString= new Date(timestamp); @@ -377,8 +406,8 @@ }, mounted() { - document.getElementById("all_usr").style.outline="none" - document.getElementById("all_usr").focus() + // document.getElementById("all_usr").style.outline="none" + // document.getElementById("all_usr").focus() this.getUserList("all_usr",7) }, created() { @@ -386,9 +415,15 @@ }, watch:{ search(val){ + // if(!val){ + // this.getUserList("all_usr",7) + // } if(!val){ - this.getUserList("all_usr",7) - } + this.params.userName = this.search + this.params.page = 1 + this.page=1 + this.getUserList(this.type_val, this.dynamic) + } } }, } @@ -426,16 +461,19 @@ .btn:active{ background-color:#409effd6 ; } */ - /deep/ .el-date-picker { - width: 200px; - } + /* /deep/ .el-date-picker { + width: 220px; + } */ /deep/ .el-table { font-size: 12px; } /deep/ .el-table tbody tr:hover>td { background-color:#D3D3D3!important; opacity:1 - } + } + /deep/ .el-range-separator{ + width: 20% !important; + } .colorChange { background-color: #409effd6;