add export rank data to csv

This commit is contained in:
virusdefender 2018-05-06 04:57:37 +08:00
parent c466d48498
commit aaeda21fdc
2 changed files with 12 additions and 0 deletions

View File

@ -26,6 +26,9 @@
<i-switch :disabled="refreshDisabled" v-model="forceUpdate"></i-switch>
</p>
</template>
<template>
<Button type="primary" size="small" @click="downloadRankCSV">download csv</Button>
</template>
</div>
</Poptip>
</div>
@ -302,6 +305,9 @@
parseTotalTime (totalTime) {
let m = moment.duration(totalTime, 's')
return [Math.floor(m.asHours()), m.minutes(), m.seconds()].join(':')
},
downloadRankCSV () {
utils.downloadFile(`contest_rank?download_csv=1&contest_id=${this.$route.params.contestID}&force_refrash=${this.forceUpdate ? '1' : '0'}`)
}
}
}

View File

@ -20,6 +20,9 @@
<span>RealName</span>
<i-switch v-model="showRealName"></i-switch>
</p>
<p>
<Button type="primary" size="small" @click="downloadRankCSV">download csv</Button>
</p>
</div>
</Poptip>
</div>
@ -221,6 +224,9 @@
}
})
})
},
downloadRankCSV () {
utils.downloadFile(`contest_rank?download_csv=1&contest_id=${this.$route.params.contestID}&force_refrash=${this.forceUpdate ? '1' : '0'}`)
}
}
}