Skip to content

Commit

Permalink
feat(stat-tables): expanded the clicking area of the statistics table
Browse files Browse the repository at this point in the history
the statistics table will now be able to response to all the clicks in a particular row of object
and be able to redirect the user to the specified object's statistics page

resolved #4
  • Loading branch information
GalvinGao committed Aug 13, 2019
1 parent c1c4ae3 commit 10040c7
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 30 deletions.
19 changes: 18 additions & 1 deletion src/layouts/StatsLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,21 @@
export default {
name: "StatsLayout"
}
</script>
</script>

<style>
.hovering::after {
transition: all 225ms cubic-bezier(0.165, 0.84, 0.44, 1);
content: "\232A";
font-size: 16px;
opacity: 0;
margin-left: 5px;
margin-top: -4px;
transform: translateX(0px);
}
.hovering.hovering--hovered::after {
opacity: 1;
margin-left: 8px;
}
</style>
8 changes: 4 additions & 4 deletions src/views/Stats/Item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@
<h1 class="title ma-3">
<v-layout align-center>
<Item
:item="selected.item"
:ratio="0.75"
disable-tooltip
disable-link
:item="selected.item"
:ratio="0.75"
disable-tooltip
disable-link
/>
<v-flex class="ml-2">
{{ $t('result.title', {item: selectedItemName}) }}
Expand Down
72 changes: 47 additions & 25 deletions src/views/Stats/Stage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@
</v-stepper-content>

<v-stepper-content :step="3">
<h1 class="title ma-3">{{ $t('stats.title', {stage: selectedStage.code}) }}</h1>
<h1 class="title ma-3">
{{ $t('stats.title', {stage: selectedStage.code}) }}
</h1>
<v-data-table
:headers="tableHeaders"
:items="stageStats"
Expand All @@ -267,31 +269,43 @@
class="elevation-0 transparentTable"
>
<template v-slot:items="props">
<td>
<v-avatar
:size="30"
class="mr-1"
<v-hover>
<tr
slot-scope="{ hover }"
class="cursor-pointer"
@click="redirectItem(props.item.item.itemId)"
>
<Item
:item="props.item.item"
:ratio="0.5"
disable-tooltip
/>
</v-avatar>
{{ props.item.item.name }}
</td>
<td class="text-xs-right">
{{ props.item.times }}
</td>
<td class="text-xs-right">
{{ props.item.quantity }}
</td>
<td class="text-xs-right">
{{ props.item.percentageText }}
</td>
<td class="text-xs-right">
{{ props.item.apPPR }}
</td>
<td
class="hovering"
:class="{ 'hovering--hovered': hover }"
>
<v-avatar
:size="30"
class="mr-1"
>
<Item
:item="props.item.item"
:ratio="0.5"
disable-tooltip
disable-link
/>
</v-avatar>
{{ props.item.item.name }}
</td>
<td class="text-xs-right">
{{ props.item.times }}
</td>
<td class="text-xs-right">
{{ props.item.quantity }}
</td>
<td class="text-xs-right">
{{ props.item.percentageText }}
</td>
<td class="text-xs-right">
{{ props.item.apPPR }}
</td>
</tr>
</v-hover>
</template>
</v-data-table>
</v-stepper-content>
Expand Down Expand Up @@ -429,6 +443,14 @@
(this.$route.params.stageId) && (this.selected.stage = this.$route.params.stageId) && (this.step += 1);
},
methods: {
redirectItem(itemId) {
this.$router.push({
name: "StatsByItem_SelectedItem",
params: {
itemId
}
})
},
storeZoneSelection(zoneId) {
this.step += 1;
this.selected.zone = zoneId
Expand Down

0 comments on commit 10040c7

Please sign in to comment.