Skip to content

Commit

Permalink
feat: add sourcecategory to advancedquery
Browse files Browse the repository at this point in the history
  • Loading branch information
GalvinGao committed Feb 19, 2023
1 parent 7815ef7 commit 5695a61
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 58 deletions.
5 changes: 4 additions & 1 deletion src/components/advancedQuery/QueryBuilder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
:server="query.server"
/>
<QuerySelectorSource v-model="query.source" />
<QuerySelectorCategory v-model="query.category" />
<QuerySelectorInterval
v-model="query.interval"
@update:type="(e) => (query.type = e)"
Expand Down Expand Up @@ -138,7 +139,7 @@
color="error"
@click="cancel"
>
取消查询
{{ $t('query.cancel') }}
</v-btn>
</v-col>
</v-row>
Expand All @@ -158,10 +159,12 @@ import query from "@/apis/query";
import marshaller from "@/utils/marshaller";
import QuerySelectorInterval from "@/components/advancedQuery/selectors/QuerySelectorInterval";
import snackbar from "@/utils/snackbar";
import QuerySelectorCategory from "@/components/advancedQuery/selectors/QuerySelectorCategory.vue";
export default {
name: "QueryBuilder",
components: {
QuerySelectorCategory,
QuerySelectorInterval,
QuerySelectorSource,
QuerySelectorItem,
Expand Down
3 changes: 2 additions & 1 deletion src/components/advancedQuery/QueryMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ export default {
item: [],
timeRange: [],
server: this.$store.getters['dataSource/server'],
source: 'global',
source: this.$store.getters['dataSource/source'],
category: this.$store.getters['dataSource/category'],
interval: null
}
],
Expand Down
66 changes: 66 additions & 0 deletions src/components/advancedQuery/selectors/QuerySelectorCategory.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<template>
<v-select
:value="value"
hide-details
prepend-icon="mdi-filter-variant"

:menu-props="{ offsetY: true }"
filled
:items="categories"
:label="$t('matrixCategory.switch')"
transition="slide-y-transition"
@input="e => $emit('input', e)"
>
<template #item="{item}">
{{ $t('matrixCategory.' + item + ".label") }}
<v-tooltip
v-if="item !== 'all'"
right
max-width="300"
>
<template #activator="{ on }">
<v-icon
class="ml-2 degraded-opacity"
size="18"
v-on="on"
>
mdi-information
</v-icon>
</template>
<span>
{{ $t('matrixCategory.' + item + ".tooltip") }}
</span>
</v-tooltip>
<v-spacer />
<v-icon v-if="item === value">
mdi-check
</v-icon>
</template>

<template #selection="{item}">
{{ $t('matrixCategory.' + item + ".label") }}
</template>
</v-select>
</template>

<script>
export default {
name: 'QuerySelectorCategory',
props: {
value: {
type: String,
required: true
}
},
data () {
return {
selected: this.$store.getters['dataSource/category'],
categories: ['all', 'automated', 'manual']
}
}
}
</script>

<style scoped>
</style>
29 changes: 15 additions & 14 deletions src/locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@
"disclaimer": "All data produced by the \"Advanced Query\" feature is protected by our site's \"License.\" Penguin Statistics does not make any commitments or endorsements regarding the data produced by the Advanced Query feature."
}
},
"cancel": "Cancel",
"type": {
"matrix": "Statistics",
"trend": "Trends"
Expand Down Expand Up @@ -770,6 +771,20 @@
"separator": ", ",
"isAre": "is | are"
},
"matrixCategory": {
"automated": {
"tooltip": "Auto: Such Matrix Category contains data from third-party tools that automatically reports drop data.",
"label": "Auto"
},
"all": {
"label": "All"
},
"manual": {
"tooltip": "Manual: Such Matrix Category contains data only from the \"Report Drops by Stage\" and \"Report Drops by Recognition\" features from the Penguin Statistics site.",
"label": "Manual"
},
"switch": "Matrix Category"
},
"members": {
"responsibilities": {
"v1frontend": "v1.0 Frontend",
Expand Down Expand Up @@ -978,20 +993,6 @@
"network": {
"error": "Network error, please check your internet connection and try again."
},
"matrixCategory": {
"auto": {
"label": "Auto",
"tooltip": "Auto: Such Matrix Category contains data from third-party tools that automatically reports drop data."
},
"all": {
"label": "All"
},
"manual": {
"tooltip": "Manual: Such Matrix Category contains data only from the \"Report Drops by Stage\" and \"Report Drops by Recognition\" features from the Penguin Statistics site.",
"label": "Manual"
},
"switch": "Matrix Category"
},
"search": {
"hint": "Type in Name for Stage, Zone or Item",
"placeholder": "Search..."
Expand Down
29 changes: 15 additions & 14 deletions src/locales/ja_JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@
"disclaimer": ""
}
},
"cancel": "",
"type": {
"matrix": "",
"trend": ""
Expand Down Expand Up @@ -770,6 +771,20 @@
"separator": "",
"isAre": ""
},
"matrixCategory": {
"automated": {
"tooltip": "",
"label": "自動"
},
"all": {
"label": "全体"
},
"manual": {
"tooltip": "",
"label": "手動"
},
"switch": "集計範囲"
},
"members": {
"responsibilities": {
"v1frontend": "",
Expand Down Expand Up @@ -978,20 +993,6 @@
"network": {
"error": "ネットワークエラー。インターネット接続をご確認の上もう一度お試しください"
},
"matrixCategory": {
"auto": {
"label": "自動",
"tooltip": ""
},
"all": {
"label": "全体"
},
"manual": {
"tooltip": "",
"label": "手動"
},
"switch": "集計範囲"
},
"search": {
"hint": "素材名・作战名・ステージコード・章タイトル・イベント名(漢字・ふりがな・カタカナ・ローマ字)で検索",
"placeholder": "検索..."
Expand Down
29 changes: 15 additions & 14 deletions src/locales/ko_KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@
"disclaimer": "“고급 쿼리” 기능으로 생성된 모든 데이터는 이 사이트의 “데이터 라이센스 협약”으로 보호됩니다. 펭귄 통계는 “고급 쿼리” 기능으로 생성된 데이터에 대하여 어떠한 형태의 약속이나 보증도 하지 않습니다."
}
},
"cancel": "",
"type": {
"matrix": "통계",
"trend": "추세"
Expand Down Expand Up @@ -770,6 +771,20 @@
"separator": ", ",
"isAre": ""
},
"matrixCategory": {
"automated": {
"tooltip": "",
"label": ""
},
"all": {
"label": ""
},
"manual": {
"tooltip": "",
"label": ""
},
"switch": ""
},
"members": {
"responsibilities": {
"v1frontend": "v1.0 프론트엔드",
Expand Down Expand Up @@ -978,20 +993,6 @@
"network": {
"error": "네트워크 오류. 인터넷 연결을 확인한 후 다시 시도하세요."
},
"matrixCategory": {
"auto": {
"label": "",
"tooltip": ""
},
"all": {
"label": ""
},
"manual": {
"tooltip": "",
"label": ""
},
"switch": ""
},
"search": {
"hint": "스테이지, 구역 또는 아이템 이름 입력",
"placeholder": "검색..."
Expand Down
29 changes: 15 additions & 14 deletions src/locales/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@
"disclaimer": "「高级查询」功能所产出的所有数据信息均受本站「数据许可协议」保护;本站不对「高级查询」功能所产出的所有数据信息做任何形式的承诺或背书。"
}
},
"cancel": "取消查询",
"type": {
"matrix": "统计数据",
"trend": "历史趋势"
Expand Down Expand Up @@ -770,6 +771,20 @@
"separator": "",
"isAre": ""
},
"matrixCategory": {
"automated": {
"tooltip": "自动数据来源:指由第三方工具所自动汇报的掉落数据",
"label": "自动"
},
"all": {
"label": "全部"
},
"manual": {
"tooltip": "手动数据来源:指由用户使用企鹅物流数据统计的「网页或 App 端」中的「掉落汇报」或「截图识别」汇报的掉落数据",
"label": "手动"
},
"switch": "数据来源"
},
"members": {
"responsibilities": {
"v1frontend": "v1.0 前端",
Expand Down Expand Up @@ -978,20 +993,6 @@
"network": {
"error": "网络请求失败,请检查网络后重试"
},
"matrixCategory": {
"auto": {
"label": "自动",
"tooltip": "自动数据来源:指由第三方工具所自动汇报的掉落数据"
},
"all": {
"label": "全部"
},
"manual": {
"tooltip": "手动数据来源:指由用户使用企鹅物流数据统计的「网页或 App 端」中的「掉落汇报」或「截图识别」汇报的掉落数据",
"label": "手动"
},
"switch": "数据来源"
},
"search": {
"hint": "键入 物品全拼 拼音首字母 作战名 章节名 关卡编号 或 部分关卡/物品昵称",
"placeholder": "搜索..."
Expand Down
1 change: 1 addition & 0 deletions src/utils/marshaller.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default {
itemIds: query.item,
server: query.server,
isPersonal: query.source === 'personal',
sourceCategory: query.category,
start,
end
}
Expand Down

0 comments on commit 5695a61

Please sign in to comment.