4 changed files with 76 additions and 6 deletions
@ -0,0 +1,64 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<md-dialog :md-active.sync="show" @close="show=false"> |
||||
|
<div class="md-layout md-alignment-bottom-center"> |
||||
|
<div class="md-layout-item md-size-100 md-small-size-100 md-alignment-bottom-center rounded-only"> |
||||
|
<md-table v-model="tags" md-card md-fixed-header> |
||||
|
<md-table-row slot="md-table-row" slot-scope="{ item }" :style="player_gametime>item.time?'background: rgba(207, 106, 50, 0.25)':''"> |
||||
|
<md-table-cell md-label="Тег">{{ item.tag }}</md-table-cell> |
||||
|
<md-table-cell md-label="Нужно наиграть">{{ $API.UNIX2FACTI_TIME(item.time) }}</md-table-cell> |
||||
|
</md-table-row> |
||||
|
</md-table> |
||||
|
<md-button style="float: right" class="btn-colored" v-on:click="showMe(false)">Закрыть</md-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</md-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
const TAGS = '#0|none\n' + |
||||
|
'#3600|[УКРАИНЕЦ][0]\n' + |
||||
|
'#18000|[ГАСТАРБАЙТЕР][1]\n' + |
||||
|
'#36000"|[ИНЖЕНЕР][2]\n' + |
||||
|
'#72000|[ПРОРАБ][3]\n' + |
||||
|
'#90000|[ЕЛЬЦИН][4]\n' + |
||||
|
'#126000|[СИНЯК][5]\n' + |
||||
|
'#162000|[БУХАРИК][6]\n' + |
||||
|
'#198000"|[ДРУГ ПУТИНА][7]\n' + |
||||
|
'#234000"|[ИНЖ НЕГР][8]\n' + |
||||
|
'#270000"|[СОБЯНИН][9]\n' + |
||||
|
'#306000"|[ХОЗЯИН ПИВКА][10]\n' + |
||||
|
'#400000"|[ПУТИН][11]\n' + |
||||
|
'#800000|[РУССКИЙ ПУТИН][12]\n' + |
||||
|
'#1600000|[PUT.IN][13]\n' + |
||||
|
'#3200000|[ПИВО][14]\n' + |
||||
|
'#6400000"|[ОЛДФАГ][15]\n' + |
||||
|
'#9600000"|[ЖИВУ НА РУСИ][16]\n'; |
||||
|
export default { |
||||
|
name: "GametimeTabsDialog", |
||||
|
data: () => ({ |
||||
|
player_gametime: 0, |
||||
|
show: false, |
||||
|
tags: [] |
||||
|
}), |
||||
|
methods: { |
||||
|
getTags() { |
||||
|
this.tags = []; |
||||
|
const tags = TAGS.replace('"','').split("\n").map(t => t.split("|", 2)).map(t => ({time:parseInt(t[0].substring(1)), tag:t[1]})); |
||||
|
for (const ll in tags) { |
||||
|
const n = parseInt(ll); |
||||
|
try { |
||||
|
if (tags[n + 1].tag !== undefined) |
||||
|
this.tags.push({time: tags[n].time, tag: tags[n + 1].tag}) |
||||
|
} catch (e) {e} |
||||
|
} |
||||
|
}, |
||||
|
showMe(b ,gt) { |
||||
|
this.getTags(); |
||||
|
this.player_gametime = gt; |
||||
|
this.show = b; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
Loading…
Reference in new issue