From eab68ac2704ad40eb05da75edce44983ff411ef0 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 31 May 2021 09:48:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A6=82=E8=A7=88=E9=A1=B5=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E5=AE=8C=E6=88=90=EF=BC=8C=E5=8F=AA=E5=B7=AE?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/users/Echart/Calendar.jsx | 21 +++--- src/forge/users/Echart/Line.jsx | 88 ++++++++++-------------- src/forge/users/GeneralView/Activity.jsx | 32 +++++---- src/forge/users/GeneralView/Index.jsx | 76 ++++++++++++++++---- src/forge/users/GeneralView/Index.scss | 3 + 5 files changed, 131 insertions(+), 89 deletions(-) diff --git a/src/forge/users/Echart/Calendar.jsx b/src/forge/users/Echart/Calendar.jsx index 811a3ae4..8190d32e 100644 --- a/src/forge/users/Echart/Calendar.jsx +++ b/src/forge/users/Echart/Calendar.jsx @@ -9,16 +9,17 @@ function Calendar({ userLogin , time , chooseTime }) { useEffect(()=>{ if(time){ - let e = `${time}-12-31`; - let b = `${time}-01-01`; - setEndT(e); - setBaginT(b); - }else if(time === ""){ - let y = moment().get('year'); - let m = moment().get('month'); - let d = moment().get('date'); - let e = `${y}-${m+1}-${d}`; - let b = `${y-1}-${m+1}-${d}`; + let e,b = ""; + if(time === "0"){ + let y = moment().get('year'); + let m = moment().get('month'); + let d = moment().get('date'); + e = `${y}-${m+1}-${d}`; + b = `${y-1}-${m+1}-${d}`; + }else{ + e = `${time}-12-31`; + b = `${time}-01-01`; + } setEndT(e); setBaginT(b); } diff --git a/src/forge/users/Echart/Line.jsx b/src/forge/users/Echart/Line.jsx index 20ea7590..f7b515cd 100644 --- a/src/forge/users/Echart/Line.jsx +++ b/src/forge/users/Echart/Line.jsx @@ -2,21 +2,18 @@ import React ,{ useEffect } from 'react'; import * as echarts from 'echarts'; function Line({data}) { - useEffect(()=>{ - Init(); - },[]) useEffect(()=>{ if(data){ - Init(); + Init(data); } },[data]) - function Init() { + function Init(d) { var huan_val = document.getElementById("Line"); var myEcharts = echarts.init(huan_val); let option = { - color: ["#f8e367", "#99dfff", "#58c0f0", "#5ea6ff", "#ff9e48", "#bcbcbc"], + color: ["#f8e367", "#58c0f0", "#ff9e48"], title: { text: '近期活动统计', left: '3%', @@ -26,7 +23,7 @@ function Line({data}) { trigger: 'axis' }, legend: { - data: ['邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎'], + data: ['commits', 'issues', 'pull_requests'], right: 'center', bottom: '0', }, @@ -37,58 +34,43 @@ function Line({data}) { containLabel: true }, toolbox: { - feature: { - // saveAsImage: {} - } + feature: { + // saveAsImage: {} + } }, xAxis: { - type: 'category', - boundaryGap: false, - data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'], - axisTick:{ - show:false - } + type: 'category', + boundaryGap: false, + data: d.dates, + axisTick:{ + show:false + } }, yAxis: { - type: 'value', - axisLine:{ - show:false - }, - axisTick:{ - show:false - } + type: 'value', + axisLine:{ + show:false + }, + axisTick:{ + show:false + } }, series: [ - { - name: '邮件营销', - type: 'line', - stack: '总量', - data: [120, 132, 101, 134, 90, 230, 210] - }, - { - name: '联盟广告', - type: 'line', - stack: '总量', - data: [220, 182, 191, 234, 290, 330, 310] - }, - { - name: '视频广告', - type: 'line', - stack: '总量', - data: [150, 232, 201, 154, 190, 330, 410] - }, - { - name: '直接访问', - type: 'line', - stack: '总量', - data: [320, 332, 301, 334, 390, 330, 320] - }, - { - name: '搜索引擎', - type: 'line', - stack: '总量', - data: [820, 932, 901, 934, 1290, 1330, 1320] - } + { + name: 'commits', + type: 'line', + data: d.commits_count + }, + { + name: 'issues', + type: 'line', + data: d.issues_count + }, + { + name: 'pull_requests', + type: 'line', + data: d.pull_requests_count + } ] }; myEcharts.setOption(option); diff --git a/src/forge/users/GeneralView/Activity.jsx b/src/forge/users/GeneralView/Activity.jsx index 90c7e524..ce09e885 100644 --- a/src/forge/users/GeneralView/Activity.jsx +++ b/src/forge/users/GeneralView/Activity.jsx @@ -4,21 +4,27 @@ import { AlignCenter } from '../../Component/layout'; import { TagInfo } from '../../Utils/TagColor'; import { getImageUrl } from 'educoder'; -function Activity() { +function Activity({list}) { return(
更新了问题状态:动态详情动态详情动态详情动态详情动态详情
-{i.action_type}:{i.name}
+