|
@@ -13,26 +13,29 @@
|
|
|
<div class="info_box">
|
|
|
<div class="info blueBG">
|
|
|
<span>用户总数</span>
|
|
|
- <!-- <span>{{ count }}</span> -->
|
|
|
- <span>{{ 310 }}</span>
|
|
|
+ <span>{{ allUser }}</span>
|
|
|
</div>
|
|
|
<div class="info blueBG">
|
|
|
<span>本月登录用户环比</span>
|
|
|
- <!-- <span>{{ weekCount }}</span> -->
|
|
|
- <span>{{ "0.9%" }}</span>
|
|
|
+ <span>{{ (loginCountMonthArray[loginCountMonthArray.length - 1].user -
|
|
|
+ loginCountMonthArray[loginCountMonthArray.length - 2].user) < 0 ? 0 :
|
|
|
+ ((loginCountMonthArray[loginCountMonthArray.length - 1].user -
|
|
|
+ loginCountMonthArray[loginCountMonthArray.length - 2].user) /
|
|
|
+ loginCountMonthArray[loginCountMonthArray.length - 2].user) * 100 + '%' }}</span>
|
|
|
</div>
|
|
|
<div class="info blueBG">
|
|
|
<span>本月登录用户总数</span>
|
|
|
- <!-- <span>{{ loginCount }}</span> -->
|
|
|
- <span>{{ 138 }}</span>
|
|
|
+ <span>{{ loginCountMonthArray[loginCountMonthArray.length - 1].user }}</span>
|
|
|
</div>
|
|
|
<div class="info blueBG">
|
|
|
<span>本月新增登录用户</span>
|
|
|
- <!-- <span>{{ (loginCount / count).toFixed(0) }}</span> -->
|
|
|
- <span>{{ 18 }}</span>
|
|
|
+ <span>{{ (loginCountMonthArray[loginCountMonthArray.length - 1].user -
|
|
|
+ loginCountMonthArray[loginCountMonthArray.length - 2].user) < 0 ? 0 :
|
|
|
+ loginCountMonthArray[loginCountMonthArray.length - 1].user -
|
|
|
+ loginCountMonthArray[loginCountMonthArray.length - 2].user }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <loginCount style="height: calc(100% - 140px)"></loginCount>
|
|
|
+ <loginCount style="height: calc(100% - 140px)" :monthArray="loginCountMonthArray"></loginCount>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="bottom">
|
|
@@ -170,74 +173,74 @@
|
|
|
</div> -->
|
|
|
</div>
|
|
|
<div class="dataBox">
|
|
|
- <div class="depth_box" style="height: calc(100%s)">
|
|
|
+ <div class="depth_box" style="height: calc(100%)">
|
|
|
<div class="depth">
|
|
|
<span>参与课程</span>
|
|
|
<div>
|
|
|
- <el-progress :width="80" type="circle" :percentage="80" :stroke-width="15" :format="format"
|
|
|
+ <el-progress :width="80" type="circle" :percentage="80" :stroke-width="5" :format="format"
|
|
|
color="#106BFF"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="depth">
|
|
|
<span>参与项目</span>
|
|
|
<div>
|
|
|
- <el-progress :width="80" type="circle" :percentage="80" :stroke-width="15" :format="format"
|
|
|
+ <el-progress :width="80" type="circle" :percentage="80" :stroke-width="5" :format="format"
|
|
|
color="#106BFF"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="depth">
|
|
|
<span>使用工具</span>
|
|
|
<div>
|
|
|
- <el-progress :width="80" type="circle" :percentage="80" :stroke-width="15" :format="format"
|
|
|
+ <el-progress :width="80" type="circle" :percentage="80" :stroke-width="5" :format="format"
|
|
|
color="#106BFF"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="depth">
|
|
|
<span>协同合作</span>
|
|
|
<div>
|
|
|
- <el-progress :width="80" type="circle" :percentage="80" :stroke-width="15" :format="format"
|
|
|
+ <el-progress :width="80" type="circle" :percentage="80" :stroke-width="5" :format="format"
|
|
|
color="#106BFF"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="depth">
|
|
|
<span>互动交流</span>
|
|
|
<div>
|
|
|
- <el-progress :width="80" type="circle" :percentage="80" :stroke-width="15" :format="format"
|
|
|
+ <el-progress :width="80" type="circle" :percentage="80" :stroke-width="5" :format="format"
|
|
|
color="#106BFF"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="depth">
|
|
|
<span>参与课程</span>
|
|
|
<div>
|
|
|
- <el-progress :width="80" type="circle" :percentage="80" :stroke-width="15" :format="format"
|
|
|
+ <el-progress :width="80" type="circle" :percentage="80" :stroke-width="5" :format="format"
|
|
|
color="#106BFF"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="depth">
|
|
|
<span>参与项目</span>
|
|
|
<div>
|
|
|
- <el-progress :width="80" type="circle" :percentage="80" :stroke-width="15" :format="format"
|
|
|
+ <el-progress :width="80" type="circle" :percentage="80" :stroke-width="5" :format="format"
|
|
|
color="#106BFF"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="depth">
|
|
|
<span>使用工具</span>
|
|
|
<div>
|
|
|
- <el-progress :width="80" type="circle" :percentage="80" :stroke-width="15" :format="format"
|
|
|
+ <el-progress :width="80" type="circle" :percentage="80" :stroke-width="5" :format="format"
|
|
|
color="#106BFF"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="depth">
|
|
|
<span>协同合作</span>
|
|
|
<div>
|
|
|
- <el-progress :width="80" type="circle" :percentage="80" :stroke-width="15" :format="format"
|
|
|
+ <el-progress :width="80" type="circle" :percentage="80" :stroke-width="5" :format="format"
|
|
|
color="#106BFF"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="depth">
|
|
|
<span>互动交流</span>
|
|
|
<div>
|
|
|
- <el-progress :width="80" type="circle" :percentage="80" :stroke-width="15" :format="format"
|
|
|
+ <el-progress :width="80" type="circle" :percentage="80" :stroke-width="5" :format="format"
|
|
|
color="#106BFF"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -332,6 +335,8 @@ export default {
|
|
|
courseType: 0,
|
|
|
oType: false,
|
|
|
shType: false,
|
|
|
+ allUser: 0,
|
|
|
+ loginCountMonthArray: []
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -344,6 +349,9 @@ export default {
|
|
|
shEchart() {
|
|
|
this.shType = !this.shType;
|
|
|
},
|
|
|
+ format(percentage) {
|
|
|
+ return percentage + '%';
|
|
|
+ },
|
|
|
getData() {
|
|
|
this.isLoading = true;
|
|
|
let params = [
|
|
@@ -360,6 +368,42 @@ export default {
|
|
|
let _subject = res.data[1]; //学科
|
|
|
let _course = res.data[2]; //课程
|
|
|
|
|
|
+ this.allUser = res.data[3][0].count; //总人数
|
|
|
+ let _loginCount = res.data[4]; //统计半年的登录用户
|
|
|
+
|
|
|
+ let loginCountMonthArray = []
|
|
|
+ const date = new Date()
|
|
|
+ var Month = date.getMonth() + 1
|
|
|
+ var Year = date.getFullYear()
|
|
|
+ for (var i = Month; i > Month - 6; i--) {
|
|
|
+ if (i <= 0) {
|
|
|
+ loginCountMonthArray.push({
|
|
|
+ Year: Year - 1,
|
|
|
+ Month: 12 + i,
|
|
|
+ user: 0,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ loginCountMonthArray.push({
|
|
|
+ Month: i,
|
|
|
+ Year: Year,
|
|
|
+ user: 0,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ loginCountMonthArray = loginCountMonthArray.reverse()
|
|
|
+ for (var i = 0; i < _loginCount.length; i++) {
|
|
|
+ let _date = new Date(_loginCount[i].create_at)
|
|
|
+ var _month = _date.getMonth() + 1
|
|
|
+ var _year = _date.getFullYear()
|
|
|
+ for (var j = 0; j < loginCountMonthArray.length; j++) {
|
|
|
+ if (_month == loginCountMonthArray[j].Month && _year == loginCountMonthArray[j].Year) {
|
|
|
+ loginCountMonthArray[j].user++
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.loginCountMonthArray = loginCountMonthArray
|
|
|
+
|
|
|
this.$forceUpdate();
|
|
|
})
|
|
|
.catch((err) => {
|
|
@@ -639,5 +683,4 @@ export default {
|
|
|
.blueBG {
|
|
|
background: rgb(243, 248, 253);
|
|
|
border: 2px solid rgb(234, 246, 255);
|
|
|
-}
|
|
|
-</style>
|
|
|
+}</style>
|