Commit 9db801d3 authored by ganjingcun's avatar ganjingcun

tabulate

parent 67f47ccc
......@@ -14,10 +14,19 @@
<li role="presentation"><a href="https://ygobbs.com/" target="_blank">{{lang.forum}} </a></li>
<li role="presentation"><a href="#/ranking">{{lang.rank}} </a></li>
<li role="presentation"><a href="#/cards">{{lang.card_rank}} </a></li>
<li role="presentation"><a href="#/deckprint">{{lang.deckprint}} </a></li>
<li role="presentation"><a href="https://rep.ygobbs.com">{{lang.battlelog}} </a></li>
<!--<li role="presentation"><a href="https://mycard.moe/ygopro/">{{lang.download}} </a></li>-->
<li role="presentation"><a href="#/download">{{lang.download}} </a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" href="#">
{{lang.tool}} <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li role="presentation"><a href="#/deckprint">{{lang.deckprint}} </a></li>
<li role="presentation"><a href="#/tabulate">{{lang.tabulate}} </a></li>
<li role="presentation"><a href="https://rep.ygobbs.com">{{lang.battlelog}} </a></li>
</ul>
</li>
<li v-if="user.isLogin" class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" href="#"><img v-bind:src="user.avatar_url" id="head-portrait">{{user.username}} <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
......@@ -27,6 +36,7 @@
<li role="presentation"><a @click.prevent="logout" href="#">{{lang.signout}} </a></li>
</ul>
</li>
<li v-else role="presentation"><a @click.prevent="login" href="#">{{lang.signin}} </a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" href="#">
......
......@@ -309,14 +309,14 @@
append = ""
}
if (userscorea < 0) {
return "<a href='#/userinfo?username=" + data + "'><span class='label label-danger'>" + data + "</span></a> " + append;
return "<a href='#/userinfo?username=" + encodeURIComponent(data) + "'><span class='label label-danger'>" + data + "</span></a> " + append;
}
if (userscorea > userscoreb) {
return "<a href='#/userinfo?username=" + data + "'><span class='label label-success'>" + data + "</span></a> " + append;
return "<a href='#/userinfo?username=" + encodeURIComponent(data) + "'><span class='label label-success'>" + data + "</span></a> " + append;
}
return "<a href='#/userinfo?username=" + data + "'><span class='label label-info'>" + data + "</span></a> " + append;
return "<a href='#/userinfo?username=" + encodeURIComponent(data) + "'><span class='label label-info'>" + data + "</span></a> " + append;
},
"targets": 0
},
......@@ -333,14 +333,14 @@
append = ""
}
if (userscoreb < 0) {
return "<a href='#/userinfo?username=" + data + "'><span class='label label-danger'>" + data + "</span></a> " + append;
return "<a href='#/userinfo?username=" + encodeURIComponent(data) + "'><span class='label label-danger'>" + data + "</span></a> " + append;
}
if (userscorea < userscoreb) {
return "<a href='#/userinfo?username=" + data + "'><span class='label label-success'>" + data + "</span></a> " + append;
return "<a href='#/userinfo?username=" + encodeURIComponent(data) + "'><span class='label label-success'>" + data + "</span></a> " + append;
}
return "<a href='#/userinfo?username=" + data + "'><span class='label label-info'>" + data + "</span></a> " + append;
return "<a href='#/userinfo?username=" + encodeURIComponent(data) + "'><span class='label label-info'>" + data + "</span></a> " + append;
},
"targets": 1
},
......
......@@ -139,7 +139,7 @@
"columnDefs": [
{
"render": function (data, type, row) {
return "<a href='#/userinfo?username=" + data + "'>" + data + "</a>";
return "<a href='#/userinfo?username=" + encodeURIComponent(data) + "'>" + data + "</a>";
},
"targets": 1
},
......@@ -178,7 +178,7 @@
"columnDefs": [
{
"render": function (data, type, row) {
return "<a href='#/userinfo?username=" + data + "'>" + data + "</a>";
return "<a href='#/userinfo?username=" + encodeURIComponent(data) + "'>" + data + "</a>";
},
"targets": 1
},
......
<template>
<div class="content">
<div class="container">
<div style="margin-left: 10%;margin-right: 10%; margin-top: 20px;">
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="一队队名" :label-width="formLabelWidth">
<el-input v-model="form.name1" placeholder="请输入一队队名" auto-complete="off" width="10px"></el-input>
</el-form-item>
<el-form-item label="二队队名" :label-width="formLabelWidth">
<el-input v-model="form.name2" placeholder="请输入二队队名" auto-complete="off" width="10px"></el-input>
</el-form-item>
<el-form-item label="比赛规则" :label-width="formLabelWidth">
<el-input v-model="form.rule" placeholder="请输入比赛规则" auto-complete="off" width="10px"></el-input>
</el-form-item>
<el-form-item label="比赛地点" :label-width="formLabelWidth">
<el-input v-model="form.location" placeholder="请输入比赛地点" auto-complete="off" width="10px"></el-input>
</el-form-item>
<el-form-item label="一队队员" :label-width="formLabelWidth">
<el-input v-model="form.member1" placeholder="请输入一队队员, 成员请用空格分开" auto-complete="off" width="10px"></el-input>
</el-form-item>
<el-form-item label="二队队员" :label-width="formLabelWidth">
<el-input v-model="form.member2" placeholder="请输入二队队员, 成员请用空格分开" auto-complete="off" width="10px"></el-input>
</el-form-item>
<el-form-item label="比赛日期" :label-width="formLabelWidth">
<el-date-picker v-model="form.date" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">排表</el-button>
</el-form-item>
</el-form>
</div>
<hr>
<div style="margin-left: 20%;margin-right: 20%; ">
<p>【胜】VS【负】 </p>
<p> 比赛: {{form.name1}} VS {{form.name2}}</p>
<p> 时间: {{getDate()}}</p>
<p> 规则: {{form.rule}}</p>
<p> 地点: {{form.location}}</p>
<p> ------------第一轮------------</p>
<p v-for="x in list">
{{x.a}} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0:0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{x.b}}
</p>
<p> ------------第二轮------------</p>
</div>
<br>
<br>
<br>
<br>
<br>
</div>
</div>
</template>
<script>
import querystring from 'querystring';
import _ from 'lodash';
import crypto from 'crypto';
import API from '../api'
import { mapGetters } from 'vuex'
import moment from 'moment'
import tb_language from './tb_lang.js'
export default {
data() {
return {
fileList3: [],
list: [],
options: [{
value: '1',
label: '默认'
}, {
value: '2',
label: 'KONAMI'
}],
value: '1',
isIE: false,
form: {
name1: '',
name2: '',
rule: '2/3【KOF】',
location: '',
member1: '',
member2: '',
date: '',
},
formLabelWidth: '80px',
isNew: true,
isClick: false,
todayCount: 0,
uploadUrl: API.uploadUrl,
imageUrl: "",
downloadPath: "",
demo_title: "",
demo_url: "",
demo1: [],
// checked: false,
checked2: false,
demo2: []
}
},
created: function () {
this.isIE = this.isIEMethod();
},
computed: {
...mapGetters({
lang: 'getLang',
user: 'getUser'
}),
},
methods: {
getDate() {
if (!this.form.date) {
return "";
}
return moment(this.form.date).format('YYYY-MM-DD')
},
handleChange(file, fileList) {
this.fileList3 = fileList.slice(-1);
},
handleAvatarSuccess(res, file) {
this.downloadPath = file.response.path
this.imageUrl = URL.createObjectURL(file.raw);
},
isIEMethod: function (ver) {
var b = document.createElement('b')
b.innerHTML = '<!--[if IE ' + ver + ']><i></i><![endif]-->'
return b.getElementsByTagName('i').length === 1
},
onSubmit: function () {
var date;
if (this.form.date) {
date = moment(this.form.date).format('YYMMDD')
}
var opt = {
name: this.form.name,
event: this.form.event,
gameid: this.form.gameid,
date: date,
id: this.downloadPath.slice(7),
print: this.checked2,
}
var member1 = this.form.member1.split(" ").filter(x => {
return x.trim()
});
var member2 = this.form.member2.split(" ").filter(x => {
return x.trim()
});
if (member1.length !== member2.length) {
this.$notify({
// title: '警告',
message: '两队人数不一致!',
type: 'error'
})
return;
}
var list = []
member1 = _.shuffle(member1)
member2 = _.shuffle(member2)
for (var i = 0; i < member1.length; i++) {
list.push({
a: member1[i],
b: member2[i]
})
}
this.list = list;
}
},
}
</script>
<style scoped>
</style>
\ No newline at end of file
......@@ -337,14 +337,14 @@
append = ""
}
if (userscorea < 0) {
return "<a href='#/userinfo?username=" + data + "'><span class='label label-danger'>" + data + "</span></a> " + append;
return "<a href='#/userinfo?username=" + encodeURIComponent(data) + "'><span class='label label-danger'>" + data + "</span></a> " + append;
}
if (userscorea > userscoreb) {
return "<a href='#/userinfo?username=" + data + "'><span class='label label-success'>" + data + "</span></a> " + append;
return "<a href='#/userinfo?username=" + encodeURIComponent(data) + "'><span class='label label-success'>" + data + "</span></a> " + append;
}
return "<a href='#/userinfo?username=" + data + "'><span class='label label-info'>" + data + "</span></a> " + append;
return "<a href='#/userinfo?username=" + encodeURIComponent(data) + "'><span class='label label-info'>" + data + "</span></a> " + append;
},
"targets": 0
},
......@@ -361,14 +361,14 @@
append = ""
}
if (userscoreb < 0) {
return "<a href='#/userinfo?username=" + data + "'><span class='label label-danger'>" + data + "</span></a> " + append;
return "<a href='#/userinfo?username=" + encodeURIComponent(data) + "'><span class='label label-danger'>" + data + "</span></a> " + append;
}
if (userscorea < userscoreb) {
return "<a href='#/userinfo?username=" + data + "'><span class='label label-success'>" + data + "</span></a> " + append;
return "<a href='#/userinfo?username=" + encodeURIComponent(data) + "'><span class='label label-success'>" + data + "</span></a> " + append;
}
return "<a href='#/userinfo?username=" + data + "'><span class='label label-info'>" + data + "</span></a> " + append;
return "<a href='#/userinfo?username=" + encodeURIComponent(data) + "'><span class='label label-info'>" + data + "</span></a> " + append;
},
"targets": 1
},
......
......@@ -11,6 +11,8 @@ module.exports = {
profile: '个人信息',
account: '用户中心',
deckprint: '卡表打印',
tabulate: '排表器',
tool: '工具',
signout: '退出',
signin: '登录 | 注册',
qc: '查询条件',
......@@ -119,6 +121,8 @@ module.exports = {
profile: 'Profile',
account: 'Account',
deckprint: "Deck Print",
tabulate: 'Tabulate',
tool: 'Tools',
signout: 'Sign out',
signin: 'Sign in | Sign up',
qc: 'Query conditions',
......
......@@ -14,6 +14,7 @@ import Report from '@/components/Report'
import Vote from '@/components/Vote'
import Ads from '@/components/Ads'
import Deckprint from '@/components/Deckprint'
import Tabulate from '@/components/Tabulate'
// import konami from '@/components/konami'
Vue.use(Router)
......@@ -72,6 +73,11 @@ export default new Router({
name: 'Deckprint',
component: Deckprint
},
{
path: '/tabulate',
name: 'Tabulate',
component: Tabulate
},
{
path: '/history',
name: 'History',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment