Compare commits
11 Commits
bc625239cd
...
393dc3885b
| Author | SHA1 | Date | |
|---|---|---|---|
| 393dc3885b | |||
| 963690bf53 | |||
| e780997a69 | |||
| 4e88fd9bfb | |||
| f62c4a3987 | |||
| 05938550e6 | |||
| c156d1414c | |||
| faf2eb4b44 | |||
| 8269155ae3 | |||
| e48c7fe238 | |||
| 440a46850a |
19
app/app.vue
19
app/app.vue
@ -11,26 +11,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ElConfigProvider } from 'element-plus';
|
import { ElConfigProvider } from 'element-plus';
|
||||||
|
|
||||||
const { login } = useStrapiAuth();
|
|
||||||
|
|
||||||
const { getElementPlusLocale } = useLocalizations();
|
const { getElementPlusLocale } = useLocalizations();
|
||||||
|
|
||||||
const elementPlusLocale = getElementPlusLocale();
|
const elementPlusLocale = getElementPlusLocale();
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
// 检查用户是否已登录
|
|
||||||
const user = useStrapiUser();
|
|
||||||
if (!user.value) {
|
|
||||||
// 如果未登录,重定向到登录页面
|
|
||||||
login({ identifier: 'remilia', password: 'huanshuo51' })
|
|
||||||
.then(() => {
|
|
||||||
console.log('Login successful');
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.error('Login failed:', error);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
console.log('User is already logged in:', user.value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -20,8 +20,8 @@
|
|||||||
<NuxtLinkLocale to="/">{{ $t('navigation.home') }}</NuxtLinkLocale>
|
<NuxtLinkLocale to="/">{{ $t('navigation.home') }}</NuxtLinkLocale>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<NuxtLink :to="$localePath('/productions')">{{
|
<NuxtLink :to="$localePath('/products')">{{
|
||||||
$t('navigation.productions')
|
$t('navigation.products')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@ -21,8 +21,8 @@
|
|||||||
:persistent="false"
|
:persistent="false"
|
||||||
router
|
router
|
||||||
>
|
>
|
||||||
<el-menu-item index="productions" :route="$localePath('/productions')">
|
<el-menu-item index="products" :route="$localePath('/products')">
|
||||||
<span class="title">{{ $t('navigation.productions') }}</span>
|
<span class="title">{{ $t('navigation.products') }}</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
<el-menu-item index="solutions" :route="$localePath('/solutions')">
|
<el-menu-item index="solutions" :route="$localePath('/solutions')">
|
||||||
<span class="title">{{ $t('navigation.solutions') }}</span>
|
<span class="title">{{ $t('navigation.solutions') }}</span>
|
||||||
@ -81,8 +81,8 @@
|
|||||||
|
|
||||||
const refreshMenu = () => {
|
const refreshMenu = () => {
|
||||||
const path = router.currentRoute.value.path;
|
const path = router.currentRoute.value.path;
|
||||||
if (path.startsWith('/productions')) {
|
if (path.startsWith('/products')) {
|
||||||
activeName.value = 'productions';
|
activeName.value = 'products';
|
||||||
} else if (path.startsWith('/solutions')) {
|
} else if (path.startsWith('/solutions')) {
|
||||||
activeName.value = 'solutions';
|
activeName.value = 'solutions';
|
||||||
} else if (path.startsWith('/support')) {
|
} else if (path.startsWith('/support')) {
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-card class="production-card" @click="handleClick">
|
<el-card class="product-card" @click="handleClick">
|
||||||
<template #header>
|
<template #header>
|
||||||
<!-- Image -->
|
<!-- Image -->
|
||||||
<el-image class="production-image" :src="imageUrl" fit="contain" />
|
<el-image class="product-image" :src="imageUrl" fit="contain" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<!-- Name -->
|
<!-- Name -->
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<span class="production-name">{{ name }}</span>
|
<span class="product-name">{{ name }}</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- Description -->
|
<!-- Description -->
|
||||||
<div class="card-description text-left opacity-25">{{ description }}</div>
|
<div class="card-description text-left opacity-25">{{ description }}</div>
|
||||||
@ -32,25 +32,25 @@
|
|||||||
// 优先使用 slug,如果没有则使用 id
|
// 优先使用 slug,如果没有则使用 id
|
||||||
const routeParam = props.slug || props.id;
|
const routeParam = props.slug || props.id;
|
||||||
if (routeParam) {
|
if (routeParam) {
|
||||||
navigateTo(localePath(`/productions/${routeParam}`));
|
navigateTo(localePath(`/products/${routeParam}`));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.production-card {
|
.product-card {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-card:hover {
|
.product-card:hover {
|
||||||
transform: translateY(-4px);
|
transform: translateY(-4px);
|
||||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-name {
|
.product-name {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
@ -60,7 +60,7 @@
|
|||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-card .el-image {
|
.product-card .el-image {
|
||||||
height: 150px;
|
height: 150px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
@ -73,13 +73,13 @@
|
|||||||
|
|
||||||
/* 响应式设计 */
|
/* 响应式设计 */
|
||||||
@media (max-width: 1200px) {
|
@media (max-width: 1200px) {
|
||||||
.production-card {
|
.product-card {
|
||||||
width: 45%;
|
width: 45%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.production-card {
|
.product-card {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2,14 +2,14 @@
|
|||||||
<div v-if="hasResults">
|
<div v-if="hasResults">
|
||||||
<div class="search-results">
|
<div class="search-results">
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
v-for="(hit, hitIndex) in paginatedHits"
|
v-for="hit in paginatedHits"
|
||||||
:key="`${getHitIdentifier(hit.content, hitIndex)}`"
|
:key="`${hit.type}-${hit.id}`"
|
||||||
:to="localePath(resolveHitLink(hit.content))"
|
:to="localePath(resolveHitLink(hit))"
|
||||||
>
|
>
|
||||||
<el-card class="result-card">
|
<el-card class="result-card">
|
||||||
<h3 class="result-title">{{ getHitTitle(hit.content) }}</h3>
|
<h3 class="result-title">{{ hit.title }}</h3>
|
||||||
<p v-if="getHitSummary(hit.content)" class="result-summary">
|
<p v-if="hit.summary" class="result-summary">
|
||||||
{{ getHitSummary(hit.content) }}
|
{{ hit.summary }}
|
||||||
</p>
|
</p>
|
||||||
<p v-if="hit.type" class="result-type">
|
<p v-if="hit.type" class="result-type">
|
||||||
<span>内容类型: </span>
|
<span>内容类型: </span>
|
||||||
@ -44,13 +44,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
interface HitItem {
|
|
||||||
content: SearchHit;
|
|
||||||
type: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
hitItems: HitItem[];
|
searchItems: SearchItemView[];
|
||||||
currentPage: number;
|
currentPage: number;
|
||||||
category?: string;
|
category?: string;
|
||||||
}>();
|
}>();
|
||||||
@ -74,12 +69,12 @@
|
|||||||
const pageSize = ref(5);
|
const pageSize = ref(5);
|
||||||
|
|
||||||
// 搜索相关
|
// 搜索相关
|
||||||
const hits = props.hitItems;
|
const items = props.searchItems;
|
||||||
const filteredHits = computed(() => {
|
const filteredHits = computed(() => {
|
||||||
if (props.category) {
|
if (props.category) {
|
||||||
return hits.filter((hit) => hit.type === props.category);
|
return items.filter((item) => item.type === props.category);
|
||||||
} else {
|
} else {
|
||||||
return hits;
|
return items;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const paginatedHits = computed(() => {
|
const paginatedHits = computed(() => {
|
||||||
@ -89,7 +84,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
const indexLabels = computed<Record<string, string>>(() => ({
|
const indexLabels = computed<Record<string, string>>(() => ({
|
||||||
production: t('search.sections.production'),
|
product: t('search.sections.product'),
|
||||||
solution: t('search.sections.solution'),
|
solution: t('search.sections.solution'),
|
||||||
support: t('search.sections.support'),
|
support: t('search.sections.support'),
|
||||||
default: t('search.sections.default'),
|
default: t('search.sections.default'),
|
||||||
@ -106,64 +101,13 @@
|
|||||||
return filteredHits.value.length > 0;
|
return filteredHits.value.length > 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取搜索条目的唯一标识符
|
|
||||||
* 尝试根据搜索条目的相关词条获取唯一标识符
|
|
||||||
* 若未找到,则fallback至给定的index
|
|
||||||
* @param hit 搜索条目
|
|
||||||
* @param index 条目索引
|
|
||||||
*/
|
|
||||||
const getHitIdentifier = (hit: SearchHit, index: number) => {
|
|
||||||
const candidate = [hit.objectID, hit.documentId, hit.id, hit.slug].find(
|
|
||||||
(value) =>
|
|
||||||
['string', 'number'].includes(typeof value) && String(value).length > 0
|
|
||||||
);
|
|
||||||
return candidate != null ? String(candidate) : String(index);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取搜索条目的标题
|
|
||||||
* @param hit 搜索条目
|
|
||||||
*/
|
|
||||||
const getHitTitle = (hit: SearchHit) => {
|
|
||||||
const candidate = [
|
|
||||||
hit.title,
|
|
||||||
hit.name,
|
|
||||||
hit.heading,
|
|
||||||
hit.documentTitle,
|
|
||||||
].find((value) => typeof value === 'string' && value.trim().length > 0);
|
|
||||||
return candidate ? String(candidate) : t('search.untitled');
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取搜索条目的摘要
|
|
||||||
* @param hit 搜索条目
|
|
||||||
*/
|
|
||||||
const getHitSummary = (hit: SearchHit) => {
|
|
||||||
const candidate = [
|
|
||||||
hit.summary,
|
|
||||||
hit.description,
|
|
||||||
hit.snippet,
|
|
||||||
hit.content,
|
|
||||||
hit.text,
|
|
||||||
].find((value) => typeof value === 'string' && value.trim().length > 0);
|
|
||||||
return candidate ? String(candidate) : '';
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解析条目链接
|
* 解析条目链接
|
||||||
* 根据条目类型返回正确的跳转链接
|
* 根据条目类型返回正确的跳转链接
|
||||||
* @param hit 搜索条目
|
* @param item 搜索条目
|
||||||
*/
|
*/
|
||||||
const resolveHitLink = (hit: SearchHit) => {
|
const resolveHitLink = (item: SearchItemView) => {
|
||||||
if (typeof hit.route === 'string' && hit.route.trim().length > 0) {
|
const slugCandidate = item.id;
|
||||||
return localePath(hit.route);
|
|
||||||
}
|
|
||||||
|
|
||||||
const slugCandidate = [hit.slug, hit.documentId, hit.id, hit.objectID].find(
|
|
||||||
(value) =>
|
|
||||||
['string', 'number'].includes(typeof value) && String(value).length > 0
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!slugCandidate) {
|
if (!slugCandidate) {
|
||||||
return null;
|
return null;
|
||||||
@ -171,11 +115,11 @@
|
|||||||
|
|
||||||
const slug = String(slugCandidate);
|
const slug = String(slugCandidate);
|
||||||
|
|
||||||
if (hit.indexUid === 'production') {
|
if (item.type === 'product') {
|
||||||
return localePath({ path: `/productions/${slug}` });
|
return localePath({ path: `/products/${slug}` });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hit.indexUid === 'solution') {
|
if (item.type === 'solution') {
|
||||||
return localePath({ path: `/solutions/${slug}` });
|
return localePath({ path: `/solutions/${slug}` });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,3 +5,7 @@ export * from './useProduct';
|
|||||||
export * from './useSolutionList';
|
export * from './useSolutionList';
|
||||||
export * from './useSolution';
|
export * from './useSolution';
|
||||||
export * from './useQuestionList';
|
export * from './useQuestionList';
|
||||||
|
export * from './useDocumentList';
|
||||||
|
export * from './useContactInfo';
|
||||||
|
export * from './useCompanyProfile';
|
||||||
|
export * from './useHomepage';
|
||||||
|
|||||||
29
app/composables/directus/useCompanyProfile.ts
Normal file
29
app/composables/directus/useCompanyProfile.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import { readSingleton } from '@directus/sdk';
|
||||||
|
|
||||||
|
export const useCompanyProfile = () => {
|
||||||
|
const { $directus } = useNuxtApp();
|
||||||
|
const { getDirectusLocale } = useLocalizations();
|
||||||
|
const locale = getDirectusLocale();
|
||||||
|
|
||||||
|
return useAsyncData(`company-profile-${locale}`, async () => {
|
||||||
|
return await $directus.request(
|
||||||
|
readSingleton('company_profile', {
|
||||||
|
fields: [
|
||||||
|
'id',
|
||||||
|
{
|
||||||
|
translations: ['id', 'content'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deep: {
|
||||||
|
translations: {
|
||||||
|
_filter: {
|
||||||
|
languages_code: {
|
||||||
|
_eq: locale,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
};
|
||||||
29
app/composables/directus/useContactInfo.ts
Normal file
29
app/composables/directus/useContactInfo.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import { readSingleton } from '@directus/sdk';
|
||||||
|
|
||||||
|
export const useContactInfo = () => {
|
||||||
|
const { $directus } = useNuxtApp();
|
||||||
|
const { getDirectusLocale } = useLocalizations();
|
||||||
|
const locale = getDirectusLocale();
|
||||||
|
|
||||||
|
return useAsyncData(`contact-info-${locale}`, async () => {
|
||||||
|
return await $directus.request(
|
||||||
|
readSingleton('contact_info', {
|
||||||
|
fields: [
|
||||||
|
'id',
|
||||||
|
{
|
||||||
|
translations: ['id', 'content'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deep: {
|
||||||
|
translations: {
|
||||||
|
_filter: {
|
||||||
|
languages_code: {
|
||||||
|
_eq: locale,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
};
|
||||||
67
app/composables/directus/useDocumentList.ts
Normal file
67
app/composables/directus/useDocumentList.ts
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
import { readItems } from '@directus/sdk';
|
||||||
|
|
||||||
|
export const useDocumentList = () => {
|
||||||
|
const { $directus } = useNuxtApp();
|
||||||
|
const { getDirectusLocale } = useLocalizations();
|
||||||
|
const locale = getDirectusLocale();
|
||||||
|
|
||||||
|
return useAsyncData(`document-list-${locale}`, async () => {
|
||||||
|
return await $directus.request(
|
||||||
|
readItems('product_documents', {
|
||||||
|
fields: [
|
||||||
|
'id',
|
||||||
|
{
|
||||||
|
file: ['id', 'filesize', 'filename_download'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
translations: ['id', 'title'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
products: [
|
||||||
|
'id',
|
||||||
|
{
|
||||||
|
products_id: [
|
||||||
|
'id',
|
||||||
|
{
|
||||||
|
translations: ['id', 'name'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
product_type: [
|
||||||
|
'id',
|
||||||
|
{
|
||||||
|
translations: ['id', 'name'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deep: {
|
||||||
|
translations: {
|
||||||
|
_filter: {
|
||||||
|
languages_code: { _eq: locale },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
products: {
|
||||||
|
products_id: {
|
||||||
|
translations: {
|
||||||
|
_filter: {
|
||||||
|
languages_code: { _eq: locale },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
product_type: {
|
||||||
|
translations: {
|
||||||
|
_filter: {
|
||||||
|
languages_code: { _eq: locale },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
};
|
||||||
54
app/composables/directus/useHomepage.ts
Normal file
54
app/composables/directus/useHomepage.ts
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
import { readSingleton } from '@directus/sdk';
|
||||||
|
|
||||||
|
export const useHomepage = () => {
|
||||||
|
const { $directus } = useNuxtApp();
|
||||||
|
const { getDirectusLocale } = useLocalizations();
|
||||||
|
const locale = getDirectusLocale();
|
||||||
|
|
||||||
|
return useAsyncData(`homepage-${locale}`, async () => {
|
||||||
|
return await $directus.request(
|
||||||
|
readSingleton('homepage', {
|
||||||
|
fields: [
|
||||||
|
'id',
|
||||||
|
{
|
||||||
|
carousel: ['id', 'directus_files_id'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
recommend_products: [
|
||||||
|
'id',
|
||||||
|
{
|
||||||
|
translations: ['id', 'name', 'summary'],
|
||||||
|
},
|
||||||
|
'cover',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
recommend_solutions: [
|
||||||
|
'id',
|
||||||
|
{
|
||||||
|
translations: ['id', 'title', 'summary'],
|
||||||
|
},
|
||||||
|
'cover',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deep: {
|
||||||
|
recommend_products: {
|
||||||
|
translations: {
|
||||||
|
_filter: {
|
||||||
|
languages_code: { _eq: locale },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
recommend_solutions: {
|
||||||
|
translations: {
|
||||||
|
_filter: {
|
||||||
|
languages_code: { _eq: locale },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
};
|
||||||
@ -87,5 +87,10 @@ export const useLocalizations = () => {
|
|||||||
* @returns 语言映射对象
|
* @returns 语言映射对象
|
||||||
*/
|
*/
|
||||||
getLocaleMapping: getMapping,
|
getLocaleMapping: getMapping,
|
||||||
|
|
||||||
|
/** 所有可用的Directus语言代码列表(只读) **/
|
||||||
|
availableDirectusLocales: readonly(
|
||||||
|
Object.values(localeMap).map((item) => item.directus)
|
||||||
|
),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,33 +1,25 @@
|
|||||||
import { MeiliSearch } from 'meilisearch';
|
import { MeiliSearch } from 'meilisearch';
|
||||||
import type { SearchParams, SearchResponse } from 'meilisearch';
|
import type { SearchParams } from 'meilisearch';
|
||||||
|
|
||||||
interface RawSearchSection {
|
const parseIndexes = (
|
||||||
indexUid: string;
|
indexes: string | string[] | undefined,
|
||||||
response: SearchResponse<Record<string, unknown>>;
|
locale?: string
|
||||||
}
|
): string[] => {
|
||||||
|
|
||||||
export interface SearchHit extends Record<string, unknown> {
|
|
||||||
indexUid: string;
|
|
||||||
objectID?: string | number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SearchSection {
|
|
||||||
indexUid: string;
|
|
||||||
hits: SearchHit[];
|
|
||||||
estimatedTotalHits: number;
|
|
||||||
processingTimeMs: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
const parseIndexes = (indexes: string | string[] | undefined): string[] => {
|
|
||||||
if (!indexes) {
|
if (!indexes) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let suffix = '';
|
||||||
|
if (locale) {
|
||||||
|
suffix = `_${locale}`;
|
||||||
|
}
|
||||||
|
|
||||||
if (Array.isArray(indexes)) {
|
if (Array.isArray(indexes)) {
|
||||||
return indexes.map((item) => item.trim()).filter(Boolean);
|
return indexes.map((item) => `${item.trim()}${suffix}`).filter(Boolean);
|
||||||
}
|
}
|
||||||
return indexes
|
return indexes
|
||||||
.split(',')
|
.split(',')
|
||||||
.map((item) => item.trim())
|
.map((item) => `${item.trim()}${suffix}`)
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -56,10 +48,22 @@ export const useMeilisearch = () => {
|
|||||||
return meiliClient;
|
return meiliClient;
|
||||||
};
|
};
|
||||||
|
|
||||||
const search = async (
|
/**
|
||||||
|
* 泛型搜索函数
|
||||||
|
* @template T 文档类型, 如 MeiliProductIndex
|
||||||
|
* ---
|
||||||
|
* @param query 搜索关键词
|
||||||
|
* @param params 其他搜索参数
|
||||||
|
* @returns 搜索结果数组
|
||||||
|
*/
|
||||||
|
async function search<
|
||||||
|
K extends MeiliSearchItemType = MeiliSearchItemType,
|
||||||
|
T extends MeiliIndexMap[K] = MeiliIndexMap[K],
|
||||||
|
>(
|
||||||
query: string,
|
query: string,
|
||||||
params: SearchParams = {}
|
params: SearchParams = {},
|
||||||
): Promise<SearchSection[]> => {
|
searchLocale?: string
|
||||||
|
): Promise<SearchSection<T>[]> {
|
||||||
const trimmedQuery = query.trim();
|
const trimmedQuery = query.trim();
|
||||||
if (!trimmedQuery) {
|
if (!trimmedQuery) {
|
||||||
return [];
|
return [];
|
||||||
@ -70,34 +74,35 @@ export const useMeilisearch = () => {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const activeIndexes = indexes.value;
|
const activeIndexes = indexes.value as K[];
|
||||||
if (!activeIndexes.length) {
|
if (!activeIndexes.length) {
|
||||||
console.warn('No Meilisearch indexes configured.');
|
console.warn('No Meilisearch indexes configured.');
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
const rawIndexMap = Object.fromEntries(
|
||||||
|
activeIndexes.map((index) => [`${index}_${searchLocale}`, index])
|
||||||
|
);
|
||||||
|
const indexesWithLocale = activeIndexes.map(
|
||||||
|
(index) => index + (searchLocale ? `_${searchLocale}` : '')
|
||||||
|
);
|
||||||
|
|
||||||
const requests = activeIndexes.map(async (indexUid) => {
|
console.log(indexesWithLocale);
|
||||||
const response = await client.index(indexUid).search(trimmedQuery, {
|
|
||||||
|
const requests = indexesWithLocale.map(async (indexUid) => {
|
||||||
|
const response = await client.index(indexUid).search<T>(trimmedQuery, {
|
||||||
limit: params.limit ?? 10,
|
limit: params.limit ?? 10,
|
||||||
...params,
|
...params,
|
||||||
});
|
});
|
||||||
const safeResponse = JSON.parse(JSON.stringify(response));
|
|
||||||
return {
|
return {
|
||||||
indexUid,
|
indexUid,
|
||||||
response: {
|
response,
|
||||||
hits: safeResponse.hits,
|
} satisfies RawSearchSection<T>;
|
||||||
estimatedTotalHits:
|
|
||||||
safeResponse.estimatedTotalHits ?? safeResponse.hits.length,
|
|
||||||
processingTimeMs: safeResponse.processingTimeMs ?? 0,
|
|
||||||
query: safeResponse.query,
|
|
||||||
},
|
|
||||||
} satisfies RawSearchSection;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log((await requests[0])?.response.hits[0]?.locale);
|
|
||||||
|
|
||||||
const settled = await Promise.allSettled(requests);
|
const settled = await Promise.allSettled(requests);
|
||||||
|
|
||||||
|
console.log('Meilisearch settled results:', settled);
|
||||||
|
|
||||||
settled
|
settled
|
||||||
.filter(
|
.filter(
|
||||||
(result): result is PromiseRejectedResult =>
|
(result): result is PromiseRejectedResult =>
|
||||||
@ -108,22 +113,22 @@ export const useMeilisearch = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return settled
|
return settled
|
||||||
.filter((result) => result.status === 'fulfilled')
|
.filter(
|
||||||
|
(result): result is PromiseFulfilledResult<RawSearchSection<T>> =>
|
||||||
|
result.status === 'fulfilled'
|
||||||
|
)
|
||||||
.map((result) => {
|
.map((result) => {
|
||||||
const fulfilled = result as PromiseFulfilledResult<RawSearchSection>;
|
const { indexUid, response } = result.value;
|
||||||
return {
|
return {
|
||||||
indexUid: fulfilled.value.indexUid,
|
indexUid: indexUid,
|
||||||
hits: fulfilled.value.response.hits.map((hit) => ({
|
rawIndex: rawIndexMap[indexUid],
|
||||||
...hit,
|
hits: response.hits,
|
||||||
indexUid: fulfilled.value.indexUid,
|
|
||||||
})),
|
|
||||||
estimatedTotalHits:
|
estimatedTotalHits:
|
||||||
fulfilled.value.response.estimatedTotalHits ??
|
response.estimatedTotalHits ?? response.hits.length,
|
||||||
fulfilled.value.response.hits.length,
|
processingTimeMs: response.processingTimeMs ?? 0,
|
||||||
processingTimeMs: fulfilled.value.response.processingTimeMs ?? 0,
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
search,
|
search,
|
||||||
|
|||||||
17
app/models/mappers/companyProfileMapper.ts
Normal file
17
app/models/mappers/companyProfileMapper.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* 将 Directus 返回的 CompanyProfile 数据转换为 CompanyProfileView 视图模型
|
||||||
|
*
|
||||||
|
* @param raw: 原始的 CompanyProfile 数据
|
||||||
|
* @returns 转换后的 CompanyProfileView 对象
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* const view = toCompanyProfileView(rawCompanyProfile);
|
||||||
|
*/
|
||||||
|
export function toCompanyProfileView(raw: CompanyProfile): CompanyProfileView {
|
||||||
|
const trans = raw.translations?.[0] ?? { content: '' };
|
||||||
|
|
||||||
|
return {
|
||||||
|
id: raw.id,
|
||||||
|
content: trans.content,
|
||||||
|
};
|
||||||
|
}
|
||||||
17
app/models/mappers/contactInfoMapper.ts
Normal file
17
app/models/mappers/contactInfoMapper.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* 将 Directus 返回的 ContactInfo 数据转换为 ContactInfoView 视图模型
|
||||||
|
*
|
||||||
|
* @param raw: 原始的 ContactInfo 数据
|
||||||
|
* @returns 转换后的 ContactInfoView 对象
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* const view = toContactInfoView(rawContactInfo);
|
||||||
|
*/
|
||||||
|
export function toContactInfoView(raw: ContactInfo): ContactInfoView {
|
||||||
|
const trans = raw.translations?.[0] ?? { content: '' };
|
||||||
|
|
||||||
|
return {
|
||||||
|
id: raw.id,
|
||||||
|
content: trans.content,
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -1,13 +1,15 @@
|
|||||||
/**
|
/**
|
||||||
* 将 Directus 返回的 Document 数据转换为 DocumentView 视图模型
|
* 将 Directus 返回的 Document 数据转换为 ProductDocumentView 视图模型
|
||||||
*
|
*
|
||||||
* @param raw: 原始的 Document 数据
|
* @param raw: 原始的 Document 数据
|
||||||
* @returns 转换后的 DocumentView 对象
|
* @returns 转换后的 ProductDocumentView 对象
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* const view = toDocumentView(rawDocument);
|
* const view = toProductDocumentView(rawDocument);
|
||||||
*/
|
*/
|
||||||
export function toDocumentView(raw: ProductDocument): ProductDocumentView {
|
export function toProductDocumentView(
|
||||||
|
raw: ProductDocument
|
||||||
|
): ProductDocumentView {
|
||||||
const trans = raw.translations?.[0] ?? {
|
const trans = raw.translations?.[0] ?? {
|
||||||
title: '',
|
title: '',
|
||||||
};
|
};
|
||||||
@ -27,3 +29,49 @@ export function toDocumentView(raw: ProductDocument): ProductDocumentView {
|
|||||||
size: file.filesize,
|
size: file.filesize,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将 Directus 返回的 Document 数据转换为 DocumentListView 视图模型
|
||||||
|
*
|
||||||
|
* @param raw: 原始的 Document 数据
|
||||||
|
* @returns 转换后的 DocumentListView 对象
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* const view = toDocumentListView(rawDocument);
|
||||||
|
*/
|
||||||
|
export function toDocumentListView(raw: ProductDocument): DocumentListView {
|
||||||
|
const trans = raw.translations?.[0] ?? { title: '' };
|
||||||
|
|
||||||
|
const fileId = typeof raw.file === 'string' ? raw.file : raw.file?.id;
|
||||||
|
const file = raw.file as DirectusFile;
|
||||||
|
|
||||||
|
const { getFileUrl } = useDirectusFiles();
|
||||||
|
const url = getFileUrl(fileId);
|
||||||
|
|
||||||
|
const related_products: DocumentListProduct[] = raw.products
|
||||||
|
?.filter(isObject<ProductsProductDocument>)
|
||||||
|
.map((item) => item.products_id)
|
||||||
|
.filter(isObject<Product>)
|
||||||
|
.map((item) => {
|
||||||
|
const productType =
|
||||||
|
isObject<ProductType>(item.product_type) &&
|
||||||
|
({
|
||||||
|
id: item.product_type.id,
|
||||||
|
name: item.product_type.translations?.[0]?.name,
|
||||||
|
} satisfies DocumentListProductType);
|
||||||
|
return {
|
||||||
|
id: item.id,
|
||||||
|
name: item.translations?.[0]?.name,
|
||||||
|
type: productType,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
id: raw.id,
|
||||||
|
filename: file.filename_download,
|
||||||
|
title: trans.title,
|
||||||
|
url: url,
|
||||||
|
size: file.filesize,
|
||||||
|
products: related_products,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|||||||
51
app/models/mappers/homepageMapper.ts
Normal file
51
app/models/mappers/homepageMapper.ts
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
/**
|
||||||
|
* 将 Directus 返回的 Homepage 数据转换为 HomepageView 视图模型
|
||||||
|
*
|
||||||
|
* @param raw: 原始的 Homepage 数据
|
||||||
|
* @returns 转换后的 HomepageView 对象
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* const view = toHomepageView(rawHomepage);
|
||||||
|
*/
|
||||||
|
export function toHomepageView(raw: Homepage): HomepageView {
|
||||||
|
const carousel = (raw.carousel ?? [])
|
||||||
|
.filter(isObject<HomepageFile>)
|
||||||
|
.map((item) => item.directus_files_id)
|
||||||
|
.filter((item) => typeof item === 'string');
|
||||||
|
|
||||||
|
const products = (raw.recommend_products ?? [])
|
||||||
|
.filter(isObject<Product>)
|
||||||
|
.map((item) => {
|
||||||
|
const cover = isObject<DirectusFile>(item.cover)
|
||||||
|
? item.cover.id
|
||||||
|
: item.cover;
|
||||||
|
return {
|
||||||
|
id: item.id,
|
||||||
|
name: item.translations?.[0].name,
|
||||||
|
summary: item.translations?.[0].summary,
|
||||||
|
cover: cover,
|
||||||
|
} satisfies HomepageProductView;
|
||||||
|
});
|
||||||
|
|
||||||
|
const solutions = (raw.recommend_solutions ?? [])
|
||||||
|
.filter(isObject<Solution>)
|
||||||
|
.map((item) => {
|
||||||
|
const cover = isObject<DirectusFile>(item.cover)
|
||||||
|
? item.cover.id
|
||||||
|
: item.cover;
|
||||||
|
|
||||||
|
return {
|
||||||
|
id: item.id,
|
||||||
|
title: item.translations?.[0].title,
|
||||||
|
summary: item.translations?.[0].summary,
|
||||||
|
cover: cover,
|
||||||
|
} satisfies HomepageSolutionView;
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
id: raw.id,
|
||||||
|
carousel: carousel ?? [],
|
||||||
|
recommendProducts: products ?? [],
|
||||||
|
recommendSolutions: solutions ?? [],
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -106,13 +106,13 @@ export function toProductView(raw: Product): ProductView {
|
|||||||
.filter(isObject<ProductsQuestion>)
|
.filter(isObject<ProductsQuestion>)
|
||||||
.map((item) => item.questions_id)
|
.map((item) => item.questions_id)
|
||||||
.filter(isObject<Question>)
|
.filter(isObject<Question>)
|
||||||
.map((item) => toQuestionView(item));
|
.map((item) => toProductQuestionView(item));
|
||||||
|
|
||||||
const documents = (raw.documents ?? [])
|
const documents = (raw.documents ?? [])
|
||||||
.filter(isObject<ProductsProductDocument>)
|
.filter(isObject<ProductsProductDocument>)
|
||||||
.map((item) => item.product_documents_id)
|
.map((item) => item.product_documents_id)
|
||||||
.filter(isObject<ProductDocument>)
|
.filter(isObject<ProductDocument>)
|
||||||
.map((item) => toDocumentView(item));
|
.map((item) => toProductDocumentView(item));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: raw.id,
|
id: raw.id,
|
||||||
|
|||||||
16
app/models/mappers/searchItemMapper.ts
Normal file
16
app/models/mappers/searchItemMapper.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* 搜索索引转换器
|
||||||
|
* @param hit 搜索条目
|
||||||
|
* @returns 转换后的搜索条目视图模型
|
||||||
|
*
|
||||||
|
* ---
|
||||||
|
* @example
|
||||||
|
* const view = toSearchItemView(item, 'products');
|
||||||
|
*/
|
||||||
|
export function toSearchItemView<T extends MeiliSearchItemType>(
|
||||||
|
item: MeiliIndexMap[T],
|
||||||
|
type: T
|
||||||
|
): SearchItemView {
|
||||||
|
const converter = converters[type];
|
||||||
|
return converter ? converter(item) : null;
|
||||||
|
}
|
||||||
35
app/models/utils/search-converters.ts
Normal file
35
app/models/utils/search-converters.ts
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/**
|
||||||
|
* 各索引对应的转换函数表
|
||||||
|
*/
|
||||||
|
export const converters: {
|
||||||
|
[K in keyof MeiliIndexMap]: (item: MeiliIndexMap[K]) => SearchItemView;
|
||||||
|
} = {
|
||||||
|
products: (item: MeiliIndexMap['products']): SearchItemView => ({
|
||||||
|
id: item.id,
|
||||||
|
type: 'product',
|
||||||
|
title: item.name,
|
||||||
|
summary: item.summary,
|
||||||
|
}),
|
||||||
|
|
||||||
|
solutions: (item: MeiliIndexMap['solutions']): SearchItemView => ({
|
||||||
|
id: item.id,
|
||||||
|
type: 'solution',
|
||||||
|
title: item.title,
|
||||||
|
summary: item.summary,
|
||||||
|
}),
|
||||||
|
|
||||||
|
questions: (item: MeiliIndexMap['questions']): SearchItemView => ({
|
||||||
|
id: item.id,
|
||||||
|
type: 'question',
|
||||||
|
title: item.title,
|
||||||
|
summary: item.content.slice(0, 100) + '...',
|
||||||
|
}),
|
||||||
|
|
||||||
|
product_documents: (
|
||||||
|
item: MeiliIndexMap['product_documents']
|
||||||
|
): SearchItemView => ({
|
||||||
|
id: item.id,
|
||||||
|
type: 'document',
|
||||||
|
title: item.title,
|
||||||
|
}),
|
||||||
|
};
|
||||||
10
app/models/views/CompanyProfileView.ts
Normal file
10
app/models/views/CompanyProfileView.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* 公司简介视图模型
|
||||||
|
*/
|
||||||
|
export interface CompanyProfileView {
|
||||||
|
/** 唯一标识符 **/
|
||||||
|
id: number;
|
||||||
|
|
||||||
|
/** 内容 **/
|
||||||
|
content: string;
|
||||||
|
}
|
||||||
10
app/models/views/ContactInfoView.ts
Normal file
10
app/models/views/ContactInfoView.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* 联系信息视图模型
|
||||||
|
*/
|
||||||
|
export interface ContactInfoView {
|
||||||
|
/** 唯一标识符 **/
|
||||||
|
id: number;
|
||||||
|
|
||||||
|
/** 内容 **/
|
||||||
|
content: string;
|
||||||
|
}
|
||||||
42
app/models/views/DocumentListView.ts
Normal file
42
app/models/views/DocumentListView.ts
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/**
|
||||||
|
* 文档关联产品类型模型
|
||||||
|
* 用于在文档库中提供产品筛选功能
|
||||||
|
*/
|
||||||
|
export interface DocumentListProductType {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档关联产品模型
|
||||||
|
* 用于在文档库中提供产品筛选功能
|
||||||
|
*/
|
||||||
|
export interface DocumentListProduct {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
type: DocumentListProductType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档列表模型
|
||||||
|
* 用于文档库(/support/documents)页面渲染的数据结构
|
||||||
|
*/
|
||||||
|
export interface DocumentListView {
|
||||||
|
/** 唯一标识符 **/
|
||||||
|
id: number;
|
||||||
|
|
||||||
|
/** 文件名 **/
|
||||||
|
filename: string;
|
||||||
|
|
||||||
|
/** 文档标题 **/
|
||||||
|
title: string;
|
||||||
|
|
||||||
|
/** 文档大小 **/
|
||||||
|
size: number;
|
||||||
|
|
||||||
|
/** 文档链接 **/
|
||||||
|
url: string;
|
||||||
|
|
||||||
|
/** 相关产品 **/
|
||||||
|
products: DocumentListProduct[];
|
||||||
|
}
|
||||||
50
app/models/views/HomepageView.ts
Normal file
50
app/models/views/HomepageView.ts
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
/**
|
||||||
|
* 主页推荐产品视图模型
|
||||||
|
*/
|
||||||
|
export interface HomepageProductView {
|
||||||
|
/** 唯一标识符 **/
|
||||||
|
id: number;
|
||||||
|
|
||||||
|
/** 产品名称 **/
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
/** 产品简介 **/
|
||||||
|
summary: string;
|
||||||
|
|
||||||
|
/** 产品封面 **/
|
||||||
|
cover: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主页推荐解决方案视图模型
|
||||||
|
*/
|
||||||
|
export interface HomepageSolutionView {
|
||||||
|
/** 唯一标识符 **/
|
||||||
|
id: number;
|
||||||
|
|
||||||
|
/** 解决方案标题 **/
|
||||||
|
title: string;
|
||||||
|
|
||||||
|
/** 解决方案摘要 **/
|
||||||
|
summary: string;
|
||||||
|
|
||||||
|
/** 解决方案封面 **/
|
||||||
|
cover: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主页视图模型
|
||||||
|
*/
|
||||||
|
export interface HomepageView {
|
||||||
|
/** 唯一标识符 **/
|
||||||
|
id: number;
|
||||||
|
|
||||||
|
/** 首页图片 **/
|
||||||
|
carousel: string[];
|
||||||
|
|
||||||
|
/** 首页推荐产品 **/
|
||||||
|
recommendProducts: HomepageProductView[];
|
||||||
|
|
||||||
|
/** 首页推荐解决方案 **/
|
||||||
|
recommendSolutions: HomepageSolutionView[];
|
||||||
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* 文档视图模型
|
* 文档视图模型
|
||||||
* 用于文档页(/support/documents)渲染的数据结构
|
* 用于文档列表渲染的数据结构
|
||||||
*/
|
*/
|
||||||
export interface ProductDocumentView {
|
export interface ProductDocumentView {
|
||||||
/** 唯一标识符 **/
|
/** 唯一标识符 **/
|
||||||
|
|||||||
13
app/models/views/SearchItemView.ts
Normal file
13
app/models/views/SearchItemView.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
export interface SearchItemView {
|
||||||
|
/** 唯一标识符 **/
|
||||||
|
id: number;
|
||||||
|
|
||||||
|
/** 条目类型 **/
|
||||||
|
type: 'product' | 'solution' | 'question' | 'document';
|
||||||
|
|
||||||
|
/** 条目标题 **/
|
||||||
|
title: string;
|
||||||
|
|
||||||
|
/** 条目摘要 **/
|
||||||
|
summary?: string;
|
||||||
|
}
|
||||||
@ -15,7 +15,7 @@
|
|||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<markdown-renderer :content="content || ''" />
|
<markdown-renderer :content="content.content || ''" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-divider content-position="left">更多信息</el-divider>
|
<el-divider content-position="left">更多信息</el-divider>
|
||||||
@ -38,17 +38,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { findOne } = useStrapi();
|
const { data, pending, error } = await useCompanyProfile();
|
||||||
const { getStrapiLocale } = useLocalizations();
|
|
||||||
const strapiLocale = getStrapiLocale();
|
|
||||||
|
|
||||||
const { data, pending, error } = useAsyncData('company-profile', () =>
|
const content = computed(() => toCompanyProfileView(data.value));
|
||||||
findOne<StrapiCompanyProfile>('company-profile', undefined, {
|
|
||||||
locale: strapiLocale,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const content = computed(() => data.value?.data.content);
|
|
||||||
|
|
||||||
watch(error, (value) => {
|
watch(error, (value) => {
|
||||||
if (value) {
|
if (value) {
|
||||||
|
|||||||
@ -12,14 +12,11 @@
|
|||||||
<div class="carousel-item">
|
<div class="carousel-item">
|
||||||
<el-image
|
<el-image
|
||||||
class="carousel-image"
|
class="carousel-image"
|
||||||
:src="useStrapiMedia(item.url || '')"
|
:src="getImageUrl(item)"
|
||||||
:alt="item.alternativeText || `Carousel Image ${index + 1}`"
|
:alt="`Carousel Image ${index + 1}`"
|
||||||
fit="contain"
|
fit="contain"
|
||||||
lazy
|
lazy
|
||||||
/>
|
/>
|
||||||
<p v-if="item.caption" class="carousel-image-caption">
|
|
||||||
{{ item.caption }}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</el-carousel-item>
|
</el-carousel-item>
|
||||||
</el-carousel>
|
</el-carousel>
|
||||||
@ -42,24 +39,24 @@
|
|||||||
:autoplay="false"
|
:autoplay="false"
|
||||||
>
|
>
|
||||||
<el-carousel-item
|
<el-carousel-item
|
||||||
v-for="n in Math.floor(recommend_productions.length / 3) + 1"
|
v-for="n in Math.floor(recommend_products.length / 3) + 1"
|
||||||
:key="n"
|
:key="n"
|
||||||
class="recommend-list"
|
class="recommend-list"
|
||||||
>
|
>
|
||||||
<div class="recommend-card-group">
|
<div class="recommend-card-group">
|
||||||
<el-card
|
<el-card
|
||||||
v-for="(item, index) in recommend_productions.slice(
|
v-for="(item, index) in recommend_products.slice(
|
||||||
(n - 1) * 3,
|
(n - 1) * 3,
|
||||||
n * 3
|
n * 3
|
||||||
)"
|
)"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="recommend-card"
|
class="recommend-card"
|
||||||
@click="handleProductionCardClick(item.documentId || '')"
|
@click="handleProductCardClick(item.id.toString() || '')"
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-image
|
<el-image
|
||||||
:src="useStrapiMedia(item.cover?.url || '')"
|
:src="getImageUrl(item.cover)"
|
||||||
:alt="item.cover?.alternativeText || item.title"
|
:alt="item.name"
|
||||||
fit="cover"
|
fit="cover"
|
||||||
lazy
|
lazy
|
||||||
/>
|
/>
|
||||||
@ -67,7 +64,7 @@
|
|||||||
<div class="recommend-card-body">
|
<div class="recommend-card-body">
|
||||||
<!-- Title -->
|
<!-- Title -->
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<span class="recommend-card-title">{{ item.title }}</span>
|
<span class="recommend-card-title">{{ item.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- Description -->
|
<!-- Description -->
|
||||||
<div class="recommend-card-description text-left opacity-25">
|
<div class="recommend-card-description text-left opacity-25">
|
||||||
@ -107,12 +104,12 @@
|
|||||||
)"
|
)"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="recommend-card"
|
class="recommend-card"
|
||||||
@click="handleSolutionCardClick(item.documentId || '')"
|
@click="handleSolutionCardClick(item.id.toString() || '')"
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-image
|
<el-image
|
||||||
:src="useStrapiMedia(item.cover?.url || '')"
|
:src="getImageUrl(item.cover)"
|
||||||
:alt="item.cover?.alternativeText || item.title"
|
:alt="item.title"
|
||||||
fit="cover"
|
fit="cover"
|
||||||
lazy
|
lazy
|
||||||
/>
|
/>
|
||||||
@ -140,55 +137,39 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { findOne } = useStrapi();
|
const { getImageUrl } = useDirectusImage();
|
||||||
const { getStrapiLocale } = useLocalizations();
|
|
||||||
const strapiLocale = getStrapiLocale();
|
|
||||||
|
|
||||||
const { data, pending, error } = useAsyncData('homepage', () =>
|
const { data, pending, error } = await useHomepage();
|
||||||
findOne<StrapiHomepage>('homepage', undefined, {
|
|
||||||
populate: {
|
|
||||||
carousel: {
|
|
||||||
populate: '*',
|
|
||||||
},
|
|
||||||
recommend_productions: {
|
|
||||||
populate: {
|
|
||||||
cover: {
|
|
||||||
populate: '*',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
recommend_solutions: {
|
|
||||||
populate: {
|
|
||||||
cover: {
|
|
||||||
populate: '*',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
locale: strapiLocale,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const carousel = computed(() => data.value?.data.carousel || []);
|
const homepageData = computed(() => {
|
||||||
const recommend_productions = computed(
|
return toHomepageView(data.value);
|
||||||
() => data.value?.data.recommend_productions || []
|
});
|
||||||
|
|
||||||
|
const carousel = computed(() => homepageData.value?.carousel);
|
||||||
|
|
||||||
|
const recommend_products = computed(
|
||||||
|
() => homepageData.value?.recommendProducts
|
||||||
);
|
);
|
||||||
const recommend_solutions = computed(
|
const recommend_solutions = computed(
|
||||||
() => data.value?.data.recommend_solutions || []
|
() => homepageData.value?.recommendSolutions
|
||||||
);
|
);
|
||||||
|
|
||||||
|
watch(pending, () => {
|
||||||
|
console.log(data.value);
|
||||||
|
});
|
||||||
|
|
||||||
watch(error, (value) => {
|
watch(error, (value) => {
|
||||||
if (value) {
|
if (value) {
|
||||||
console.error('数据获取失败: ', value);
|
console.error('数据获取失败: ', value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleProductionCardClick = (documentId: string) => {
|
const handleProductCardClick = (documentId: string) => {
|
||||||
// 使用路由导航到产品详情页
|
// 使用路由导航到产品详情页
|
||||||
if (documentId) {
|
if (documentId) {
|
||||||
const localePath = useLocalePath();
|
const localePath = useLocalePath();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
router.push(localePath(`/productions/${documentId}`));
|
router.push(localePath(`/products/${documentId}`));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-container">
|
<div class="page-container">
|
||||||
<div v-if="!pending">
|
<div v-if="!pending">
|
||||||
<div v-if="production">
|
<div v-if="product">
|
||||||
<!-- 面包屑导航 -->
|
<!-- 面包屑导航 -->
|
||||||
<el-breadcrumb class="breadcrumb" separator="/">
|
<el-breadcrumb class="breadcrumb" separator="/">
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
@ -10,44 +10,44 @@
|
|||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/productions')">{{
|
<NuxtLink :to="$localePath('/products')">{{
|
||||||
$t('navigation.productions')
|
$t('navigation.products')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item class="text-md opactiy-50">{{
|
<el-breadcrumb-item class="text-md opactiy-50">{{
|
||||||
production.name
|
product.name
|
||||||
}}</el-breadcrumb-item>
|
}}</el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
|
|
||||||
<!-- 产品详情内容 -->
|
<!-- 产品详情内容 -->
|
||||||
<div class="production-header">
|
<div class="product-header">
|
||||||
<div class="production-image">
|
<div class="product-image">
|
||||||
<el-image
|
<el-image
|
||||||
v-if="production.images.length <= 1"
|
v-if="product.images.length <= 1"
|
||||||
:src="getImageUrl(production.images[0].image)"
|
:src="getImageUrl(product.images[0].image)"
|
||||||
:alt="production.name"
|
:alt="product.name"
|
||||||
fit="contain"
|
fit="contain"
|
||||||
/>
|
/>
|
||||||
<el-carousel
|
<el-carousel
|
||||||
v-else
|
v-else
|
||||||
class="production-carousel"
|
class="product-carousel"
|
||||||
height="500px"
|
height="500px"
|
||||||
:autoplay="false"
|
:autoplay="false"
|
||||||
:loop="false"
|
:loop="false"
|
||||||
arrow="always"
|
arrow="always"
|
||||||
>
|
>
|
||||||
<el-carousel-item
|
<el-carousel-item
|
||||||
v-for="(item, index) in production.images || []"
|
v-for="(item, index) in product.images || []"
|
||||||
:key="index"
|
:key="index"
|
||||||
>
|
>
|
||||||
<div class="production-carousel-item">
|
<div class="product-carousel-item">
|
||||||
<el-image
|
<el-image
|
||||||
:src="getImageUrl(item.image || '')"
|
:src="getImageUrl(item.image || '')"
|
||||||
:alt="production.name"
|
:alt="product.name"
|
||||||
fit="contain"
|
fit="contain"
|
||||||
lazy
|
lazy
|
||||||
/>
|
/>
|
||||||
<p v-if="item.caption" class="production-image-caption">
|
<p v-if="item.caption" class="product-image-caption">
|
||||||
{{ item.caption }}
|
{{ item.caption }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@ -55,26 +55,26 @@
|
|||||||
</el-carousel>
|
</el-carousel>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="production-info">
|
<div class="product-info">
|
||||||
<h1>{{ production.name }}</h1>
|
<h1>{{ product.name }}</h1>
|
||||||
<p class="summary">{{ production.summary }}</p>
|
<p class="summary">{{ product.summary }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 产品详细描述 -->
|
<!-- 产品详细描述 -->
|
||||||
<div class="production-content">
|
<div class="product-content">
|
||||||
<el-tabs v-model="activeName" class="production-tabs" stretch>
|
<el-tabs v-model="activeName" class="product-tabs" stretch>
|
||||||
<el-tab-pane label="产品详情" name="details">
|
<el-tab-pane label="产品详情" name="details">
|
||||||
<markdown-renderer :content="production.description || ''" />
|
<markdown-renderer :content="product.description || ''" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="技术规格" name="specs">
|
<el-tab-pane label="技术规格" name="specs">
|
||||||
<spec-table :data="production.specs" />
|
<spec-table :data="product.specs" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="常见问题" name="faq">
|
<el-tab-pane label="常见问题" name="faq">
|
||||||
<question-list :questions="production.faqs" />
|
<question-list :questions="product.faqs" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="相关文档" name="documents">
|
<el-tab-pane label="相关文档" name="documents">
|
||||||
<document-list :documents="production.documents" />
|
<document-list :documents="product.documents" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
@ -87,8 +87,8 @@
|
|||||||
:sub-title="$t('product-not-found-desc')"
|
:sub-title="$t('product-not-found-desc')"
|
||||||
>
|
>
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<el-button type="primary" @click="$router.push('/productions')">
|
<el-button type="primary" @click="$router.push('/products')">
|
||||||
{{ $t('back-to-productions') }}
|
{{ $t('back-to-products') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-result>
|
</el-result>
|
||||||
@ -117,12 +117,12 @@
|
|||||||
|
|
||||||
console.log('Raw Data: ', data.value);
|
console.log('Raw Data: ', data.value);
|
||||||
|
|
||||||
const rawProduction = computed(() => data.value ?? null);
|
const rawProduct = computed(() => data.value ?? null);
|
||||||
const production = computed(() => {
|
const product = computed(() => {
|
||||||
return toProductView(rawProduction.value);
|
return toProductView(rawProduct.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('View Data: ', production.value);
|
console.log('View Data: ', product.value);
|
||||||
|
|
||||||
const activeName = ref('details'); // 默认选中概览标签
|
const activeName = ref('details'); // 默认选中概览标签
|
||||||
|
|
||||||
@ -134,11 +134,11 @@
|
|||||||
|
|
||||||
// SEO
|
// SEO
|
||||||
useHead({
|
useHead({
|
||||||
title: computed(() => production.value?.name || 'Product Detail'),
|
title: computed(() => product.value?.name || 'Product Detail'),
|
||||||
meta: [
|
meta: [
|
||||||
{
|
{
|
||||||
name: 'description',
|
name: 'description',
|
||||||
content: computed(() => production.value?.summary || ''),
|
content: computed(() => product.value?.summary || ''),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
@ -155,20 +155,20 @@
|
|||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-header {
|
.product-header {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 2fr 1fr;
|
grid-template-columns: 2fr 1fr;
|
||||||
gap: 3rem;
|
gap: 3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-image .el-image {
|
.product-image .el-image {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 500px;
|
height: 500px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-image-caption {
|
.product-image-caption {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
/* left: 10%; */
|
/* left: 10%; */
|
||||||
@ -180,7 +180,7 @@
|
|||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-carousel :deep(.el-carousel__button) {
|
.product-carousel :deep(.el-carousel__button) {
|
||||||
/* 指示器按钮样式 */
|
/* 指示器按钮样式 */
|
||||||
width: 8px;
|
width: 8px;
|
||||||
height: 8px;
|
height: 8px;
|
||||||
@ -189,7 +189,7 @@
|
|||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-info h1 {
|
.product-info h1 {
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
@ -202,16 +202,16 @@
|
|||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-tabs ::v-deep(.el-tabs__nav) {
|
.product-tabs ::v-deep(.el-tabs__nav) {
|
||||||
min-width: 30%;
|
min-width: 30%;
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-tabs ::v-deep(.el-tabs__content) {
|
.product-tabs ::v-deep(.el-tabs__content) {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-content h2 {
|
.product-content h2 {
|
||||||
color: var(--el-text-color-primary);
|
color: var(--el-text-color-primary);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
@ -232,12 +232,12 @@
|
|||||||
|
|
||||||
/* 响应式设计 */
|
/* 响应式设计 */
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.production-header {
|
.product-header {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
gap: 2rem;
|
gap: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-info h1 {
|
.product-info h1 {
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-container">
|
<div class="page-container">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1 class="page-title">{{ $t('our-productions') }}</h1>
|
<h1 class="page-title">{{ $t('our-products') }}</h1>
|
||||||
<el-breadcrumb class="breadcrumb">
|
<el-breadcrumb class="breadcrumb">
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/')">{{
|
<NuxtLink :to="$localePath('/')">{{
|
||||||
@ -9,29 +9,29 @@
|
|||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/productions')">{{
|
<NuxtLink :to="$localePath('/products')">{{
|
||||||
$t('navigation.productions')
|
$t('navigation.products')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!pending" class="page-content">
|
<div v-if="!pending" class="page-content">
|
||||||
<div class="productions-container">
|
<div class="products-container">
|
||||||
<el-collapse v-model="activeNames" class="production-collapse">
|
<el-collapse v-model="activeNames" class="product-collapse">
|
||||||
<el-collapse-item
|
<el-collapse-item
|
||||||
v-for="(group, type) in groupedProductions"
|
v-for="(group, type) in groupedProducts"
|
||||||
:key="type"
|
:key="type"
|
||||||
:title="type || '未分类'"
|
:title="type || '未分类'"
|
||||||
:name="type || 'no-category'"
|
:name="type || 'no-category'"
|
||||||
>
|
>
|
||||||
<div class="group-list">
|
<div class="group-list">
|
||||||
<production-card
|
<product-card
|
||||||
v-for="production in group"
|
v-for="product in group"
|
||||||
:key="production.id"
|
:key="product.id"
|
||||||
:slug="production.id.toString()"
|
:slug="product.id.toString()"
|
||||||
:image-url="getImageUrl(production.cover.toString())"
|
:image-url="getImageUrl(product.cover.toString())"
|
||||||
:name="production.name"
|
:name="product.name"
|
||||||
:description="production.summary || ''"
|
:description="product.summary || ''"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
@ -51,16 +51,16 @@
|
|||||||
|
|
||||||
const activeNames = ref<string[]>([]);
|
const activeNames = ref<string[]>([]);
|
||||||
|
|
||||||
const productionsRaw = computed(() => data.value ?? []);
|
const productsRaw = computed(() => data.value ?? []);
|
||||||
const productions = computed(() =>
|
const products = computed(() =>
|
||||||
productionsRaw.value.map((item) => toProductListView(item))
|
productsRaw.value.map((item) => toProductListView(item))
|
||||||
);
|
);
|
||||||
|
|
||||||
// 按类型分组
|
// 按类型分组
|
||||||
// 兼容 production_type 既可能为对象也可能为字符串
|
// 兼容 product_type 既可能为对象也可能为字符串
|
||||||
const groupedProductions = computed(() => {
|
const groupedProducts = computed(() => {
|
||||||
const groups: Record<string, ProductListView[]> = {};
|
const groups: Record<string, ProductListView[]> = {};
|
||||||
for (const prod of productions.value) {
|
for (const prod of products.value) {
|
||||||
let typeKey = '';
|
let typeKey = '';
|
||||||
if (typeof prod.product_type === 'string') {
|
if (typeof prod.product_type === 'string') {
|
||||||
typeKey = prod.product_type;
|
typeKey = prod.product_type;
|
||||||
@ -78,10 +78,10 @@
|
|||||||
return groups;
|
return groups;
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(groupedProductions, () => {
|
watch(groupedProducts, () => {
|
||||||
if (groupedProductions.value) {
|
if (groupedProducts.value) {
|
||||||
activeNames.value = [
|
activeNames.value = [
|
||||||
...Object.keys(groupedProductions.value),
|
...Object.keys(groupedProducts.value),
|
||||||
'no-category',
|
'no-category',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -100,9 +100,9 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
if (groupedProductions.value) {
|
if (groupedProducts.value) {
|
||||||
activeNames.value = [
|
activeNames.value = [
|
||||||
...Object.keys(groupedProductions.value),
|
...Object.keys(groupedProducts.value),
|
||||||
'no-category',
|
'no-category',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -131,13 +131,13 @@
|
|||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.productions-container {
|
.products-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 40px;
|
gap: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-group {
|
.product-group {
|
||||||
margin-bottom: 32px;
|
margin-bottom: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,17 +30,17 @@
|
|||||||
<el-tab-pane :label="`全部(${resultCount['all']})`" name="all">
|
<el-tab-pane :label="`全部(${resultCount['all']})`" name="all">
|
||||||
<search-results
|
<search-results
|
||||||
v-model:current-page="currentPage"
|
v-model:current-page="currentPage"
|
||||||
:hit-items="hits"
|
:search-items="searchItems"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane
|
<el-tab-pane
|
||||||
:label="`产品(${resultCount['production'] || 0})`"
|
:label="`产品(${resultCount['product'] || 0})`"
|
||||||
name="production"
|
name="product"
|
||||||
>
|
>
|
||||||
<search-results
|
<search-results
|
||||||
v-model:current-page="currentPage"
|
v-model:current-page="currentPage"
|
||||||
:hit-items="hits"
|
:search-items="searchItems"
|
||||||
category="production"
|
category="product"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane
|
<el-tab-pane
|
||||||
@ -49,7 +49,7 @@
|
|||||||
>
|
>
|
||||||
<search-results
|
<search-results
|
||||||
v-model:current-page="currentPage"
|
v-model:current-page="currentPage"
|
||||||
:hit-items="hits"
|
:search-items="searchItems"
|
||||||
category="solution"
|
category="solution"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@ -59,7 +59,7 @@
|
|||||||
>
|
>
|
||||||
<search-results
|
<search-results
|
||||||
v-model:current-page="currentPage"
|
v-model:current-page="currentPage"
|
||||||
:hit-items="hits"
|
:search-items="searchItems"
|
||||||
category="question"
|
category="question"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@ -69,7 +69,7 @@
|
|||||||
>
|
>
|
||||||
<search-results
|
<search-results
|
||||||
v-model:current-page="currentPage"
|
v-model:current-page="currentPage"
|
||||||
:hit-items="hits"
|
:search-items="searchItems"
|
||||||
category="document"
|
category="document"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@ -92,8 +92,8 @@
|
|||||||
|
|
||||||
// i18n相关
|
// i18n相关
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { getStrapiLocale } = useLocalizations();
|
const { getDirectusLocale } = useLocalizations();
|
||||||
const strapiLocale = getStrapiLocale();
|
const directusLocale = getDirectusLocale();
|
||||||
|
|
||||||
// 路由相关
|
// 路由相关
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
@ -110,40 +110,48 @@
|
|||||||
pending: loading,
|
pending: loading,
|
||||||
error,
|
error,
|
||||||
} = await useAsyncData(
|
} = await useAsyncData(
|
||||||
() => `search-${route.query.query ?? ''}`,
|
() => `search-${directusLocale}-${route.query.query ?? ''}`,
|
||||||
async () => {
|
async () => {
|
||||||
const q = String(route.query.query ?? '').trim();
|
const q = String(route.query.query ?? '').trim();
|
||||||
if (!q) return [];
|
if (!q) return [];
|
||||||
return await search(q, { limit: 12 });
|
return await search(q, { limit: 12 }, directusLocale);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// 本地化+空Section过滤
|
// 空Section过滤
|
||||||
const filteredSections = computed(() =>
|
const filteredSections = computed(() =>
|
||||||
sections.value
|
sections.value.filter((section) => section.hits.length > 0)
|
||||||
.map((section) => ({
|
|
||||||
...section,
|
|
||||||
hits: section.hits.filter(
|
|
||||||
(hit) =>
|
|
||||||
!hit.locale ||
|
|
||||||
String(hit.locale).toLowerCase() === strapiLocale.toLowerCase()
|
|
||||||
),
|
|
||||||
}))
|
|
||||||
.filter((section) => section.hits.length > 0)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const typeMap = {
|
||||||
|
products: 'products',
|
||||||
|
solutions: 'solutions',
|
||||||
|
questions: 'questions',
|
||||||
|
product_documents: 'product_documents',
|
||||||
|
} as const;
|
||||||
// 展平hits
|
// 展平hits
|
||||||
const hits = computed(() =>
|
const hits = computed(() =>
|
||||||
filteredSections.value.flatMap((item) =>
|
filteredSections.value.flatMap((section) => {
|
||||||
item.hits.map((content) => ({ content, type: item.indexUid }))
|
const type = typeMap[section.rawIndex as keyof typeof typeMap];
|
||||||
)
|
if (!type) return [];
|
||||||
|
return section.hits.map((hit) => ({ type, content: hit }));
|
||||||
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const searchItems = computed(() =>
|
||||||
|
hits.value.map((hit) => {
|
||||||
|
return toSearchItemView(hit.content, hit.type);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log(searchItems.value);
|
||||||
|
|
||||||
// 分类控制
|
// 分类控制
|
||||||
const activeTab = ref('all');
|
const activeTab = ref('all');
|
||||||
const resultCount = computed(() => {
|
const resultCount = computed(() => {
|
||||||
const map: Record<string, number> = { all: hits.value.length };
|
const map: Record<string, number> = { all: searchItems.value.length };
|
||||||
for (const hit of hits.value) {
|
for (const item of searchItems.value) {
|
||||||
map[hit.type] = (map[hit.type] ?? 0) + 1;
|
map[item.type] = (map[item.type] ?? 0) + 1;
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
});
|
});
|
||||||
@ -177,7 +185,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const results = await search(trimmed, { limit: 12 });
|
const results = await search(trimmed, { limit: 12 }, directusLocale);
|
||||||
if (requestId === activeRequestId.value) {
|
if (requestId === activeRequestId.value) {
|
||||||
sections.value = results;
|
sections.value = results;
|
||||||
}
|
}
|
||||||
@ -199,10 +207,10 @@
|
|||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => route.query.query,
|
() => route.query.query,
|
||||||
(newQuery) => {
|
async (newQuery) => {
|
||||||
if (typeof newQuery === 'string' && newQuery.trim()) {
|
if (typeof newQuery === 'string' && newQuery.trim()) {
|
||||||
keyword.value = newQuery;
|
keyword.value = newQuery;
|
||||||
performSearch(newQuery);
|
await performSearch(newQuery);
|
||||||
} else {
|
} else {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
:sub-title="$t('solution-not-found-desc')"
|
:sub-title="$t('solution-not-found-desc')"
|
||||||
>
|
>
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<el-button type="primary" @click="$router.push('/productions')">
|
<el-button type="primary" @click="$router.push('/solutions')">
|
||||||
{{ $t('back-to-solutions') }}
|
{{ $t('back-to-solutions') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="!pending" class="page-content">
|
<div v-if="!pending" class="page-content">
|
||||||
<markdown-renderer :content="content || ''" />
|
<markdown-renderer :content="content.content || ''" />
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="loading">
|
<div v-else class="loading">
|
||||||
<el-skeleton :rows="5" animated />
|
<el-skeleton :rows="5" animated />
|
||||||
@ -32,18 +32,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { findOne } = useStrapi();
|
const { data, pending, error } = await useContactInfo();
|
||||||
const { getStrapiLocale } = useLocalizations();
|
|
||||||
const strapiLocale = getStrapiLocale();
|
|
||||||
|
|
||||||
const { data, pending, error } = useAsyncData('contact-info', () =>
|
const content = computed(() => toContactInfoView(data.value));
|
||||||
findOne<StrapiContactInfo>('contact-info', undefined, {
|
|
||||||
populate: '*',
|
|
||||||
locale: strapiLocale,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const content = computed(() => data.value?.data.content ?? '');
|
|
||||||
|
|
||||||
watch(error, (value) => {
|
watch(error, (value) => {
|
||||||
if (value) {
|
if (value) {
|
||||||
|
|||||||
@ -28,22 +28,22 @@
|
|||||||
<div class="document-category">
|
<div class="document-category">
|
||||||
<el-select v-model="selectedType" placeholder="选择产品类型" clearable>
|
<el-select v-model="selectedType" placeholder="选择产品类型" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="type in productionTypeOptions"
|
v-for="type in productTypeOptions"
|
||||||
:key="type.documentId"
|
:key="type.id"
|
||||||
:label="type.type"
|
:label="type.name"
|
||||||
:value="type.documentId"
|
:value="type.id"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="selectedProduction"
|
v-model="selectedProduct"
|
||||||
placeholder="选择系列产品"
|
placeholder="选择系列产品"
|
||||||
clearable
|
clearable
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="production in productionOptions"
|
v-for="product in productOptions"
|
||||||
:key="production.documentId"
|
:key="product.id"
|
||||||
:label="production.title"
|
:label="product.name"
|
||||||
:value="production.documentId"
|
:value="product.id"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input
|
<el-input
|
||||||
@ -63,37 +63,24 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Search } from '@element-plus/icons-vue';
|
import { Search } from '@element-plus/icons-vue';
|
||||||
|
|
||||||
const { find } = useStrapi();
|
const { data, pending, error } = await useDocumentList();
|
||||||
const { getStrapiLocale } = useLocalizations();
|
|
||||||
const strapiLocale = getStrapiLocale();
|
|
||||||
|
|
||||||
const { data, pending, error } = useAsyncData('documents', () =>
|
const documents = computed(
|
||||||
find<ProductionDocument>('production-documents', {
|
() => data?.value.map((item) => toDocumentListView(item)) ?? []
|
||||||
populate: ['document', 'related_productions.production_type'],
|
|
||||||
locale: strapiLocale,
|
|
||||||
})
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// const documents = computed(
|
|
||||||
// () =>
|
|
||||||
// data.value?.data.map((item) => ({
|
|
||||||
// ...item.document,
|
|
||||||
// })) || []
|
|
||||||
// );
|
|
||||||
const documents = computed(() => data.value?.data ?? []);
|
|
||||||
|
|
||||||
const keyword = ref('');
|
const keyword = ref('');
|
||||||
|
|
||||||
const selectedType = ref<string | null>(null);
|
const selectedType = ref<number | null>(null);
|
||||||
const selectedProduction = ref<string | null>(null);
|
const selectedProduct = ref<number | null>(null);
|
||||||
|
|
||||||
const productionTypeOptions = computed(() => {
|
const productTypeOptions = computed(() => {
|
||||||
const types: ProductionType[] = [];
|
const types: DocumentListProductType[] = [];
|
||||||
documents.value.forEach((document: ProductionDocument) => {
|
documents.value.forEach((doc: DocumentListView) => {
|
||||||
document.related_productions?.forEach((production: Production) => {
|
doc.products?.forEach((product: DocumentListProduct) => {
|
||||||
const productionType = production?.production_type;
|
const productType = product.type;
|
||||||
if (!types.some((p) => p.documentId === productionType.documentId)) {
|
if (!types.some((item) => item.id === productType.id)) {
|
||||||
types.push(productionType);
|
types.push(productType);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -101,51 +88,48 @@
|
|||||||
return types;
|
return types;
|
||||||
});
|
});
|
||||||
|
|
||||||
const productionOptions = computed(() => {
|
const productOptions = computed(() => {
|
||||||
if (!selectedType.value) return [];
|
if (!selectedType.value) return [];
|
||||||
const productions: Production[] = [];
|
const products: DocumentListProduct[] = [];
|
||||||
documents.value.forEach((document: ProductionDocument) => {
|
|
||||||
document.related_productions.forEach((production: Production) => {
|
documents.value.forEach((doc: DocumentListView) => {
|
||||||
|
doc.products?.forEach((product: DocumentListProduct) => {
|
||||||
if (
|
if (
|
||||||
production.production_type?.documentId === selectedType.value &&
|
product.type.id === selectedType.value &&
|
||||||
!productions.some((p) => p.documentId === production.documentId)
|
!products.some((item) => item.id === product.id)
|
||||||
) {
|
) {
|
||||||
productions.push(production);
|
products.push(product);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return productions;
|
|
||||||
|
return products;
|
||||||
});
|
});
|
||||||
|
|
||||||
const filteredDocuments = computed(() =>
|
const filteredDocuments = computed(() =>
|
||||||
documents.value
|
documents.value.filter((doc: DocumentListView) => {
|
||||||
.filter((document: ProductionDocument) => {
|
const matchProduct = selectedProduct.value
|
||||||
const matchProduction = selectedProduction.value
|
? doc.products?.some(
|
||||||
? document.related_productions?.some(
|
(product: DocumentListProduct) =>
|
||||||
(production: Production) =>
|
product.id === selectedProduct.value
|
||||||
production.documentId === selectedProduction.value
|
|
||||||
)
|
)
|
||||||
: selectedType.value
|
: selectedType.value
|
||||||
? document.related_productions?.some(
|
? doc.products?.some(
|
||||||
(production: Production) =>
|
(product: DocumentListProduct) =>
|
||||||
production.production_type?.documentId === selectedType.value
|
product.type?.id === selectedType.value
|
||||||
)
|
)
|
||||||
: true;
|
: true;
|
||||||
|
|
||||||
const matchKeyword = keyword.value
|
const matchKeyword = keyword.value
|
||||||
? document.document.caption &&
|
? doc.title && doc.title.includes(keyword.value)
|
||||||
document.document.caption.includes(keyword.value)
|
|
||||||
: true;
|
: true;
|
||||||
|
|
||||||
return matchProduction && matchKeyword;
|
return matchProduct && matchKeyword;
|
||||||
})
|
})
|
||||||
.map((item) => ({
|
|
||||||
...item.document,
|
|
||||||
}))
|
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(selectedType, () => {
|
watch(selectedType, () => {
|
||||||
selectedProduction.value = null;
|
selectedProduct.value = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(documents, (value) => {
|
watch(documents, (value) => {
|
||||||
|
|||||||
@ -34,18 +34,14 @@
|
|||||||
:value="type.id"
|
:value="type.id"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-select
|
<el-sel v-model="selectedProduct" placeholder="选择系列产品" clearable>
|
||||||
v-model="selectedProduct"
|
|
||||||
placeholder="选择系列产品"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="production in productOptions"
|
v-for="product in productOptions"
|
||||||
:key="production.id"
|
:key="product.id"
|
||||||
:label="production.name"
|
:label="product.name"
|
||||||
:value="production.id"
|
:value="product.id"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-sel>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="keyword"
|
v-model="keyword"
|
||||||
placeholder="输入关键词..."
|
placeholder="输入关键词..."
|
||||||
@ -105,7 +101,7 @@
|
|||||||
|
|
||||||
const filteredQuestions = computed(() => {
|
const filteredQuestions = computed(() => {
|
||||||
return questions.value.filter((question: QuestionListView) => {
|
return questions.value.filter((question: QuestionListView) => {
|
||||||
const matchProduction = selectedProduct.value
|
const matchProduct = selectedProduct.value
|
||||||
? question.products?.some(
|
? question.products?.some(
|
||||||
(product: QuestionListProduct) =>
|
(product: QuestionListProduct) =>
|
||||||
product.id === selectedProduct.value
|
product.id === selectedProduct.value
|
||||||
@ -122,7 +118,7 @@
|
|||||||
(question.content && question.content.includes(keyword.value))
|
(question.content && question.content.includes(keyword.value))
|
||||||
: true;
|
: true;
|
||||||
|
|
||||||
return matchProduction && matchKeyword;
|
return matchProduct && matchKeyword;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ export interface CompanyProfileTranslation {
|
|||||||
id: number;
|
id: number;
|
||||||
company_profile_id?: CompanyProfile | string | null;
|
company_profile_id?: CompanyProfile | string | null;
|
||||||
languages_code?: Language | string | null;
|
languages_code?: Language | string | null;
|
||||||
content?: 'json' | null;
|
content?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ContactInfo {
|
export interface ContactInfo {
|
||||||
@ -23,7 +23,7 @@ export interface ContactInfoTranslation {
|
|||||||
id: number;
|
id: number;
|
||||||
contact_info_id?: ContactInfo | string | null;
|
contact_info_id?: ContactInfo | string | null;
|
||||||
languages_code?: Language | string | null;
|
languages_code?: Language | string | null;
|
||||||
content?: 'json' | null;
|
content?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DocumentsTranslation {
|
export interface DocumentsTranslation {
|
||||||
|
|||||||
2
app/types/meilisearch/index.ts
Normal file
2
app/types/meilisearch/index.ts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export * from './meili-index';
|
||||||
|
export * from './search-result';
|
||||||
88
app/types/meilisearch/meili-index.ts
Normal file
88
app/types/meilisearch/meili-index.ts
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
/**
|
||||||
|
* 产品索引文档结构
|
||||||
|
*/
|
||||||
|
export interface MeiliProductIndex {
|
||||||
|
/** 唯一标识符 **/
|
||||||
|
id: number;
|
||||||
|
|
||||||
|
/** 产品名称 **/
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
/** 产品简介 **/
|
||||||
|
summary: string;
|
||||||
|
|
||||||
|
/** 产品详情 **/
|
||||||
|
description: string;
|
||||||
|
|
||||||
|
/** 产品类型 **/
|
||||||
|
type: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解决方案索引文档结构
|
||||||
|
*/
|
||||||
|
export interface MeiliSolutionIndex {
|
||||||
|
/** 唯一标识符 **/
|
||||||
|
id: number;
|
||||||
|
|
||||||
|
/** 解决方案标题 **/
|
||||||
|
title: string;
|
||||||
|
|
||||||
|
/** 解决方案摘要 **/
|
||||||
|
summary: string;
|
||||||
|
|
||||||
|
/** 解决方案内容 **/
|
||||||
|
content: string;
|
||||||
|
|
||||||
|
/** 解决方案类型 **/
|
||||||
|
type: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相关问题索引文档结构
|
||||||
|
*/
|
||||||
|
export interface MeiliQuestionIndex {
|
||||||
|
/** 唯一标识符 **/
|
||||||
|
id: number;
|
||||||
|
|
||||||
|
/** 问题标题 **/
|
||||||
|
title: string;
|
||||||
|
|
||||||
|
/** 问题内容 **/
|
||||||
|
content: string;
|
||||||
|
|
||||||
|
/** 相关产品 **/
|
||||||
|
products: string[];
|
||||||
|
|
||||||
|
/** 相关产品类型 **/
|
||||||
|
product_types: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相关文档索引文档结构
|
||||||
|
*/
|
||||||
|
export interface MeiliProductDocumentIndex {
|
||||||
|
/** 唯一标识符 **/
|
||||||
|
id: number;
|
||||||
|
|
||||||
|
/** 文档标题 **/
|
||||||
|
title: string;
|
||||||
|
|
||||||
|
/** 相关产品 **/
|
||||||
|
products: string[];
|
||||||
|
|
||||||
|
/** 相关产品类型 **/
|
||||||
|
product_types: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 索引名与类型映射
|
||||||
|
*/
|
||||||
|
export interface MeiliIndexMap {
|
||||||
|
products: MeiliProductIndex;
|
||||||
|
solutions: MeiliSolutionIndex;
|
||||||
|
questions: MeiliQuestionIndex;
|
||||||
|
product_documents: MeiliProductDocumentIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type MeiliSearchItemType = keyof MeiliIndexMap;
|
||||||
42
app/types/meilisearch/search-result.ts
Normal file
42
app/types/meilisearch/search-result.ts
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
import type { SearchResponse } from 'meilisearch';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原始搜索分段结果
|
||||||
|
* @template T 索引类型
|
||||||
|
*/
|
||||||
|
export interface RawSearchSection<T> {
|
||||||
|
/** 索引名 **/
|
||||||
|
indexUid: string;
|
||||||
|
|
||||||
|
/** 响应数据 **/
|
||||||
|
response: SearchResponse<T>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索结果
|
||||||
|
*/
|
||||||
|
export interface SearchHit extends Record<string, unknown> {
|
||||||
|
objectID?: string | number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索分段结果
|
||||||
|
* @template T 索引类型
|
||||||
|
*/
|
||||||
|
export interface SearchSection<T> {
|
||||||
|
/** 索引名 **/
|
||||||
|
indexUid: string;
|
||||||
|
|
||||||
|
/** 原始索引名 **/
|
||||||
|
rawIndex: MeiliSearchItemType;
|
||||||
|
|
||||||
|
/** 命中条目 **/
|
||||||
|
hits: T[];
|
||||||
|
// hits: SearchHit[];
|
||||||
|
|
||||||
|
/** 条目总数 **/
|
||||||
|
estimatedTotalHits: number;
|
||||||
|
|
||||||
|
/** 处理时间 **/
|
||||||
|
processingTimeMs: number;
|
||||||
|
}
|
||||||
@ -1,53 +0,0 @@
|
|||||||
export interface StrapiEntity {
|
|
||||||
id: number;
|
|
||||||
documentId: string;
|
|
||||||
createdAt: string;
|
|
||||||
updatedAt: string;
|
|
||||||
publishedAt: string;
|
|
||||||
locale: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StrapiMedia {
|
|
||||||
id: number;
|
|
||||||
url: string;
|
|
||||||
ext: string;
|
|
||||||
name: string;
|
|
||||||
size: number;
|
|
||||||
alternativeText: string;
|
|
||||||
caption: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StrapiImageFormat {
|
|
||||||
url: string;
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
size: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StrapiImage extends StrapiMedia {
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
formats: {
|
|
||||||
small: StrapiImageFormat;
|
|
||||||
medium: StrapiImageFormat;
|
|
||||||
thumbnail: StrapiImageFormat;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StrapiResponse<T> {
|
|
||||||
data: T;
|
|
||||||
meta: {
|
|
||||||
pagination: {
|
|
||||||
page: number;
|
|
||||||
pageSize: number;
|
|
||||||
pageCount: number;
|
|
||||||
total: number;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export type StrapiRelation<T, K extends keyof T = never> = Omit<
|
|
||||||
T,
|
|
||||||
K | keyof StrapiEntity
|
|
||||||
> &
|
|
||||||
StrapiEntity;
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
export * from './common';
|
|
||||||
export * from './production';
|
|
||||||
export * from './singleTypes';
|
|
||||||
export * from './solution';
|
|
||||||
export * from './question';
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
import type {
|
|
||||||
StrapiEntity,
|
|
||||||
StrapiImage,
|
|
||||||
StrapiMedia,
|
|
||||||
StrapiRelation,
|
|
||||||
} from './common';
|
|
||||||
|
|
||||||
export interface ProductionType extends StrapiEntity {
|
|
||||||
type: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ProductionSpecItem {
|
|
||||||
label: string;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ProductionSpecGroup {
|
|
||||||
title: string;
|
|
||||||
items: ProductionSpecItem[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Production extends StrapiEntity {
|
|
||||||
title: string;
|
|
||||||
summary: string;
|
|
||||||
production_type: ProductionType;
|
|
||||||
cover: StrapiImage;
|
|
||||||
production_images: StrapiImage[];
|
|
||||||
production_details: string;
|
|
||||||
production_specs: ProductionSpecGroup[];
|
|
||||||
production_documents: StrapiRelation<
|
|
||||||
ProductionDocument,
|
|
||||||
'related_productions'
|
|
||||||
>[];
|
|
||||||
questions: StrapiRelation<Question, 'related_productions'>[];
|
|
||||||
show_in_production_list: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ProductionDocument extends StrapiEntity {
|
|
||||||
document: StrapiMedia;
|
|
||||||
related_productions: StrapiRelation<Production, 'production_documents'>[];
|
|
||||||
}
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
export interface Question extends StrapiEntity {
|
|
||||||
title: string;
|
|
||||||
content: string;
|
|
||||||
related_productions: StrapiRelation<Production, 'questions'>[];
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
export interface StrapiCompanyProfile extends StrapiEntity {
|
|
||||||
content: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StrapiContactInfo extends StrapiEntity {
|
|
||||||
content: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StrapiHomepage extends StrapiEntity {
|
|
||||||
carousel: StrapiImage[];
|
|
||||||
recommend_productions: StrapiRelation<Production>[];
|
|
||||||
recommend_solutions: StrapiRelation<Solution>[];
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
import type { StrapiEntity, StrapiImage } from './common';
|
|
||||||
|
|
||||||
export interface SolutionType extends StrapiEntity {
|
|
||||||
type: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Solution extends StrapiEntity {
|
|
||||||
title: string;
|
|
||||||
summary: string;
|
|
||||||
cover: StrapiImage;
|
|
||||||
solution_type: SolutionType;
|
|
||||||
content: string;
|
|
||||||
}
|
|
||||||
@ -12,7 +12,7 @@
|
|||||||
"no-query": "Enter a keyword to start searching.",
|
"no-query": "Enter a keyword to start searching.",
|
||||||
"untitled": "Untitled",
|
"untitled": "Untitled",
|
||||||
"sections": {
|
"sections": {
|
||||||
"production": "Products",
|
"product": "Products",
|
||||||
"solution": "Solutions",
|
"solution": "Solutions",
|
||||||
"support": "Support",
|
"support": "Support",
|
||||||
"default": "Other"
|
"default": "Other"
|
||||||
@ -21,14 +21,14 @@
|
|||||||
"company-name": "Jinshen Machinary Manufacturing Co., Ltd.",
|
"company-name": "Jinshen Machinary Manufacturing Co., Ltd.",
|
||||||
"company-description": "We specialize in manufacturing a range of paper tube and can equipment, integrating design, manufacturing, sales, and service.",
|
"company-description": "We specialize in manufacturing a range of paper tube and can equipment, integrating design, manufacturing, sales, and service.",
|
||||||
"learn-more": "Learn More",
|
"learn-more": "Learn More",
|
||||||
"productions-desc": "We provide high-quality product solutions to meet various business needs.",
|
"products-desc": "We provide high-quality product solutions to meet various business needs.",
|
||||||
"solutions-desc": "Providing customized technology solutions for enterprises to accelerate digital transformation.",
|
"solutions-desc": "Providing customized technology solutions for enterprises to accelerate digital transformation.",
|
||||||
"support-desc": "24/7 professional technical support to ensure stable operation of your business.",
|
"support-desc": "24/7 professional technical support to ensure stable operation of your business.",
|
||||||
"quick-links": "Quick Links",
|
"quick-links": "Quick Links",
|
||||||
"utilities": "Utilities",
|
"utilities": "Utilities",
|
||||||
"navigation": {
|
"navigation": {
|
||||||
"home": "Home",
|
"home": "Home",
|
||||||
"productions": "Productions",
|
"products": "Products",
|
||||||
"solutions": "Solutions",
|
"solutions": "Solutions",
|
||||||
"support": "Support",
|
"support": "Support",
|
||||||
"about-us": "About Us",
|
"about-us": "About Us",
|
||||||
@ -50,13 +50,13 @@
|
|||||||
"product-details": "Product Details",
|
"product-details": "Product Details",
|
||||||
"product-not-found": "Product Not Found",
|
"product-not-found": "Product Not Found",
|
||||||
"product-not-found-desc": "Sorry, the product you are looking for does not exist or has been removed.",
|
"product-not-found-desc": "Sorry, the product you are looking for does not exist or has been removed.",
|
||||||
"back-to-productions": "Back to Products",
|
"back-to-products": "Back to Products",
|
||||||
"solution-not-found": "Solution Not Found",
|
"solution-not-found": "Solution Not Found",
|
||||||
"solution-not-found-desc": "Sorry, the solution you are lokking for does not exist or has been removed.",
|
"solution-not-found-desc": "Sorry, the solution you are lokking for does not exist or has been removed.",
|
||||||
"back-to-solutions": "Back to Solutions",
|
"back-to-solutions": "Back to Solutions",
|
||||||
"no-content-available": "No detailed information available",
|
"no-content-available": "No detailed information available",
|
||||||
"loading": "Loading...",
|
"loading": "Loading...",
|
||||||
"our-productions": "Our Productions",
|
"our-products": "Our Products",
|
||||||
"learn-our-solutions": "Learn Our Solutions",
|
"learn-our-solutions": "Learn Our Solutions",
|
||||||
"all": "All"
|
"all": "All"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
"no-query": "请输入关键字开始搜索。",
|
"no-query": "请输入关键字开始搜索。",
|
||||||
"untitled": "未命名条目",
|
"untitled": "未命名条目",
|
||||||
"sections": {
|
"sections": {
|
||||||
"production": "产品",
|
"product": "产品",
|
||||||
"solution": "解决方案",
|
"solution": "解决方案",
|
||||||
"support": "服务支持",
|
"support": "服务支持",
|
||||||
"default": "其他内容"
|
"default": "其他内容"
|
||||||
@ -21,14 +21,14 @@
|
|||||||
"company-name": "金申机械制造有限公司",
|
"company-name": "金申机械制造有限公司",
|
||||||
"company-description": "专业生产一系列纸管、纸罐设备,集设计、制造、销售、服务于一体。",
|
"company-description": "专业生产一系列纸管、纸罐设备,集设计、制造、销售、服务于一体。",
|
||||||
"learn-more": "了解更多",
|
"learn-more": "了解更多",
|
||||||
"productions-desc": "我们提供高质量的产品解决方案,满足各种业务需求。",
|
"products-desc": "我们提供高质量的产品解决方案,满足各种业务需求。",
|
||||||
"solutions-desc": "为企业提供定制化的技术解决方案,助力数字化转型。",
|
"solutions-desc": "为企业提供定制化的技术解决方案,助力数字化转型。",
|
||||||
"support-desc": "7x24小时专业技术支持,确保您的业务稳定运行。",
|
"support-desc": "7x24小时专业技术支持,确保您的业务稳定运行。",
|
||||||
"quick-links": "快速链接",
|
"quick-links": "快速链接",
|
||||||
"utilities": "实用工具",
|
"utilities": "实用工具",
|
||||||
"navigation": {
|
"navigation": {
|
||||||
"home": "主页",
|
"home": "主页",
|
||||||
"productions": "产品中心",
|
"products": "产品中心",
|
||||||
"solutions": "解决方案",
|
"solutions": "解决方案",
|
||||||
"support": "服务支持",
|
"support": "服务支持",
|
||||||
"about-us": "关于我们",
|
"about-us": "关于我们",
|
||||||
@ -50,13 +50,13 @@
|
|||||||
"product-details": "产品详情",
|
"product-details": "产品详情",
|
||||||
"product-not-found": "产品未找到",
|
"product-not-found": "产品未找到",
|
||||||
"product-not-found-desc": "抱歉,您访问的产品不存在或已被删除。",
|
"product-not-found-desc": "抱歉,您访问的产品不存在或已被删除。",
|
||||||
"back-to-productions": "返回产品列表",
|
"back-to-products": "返回产品列表",
|
||||||
"solution-not-found": "解决方案未找到",
|
"solution-not-found": "解决方案未找到",
|
||||||
"solution-not-found-desc": "抱歉,您访问的解决方案不存在或已被删除",
|
"solution-not-found-desc": "抱歉,您访问的解决方案不存在或已被删除",
|
||||||
"back-to-solutions": "返回解决方案列表",
|
"back-to-solutions": "返回解决方案列表",
|
||||||
"no-content-available": "暂无详细信息",
|
"no-content-available": "暂无详细信息",
|
||||||
"loading": "加载中...",
|
"loading": "加载中...",
|
||||||
"our-productions": "我们的产品",
|
"our-products": "我们的产品",
|
||||||
"learn-our-solutions": "了解我们的解决方案",
|
"learn-our-solutions": "了解我们的解决方案",
|
||||||
"all": "全部"
|
"all": "全部"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,16 +27,7 @@ export default defineNuxtConfig({
|
|||||||
? typeof process.env.MEILI_SEARCH_INDEXES === 'string'
|
? typeof process.env.MEILI_SEARCH_INDEXES === 'string'
|
||||||
? process.env.MEILI_SEARCH_INDEXES.split(',').map((i) => i.trim())
|
? process.env.MEILI_SEARCH_INDEXES.split(',').map((i) => i.trim())
|
||||||
: process.env.MEILI_SEARCH_INDEXES
|
: process.env.MEILI_SEARCH_INDEXES
|
||||||
: ['production', 'solution'],
|
: ['products', 'solutions', 'questions', 'product_documents'],
|
||||||
},
|
|
||||||
strapi: {
|
|
||||||
url: process.env.STRAPI_URL || 'http://localhost:1337',
|
|
||||||
token: process.env.STRAPI_TOKEN || undefined,
|
|
||||||
prefix: '/api',
|
|
||||||
admin: '/admin',
|
|
||||||
version: 'v5',
|
|
||||||
cookie: {},
|
|
||||||
cookieName: 'strapi_jwt',
|
|
||||||
},
|
},
|
||||||
directus: {
|
directus: {
|
||||||
url: process.env.DIRECTUS_URL || 'http://localhost:8055',
|
url: process.env.DIRECTUS_URL || 'http://localhost:8055',
|
||||||
@ -132,6 +123,5 @@ export default defineNuxtConfig({
|
|||||||
'@unocss/nuxt',
|
'@unocss/nuxt',
|
||||||
'@element-plus/nuxt',
|
'@element-plus/nuxt',
|
||||||
'@nuxtjs/i18n',
|
'@nuxtjs/i18n',
|
||||||
'@nuxtjs/strapi',
|
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|||||||
@ -19,7 +19,6 @@
|
|||||||
"@nuxt/image": "1.11.0",
|
"@nuxt/image": "1.11.0",
|
||||||
"@nuxt/test-utils": "3.19.2",
|
"@nuxt/test-utils": "3.19.2",
|
||||||
"@nuxtjs/i18n": "10.0.5",
|
"@nuxtjs/i18n": "10.0.5",
|
||||||
"@nuxtjs/strapi": "2.1.1",
|
|
||||||
"@pinia/nuxt": "^0.11.2",
|
"@pinia/nuxt": "^0.11.2",
|
||||||
"@types/markdown-it": "^14.1.2",
|
"@types/markdown-it": "^14.1.2",
|
||||||
"@unocss/nuxt": "^66.4.2",
|
"@unocss/nuxt": "^66.4.2",
|
||||||
|
|||||||
172
pnpm-lock.yaml
generated
172
pnpm-lock.yaml
generated
@ -32,9 +32,6 @@ importers:
|
|||||||
'@nuxtjs/i18n':
|
'@nuxtjs/i18n':
|
||||||
specifier: 10.0.5
|
specifier: 10.0.5
|
||||||
version: 10.0.5(@vue/compiler-dom@3.5.21)(db0@0.3.2)(eslint@9.35.0(jiti@2.5.1))(ioredis@5.7.0)(magicast@0.3.5)(rollup@4.50.2)(vue@3.5.21(typescript@5.9.2))
|
version: 10.0.5(@vue/compiler-dom@3.5.21)(db0@0.3.2)(eslint@9.35.0(jiti@2.5.1))(ioredis@5.7.0)(magicast@0.3.5)(rollup@4.50.2)(vue@3.5.21(typescript@5.9.2))
|
||||||
'@nuxtjs/strapi':
|
|
||||||
specifier: 2.1.1
|
|
||||||
version: 2.1.1(magicast@0.3.5)
|
|
||||||
'@pinia/nuxt':
|
'@pinia/nuxt':
|
||||||
specifier: ^0.11.2
|
specifier: ^0.11.2
|
||||||
version: 0.11.2(magicast@0.3.5)(pinia@3.0.3(typescript@5.9.2)(vue@3.5.21(typescript@5.9.2)))
|
version: 0.11.2(magicast@0.3.5)(pinia@3.0.3(typescript@5.9.2)(vue@3.5.21(typescript@5.9.2)))
|
||||||
@ -1007,9 +1004,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-rLQc/nEVWL0xMJf1a6+ndUpdQtxPBFzm4jeqG4o7HuXtDLn4HOe1dPdu7AsaIqq7EcsEjZ5T4mX4X8XnB8cT0Q==}
|
resolution: {integrity: sha512-rLQc/nEVWL0xMJf1a6+ndUpdQtxPBFzm4jeqG4o7HuXtDLn4HOe1dPdu7AsaIqq7EcsEjZ5T4mX4X8XnB8cT0Q==}
|
||||||
engines: {node: '>=20.11.1'}
|
engines: {node: '>=20.11.1'}
|
||||||
|
|
||||||
'@nuxtjs/strapi@2.1.1':
|
|
||||||
resolution: {integrity: sha512-CNcsEqkhto4P5SEA4ZuRrGdfOT7swsZp/hvR7SNG3OW3J8eHJythE68P1LaszCq5uvYlg7j90Iue534sEdedtQ==}
|
|
||||||
|
|
||||||
'@oxc-minify/binding-android-arm64@0.87.0':
|
'@oxc-minify/binding-android-arm64@0.87.0':
|
||||||
resolution: {integrity: sha512-ZbJmAfXvNAamOSnXId3BiM3DiuzlD1isqKjtmRFb/hpvChHHA23FSPrFcO16w+ugZKg33sZ93FinFkKtlC4hww==}
|
resolution: {integrity: sha512-ZbJmAfXvNAamOSnXId3BiM3DiuzlD1isqKjtmRFb/hpvChHHA23FSPrFcO16w+ugZKg33sZ93FinFkKtlC4hww==}
|
||||||
engines: {node: '>=14.0.0'}
|
engines: {node: '>=14.0.0'}
|
||||||
@ -2548,14 +2542,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==}
|
resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==}
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
|
|
||||||
call-bind-apply-helpers@1.0.2:
|
|
||||||
resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==}
|
|
||||||
engines: {node: '>= 0.4'}
|
|
||||||
|
|
||||||
call-bound@1.0.4:
|
|
||||||
resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==}
|
|
||||||
engines: {node: '>= 0.4'}
|
|
||||||
|
|
||||||
callsites@3.1.0:
|
callsites@3.1.0:
|
||||||
resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
|
resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
@ -2968,10 +2954,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-Sf2LSQP+bOlhKWWyhFsn0UsfdK/kCWRv1iuA2gXAwt3dyNabr6QSj00I2V10pidqz69soatm9ZwZvpQMTIOd5Q==}
|
resolution: {integrity: sha512-Sf2LSQP+bOlhKWWyhFsn0UsfdK/kCWRv1iuA2gXAwt3dyNabr6QSj00I2V10pidqz69soatm9ZwZvpQMTIOd5Q==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
|
|
||||||
dunder-proto@1.0.1:
|
|
||||||
resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==}
|
|
||||||
engines: {node: '>= 0.4'}
|
|
||||||
|
|
||||||
duplexer@0.1.2:
|
duplexer@0.1.2:
|
||||||
resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==}
|
resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==}
|
||||||
|
|
||||||
@ -3030,21 +3012,9 @@ packages:
|
|||||||
errx@0.1.0:
|
errx@0.1.0:
|
||||||
resolution: {integrity: sha512-fZmsRiDNv07K6s2KkKFTiD2aIvECa7++PKyD5NC32tpRw46qZA3sOz+aM+/V9V0GDHxVTKLziveV4JhzBHDp9Q==}
|
resolution: {integrity: sha512-fZmsRiDNv07K6s2KkKFTiD2aIvECa7++PKyD5NC32tpRw46qZA3sOz+aM+/V9V0GDHxVTKLziveV4JhzBHDp9Q==}
|
||||||
|
|
||||||
es-define-property@1.0.1:
|
|
||||||
resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==}
|
|
||||||
engines: {node: '>= 0.4'}
|
|
||||||
|
|
||||||
es-errors@1.3.0:
|
|
||||||
resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==}
|
|
||||||
engines: {node: '>= 0.4'}
|
|
||||||
|
|
||||||
es-module-lexer@1.7.0:
|
es-module-lexer@1.7.0:
|
||||||
resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==}
|
resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==}
|
||||||
|
|
||||||
es-object-atoms@1.1.1:
|
|
||||||
resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==}
|
|
||||||
engines: {node: '>= 0.4'}
|
|
||||||
|
|
||||||
esbuild@0.25.9:
|
esbuild@0.25.9:
|
||||||
resolution: {integrity: sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==}
|
resolution: {integrity: sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
@ -3362,17 +3332,9 @@ packages:
|
|||||||
resolution: {integrity: sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==}
|
resolution: {integrity: sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
get-intrinsic@1.3.0:
|
|
||||||
resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==}
|
|
||||||
engines: {node: '>= 0.4'}
|
|
||||||
|
|
||||||
get-port-please@3.2.0:
|
get-port-please@3.2.0:
|
||||||
resolution: {integrity: sha512-I9QVvBw5U/hw3RmWpYKRumUeaDgxTPd401x364rLmWBJcOQ753eov1eTgzDqRG9bqFIfDc7gfzcQEWrUri3o1A==}
|
resolution: {integrity: sha512-I9QVvBw5U/hw3RmWpYKRumUeaDgxTPd401x364rLmWBJcOQ753eov1eTgzDqRG9bqFIfDc7gfzcQEWrUri3o1A==}
|
||||||
|
|
||||||
get-proto@1.0.1:
|
|
||||||
resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==}
|
|
||||||
engines: {node: '>= 0.4'}
|
|
||||||
|
|
||||||
get-stream@8.0.1:
|
get-stream@8.0.1:
|
||||||
resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==}
|
resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==}
|
||||||
engines: {node: '>=16'}
|
engines: {node: '>=16'}
|
||||||
@ -3437,20 +3399,12 @@ packages:
|
|||||||
resolution: {integrity: sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==}
|
resolution: {integrity: sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
gopd@1.2.0:
|
|
||||||
resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==}
|
|
||||||
engines: {node: '>= 0.4'}
|
|
||||||
|
|
||||||
graceful-fs@4.2.11:
|
graceful-fs@4.2.11:
|
||||||
resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
|
resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
|
||||||
|
|
||||||
graphemer@1.4.0:
|
graphemer@1.4.0:
|
||||||
resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==}
|
resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==}
|
||||||
|
|
||||||
graphql@16.11.0:
|
|
||||||
resolution: {integrity: sha512-mS1lbMsxgQj6hge1XZ6p7GPhbrtFwUFYi3wRzXAC/FmYnyXMTvvI3td3rjmQ2u8ewXueaSvRPWaEcgVVOT9Jnw==}
|
|
||||||
engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0}
|
|
||||||
|
|
||||||
gzip-size@6.0.0:
|
gzip-size@6.0.0:
|
||||||
resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==}
|
resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
@ -3466,10 +3420,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
|
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
|
|
||||||
has-symbols@1.1.0:
|
|
||||||
resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==}
|
|
||||||
engines: {node: '>= 0.4'}
|
|
||||||
|
|
||||||
hasown@2.0.2:
|
hasown@2.0.2:
|
||||||
resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
|
resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
@ -3898,10 +3848,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==}
|
resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
math-intrinsics@1.1.0:
|
|
||||||
resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==}
|
|
||||||
engines: {node: '>= 0.4'}
|
|
||||||
|
|
||||||
mdn-data@2.0.28:
|
mdn-data@2.0.28:
|
||||||
resolution: {integrity: sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==}
|
resolution: {integrity: sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==}
|
||||||
|
|
||||||
@ -4154,10 +4100,6 @@ packages:
|
|||||||
engines: {node: ^14.16.0 || >=16.10.0}
|
engines: {node: ^14.16.0 || >=16.10.0}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
object-inspect@1.13.4:
|
|
||||||
resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==}
|
|
||||||
engines: {node: '>= 0.4'}
|
|
||||||
|
|
||||||
ofetch@1.4.1:
|
ofetch@1.4.1:
|
||||||
resolution: {integrity: sha512-QZj2DfGplQAr2oj9KzceK9Hwz6Whxazmn85yYeVuS3u9XTMOGMRx0kO95MQ+vLsj/S/NwBDMMLU5hpxvI6Tklw==}
|
resolution: {integrity: sha512-QZj2DfGplQAr2oj9KzceK9Hwz6Whxazmn85yYeVuS3u9XTMOGMRx0kO95MQ+vLsj/S/NwBDMMLU5hpxvI6Tklw==}
|
||||||
|
|
||||||
@ -4572,10 +4514,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
|
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
|
|
||||||
qs@6.14.0:
|
|
||||||
resolution: {integrity: sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==}
|
|
||||||
engines: {node: '>=0.6'}
|
|
||||||
|
|
||||||
quansync@0.2.11:
|
quansync@0.2.11:
|
||||||
resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==}
|
resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==}
|
||||||
|
|
||||||
@ -4779,22 +4717,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==}
|
resolution: {integrity: sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
side-channel-list@1.0.0:
|
|
||||||
resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==}
|
|
||||||
engines: {node: '>= 0.4'}
|
|
||||||
|
|
||||||
side-channel-map@1.0.1:
|
|
||||||
resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==}
|
|
||||||
engines: {node: '>= 0.4'}
|
|
||||||
|
|
||||||
side-channel-weakmap@1.0.2:
|
|
||||||
resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==}
|
|
||||||
engines: {node: '>= 0.4'}
|
|
||||||
|
|
||||||
side-channel@1.1.0:
|
|
||||||
resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==}
|
|
||||||
engines: {node: '>= 0.4'}
|
|
||||||
|
|
||||||
signal-exit@4.1.0:
|
signal-exit@4.1.0:
|
||||||
resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}
|
resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}
|
||||||
engines: {node: '>=14'}
|
engines: {node: '>=14'}
|
||||||
@ -6896,16 +6818,6 @@ snapshots:
|
|||||||
- uploadthing
|
- uploadthing
|
||||||
- vue
|
- vue
|
||||||
|
|
||||||
'@nuxtjs/strapi@2.1.1(magicast@0.3.5)':
|
|
||||||
dependencies:
|
|
||||||
'@nuxt/kit': 3.19.2(magicast@0.3.5)
|
|
||||||
defu: 6.1.4
|
|
||||||
graphql: 16.11.0
|
|
||||||
qs: 6.14.0
|
|
||||||
ufo: 1.6.1
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- magicast
|
|
||||||
|
|
||||||
'@oxc-minify/binding-android-arm64@0.87.0':
|
'@oxc-minify/binding-android-arm64@0.87.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
@ -8379,16 +8291,6 @@ snapshots:
|
|||||||
|
|
||||||
cac@6.7.14: {}
|
cac@6.7.14: {}
|
||||||
|
|
||||||
call-bind-apply-helpers@1.0.2:
|
|
||||||
dependencies:
|
|
||||||
es-errors: 1.3.0
|
|
||||||
function-bind: 1.1.2
|
|
||||||
|
|
||||||
call-bound@1.0.4:
|
|
||||||
dependencies:
|
|
||||||
call-bind-apply-helpers: 1.0.2
|
|
||||||
get-intrinsic: 1.3.0
|
|
||||||
|
|
||||||
callsites@3.1.0: {}
|
callsites@3.1.0: {}
|
||||||
|
|
||||||
caniuse-api@3.0.0:
|
caniuse-api@3.0.0:
|
||||||
@ -8769,12 +8671,6 @@ snapshots:
|
|||||||
|
|
||||||
dotenv@17.2.2: {}
|
dotenv@17.2.2: {}
|
||||||
|
|
||||||
dunder-proto@1.0.1:
|
|
||||||
dependencies:
|
|
||||||
call-bind-apply-helpers: 1.0.2
|
|
||||||
es-errors: 1.3.0
|
|
||||||
gopd: 1.2.0
|
|
||||||
|
|
||||||
duplexer@0.1.2: {}
|
duplexer@0.1.2: {}
|
||||||
|
|
||||||
eastasianwidth@0.2.0: {}
|
eastasianwidth@0.2.0: {}
|
||||||
@ -8836,16 +8732,8 @@ snapshots:
|
|||||||
|
|
||||||
errx@0.1.0: {}
|
errx@0.1.0: {}
|
||||||
|
|
||||||
es-define-property@1.0.1: {}
|
|
||||||
|
|
||||||
es-errors@1.3.0: {}
|
|
||||||
|
|
||||||
es-module-lexer@1.7.0: {}
|
es-module-lexer@1.7.0: {}
|
||||||
|
|
||||||
es-object-atoms@1.1.1:
|
|
||||||
dependencies:
|
|
||||||
es-errors: 1.3.0
|
|
||||||
|
|
||||||
esbuild@0.25.9:
|
esbuild@0.25.9:
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@esbuild/aix-ppc64': 0.25.9
|
'@esbuild/aix-ppc64': 0.25.9
|
||||||
@ -9236,26 +9124,8 @@ snapshots:
|
|||||||
|
|
||||||
get-east-asian-width@1.4.0: {}
|
get-east-asian-width@1.4.0: {}
|
||||||
|
|
||||||
get-intrinsic@1.3.0:
|
|
||||||
dependencies:
|
|
||||||
call-bind-apply-helpers: 1.0.2
|
|
||||||
es-define-property: 1.0.1
|
|
||||||
es-errors: 1.3.0
|
|
||||||
es-object-atoms: 1.1.1
|
|
||||||
function-bind: 1.1.2
|
|
||||||
get-proto: 1.0.1
|
|
||||||
gopd: 1.2.0
|
|
||||||
has-symbols: 1.1.0
|
|
||||||
hasown: 2.0.2
|
|
||||||
math-intrinsics: 1.1.0
|
|
||||||
|
|
||||||
get-port-please@3.2.0: {}
|
get-port-please@3.2.0: {}
|
||||||
|
|
||||||
get-proto@1.0.1:
|
|
||||||
dependencies:
|
|
||||||
dunder-proto: 1.0.1
|
|
||||||
es-object-atoms: 1.1.1
|
|
||||||
|
|
||||||
get-stream@8.0.1: {}
|
get-stream@8.0.1: {}
|
||||||
|
|
||||||
get-tsconfig@4.10.1:
|
get-tsconfig@4.10.1:
|
||||||
@ -9329,14 +9199,10 @@ snapshots:
|
|||||||
slash: 5.1.0
|
slash: 5.1.0
|
||||||
unicorn-magic: 0.3.0
|
unicorn-magic: 0.3.0
|
||||||
|
|
||||||
gopd@1.2.0: {}
|
|
||||||
|
|
||||||
graceful-fs@4.2.11: {}
|
graceful-fs@4.2.11: {}
|
||||||
|
|
||||||
graphemer@1.4.0: {}
|
graphemer@1.4.0: {}
|
||||||
|
|
||||||
graphql@16.11.0: {}
|
|
||||||
|
|
||||||
gzip-size@6.0.0:
|
gzip-size@6.0.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
duplexer: 0.1.2
|
duplexer: 0.1.2
|
||||||
@ -9359,8 +9225,6 @@ snapshots:
|
|||||||
|
|
||||||
has-flag@4.0.0: {}
|
has-flag@4.0.0: {}
|
||||||
|
|
||||||
has-symbols@1.1.0: {}
|
|
||||||
|
|
||||||
hasown@2.0.2:
|
hasown@2.0.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
function-bind: 1.1.2
|
function-bind: 1.1.2
|
||||||
@ -9811,8 +9675,6 @@ snapshots:
|
|||||||
punycode.js: 2.3.1
|
punycode.js: 2.3.1
|
||||||
uc.micro: 2.1.0
|
uc.micro: 2.1.0
|
||||||
|
|
||||||
math-intrinsics@1.1.0: {}
|
|
||||||
|
|
||||||
mdn-data@2.0.28: {}
|
mdn-data@2.0.28: {}
|
||||||
|
|
||||||
mdn-data@2.0.30:
|
mdn-data@2.0.30:
|
||||||
@ -10211,8 +10073,6 @@ snapshots:
|
|||||||
pkg-types: 2.3.0
|
pkg-types: 2.3.0
|
||||||
tinyexec: 1.0.1
|
tinyexec: 1.0.1
|
||||||
|
|
||||||
object-inspect@1.13.4: {}
|
|
||||||
|
|
||||||
ofetch@1.4.1:
|
ofetch@1.4.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
destr: 2.0.5
|
destr: 2.0.5
|
||||||
@ -10683,10 +10543,6 @@ snapshots:
|
|||||||
|
|
||||||
punycode@2.3.1: {}
|
punycode@2.3.1: {}
|
||||||
|
|
||||||
qs@6.14.0:
|
|
||||||
dependencies:
|
|
||||||
side-channel: 1.1.0
|
|
||||||
|
|
||||||
quansync@0.2.11: {}
|
quansync@0.2.11: {}
|
||||||
|
|
||||||
queue-microtask@1.2.3: {}
|
queue-microtask@1.2.3: {}
|
||||||
@ -10957,34 +10813,6 @@ snapshots:
|
|||||||
|
|
||||||
shell-quote@1.8.3: {}
|
shell-quote@1.8.3: {}
|
||||||
|
|
||||||
side-channel-list@1.0.0:
|
|
||||||
dependencies:
|
|
||||||
es-errors: 1.3.0
|
|
||||||
object-inspect: 1.13.4
|
|
||||||
|
|
||||||
side-channel-map@1.0.1:
|
|
||||||
dependencies:
|
|
||||||
call-bound: 1.0.4
|
|
||||||
es-errors: 1.3.0
|
|
||||||
get-intrinsic: 1.3.0
|
|
||||||
object-inspect: 1.13.4
|
|
||||||
|
|
||||||
side-channel-weakmap@1.0.2:
|
|
||||||
dependencies:
|
|
||||||
call-bound: 1.0.4
|
|
||||||
es-errors: 1.3.0
|
|
||||||
get-intrinsic: 1.3.0
|
|
||||||
object-inspect: 1.13.4
|
|
||||||
side-channel-map: 1.0.1
|
|
||||||
|
|
||||||
side-channel@1.1.0:
|
|
||||||
dependencies:
|
|
||||||
es-errors: 1.3.0
|
|
||||||
object-inspect: 1.13.4
|
|
||||||
side-channel-list: 1.0.0
|
|
||||||
side-channel-map: 1.0.1
|
|
||||||
side-channel-weakmap: 1.0.2
|
|
||||||
|
|
||||||
signal-exit@4.1.0: {}
|
signal-exit@4.1.0: {}
|
||||||
|
|
||||||
simple-concat@1.0.1:
|
simple-concat@1.0.1:
|
||||||
|
|||||||
Reference in New Issue
Block a user