diff --git a/app/components/pages/support/QuestionFilter.vue b/app/components/pages/support/QuestionFilter.vue
new file mode 100644
index 0000000..b6420e6
--- /dev/null
+++ b/app/components/pages/support/QuestionFilter.vue
@@ -0,0 +1,112 @@
+
+
+
+
+ {{
+ $t('product-filter.product-type')
+ }}
+
+
+
+
+
+
+ {{
+ $t('product-filter.product-model')
+ }}
+
+
+
+
+
+
+
+ {{ $t('product-filter.question-type') }}
+
+
+
+
+
+
+
+ {{ $t('product-filter.keyword') }}
+
+
+
+
+
+
+
+
+
diff --git a/app/pages/support/faq.vue b/app/pages/support/faq.vue
index df53b44..e403f68 100644
--- a/app/pages/support/faq.vue
+++ b/app/pages/support/faq.vue
@@ -11,10 +11,11 @@
-
@@ -37,8 +38,9 @@
const route = useRoute();
const filters = reactive({
- selectedType: null as string | null,
+ selectedQuestionType: null as string | null,
selectedProduct: null as string | null,
+ selectedProductType: null as string | null,
keyword: '',
});
@@ -57,6 +59,23 @@
const { data: questions, pending, error } = await useQuestionList();
+ const questionTypeOptions = computed(() => {
+ const types: QuestionTypeView[] = [];
+ questions.value.forEach((q: QuestionListView) => {
+ if (!types.some((t) => t.id === q.type.id)) {
+ if (q.type.id === '-1') {
+ types.push({
+ id: '-1',
+ name: $t('product-filter.misc'),
+ });
+ } else {
+ types.push(q.type);
+ }
+ }
+ });
+ return types;
+ });
+
const productTypeOptions = computed(() => {
const types: QuestionListProductType[] = [];
questions.value.forEach((q: QuestionListView) => {
@@ -71,12 +90,12 @@
});
const productOptions = computed(() => {
- if (!filters.selectedType) return [];
+ if (!filters.selectedProductType) return [];
const products: QuestionListProduct[] = [];
questions.value.forEach((q: QuestionListView) => {
q.products.forEach((product: QuestionListProduct) => {
if (
- product.type.id === filters.selectedType &&
+ product.type.id === filters.selectedProductType &&
!products.some((p) => p.id === product.id)
) {
products.push(product);
@@ -98,14 +117,18 @@
(product: QuestionListProduct) =>
product.id === filters.selectedProduct
)
- : filters.selectedType
+ : filters.selectedProductType
? question.products?.some(
(product: QuestionListProduct) =>
- product.type.id === filters.selectedType
+ product.type.id === filters.selectedProductType
)
: true;
- return matchProduct;
+ const matchQuestionType = filters.selectedQuestionType
+ ? question.type.id === filters.selectedQuestionType
+ : true;
+
+ return matchProduct && matchQuestionType;
});
});
@@ -138,7 +161,7 @@
);
watch(
- () => filters.selectedType,
+ () => filters.selectedProductType,
() => {
filters.selectedProduct = null;
}
diff --git a/i18n/locales/en.json b/i18n/locales/en.json
index 1112bc2..ad02c64 100644
--- a/i18n/locales/en.json
+++ b/i18n/locales/en.json
@@ -79,7 +79,12 @@
"keyword": "Keyword",
"select-product-type": "Select product type",
"select-product-model": "Select product model",
- "enter-keyword": "Enter keyword"
+ "enter-keyword": "Enter keyword",
+ "question-type": "Question Type",
+ "select-question-type": "Select question type",
+ "document-type": "Document Type",
+ "select-document-type": "Select document type",
+ "misc": "Misc"
},
"document-meta": {
"size": "Size",
diff --git a/i18n/locales/zh.json b/i18n/locales/zh.json
index 50f27ce..f07808a 100644
--- a/i18n/locales/zh.json
+++ b/i18n/locales/zh.json
@@ -78,7 +78,12 @@
"keyword": "关键词",
"select-product-type": "选择产品类型",
"select-product-model": "选择产品系列",
- "enter-keyword": "输入关键词"
+ "enter-keyword": "输入关键词",
+ "question-type": "问题类型",
+ "select-question-type": "选择问题类型",
+ "document-type": "文档类型",
+ "select-document-type": "选择文档类型",
+ "misc": "其他"
},
"document-meta": {
"size": "大小",