排行接口

sale
tianea 3 years ago
parent 9513fc0c06
commit 1fbf694f7f

@ -33,6 +33,17 @@ export function position(q){
})
}
export function getGroup(compId,stageId){
return request({
url: baseUrl+ "group",
method: 'get',
params: {
compId: compId,
stageId: stageId
}
})
}
export function get(q){
return request({
url: baseUrl+ "get",

@ -1,9 +1,54 @@
import request from '@/utils/request'
import * as auth from '@/utils/auth'
let baseUrl = '/api/user/'
let authUrl = '/auth/competition/member'
export function login(data){
return request({
url: baseUrl+"login/password",
method: 'post',
data: data
})
}
export function getMemberInfo(compId,stageId){
return request({
url: authUrl+"/get",
method: 'get',
params: {
compId: compId,
stageId: stageId
}
})
}
export function getPaper(compId,stageId){
return request({
url: authUrl+"paper",
method: 'get',
params: {
compId: compId,
stageId: stageId
}
})
}
export function loginout(){
let userInfo = auth.getInfo()
return request({
url: baseUrl+"login/out",
method: 'get',
params: {
userNo: userInfo.id
}
})
}
export function saveInfo(info){
let url = "/auth/user/complete"
return request({
url: url,
method: 'post',
data: info
})
}

@ -0,0 +1,22 @@
import request from '@/utils/request'
let baseUrl = "auth/competition/task"
export function list(compId){
return request({
url: authUrl+"list",
method: 'get',
params: {
compId: compId
}
})
}
export function get(compId,stageId){
return request({
url: authUrl+"list",
method: 'get',
params: {
compId: compId,
stageId: stageId
}
})
}

@ -6,10 +6,11 @@ import Login from '@/views/login/index'
import Exam from '@/views/system/exam'
import Member from '@/views/member/index'
import System from '@/views/system/index'
import {getInfo} from '@/utils/auth'
Vue.use(Router)
export default new Router({
let router = new Router({
mode: 'history',
routes: [
{
@ -44,3 +45,19 @@ export default new Router({
}
]
})
export default router
router.beforeEach((to,from,next) =>{
let userInfo = getInfo()
if(!!userInfo){
if((!userInfo.complete)&&to.path!='/member'){
alert("请完善个人信息!")
next('/member')
}else{
next()
}
}else{
next()
}
})

@ -72,25 +72,22 @@
</div>
</template>
<script>
import * as competitionApi from '@/api/competition'
export default {
data(){
return {
compId: 0,
competition:{}
}
},
created(){
props:{
competition:{
type: Object,
default: function() { return {}}
}
},
created(){
if(this.$route.query){
this.compId = this.$route.query.id
}
competitionApi.get({compId: this.compId}).then(res=>{
console.log(res)
if(res.code == 200){
this.competition = res.data
}
})
},
methods:{
gotPage(type,id){

@ -9,8 +9,12 @@
indicators
>
<b-carousel-slide v-for="(item,$index) in carouselList" :key="$index"
:img-src="item.img"
></b-carousel-slide>
>
<template v-slot:img>
<b-img :src="item.img" @click="openTab(item.link)" />
</template>
</b-carousel-slide>
</b-carousel>
</div>
<b-navbar toggleable="lg" type="dark" variant="info" class="tz-nav" >
@ -25,18 +29,21 @@
</b-collapse>
</b-navbar>
</div>
<tz-second v-if="pageId == 0" />
<tz-first v-if="pageId == 1" />
<tz-ranking v-if="pageId == 2" />
<tz-second v-if="pageId == 0" :competition="competition" />
<tz-first v-if="pageId == 1" :competition="competition" />
<tz-ranking v-if="pageId == 2" :competition="competition" />
<div v-if="pageId == 3">
<b-img thumbnail src="/static/image/race.jpg" />
<div v-html="competition.summary">
</div>
</div>
<div v-if="pageId == 4">
<b-img thumbnail src="/static/image/trade_rule.jpg" />
<div v-html="competition.rule">
</div>
</div>
<div v-if="pageId == 5">
<b-img thumbnail src="/static/image/prize.jpg" />
<div v-html="competition.prize">
</div>
</div>
<tz-footer />
@ -49,11 +56,13 @@ import Ranking from './ranking.vue'
import First from './first.vue'
import Second from './second.vue'
import { getToken } from '@/utils/auth'
import * as competitionApi from '@/api/competition'
export default {
data(){
return {
compId: 0,
pageId: 0,
competition: null,
carouselList:[
{
img: '/static/image/top_banner.jpg',
@ -116,6 +125,13 @@ export default {
path: '/login'
})
}
if(this.compId){
competitionApi.get({compId: this.compId}).then(res=>{
if(res.code == 200){
this.competition = res.data
}
})
}
},
mounted(){
this.pageId = location.hash.substring(1)
@ -127,6 +143,9 @@ export default {
},
goPage(val){
this.pageId =val
},
openTab(link){
window.open(link)
}
}
}

@ -34,7 +34,7 @@
</div>
<div class="tz-panel">
<div class="tz-left-tab">
<div :class="rankingSubType==1?'ranking-sub-type-selected':''" @click="rankingSubType=1" >团队排行榜</div>
<div v-if="competition.type == 1" :class="rankingSubType==1?'ranking-sub-type-selected':''" @click="rankingSubType=1" >团队排行榜</div>
<div :class="rankingSubType==2?'ranking-sub-type-selected':''" @click="rankingSubType=2" >个人排行榜</div>
<div :class="rankingSubType==3?'ranking-sub-type-selected':''" @click="rankingSubType=3" >大屏排行榜</div>
</div>
@ -70,7 +70,19 @@
</template>
<script>
import { getInfo } from '@/utils/auth'
import * as competitionApi from '@/api/competition'
export default {
props:{
competition:{
type: Object,
default: null
}
},
watch:{
competition:function(nv){
this.loadData()
}
},
data(){
return {
userInfo: null,
@ -80,68 +92,45 @@ export default {
rankingId: 1,
rankingType: 1,
rankingSubType:1,
stageList:[
{
id: 1,
name: '初赛'
},
{
id: 2,
name: '决赛'
},
{
id: 3,
name: '冠军邀请赛'
}
],
regionList:[
{
id: 1,
name: '华南地区'
},
{
id: 2,
name: '华北地区'
},
{
id: 3,
name: '华东地区'
},
{
id:4,
name: '华南地区'
},
{
id: 5,
name: '西北地区'
},
{
id: 6,
name: '西南地区'
},
{
id: 7,
name: '东北地区'
},
{
id: 8,
name: '港澳台地区'
}
],
levelList:[
{
id: 1,
name: '本科组'
},
{
id: 2,
name: '专科组'
stageList:[],
regionList:[],
levelList:[]
}
},
methods:{
loadData(){
this.stageList = []
if(this.competition){
this.competition.stageList.forEach(stage=>{
this.stageList.push({
id: stage.id,
name: stage.name
})
})
}
competitionApi.getGroup(this.competition.id,this.stageId).then(res=>{
if(res.code == 200){
res.data.list.forEach(g=>{
if(g.limitType == 2){
this.regionList.push({
id: g.id,
name: g.name
})
}else{
this.levelList.push({
id: g.id,
name: g.name
})
}
})
}
]
})
}
},
created(){
this.userInfo = getInfo()
this.loadData()
}
}
</script>

@ -5,7 +5,7 @@
<b-row>
<b-col sm>
</b-col>
<b-col sm>
<b-col sm v-if="!!competition">
<div class="haf_circle">
<div>
<b-img src="/static/image/tx80x80.png" />
@ -23,34 +23,34 @@
</b-col>
</b-row>
</b-container>
<b-container class="ranking-info">
<b-container class="ranking-info" v-if="!!memberInfo">
<b-row>
<b-col>
<div>
<b-img src="/static/image/icon1_105x105.png" />
<div>个人总收益率</div>
<div class="tz-font tz-font-blue">117.91%</div>
<div class="tz-font tz-font-blue">{{memberInfo.currentRatio}}</div>
</div>
</b-col>
<b-col>
<div>
<b-img src="/static/image/icon2_105x105.png" />
<div>个人综合排名</div>
<div class="tz-font tz-font-yellow">1</div>
<div class="tz-font tz-font-yellow">{{memberInfo.personalRank}}</div>
</div>
</b-col>
<b-col>
<b-col v-if="competition.type == 1">
<div>
<b-img src="/static/image/icon3_105x105.png" />
<div>团队综合排名</div>
<div class="tz-font tz-font-orange">1</div>
<div class="tz-font tz-font-orange">{{memberInfo.teamRank}}</div>
</div>
</b-col>
<b-col>
<div>
<b-img src="/static/image/icon4_105x105.png" />
<div>个人总资产</div>
<div class="tz-font tz-font-purple">217.58</div>
<div class="tz-font tz-font-purple">{{memberInfo.totalFounds}}</div>
</div>
</b-col>
</b-row>
@ -64,7 +64,7 @@
<b-col sm>
<div>
<b-img src="/static/image/icon5_40x40.png" />
<span class="tz-bold">吴和静的总成绩</span>
<span class="tz-bold">{{userInfo.name}}的总成绩</span>
</div>
</b-col>
<b-col sm>
@ -80,7 +80,7 @@
<div>
<b-img src="/static/image/icon8_40x40.png" />
个人收益率趋势</div>
<div>创建日期2021-10-10</div>
<div>创建日期{{createTime}}</div>
</div>
<div id="personalRatio" style="width:100%; height:100%">
</div>
@ -92,7 +92,7 @@
<div>
<b-img src="/static/image/icon7_40x40.png" />
团队收益率趋势</div>
<div>创建日期2021-10-10</div>
<div>创建日期{{createTime}}</div>
</div>
<div id="teamRatio" style="width:100%; height:100%">
@ -109,7 +109,7 @@
<b-img src="/static/image/icon8_40x40.png" />
个人综合排名走势
</div>
<div>创建日期2021-10-10</div>
<div>创建日期{{createTime}}</div>
</div>
<div id="personalRanking" style="width:100%; height:100%">
</div>
@ -122,7 +122,7 @@
<b-img src="/static/image/icon7_40x40.png" />
团队综合排名走势
</div>
<div>创建日期2021-10-10</div>
<div>创建日期{{createTime}}</div>
</div>
<div id="teamRanking" style="width:100%; height:100%">
@ -202,6 +202,7 @@
import * as echarts from 'echarts'
import * as competitionApi from '@/api/competition'
import { getInfo } from '@/utils/auth'
import * as memberApi from '@/api/member'
export default {
data(){
return {
@ -210,10 +211,18 @@ export default {
personalRankingCharts: null,
teamRankingCharts: null,
compId: 0,
competition: {},
stageId: 0,
currentStage: null,
positionList:[],
userInfo:null
userInfo:null,
memberInfo: null,
createTime: new Date().Format('yyyy-MM-dd')
}
},
props:{
competition:{
type: Object,
default: null
}
},
created(){
@ -221,15 +230,19 @@ export default {
this.compId = this.$route.query.id
}
this.userInfo = getInfo()
competitionApi.get({compId: this.compId}).then(res=> {
if(res.code == 200 ){
this.competition = res.data
this.stageId = this.competition.stageList[0].id
this.listPosition()
}
})
},
watch:{
competition:function(nv){
this.stageId = this.competition.stageList[0].id
this.loadData()
}
},
mounted(){
if(this.competition){
this.stageId = this.competition.stageList[0].id
this.loadData()
}
this.draw("personalRatio")
this.draw("teamRatio")
this.drawRanking("personalRanking")
@ -244,9 +257,21 @@ export default {
}
})
},
getMemberInfo(){
memberApi.getMemberInfo(this.compId,this.stageId).then(res=>{
if(res.code == 200){
this.memberInfo = res.data
}
})
},
loadData(){
this.listPosition()
this.getMemberInfo()
},
changeStage(id){
this.stageId = id
this.listPosition()
this.getCurrentStage(id)
this.loadData()
},
numberFixed(num){
if(typeof num == 'number'){
@ -255,6 +280,14 @@ export default {
return 0;
}
},
getCurrentStage(id){
let stage = this.competition.stageList.filter(st =>{
return st.id == id
})
if(stage){
this.currentStage = stage
}
},
draw(id){
let base = +new Date(1968, 9, 3);
let oneDay = 24 * 3600 * 1000;

@ -19,7 +19,7 @@ export default {
return {
user: {
username:'2020096911',
password:'tz2022'
password:'abc123ddd'
},
msg: ''
}

@ -14,7 +14,7 @@
<b-img src="/static/image/icon_admin2_30x30.png" />
<span>个人中心</span>
</div>
<div>
<div @click="loginout">
<b-img src="/static/image/icon_admin3_30x30.png" />
<span>退出</span>
</div>
@ -42,16 +42,16 @@
</div>
<div>
<b-img src="/static/image/icon_admin5_20x20.png" />
<span><b-img src="/static/image/member_info_icon.jpg" />上次登录1天</span>
<span><b-img src="/static/image/member_info_icon.jpg" />上次登录{{formatLastTime()}}</span>
</div>
<div class="edit-container">
<div>
<span> 上次登陆IP: 110.12.68.64</span>
<span> IP登陆地: 广东省深圳市宝安区</span>
<span> 上次登陆IP: {{userInfo.ip}}</span>
<span> IP登陆地: {{userInfo.location}}</span>
</div>
<div>
<b-button class="tz-btn tz-btn-edit" @click="visiable = !visiable ">编辑</b-button>
<b-button class="tz-btn tz-btn-save">保存</b-button>
<b-button class="tz-btn tz-btn-save" @click="saveInfo()"></b-button>
</div>
</div>
@ -67,7 +67,7 @@
<div class="member-table">
<div class="tz-row">
<div>
<span>姓名:</span><span>伍金林</span>
<span>姓名:</span><span>{{ userInfo.name}}</span>
</div>
<div>
<span>班级:</span><span>天择1班</span>
@ -75,10 +75,10 @@
</div>
<div class="tz-row">
<div>
<span>学号:</span><span>20171031</span>
<span>学号:</span><span>{{userInfo.username}}</span>
</div>
<div>
<span>学校:</span><span>天择大学</span>
<span>学校:</span><span>{{ userInfo.school }}</span>
</div>
</div>
<div class="tz-row">
@ -86,15 +86,15 @@
<span>学历:</span><span>本科</span>
</div>
<div>
<span>电话:</span> <b-input />
<span>电话:</span> <b-input v-model="userInfo.mobile" required />
</div>
</div>
<div class="tz-row">
<div>
<span>邮箱:</span><b-input />
<span>邮箱:</span><b-input v-model="userInfo.email" required />
</div>
<div>
<span>密码:</span> <b-input />
<span>密码:</span> <b-input v-model="userInfo.password" required />
</div>
</div>
</div>
@ -106,13 +106,25 @@
</template>
<script>
import Footer from '@/components/footer'
import { getInfo, setInfo } from '@/utils/auth'
import * as memberApi from '@/api/member'
import * as auth from '@/utils/auth'
export default {
components:{
"tz-footer": Footer
},
data(){
return {
visiable: true
visiable: true,
userInfo: null
}
},
created(){
this.userInfo = getInfo()
if(!this.userInfo){
this.$router.push({
path: '/login'
})
}
},
methods:{
@ -120,6 +132,43 @@ export default {
this.$router.push({
path: '/'
})
},
formatLastTime(){
console.log(this.userInfo.lastLoginTime);
let lt = new Date(this.userInfo.lastLoginTime)
let now = new Date()
let hours = (now.getTime() - lt.getTime())/3600000
let rs = ''
if(hours>24){
rs = Math.round(hours/24) +"天";
}else{
if(hours<1){
rs = Math.round((now.getTime() - lt.getTime())/60*1000 )+ "分钟"
}else{
rs = Math.round(hours) +"小时";
}
}
return rs
},
saveInfo(){
memberApi.saveInfo(this.userInfo).then(res => {
if(res.data){
this.userInfo.compele = true
setInfo(this.userInfo)
alert("操作成功")
}else{
alert(res.msg)
}
})
},
loginout(){
memberApi.loginout().then(res=>{
auth.loginout()
this.$router.push({
path: '/'
})
})
}
}
}

@ -72,12 +72,12 @@
</div>
<div v-for="cq in singleQuestion" :key="cq.id">
<a :name="cq.id" />
<div class="question-stem">
<div class="question-stem" @click="mark(cq.id)">
{{cq.id}}.{{cq.item.stem}}
</div>
<div v-if="cq.item.questionType == 1">
<div v-for="item in cq.item.answerList" :key="item.id" class="question">
<b-radio v-model="cq.item.answerId" :name="cq.item.id+''" :value="item.id" ></b-radio> <span> {{ idToName(item.id)}}.</span>{{item.title}}
<b-radio v-model="cq.item.answerId" :name="cq.item.id+''" :value="item.id" @change="checkStatus(cq.id)" ></b-radio> <span> {{ idToName(item.id)}}.</span>{{item.title}}
</div>
</div>
</div>
@ -87,12 +87,12 @@
</div>
<div v-for="cq in multiQuestion" :key="cq.id">
<a :name="cq.id" />
<div v-if="!!cq.item" class="question-stem">
<div v-if="!!cq.item" class="question-stem" @click="mark(cq.id)">
{{cq.id}}.{{cq.item.stem}}
</div>
<div v-if="!!cq.item&&cq.item.questionType == 2">
<div v-for="item in cq.item.answerList" :key="item.id" class="question">
<b-check v-model="cq.item.answerId" :name="cq.item.id+''" :value="item.id" ></b-check> <span> {{ idToName(item.id)}}.</span>{{item.title}}
<b-check v-model="cq.item.answerId" :name="cq.item.id+''" :value="item.id" @change="checkStatus(cq.id)" ></b-check> <span> {{ idToName(item.id)}}.</span>{{item.title}}
</div>
</div>
</div>
@ -102,12 +102,12 @@
</div>
<div v-for="cq in judgeQuestion" :key="cq.id">
<a :name="cq.id" />
<div v-if="!!cq.item" class="question-stem">
<div v-if="!!cq.item" class="question-stem" @click="mark(cq.id)">
{{cq.id}}.{{cq.item.stem}}
</div>
<div v-if="!!cq.item&&cq.item.questionType == 3">
<div v-for="item in cq.item.answerList" :key="item.id" class="question">
<b-radio v-model="cq.item.answerId" :name="cq.item.id+''" :value="item.id" ></b-radio> <span> {{ idToName(item.id)}}.</span>{{item.title}}
<b-radio v-model="cq.item.answerId" :name="cq.item.id+''" :value="item.id" @change="checkStatus(cq.id)" ></b-radio> <span> {{ idToName(item.id)}}.</span>{{item.title}}
</div>
</div>
</div>
@ -131,7 +131,7 @@
</div>
<div v-if="subcq.questionType == 1 || subcq.questionType ==3 ">
<div v-for="subitem in subcq.answerList" :key="subitem.id" class="question">
<b-radio v-model="subcq.answerId" :name="cq.id+'_'+subcq.id+''" :value="subitem.id" ></b-radio> <span> {{ idToName(subitem.id)}}.</span>{{subitem.title}}
<b-radio v-model="subcq.answerId" :name="cq.id+'_'+subcq.id+''" :value="subitem.id" ></b-radio> <span> {{ idToName(subitem.id)}}.</span>{{subitem.title}}
</div>
</div>
@ -156,6 +156,7 @@ import CutDown from './cutdown.vue'
import Footer from '@/components/footer.vue'
import ConfirmDialog from '@/views/dialog/confirmdialog.vue'
import * as examApi from '@/api/competition'
import * as memberApi from '@/api/member'
import { getInfo } from '@/utils/auth'
export default {
data(){
@ -187,11 +188,12 @@ export default {
doneList:[],
markList:[],
current: 1,
pre: 1,
currentQ: null,
userInfo: null,
tabId: 0,
compId: 1,
stageId: 1,
compId: 0,
stageId: 0,
confirm: false,
dlgVisiable: true,
competition: null,
@ -243,8 +245,27 @@ export default {
qList=qList.concat(this.getQList(this.anliQuestion))
examApi.submit(this.compId,this.stageId,qList).then(res=>{
console.log(res)
if(res.code == 200){
alert("考试得分"+res.data.score)
}
})
},
checkStatus(id){
if(id!=this.current){
this.doneList.push(this.pre)
this.current = id
this.pre = id
}
},
mark(id){
if(this.markList.indexOf(id)<0){
this.markList.push(id)
}else{
let index = this.markList.indexOf(id)
this.markList.splice(index,1)
}
},
getQList(obj){
let list = []
obj.forEach(i=>{
@ -345,6 +366,8 @@ export default {
this.examInfo.startTime = res.data.startTime
this.examInfo.endTime = res.data.endTime
this.loadQuestion()
}else{
alert(res.msg)
}
})
},
@ -389,6 +412,7 @@ export default {
created(){
if(this.$route.query){
this.compId = this.$route.query.id
this.stageId = this.$route.query.stageId
examApi.get({compId: this.compId}).then(res=>{
if(res.code == 200){
this.competition = res.data

@ -35,23 +35,23 @@
<div v-if="tabId == 0">
<div class="comp-info">
<div class="comp-thumbnail">
<b-img src="/static/image/pic_1_340x190.png" />
<b-img fluid :src="competition.thumbnail" />
</div>
<div class="">
<div class="comp-info-title">
<span class="comp-type">团队赛</span>
<span class="comp-title">2020年全国高职财经大数据分析大赛--初赛--证券投资赛项</span>
<span class="comp-type">{{ competition&&competition.type == 1?'团队赛':'个人赛' }}</span>
<span class="comp-title">{{ competition.name }}--{{ currentStage.name }}--证券投资赛项</span>
</div>
<hr />
<div class="comp-info-title">
<div class="comp-info-content">
<div>
<b-img src="/static/image/system_cmp_icon1.png"/>
<div>开始时间: 2019-01-18</div>
<div>开始时间: {{ new Date(currentStage.startTime).Format('yyyy-MM-dd')}}</div>
</div>
<div>
<b-img src="/static/image/system_cmp_icon2.png"/>
<div>结束时间: 2019-01-18</div>
<div>结束时间: {{ new Date(currentStage.endTime).Format('yyyy-MM-dd')}}</div>
</div>
<div>
<b-img src="/static/image/system_cmp_icon3.png"/>
@ -65,7 +65,7 @@
</div>
<div>
<b-img src="/static/image/system_cmp_icon5.png"/>
<div>参赛人数: 24</div>
<div>参赛人数: {{competition.peopleCount}}</div>
</div>
<div>
<b-img src="/static/image/system_cmp_icon6.png"/>
@ -94,13 +94,13 @@
</div>
</div>
<div id="main">
<div id="main" style="width:100%; height:100%">
</div>
</div>
</div>
<div v-if="tabId == 2">
<div class="comp-info">
<div class="tz-bold"> >>2020年全国高职财经大数据分析大赛--初赛--证券投资赛项 </div>
<div class="tz-bold"> >>{{ competition.name }}--{{ currentStage.name }}--证券投资赛项 </div>
<div class="member-info">
<div>
<b-img src="/static/image/system_icon11.png"/>
@ -326,6 +326,8 @@ import Quotation from './quotation.vue'
import Portrait from './portrait.vue'
import * as echarts from 'echarts'
import { getInfo } from '@/utils/auth'
import * as competitionApi from '@/api/competition'
import * as memberApi from '@/api/member'
export default {
components:{
'tz-footer': Footer,
@ -333,21 +335,33 @@ export default {
'tz-portrait': Portrait
},
methods:{
sim(){
let url = 'https://sim.sztzjy.com/user/login?token=157e2484a38880effebe57c4ee95d6c29984e2f8&redirect=https://sim.sztzjy.com/sim?acc=2e41a913-9dc1-11ec-89b3-00163e0e6ad0'
sim(){
if(!this.memberInfo.accountPwd){
alert("竞赛还未开始");
return
}
let url = 'https://sim.sztzjy.com/user/login?token='+this.memberInfo.accountPwd+'&redirect=https://sim.sztzjy.com/sim?acc='+this.memberInfo.accountId
window.open(url,"onlywin",'toolbar=no, location=no,directoryies=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, height=600, width=1100, left=180, top=100')
},
jixiao(){
let url = 'https://sim.sztzjy.com/user/login?token=157e2484a38880effebe57c4ee95d6c29984e2f8&redirect=https://sim.sztzjy.com/perfweb/analysis/profile/10'
if(!this.memberInfo.accountPwd){
alert("竞赛还未开始");
return
}
let url = 'https://sim.sztzjy.com/user/login?token='+this.memberInfo.accountPwd+'&redirect=https://sim.sztzjy.com/perfweb/analysis/profile/'+this.memberInfo.reportId
window.open(url,"onlywin",'toolbar=no, location=no,directoryies=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, height=600, width=1100, left=180, top=100')
},
changeTab(id){
this.tabId = id
},
loadData(){
memberApi.getMemberInfo(this.compId, this.stageId).then(res=>{
if(res.code == 200){
this.memberInfo = res.data
}
})
},
drawRanking(){
// domecharts
if(!this.rankingCharts){
this.rankingCharts = echarts.init(document.getElementById('main'));
let option = {
xAxis: {
type: 'category',
@ -365,12 +379,14 @@ export default {
]
}
if(!this.rankingCharts){
this.rankingCharts = echarts.init(document.getElementById('main'));
}
//
this.rankingCharts.setOption(option,true);
}else{
console.log("resize")
this.rankingCharts.resize()
}
this.rankingCharts.setOption(option);
}
},
data(){
@ -379,11 +395,35 @@ export default {
tabId: 0,
list:[
],
rankingCharts: null
rankingCharts: null,
competition: null,
compId: 0 ,
stageId: 0,
currentStage: null,
memberInfo: null
}
},
created(){
this.userInfo = getInfo()
if(this.$route.query){
this.compId = this.$route.query.id
this.stageId = this.$route.query.stageId
this.loadData()
competitionApi.get({compId: this.compId}).then(res =>{
if(res.code == 200 ){
this.competition = res.data
let stage = this.competition.stageList.filter(s=>s.id == this.stageId)
if(stage.length>0){
this.currentStage = stage[0]
}
}
})
competitionApi.getGroup(this.compId,this.stageId).then(res=>{
console.log("groupData:",res)
})
}
for(var i = 0 ;i<50;i++){
this.list.push({
name: '王先生',
@ -411,7 +451,17 @@ export default {
}
},
mounted(){
this.drawRanking()
this.$nextTick(function(){
this.drawRanking()
})
},
updated(){
console.log(this.tabId)
if(this.tabId == 0 ){
this.$nextTick(()=>{
this.drawRanking()
})
}
}
}
</script>
@ -557,9 +607,7 @@ export default {
color: white;
margin-left: 25rem;
}
.tz-bold{
font-weight: bold;
}
.tz-flex div{
min-height: 80px;
align-items: center;
@ -657,6 +705,7 @@ export default {
border-radius: 3px;
border: 2px solid white;
margin-right: 1rem;
width: 18rem;
}
.comp-type{
display: inline-block;
@ -672,8 +721,6 @@ export default {
min-height: 387px;
max-width: 86rem;
background: white;
display: block;
width: 100%;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}

@ -6,7 +6,7 @@
<div>
<b-img src="/static/image/system_icon11.png"/>
<span> 欢迎</span>
<span>{{userInfo.name}}</span>
<span>{{ userInfo? userInfo.name: ''}}</span>
</div>
<div>
<b-img src="/static/image/system_icon12.png" />

Loading…
Cancel
Save