Skip to content

Commit

Permalink
Merge pull request #131 from penguin-statistics/dev
Browse files Browse the repository at this point in the history
PR for v1.0.1
  • Loading branch information
AlvISsReimu authored Aug 24, 2019
2 parents 179225b + f1f1437 commit f1f43d6
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "penguin-stats-frontend",
"version": "0.1.0",
"version": "1.0.1",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="msapplication-config" content="<%= BASE_URL %>assets/favicon/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<title>明日方舟素材掉落统计</title>
<link href="https://cdn.bootcss.com/MaterialDesign-Webfont/3.8.95/css/materialdesignicons.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/MaterialDesign-Webfont/3.8.95/css/materialdesignicons.min.css" rel="preload" as="style" onload="this.rel='stylesheet'">
</head>
<body>
<noscript>
Expand Down
21 changes: 19 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<v-list-tile
v-if="!route.children || route.meta.forceSingle"
:key="route.name"
:to="route.path"
@click="onMenuItemClicked(route)"
>
<v-list-tile-action>
<v-icon>{{ route.meta.icon }}</v-icon>
Expand Down Expand Up @@ -170,7 +170,7 @@
<v-list-tile
v-for="child in route.children.filter(el => !(el.meta.hide))"
:key="child.name"
:to="{ 'name': child.name }"
@click="onMenuItemClicked(child)"
>
<v-list-tile-content>
<v-list-tile-title>{{ $t(child.meta.i18n) }}</v-list-tile-title>
Expand Down Expand Up @@ -395,6 +395,23 @@ export default {
this.randomizeLogo();
},
methods: {
onMenuItemClicked (route) {
if (route.meta && route.meta.externalRedirect) {
if (route.meta.ga) {
let ga = route.meta.ga;
this.$ga.event(
ga.category || 'redirect',
ga.action || 'links',
ga.label || 'unknown',
ga.value || 1);
}
if (route.meta.link) {
window.open(route.meta.link);
}
} else {
this.$router.push({'name': route.name})
}
},
async refreshData () {
await this.$store.dispatch("fetchData", true);
},
Expand Down
4 changes: 2 additions & 2 deletions src/config/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export default {
api: {
submitParams: {
source: "frontend-v2--development",
version: "v0.0.1"
source: "frontend-v2",
version: "v1.0.1"
}
},
cdn: {
Expand Down
14 changes: 8 additions & 6 deletions src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ const router = new Router({
i18n: 'menu.report',
forceSingle: true
},
children: [
{
children: [{
path: ':zoneId',
name: 'ReportByZone_SelectedZone',
component: Report,
Expand Down Expand Up @@ -131,11 +130,14 @@ const router = new Router({
{
path: '/planner',
name: 'Planner',
beforeEnter() {
this.$ga.event('redirect', 'links', 'ArkPlanner', 1)
window.location.replace("https://planner.penguin-stats.io")
},
meta: {
ga: {
category: 'redirect',
action: 'links',
label: 'ArkPlanner',
value: 1
},
link: "https://planner.penguin-stats.io",
icon: 'mdi-floor-plan',
i18n: 'menu.planner',
externalRedirect: true
Expand Down
7 changes: 4 additions & 3 deletions src/views/Report.vue
Original file line number Diff line number Diff line change
Expand Up @@ -711,9 +711,10 @@
return items
},
valid () {
return this.invalidCount === 0 &&
this.results.length >= this.typeLimitation.lower &&
this.results.length <= this.typeLimitation.upper
// return this.invalidCount === 0 &&
// this.results.length >= this.typeLimitation.lower &&
// this.results.length <= this.typeLimitation.upper
return true; // workaround
},
typeLimitation () {
if (!this.selected.stage) return {};
Expand Down

0 comments on commit f1f43d6

Please sign in to comment.