|
@@ -1,56 +1,58 @@
|
|
|
<template>
|
|
|
<div class="mine-container">
|
|
|
- <div class="mine-top-wrapper">
|
|
|
- <el-row :gutter="0" style="height:100%">
|
|
|
- <el-col :span="16">
|
|
|
- <div class="advertise-imgs">
|
|
|
- <img
|
|
|
- src="http://sinastorage.com/storage.miaosha.sina.com.cn/products/201903/e496d11b3d74cf660c286fbd5ab8d0bb.png"
|
|
|
- >
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <div class="user-banner">
|
|
|
- <p class="head">
|
|
|
- <a href="javascript:;" class="login-link">
|
|
|
- <img :src="user == null || user.userVO.photoUrl == null?defaultValue.image:user.userVO.photoUrl" class="user-img">
|
|
|
- <span class="vertify hide"></span>
|
|
|
- </a>
|
|
|
- </p>
|
|
|
- <div class="username_box">
|
|
|
- <div class="username_icon username_"></div>
|
|
|
- <span class="username">{{user == null?'...':user.userVO.name}}</span>
|
|
|
- </div>
|
|
|
- <!--<p class="name">-->
|
|
|
- <!--<a href="javascript:;" class="login-btn btn btn-medium btn-info">登录</a>-->
|
|
|
- <!--<a-->
|
|
|
- <!--href="https://login.sina.com.cn/signup/signup?entry=tech"-->
|
|
|
- <!--class="register-btn btn btn-medium btn-info"-->
|
|
|
- <!--target="_blank"-->
|
|
|
- <!-->注册</a>-->
|
|
|
- <!--</p>-->
|
|
|
- <!--<p class="scores">-->
|
|
|
- <!--<a href="/rule/merit" target="_blank">-->
|
|
|
- <!--积分-->
|
|
|
- <!--<em class="num1">{{user.score}}</em>-->
|
|
|
- <!--</a>-->
|
|
|
- <!--<span class="line">|</span>-->
|
|
|
- <!--<a href="/rule/merit" target="_blank">-->
|
|
|
- <!--威望-->
|
|
|
- <!--<em class="num2">{{user.prestige}}</em>-->
|
|
|
- <!--</a>-->
|
|
|
- <!--</p>-->
|
|
|
- <p>
|
|
|
- <router-link :to="{ name: 'AuthenticationIndex'}">
|
|
|
- <div class="btn btn-medium">实名认证</div>
|
|
|
- </router-link>
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
- <div class="mine-body">
|
|
|
- <el-tabs tabPosition="top" type="card">
|
|
|
+ <div id="myChart" style="width: 100%;height: 400px"></div>
|
|
|
+ <!--<div class="mine-top-wrapper">-->
|
|
|
+ <!--<el-row :gutter="0" style="height:100%">-->
|
|
|
+ <!--<el-col :span="16">-->
|
|
|
+ <!--<div class="advertise-imgs">-->
|
|
|
+ <!--<img-->
|
|
|
+ <!--src="http://sinastorage.com/storage.miaosha.sina.com.cn/products/201903/e496d11b3d74cf660c286fbd5ab8d0bb.png"-->
|
|
|
+ <!-->-->
|
|
|
+ <!--</div>-->
|
|
|
+ <!--</el-col>-->
|
|
|
+ <!--<el-col :span="8">-->
|
|
|
+ <!--<div class="user-banner">-->
|
|
|
+ <!--<p class="head">-->
|
|
|
+ <!--<a href="javascript:;" class="login-link">-->
|
|
|
+ <!--<img :src="user == null || user.userVO.photoUrl == null?defaultValue.image:user.userVO.photoUrl"-->
|
|
|
+ <!--class="user-img">-->
|
|
|
+ <!--<span class="vertify hide"></span>-->
|
|
|
+ <!--</a>-->
|
|
|
+ <!--</p>-->
|
|
|
+ <!--<div class="username_box">-->
|
|
|
+ <!--<div class="username_icon username_"></div>-->
|
|
|
+ <!--<span class="username">{{user == null?'...':user.userVO.name}}</span>-->
|
|
|
+ <!--</div>-->
|
|
|
+ <!--<!–<p class="name">–>-->
|
|
|
+ <!--<!–<a href="javascript:;" class="login-btn btn btn-medium btn-info">登录</a>–>-->
|
|
|
+ <!--<!–<a–>-->
|
|
|
+ <!--<!–href="https://login.sina.com.cn/signup/signup?entry=tech"–>-->
|
|
|
+ <!--<!–class="register-btn btn btn-medium btn-info"–>-->
|
|
|
+ <!--<!–target="_blank"–>-->
|
|
|
+ <!--<!–>注册</a>–>-->
|
|
|
+ <!--<!–</p>–>-->
|
|
|
+ <!--<!–<p class="scores">–>-->
|
|
|
+ <!--<!–<a href="/rule/merit" target="_blank">–>-->
|
|
|
+ <!--<!–积分–>-->
|
|
|
+ <!--<!–<em class="num1">{{user.score}}</em>–>-->
|
|
|
+ <!--<!–</a>–>-->
|
|
|
+ <!--<!–<span class="line">|</span>–>-->
|
|
|
+ <!--<!–<a href="/rule/merit" target="_blank">–>-->
|
|
|
+ <!--<!–威望–>-->
|
|
|
+ <!--<!–<em class="num2">{{user.prestige}}</em>–>-->
|
|
|
+ <!--<!–</a>–>-->
|
|
|
+ <!--<!–</p>–>-->
|
|
|
+ <!--<p>-->
|
|
|
+ <!--<router-link :to="{ name: 'AuthenticationIndex'}">-->
|
|
|
+ <!--<div class="btn btn-medium">实名认证</div>-->
|
|
|
+ <!--</router-link>-->
|
|
|
+ <!--</p>-->
|
|
|
+ <!--</div>-->
|
|
|
+ <!--</el-col>-->
|
|
|
+ <!--</el-row>-->
|
|
|
+ <!--</div>-->
|
|
|
+ <div class="mine-body" style="text-align: center;">
|
|
|
+ <el-tabs tabPosition="top" v-loading="loading" style="width: 90%;margin-left: 5%">
|
|
|
<el-tab-pane v-if="rolesPermissions.isAgency" label="未完成任务">
|
|
|
<span v-if="unFinishedTaskList == null || unFinishedTaskList.length == 0"> 暂无任务 </span>
|
|
|
<task-item v-if="unFinishedTaskList != null || unFinishedTaskList.length > 0"
|
|
@@ -91,6 +93,7 @@ import Http from '@/js/http.js'
|
|
|
import Apis from '@/js/api.js'
|
|
|
import {notify} from '@/constants/index'
|
|
|
import {defaultValue, getRolesPermissions, storageGet} from '@/js/index'
|
|
|
+import echarts from 'echarts'
|
|
|
|
|
|
export default {
|
|
|
name: 'Mine',
|
|
@@ -140,6 +143,7 @@ export default {
|
|
|
this.setUserInfo()
|
|
|
this.setRolesPermissions()
|
|
|
this.loadData()
|
|
|
+ this.setEcharts()
|
|
|
// storageGet('user').then((res)=>{
|
|
|
// this.user = res;
|
|
|
// this.setRolesPermissions()
|
|
@@ -148,6 +152,7 @@ export default {
|
|
|
|
|
|
},
|
|
|
loadData () {
|
|
|
+ this.showLoading()
|
|
|
Http.get(Apis.PAGE.MY_CROWD_TEST_PAGE.replace('{userId}', this.user.userVO.id)).then((res) => {
|
|
|
if (res.unfinishedTasks != null && res.unfinishedTasks.length > 0) {
|
|
|
this.unFinishedTaskList = res.unfinishedTasks
|
|
@@ -164,9 +169,13 @@ export default {
|
|
|
if (res.acceptableProjects != null && res.acceptableProjects.length > 0) {
|
|
|
this.acceptableProjects = res.acceptableProjects
|
|
|
}
|
|
|
+ this.hideLoading()
|
|
|
// if (res.userVO != null && res.userVO.length > 0) {
|
|
|
// this.user = res.userVO
|
|
|
// }
|
|
|
+ }).catch((error)=>{
|
|
|
+ this.hideLoading()
|
|
|
+ notify('error','加载失败:'+error.data)
|
|
|
})
|
|
|
},
|
|
|
setUserInfo () {
|
|
@@ -174,8 +183,82 @@ export default {
|
|
|
},
|
|
|
setRolesPermissions () {
|
|
|
this.rolesPermissions = storageGet('rolesPermissions')
|
|
|
+ },
|
|
|
+ setEcharts () {
|
|
|
+ // 基于准备好的dom,初始化echarts实例
|
|
|
+ let myChart = echarts.init(document.getElementById('myChart'))
|
|
|
+ // 绘制图表
|
|
|
+ var option = {
|
|
|
+ title: {
|
|
|
+ text: ''
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'axis'
|
|
|
+ },
|
|
|
+ legend: {
|
|
|
+ data:['接收项目数量','完成项目数量','接收任务数量','完成任务数量','发布项目数量']
|
|
|
+ },
|
|
|
+ grid: {
|
|
|
+ left: '5%',
|
|
|
+ right: '10%',
|
|
|
+ bottom: '3%',
|
|
|
+ top:'10%',
|
|
|
+ containLabel: true
|
|
|
+ },
|
|
|
+ toolbox: {
|
|
|
+ feature: {
|
|
|
+ saveAsImage: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ xAxis: {
|
|
|
+ type: 'category',
|
|
|
+ boundaryGap: false,
|
|
|
+ data: ['2019年5月','2019年6月','2019年7月','2019年8月','2019年9月','2019年10月','2019年11月']
|
|
|
+ },
|
|
|
+ yAxis: {
|
|
|
+ type: 'value'
|
|
|
+ },
|
|
|
+ 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]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ myChart.setOption(option)
|
|
|
+ },
|
|
|
+ showLoading(){
|
|
|
+ this.loading = true
|
|
|
+ },
|
|
|
+ hideLoading(){
|
|
|
+ this.loading = false
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
created: function () {
|
|
|
|