|
|
|
@ -51,9 +51,9 @@
|
|
|
|
|
<option v-for="r in store.state.rosters" :key="r._id" :value="r._id">{{ r.name }}</option>
|
|
|
|
|
</select>
|
|
|
|
|
<p class="mt-4">Started</p>
|
|
|
|
|
<input :checked="started" class="my-4 border border-gray-500 rounded-lg w-6 h-6" type="checkbox" required />
|
|
|
|
|
<input :checked="started" class="my-4 border border-gray-500 rounded-lg w-6 h-6" type="checkbox" />
|
|
|
|
|
<p class="mt-4">Done</p>
|
|
|
|
|
<input :checked="done" class="my-4 border border-gray-500 rounded-lg w-6 h-6" type="checkbox" required />
|
|
|
|
|
<input :checked="done" class="my-4 border border-gray-500 rounded-lg w-6 h-6" type="checkbox" />
|
|
|
|
|
<p class="mt-4">Best Of</p>
|
|
|
|
|
<input v-model="bestof" class="block my-4 border border-gray-500 rounded-lg w-64 h-8 px-4" type="number" required />
|
|
|
|
|
<p v-if="item" class="mt-4">Series Score</p>
|
|
|
|
@ -85,37 +85,43 @@ export default {
|
|
|
|
|
|
|
|
|
|
const setItem = (e) => {
|
|
|
|
|
item.value = e._id
|
|
|
|
|
// name.value = e.name
|
|
|
|
|
// logo.value = e.logo
|
|
|
|
|
// players.value = e.players
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const addPlayer = () => {
|
|
|
|
|
players.value.push({
|
|
|
|
|
name: '',
|
|
|
|
|
account: '',
|
|
|
|
|
})
|
|
|
|
|
type.value = e.type
|
|
|
|
|
blue.value = e.blue
|
|
|
|
|
orange.value = e.orange
|
|
|
|
|
started.value = e.started
|
|
|
|
|
done.value = e.done
|
|
|
|
|
bestof.value = e.bestof
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const reset = () => {
|
|
|
|
|
item.value = ''
|
|
|
|
|
name.value = ''
|
|
|
|
|
logo.value = ''
|
|
|
|
|
players.value = []
|
|
|
|
|
type.value = ''
|
|
|
|
|
blue.value = ''
|
|
|
|
|
orange.value = ''
|
|
|
|
|
orange.value = ''
|
|
|
|
|
started.value = false
|
|
|
|
|
done.value = false
|
|
|
|
|
bestof.value = ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const form = () => {
|
|
|
|
|
if (item.value !== '') {
|
|
|
|
|
update('rosters', item.value, {
|
|
|
|
|
name: name.value,
|
|
|
|
|
logo: logo.value,
|
|
|
|
|
players: players.value,
|
|
|
|
|
update('matches', item.value, {
|
|
|
|
|
type: type.value,
|
|
|
|
|
blue: blue.value,
|
|
|
|
|
orange: orange.value,
|
|
|
|
|
started: started.value,
|
|
|
|
|
done: done.value,
|
|
|
|
|
bestOf: bestof.value,
|
|
|
|
|
})
|
|
|
|
|
} else if (name.value !== '') {
|
|
|
|
|
create('rosters', {
|
|
|
|
|
name: name.value,
|
|
|
|
|
logo: logo.value,
|
|
|
|
|
players: players.value,
|
|
|
|
|
} else if (type.value !== '') {
|
|
|
|
|
create('matches', {
|
|
|
|
|
type: type.value,
|
|
|
|
|
blue: blue.value,
|
|
|
|
|
orange: orange.value,
|
|
|
|
|
started: started.value,
|
|
|
|
|
done: done.value,
|
|
|
|
|
bestOf: bestof.value,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
reset()
|
|
|
|
@ -123,7 +129,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
const delForm = () => {
|
|
|
|
|
if (item.value) {
|
|
|
|
|
del('rosters', item.value)
|
|
|
|
|
del('matches', item.value)
|
|
|
|
|
reset()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -140,7 +146,6 @@ export default {
|
|
|
|
|
setItem,
|
|
|
|
|
form,
|
|
|
|
|
delForm,
|
|
|
|
|
addPlayer,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|