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">
|
||||
import { ElConfigProvider } from 'element-plus';
|
||||
|
||||
const { login } = useStrapiAuth();
|
||||
|
||||
const { getElementPlusLocale } = useLocalizations();
|
||||
|
||||
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>
|
||||
|
||||
@ -20,8 +20,8 @@
|
||||
<NuxtLinkLocale to="/">{{ $t('navigation.home') }}</NuxtLinkLocale>
|
||||
</li>
|
||||
<li>
|
||||
<NuxtLink :to="$localePath('/productions')">{{
|
||||
$t('navigation.productions')
|
||||
<NuxtLink :to="$localePath('/products')">{{
|
||||
$t('navigation.products')
|
||||
}}</NuxtLink>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
@ -21,8 +21,8 @@
|
||||
:persistent="false"
|
||||
router
|
||||
>
|
||||
<el-menu-item index="productions" :route="$localePath('/productions')">
|
||||
<span class="title">{{ $t('navigation.productions') }}</span>
|
||||
<el-menu-item index="products" :route="$localePath('/products')">
|
||||
<span class="title">{{ $t('navigation.products') }}</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="solutions" :route="$localePath('/solutions')">
|
||||
<span class="title">{{ $t('navigation.solutions') }}</span>
|
||||
@ -81,8 +81,8 @@
|
||||
|
||||
const refreshMenu = () => {
|
||||
const path = router.currentRoute.value.path;
|
||||
if (path.startsWith('/productions')) {
|
||||
activeName.value = 'productions';
|
||||
if (path.startsWith('/products')) {
|
||||
activeName.value = 'products';
|
||||
} else if (path.startsWith('/solutions')) {
|
||||
activeName.value = 'solutions';
|
||||
} else if (path.startsWith('/support')) {
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<el-card class="production-card" @click="handleClick">
|
||||
<el-card class="product-card" @click="handleClick">
|
||||
<template #header>
|
||||
<!-- Image -->
|
||||
<el-image class="production-image" :src="imageUrl" fit="contain" />
|
||||
<el-image class="product-image" :src="imageUrl" fit="contain" />
|
||||
</template>
|
||||
|
||||
<div class="card-body">
|
||||
<!-- Name -->
|
||||
<div class="text-center">
|
||||
<span class="production-name">{{ name }}</span>
|
||||
<span class="product-name">{{ name }}</span>
|
||||
</div>
|
||||
<!-- Description -->
|
||||
<div class="card-description text-left opacity-25">{{ description }}</div>
|
||||
@ -32,25 +32,25 @@
|
||||
// 优先使用 slug,如果没有则使用 id
|
||||
const routeParam = props.slug || props.id;
|
||||
if (routeParam) {
|
||||
navigateTo(localePath(`/productions/${routeParam}`));
|
||||
navigateTo(localePath(`/products/${routeParam}`));
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.production-card {
|
||||
.product-card {
|
||||
width: 30%;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.production-card:hover {
|
||||
.product-card:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.production-name {
|
||||
.product-name {
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
@ -60,7 +60,7 @@
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.production-card .el-image {
|
||||
.product-card .el-image {
|
||||
height: 150px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
@ -73,13 +73,13 @@
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 1200px) {
|
||||
.production-card {
|
||||
.product-card {
|
||||
width: 45%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.production-card {
|
||||
.product-card {
|
||||
width: 90%;
|
||||
}
|
||||
}
|
||||
@ -2,14 +2,14 @@
|
||||
<div v-if="hasResults">
|
||||
<div class="search-results">
|
||||
<NuxtLink
|
||||
v-for="(hit, hitIndex) in paginatedHits"
|
||||
:key="`${getHitIdentifier(hit.content, hitIndex)}`"
|
||||
:to="localePath(resolveHitLink(hit.content))"
|
||||
v-for="hit in paginatedHits"
|
||||
:key="`${hit.type}-${hit.id}`"
|
||||
:to="localePath(resolveHitLink(hit))"
|
||||
>
|
||||
<el-card class="result-card">
|
||||
<h3 class="result-title">{{ getHitTitle(hit.content) }}</h3>
|
||||
<p v-if="getHitSummary(hit.content)" class="result-summary">
|
||||
{{ getHitSummary(hit.content) }}
|
||||
<h3 class="result-title">{{ hit.title }}</h3>
|
||||
<p v-if="hit.summary" class="result-summary">
|
||||
{{ hit.summary }}
|
||||
</p>
|
||||
<p v-if="hit.type" class="result-type">
|
||||
<span>内容类型: </span>
|
||||
@ -44,13 +44,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
interface HitItem {
|
||||
content: SearchHit;
|
||||
type: string;
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
hitItems: HitItem[];
|
||||
searchItems: SearchItemView[];
|
||||
currentPage: number;
|
||||
category?: string;
|
||||
}>();
|
||||
@ -74,12 +69,12 @@
|
||||
const pageSize = ref(5);
|
||||
|
||||
// 搜索相关
|
||||
const hits = props.hitItems;
|
||||
const items = props.searchItems;
|
||||
const filteredHits = computed(() => {
|
||||
if (props.category) {
|
||||
return hits.filter((hit) => hit.type === props.category);
|
||||
return items.filter((item) => item.type === props.category);
|
||||
} else {
|
||||
return hits;
|
||||
return items;
|
||||
}
|
||||
});
|
||||
const paginatedHits = computed(() => {
|
||||
@ -89,7 +84,7 @@
|
||||
});
|
||||
|
||||
const indexLabels = computed<Record<string, string>>(() => ({
|
||||
production: t('search.sections.production'),
|
||||
product: t('search.sections.product'),
|
||||
solution: t('search.sections.solution'),
|
||||
support: t('search.sections.support'),
|
||||
default: t('search.sections.default'),
|
||||
@ -106,64 +101,13 @@
|
||||
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) => {
|
||||
if (typeof hit.route === 'string' && hit.route.trim().length > 0) {
|
||||
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
|
||||
);
|
||||
const resolveHitLink = (item: SearchItemView) => {
|
||||
const slugCandidate = item.id;
|
||||
|
||||
if (!slugCandidate) {
|
||||
return null;
|
||||
@ -171,11 +115,11 @@
|
||||
|
||||
const slug = String(slugCandidate);
|
||||
|
||||
if (hit.indexUid === 'production') {
|
||||
return localePath({ path: `/productions/${slug}` });
|
||||
if (item.type === 'product') {
|
||||
return localePath({ path: `/products/${slug}` });
|
||||
}
|
||||
|
||||
if (hit.indexUid === 'solution') {
|
||||
if (item.type === 'solution') {
|
||||
return localePath({ path: `/solutions/${slug}` });
|
||||
}
|
||||
|
||||
|
||||
@ -5,3 +5,7 @@ export * from './useProduct';
|
||||
export * from './useSolutionList';
|
||||
export * from './useSolution';
|
||||
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 语言映射对象
|
||||
*/
|
||||
getLocaleMapping: getMapping,
|
||||
|
||||
/** 所有可用的Directus语言代码列表(只读) **/
|
||||
availableDirectusLocales: readonly(
|
||||
Object.values(localeMap).map((item) => item.directus)
|
||||
),
|
||||
};
|
||||
};
|
||||
|
||||
@ -1,33 +1,25 @@
|
||||
import { MeiliSearch } from 'meilisearch';
|
||||
import type { SearchParams, SearchResponse } from 'meilisearch';
|
||||
import type { SearchParams } from 'meilisearch';
|
||||
|
||||
interface RawSearchSection {
|
||||
indexUid: string;
|
||||
response: SearchResponse<Record<string, unknown>>;
|
||||
}
|
||||
|
||||
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[] => {
|
||||
const parseIndexes = (
|
||||
indexes: string | string[] | undefined,
|
||||
locale?: string
|
||||
): string[] => {
|
||||
if (!indexes) {
|
||||
return [];
|
||||
}
|
||||
|
||||
let suffix = '';
|
||||
if (locale) {
|
||||
suffix = `_${locale}`;
|
||||
}
|
||||
|
||||
if (Array.isArray(indexes)) {
|
||||
return indexes.map((item) => item.trim()).filter(Boolean);
|
||||
return indexes.map((item) => `${item.trim()}${suffix}`).filter(Boolean);
|
||||
}
|
||||
return indexes
|
||||
.split(',')
|
||||
.map((item) => item.trim())
|
||||
.map((item) => `${item.trim()}${suffix}`)
|
||||
.filter(Boolean);
|
||||
};
|
||||
|
||||
@ -56,10 +48,22 @@ export const useMeilisearch = () => {
|
||||
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,
|
||||
params: SearchParams = {}
|
||||
): Promise<SearchSection[]> => {
|
||||
params: SearchParams = {},
|
||||
searchLocale?: string
|
||||
): Promise<SearchSection<T>[]> {
|
||||
const trimmedQuery = query.trim();
|
||||
if (!trimmedQuery) {
|
||||
return [];
|
||||
@ -70,34 +74,35 @@ export const useMeilisearch = () => {
|
||||
return [];
|
||||
}
|
||||
|
||||
const activeIndexes = indexes.value;
|
||||
const activeIndexes = indexes.value as K[];
|
||||
if (!activeIndexes.length) {
|
||||
console.warn('No Meilisearch indexes configured.');
|
||||
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) => {
|
||||
const response = await client.index(indexUid).search(trimmedQuery, {
|
||||
console.log(indexesWithLocale);
|
||||
|
||||
const requests = indexesWithLocale.map(async (indexUid) => {
|
||||
const response = await client.index(indexUid).search<T>(trimmedQuery, {
|
||||
limit: params.limit ?? 10,
|
||||
...params,
|
||||
});
|
||||
const safeResponse = JSON.parse(JSON.stringify(response));
|
||||
return {
|
||||
indexUid,
|
||||
response: {
|
||||
hits: safeResponse.hits,
|
||||
estimatedTotalHits:
|
||||
safeResponse.estimatedTotalHits ?? safeResponse.hits.length,
|
||||
processingTimeMs: safeResponse.processingTimeMs ?? 0,
|
||||
query: safeResponse.query,
|
||||
},
|
||||
} satisfies RawSearchSection;
|
||||
response,
|
||||
} satisfies RawSearchSection<T>;
|
||||
});
|
||||
|
||||
console.log((await requests[0])?.response.hits[0]?.locale);
|
||||
|
||||
const settled = await Promise.allSettled(requests);
|
||||
|
||||
console.log('Meilisearch settled results:', settled);
|
||||
|
||||
settled
|
||||
.filter(
|
||||
(result): result is PromiseRejectedResult =>
|
||||
@ -108,22 +113,22 @@ export const useMeilisearch = () => {
|
||||
});
|
||||
|
||||
return settled
|
||||
.filter((result) => result.status === 'fulfilled')
|
||||
.filter(
|
||||
(result): result is PromiseFulfilledResult<RawSearchSection<T>> =>
|
||||
result.status === 'fulfilled'
|
||||
)
|
||||
.map((result) => {
|
||||
const fulfilled = result as PromiseFulfilledResult<RawSearchSection>;
|
||||
const { indexUid, response } = result.value;
|
||||
return {
|
||||
indexUid: fulfilled.value.indexUid,
|
||||
hits: fulfilled.value.response.hits.map((hit) => ({
|
||||
...hit,
|
||||
indexUid: fulfilled.value.indexUid,
|
||||
})),
|
||||
indexUid: indexUid,
|
||||
rawIndex: rawIndexMap[indexUid],
|
||||
hits: response.hits,
|
||||
estimatedTotalHits:
|
||||
fulfilled.value.response.estimatedTotalHits ??
|
||||
fulfilled.value.response.hits.length,
|
||||
processingTimeMs: fulfilled.value.response.processingTimeMs ?? 0,
|
||||
response.estimatedTotalHits ?? response.hits.length,
|
||||
processingTimeMs: response.processingTimeMs ?? 0,
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
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 数据
|
||||
* @returns 转换后的 DocumentView 对象
|
||||
* @returns 转换后的 ProductDocumentView 对象
|
||||
*
|
||||
* @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] ?? {
|
||||
title: '',
|
||||
};
|
||||
@ -27,3 +29,49 @@ export function toDocumentView(raw: ProductDocument): ProductDocumentView {
|
||||
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>)
|
||||
.map((item) => item.questions_id)
|
||||
.filter(isObject<Question>)
|
||||
.map((item) => toQuestionView(item));
|
||||
.map((item) => toProductQuestionView(item));
|
||||
|
||||
const documents = (raw.documents ?? [])
|
||||
.filter(isObject<ProductsProductDocument>)
|
||||
.map((item) => item.product_documents_id)
|
||||
.filter(isObject<ProductDocument>)
|
||||
.map((item) => toDocumentView(item));
|
||||
.map((item) => toProductDocumentView(item));
|
||||
|
||||
return {
|
||||
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 {
|
||||
/** 唯一标识符 **/
|
||||
|
||||
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>
|
||||
|
||||
<div class="content">
|
||||
<markdown-renderer :content="content || ''" />
|
||||
<markdown-renderer :content="content.content || ''" />
|
||||
</div>
|
||||
|
||||
<el-divider content-position="left">更多信息</el-divider>
|
||||
@ -38,17 +38,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const { findOne } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
const { data, pending, error } = await useCompanyProfile();
|
||||
|
||||
const { data, pending, error } = useAsyncData('company-profile', () =>
|
||||
findOne<StrapiCompanyProfile>('company-profile', undefined, {
|
||||
locale: strapiLocale,
|
||||
})
|
||||
);
|
||||
|
||||
const content = computed(() => data.value?.data.content);
|
||||
const content = computed(() => toCompanyProfileView(data.value));
|
||||
|
||||
watch(error, (value) => {
|
||||
if (value) {
|
||||
|
||||
@ -12,14 +12,11 @@
|
||||
<div class="carousel-item">
|
||||
<el-image
|
||||
class="carousel-image"
|
||||
:src="useStrapiMedia(item.url || '')"
|
||||
:alt="item.alternativeText || `Carousel Image ${index + 1}`"
|
||||
:src="getImageUrl(item)"
|
||||
:alt="`Carousel Image ${index + 1}`"
|
||||
fit="contain"
|
||||
lazy
|
||||
/>
|
||||
<p v-if="item.caption" class="carousel-image-caption">
|
||||
{{ item.caption }}
|
||||
</p>
|
||||
</div>
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
@ -42,24 +39,24 @@
|
||||
:autoplay="false"
|
||||
>
|
||||
<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"
|
||||
class="recommend-list"
|
||||
>
|
||||
<div class="recommend-card-group">
|
||||
<el-card
|
||||
v-for="(item, index) in recommend_productions.slice(
|
||||
v-for="(item, index) in recommend_products.slice(
|
||||
(n - 1) * 3,
|
||||
n * 3
|
||||
)"
|
||||
:key="index"
|
||||
class="recommend-card"
|
||||
@click="handleProductionCardClick(item.documentId || '')"
|
||||
@click="handleProductCardClick(item.id.toString() || '')"
|
||||
>
|
||||
<template #header>
|
||||
<el-image
|
||||
:src="useStrapiMedia(item.cover?.url || '')"
|
||||
:alt="item.cover?.alternativeText || item.title"
|
||||
:src="getImageUrl(item.cover)"
|
||||
:alt="item.name"
|
||||
fit="cover"
|
||||
lazy
|
||||
/>
|
||||
@ -67,7 +64,7 @@
|
||||
<div class="recommend-card-body">
|
||||
<!-- Title -->
|
||||
<div class="text-center">
|
||||
<span class="recommend-card-title">{{ item.title }}</span>
|
||||
<span class="recommend-card-title">{{ item.name }}</span>
|
||||
</div>
|
||||
<!-- Description -->
|
||||
<div class="recommend-card-description text-left opacity-25">
|
||||
@ -107,12 +104,12 @@
|
||||
)"
|
||||
:key="index"
|
||||
class="recommend-card"
|
||||
@click="handleSolutionCardClick(item.documentId || '')"
|
||||
@click="handleSolutionCardClick(item.id.toString() || '')"
|
||||
>
|
||||
<template #header>
|
||||
<el-image
|
||||
:src="useStrapiMedia(item.cover?.url || '')"
|
||||
:alt="item.cover?.alternativeText || item.title"
|
||||
:src="getImageUrl(item.cover)"
|
||||
:alt="item.title"
|
||||
fit="cover"
|
||||
lazy
|
||||
/>
|
||||
@ -140,55 +137,39 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const { findOne } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
const { getImageUrl } = useDirectusImage();
|
||||
|
||||
const { data, pending, error } = useAsyncData('homepage', () =>
|
||||
findOne<StrapiHomepage>('homepage', undefined, {
|
||||
populate: {
|
||||
carousel: {
|
||||
populate: '*',
|
||||
},
|
||||
recommend_productions: {
|
||||
populate: {
|
||||
cover: {
|
||||
populate: '*',
|
||||
},
|
||||
},
|
||||
},
|
||||
recommend_solutions: {
|
||||
populate: {
|
||||
cover: {
|
||||
populate: '*',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
locale: strapiLocale,
|
||||
})
|
||||
);
|
||||
const { data, pending, error } = await useHomepage();
|
||||
|
||||
const carousel = computed(() => data.value?.data.carousel || []);
|
||||
const recommend_productions = computed(
|
||||
() => data.value?.data.recommend_productions || []
|
||||
const homepageData = computed(() => {
|
||||
return toHomepageView(data.value);
|
||||
});
|
||||
|
||||
const carousel = computed(() => homepageData.value?.carousel);
|
||||
|
||||
const recommend_products = computed(
|
||||
() => homepageData.value?.recommendProducts
|
||||
);
|
||||
const recommend_solutions = computed(
|
||||
() => data.value?.data.recommend_solutions || []
|
||||
() => homepageData.value?.recommendSolutions
|
||||
);
|
||||
|
||||
watch(pending, () => {
|
||||
console.log(data.value);
|
||||
});
|
||||
|
||||
watch(error, (value) => {
|
||||
if (value) {
|
||||
console.error('数据获取失败: ', value);
|
||||
}
|
||||
});
|
||||
|
||||
const handleProductionCardClick = (documentId: string) => {
|
||||
const handleProductCardClick = (documentId: string) => {
|
||||
// 使用路由导航到产品详情页
|
||||
if (documentId) {
|
||||
const localePath = useLocalePath();
|
||||
const router = useRouter();
|
||||
router.push(localePath(`/productions/${documentId}`));
|
||||
router.push(localePath(`/products/${documentId}`));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<div v-if="!pending">
|
||||
<div v-if="production">
|
||||
<div v-if="product">
|
||||
<!-- 面包屑导航 -->
|
||||
<el-breadcrumb class="breadcrumb" separator="/">
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
@ -10,44 +10,44 @@
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/productions')">{{
|
||||
$t('navigation.productions')
|
||||
<NuxtLink :to="$localePath('/products')">{{
|
||||
$t('navigation.products')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item class="text-md opactiy-50">{{
|
||||
production.name
|
||||
product.name
|
||||
}}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
|
||||
<!-- 产品详情内容 -->
|
||||
<div class="production-header">
|
||||
<div class="production-image">
|
||||
<div class="product-header">
|
||||
<div class="product-image">
|
||||
<el-image
|
||||
v-if="production.images.length <= 1"
|
||||
:src="getImageUrl(production.images[0].image)"
|
||||
:alt="production.name"
|
||||
v-if="product.images.length <= 1"
|
||||
:src="getImageUrl(product.images[0].image)"
|
||||
:alt="product.name"
|
||||
fit="contain"
|
||||
/>
|
||||
<el-carousel
|
||||
v-else
|
||||
class="production-carousel"
|
||||
class="product-carousel"
|
||||
height="500px"
|
||||
:autoplay="false"
|
||||
:loop="false"
|
||||
arrow="always"
|
||||
>
|
||||
<el-carousel-item
|
||||
v-for="(item, index) in production.images || []"
|
||||
v-for="(item, index) in product.images || []"
|
||||
:key="index"
|
||||
>
|
||||
<div class="production-carousel-item">
|
||||
<div class="product-carousel-item">
|
||||
<el-image
|
||||
:src="getImageUrl(item.image || '')"
|
||||
:alt="production.name"
|
||||
:alt="product.name"
|
||||
fit="contain"
|
||||
lazy
|
||||
/>
|
||||
<p v-if="item.caption" class="production-image-caption">
|
||||
<p v-if="item.caption" class="product-image-caption">
|
||||
{{ item.caption }}
|
||||
</p>
|
||||
</div>
|
||||
@ -55,26 +55,26 @@
|
||||
</el-carousel>
|
||||
</div>
|
||||
|
||||
<div class="production-info">
|
||||
<h1>{{ production.name }}</h1>
|
||||
<p class="summary">{{ production.summary }}</p>
|
||||
<div class="product-info">
|
||||
<h1>{{ product.name }}</h1>
|
||||
<p class="summary">{{ product.summary }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 产品详细描述 -->
|
||||
<div class="production-content">
|
||||
<el-tabs v-model="activeName" class="production-tabs" stretch>
|
||||
<div class="product-content">
|
||||
<el-tabs v-model="activeName" class="product-tabs" stretch>
|
||||
<el-tab-pane label="产品详情" name="details">
|
||||
<markdown-renderer :content="production.description || ''" />
|
||||
<markdown-renderer :content="product.description || ''" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="技术规格" name="specs">
|
||||
<spec-table :data="production.specs" />
|
||||
<spec-table :data="product.specs" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="常见问题" name="faq">
|
||||
<question-list :questions="production.faqs" />
|
||||
<question-list :questions="product.faqs" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="相关文档" name="documents">
|
||||
<document-list :documents="production.documents" />
|
||||
<document-list :documents="product.documents" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
@ -87,8 +87,8 @@
|
||||
:sub-title="$t('product-not-found-desc')"
|
||||
>
|
||||
<template #extra>
|
||||
<el-button type="primary" @click="$router.push('/productions')">
|
||||
{{ $t('back-to-productions') }}
|
||||
<el-button type="primary" @click="$router.push('/products')">
|
||||
{{ $t('back-to-products') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-result>
|
||||
@ -117,12 +117,12 @@
|
||||
|
||||
console.log('Raw Data: ', data.value);
|
||||
|
||||
const rawProduction = computed(() => data.value ?? null);
|
||||
const production = computed(() => {
|
||||
return toProductView(rawProduction.value);
|
||||
const rawProduct = computed(() => data.value ?? null);
|
||||
const product = computed(() => {
|
||||
return toProductView(rawProduct.value);
|
||||
});
|
||||
|
||||
console.log('View Data: ', production.value);
|
||||
console.log('View Data: ', product.value);
|
||||
|
||||
const activeName = ref('details'); // 默认选中概览标签
|
||||
|
||||
@ -134,11 +134,11 @@
|
||||
|
||||
// SEO
|
||||
useHead({
|
||||
title: computed(() => production.value?.name || 'Product Detail'),
|
||||
title: computed(() => product.value?.name || 'Product Detail'),
|
||||
meta: [
|
||||
{
|
||||
name: 'description',
|
||||
content: computed(() => production.value?.summary || ''),
|
||||
content: computed(() => product.value?.summary || ''),
|
||||
},
|
||||
],
|
||||
});
|
||||
@ -155,20 +155,20 @@
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.production-header {
|
||||
.product-header {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
gap: 3rem;
|
||||
}
|
||||
|
||||
.production-image .el-image {
|
||||
.product-image .el-image {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.production-image-caption {
|
||||
.product-image-caption {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
/* left: 10%; */
|
||||
@ -180,7 +180,7 @@
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.production-carousel :deep(.el-carousel__button) {
|
||||
.product-carousel :deep(.el-carousel__button) {
|
||||
/* 指示器按钮样式 */
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
@ -189,7 +189,7 @@
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.production-info h1 {
|
||||
.product-info h1 {
|
||||
margin-top: 2rem;
|
||||
margin-bottom: 1rem;
|
||||
font-size: 2rem;
|
||||
@ -202,16 +202,16 @@
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.production-tabs ::v-deep(.el-tabs__nav) {
|
||||
.product-tabs ::v-deep(.el-tabs__nav) {
|
||||
min-width: 30%;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.production-tabs ::v-deep(.el-tabs__content) {
|
||||
.product-tabs ::v-deep(.el-tabs__content) {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.production-content h2 {
|
||||
.product-content h2 {
|
||||
color: var(--el-text-color-primary);
|
||||
margin: 0;
|
||||
}
|
||||
@ -232,12 +232,12 @@
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.production-header {
|
||||
.product-header {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.production-info h1 {
|
||||
.product-info h1 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<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-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/')">{{
|
||||
@ -9,29 +9,29 @@
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/productions')">{{
|
||||
$t('navigation.productions')
|
||||
<NuxtLink :to="$localePath('/products')">{{
|
||||
$t('navigation.products')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</div>
|
||||
<div v-if="!pending" class="page-content">
|
||||
<div class="productions-container">
|
||||
<el-collapse v-model="activeNames" class="production-collapse">
|
||||
<div class="products-container">
|
||||
<el-collapse v-model="activeNames" class="product-collapse">
|
||||
<el-collapse-item
|
||||
v-for="(group, type) in groupedProductions"
|
||||
v-for="(group, type) in groupedProducts"
|
||||
:key="type"
|
||||
:title="type || '未分类'"
|
||||
:name="type || 'no-category'"
|
||||
>
|
||||
<div class="group-list">
|
||||
<production-card
|
||||
v-for="production in group"
|
||||
:key="production.id"
|
||||
:slug="production.id.toString()"
|
||||
:image-url="getImageUrl(production.cover.toString())"
|
||||
:name="production.name"
|
||||
:description="production.summary || ''"
|
||||
<product-card
|
||||
v-for="product in group"
|
||||
:key="product.id"
|
||||
:slug="product.id.toString()"
|
||||
:image-url="getImageUrl(product.cover.toString())"
|
||||
:name="product.name"
|
||||
:description="product.summary || ''"
|
||||
/>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
@ -51,16 +51,16 @@
|
||||
|
||||
const activeNames = ref<string[]>([]);
|
||||
|
||||
const productionsRaw = computed(() => data.value ?? []);
|
||||
const productions = computed(() =>
|
||||
productionsRaw.value.map((item) => toProductListView(item))
|
||||
const productsRaw = computed(() => data.value ?? []);
|
||||
const products = computed(() =>
|
||||
productsRaw.value.map((item) => toProductListView(item))
|
||||
);
|
||||
|
||||
// 按类型分组
|
||||
// 兼容 production_type 既可能为对象也可能为字符串
|
||||
const groupedProductions = computed(() => {
|
||||
// 兼容 product_type 既可能为对象也可能为字符串
|
||||
const groupedProducts = computed(() => {
|
||||
const groups: Record<string, ProductListView[]> = {};
|
||||
for (const prod of productions.value) {
|
||||
for (const prod of products.value) {
|
||||
let typeKey = '';
|
||||
if (typeof prod.product_type === 'string') {
|
||||
typeKey = prod.product_type;
|
||||
@ -78,10 +78,10 @@
|
||||
return groups;
|
||||
});
|
||||
|
||||
watch(groupedProductions, () => {
|
||||
if (groupedProductions.value) {
|
||||
watch(groupedProducts, () => {
|
||||
if (groupedProducts.value) {
|
||||
activeNames.value = [
|
||||
...Object.keys(groupedProductions.value),
|
||||
...Object.keys(groupedProducts.value),
|
||||
'no-category',
|
||||
];
|
||||
}
|
||||
@ -100,9 +100,9 @@
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
if (groupedProductions.value) {
|
||||
if (groupedProducts.value) {
|
||||
activeNames.value = [
|
||||
...Object.keys(groupedProductions.value),
|
||||
...Object.keys(groupedProducts.value),
|
||||
'no-category',
|
||||
];
|
||||
}
|
||||
@ -131,13 +131,13 @@
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.productions-container {
|
||||
.products-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 40px;
|
||||
}
|
||||
|
||||
.production-group {
|
||||
.product-group {
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
@ -30,17 +30,17 @@
|
||||
<el-tab-pane :label="`全部(${resultCount['all']})`" name="all">
|
||||
<search-results
|
||||
v-model:current-page="currentPage"
|
||||
:hit-items="hits"
|
||||
:search-items="searchItems"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane
|
||||
:label="`产品(${resultCount['production'] || 0})`"
|
||||
name="production"
|
||||
:label="`产品(${resultCount['product'] || 0})`"
|
||||
name="product"
|
||||
>
|
||||
<search-results
|
||||
v-model:current-page="currentPage"
|
||||
:hit-items="hits"
|
||||
category="production"
|
||||
:search-items="searchItems"
|
||||
category="product"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane
|
||||
@ -49,7 +49,7 @@
|
||||
>
|
||||
<search-results
|
||||
v-model:current-page="currentPage"
|
||||
:hit-items="hits"
|
||||
:search-items="searchItems"
|
||||
category="solution"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
@ -59,7 +59,7 @@
|
||||
>
|
||||
<search-results
|
||||
v-model:current-page="currentPage"
|
||||
:hit-items="hits"
|
||||
:search-items="searchItems"
|
||||
category="question"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
@ -69,7 +69,7 @@
|
||||
>
|
||||
<search-results
|
||||
v-model:current-page="currentPage"
|
||||
:hit-items="hits"
|
||||
:search-items="searchItems"
|
||||
category="document"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
@ -92,8 +92,8 @@
|
||||
|
||||
// i18n相关
|
||||
const { t } = useI18n();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
const { getDirectusLocale } = useLocalizations();
|
||||
const directusLocale = getDirectusLocale();
|
||||
|
||||
// 路由相关
|
||||
const route = useRoute();
|
||||
@ -110,40 +110,48 @@
|
||||
pending: loading,
|
||||
error,
|
||||
} = await useAsyncData(
|
||||
() => `search-${route.query.query ?? ''}`,
|
||||
() => `search-${directusLocale}-${route.query.query ?? ''}`,
|
||||
async () => {
|
||||
const q = String(route.query.query ?? '').trim();
|
||||
if (!q) return [];
|
||||
return await search(q, { limit: 12 });
|
||||
return await search(q, { limit: 12 }, directusLocale);
|
||||
}
|
||||
);
|
||||
|
||||
// 本地化+空Section过滤
|
||||
// 空Section过滤
|
||||
const filteredSections = computed(() =>
|
||||
sections.value
|
||||
.map((section) => ({
|
||||
...section,
|
||||
hits: section.hits.filter(
|
||||
(hit) =>
|
||||
!hit.locale ||
|
||||
String(hit.locale).toLowerCase() === strapiLocale.toLowerCase()
|
||||
),
|
||||
}))
|
||||
.filter((section) => section.hits.length > 0)
|
||||
sections.value.filter((section) => section.hits.length > 0)
|
||||
);
|
||||
|
||||
const typeMap = {
|
||||
products: 'products',
|
||||
solutions: 'solutions',
|
||||
questions: 'questions',
|
||||
product_documents: 'product_documents',
|
||||
} as const;
|
||||
// 展平hits
|
||||
const hits = computed(() =>
|
||||
filteredSections.value.flatMap((item) =>
|
||||
item.hits.map((content) => ({ content, type: item.indexUid }))
|
||||
)
|
||||
filteredSections.value.flatMap((section) => {
|
||||
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 resultCount = computed(() => {
|
||||
const map: Record<string, number> = { all: hits.value.length };
|
||||
for (const hit of hits.value) {
|
||||
map[hit.type] = (map[hit.type] ?? 0) + 1;
|
||||
const map: Record<string, number> = { all: searchItems.value.length };
|
||||
for (const item of searchItems.value) {
|
||||
map[item.type] = (map[item.type] ?? 0) + 1;
|
||||
}
|
||||
return map;
|
||||
});
|
||||
@ -177,7 +185,7 @@
|
||||
}
|
||||
|
||||
try {
|
||||
const results = await search(trimmed, { limit: 12 });
|
||||
const results = await search(trimmed, { limit: 12 }, directusLocale);
|
||||
if (requestId === activeRequestId.value) {
|
||||
sections.value = results;
|
||||
}
|
||||
@ -199,10 +207,10 @@
|
||||
|
||||
watch(
|
||||
() => route.query.query,
|
||||
(newQuery) => {
|
||||
async (newQuery) => {
|
||||
if (typeof newQuery === 'string' && newQuery.trim()) {
|
||||
keyword.value = newQuery;
|
||||
performSearch(newQuery);
|
||||
await performSearch(newQuery);
|
||||
} else {
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
:sub-title="$t('solution-not-found-desc')"
|
||||
>
|
||||
<template #extra>
|
||||
<el-button type="primary" @click="$router.push('/productions')">
|
||||
<el-button type="primary" @click="$router.push('/solutions')">
|
||||
{{ $t('back-to-solutions') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
</div>
|
||||
|
||||
<div v-if="!pending" class="page-content">
|
||||
<markdown-renderer :content="content || ''" />
|
||||
<markdown-renderer :content="content.content || ''" />
|
||||
</div>
|
||||
<div v-else class="loading">
|
||||
<el-skeleton :rows="5" animated />
|
||||
@ -32,18 +32,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const { findOne } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
const { data, pending, error } = await useContactInfo();
|
||||
|
||||
const { data, pending, error } = useAsyncData('contact-info', () =>
|
||||
findOne<StrapiContactInfo>('contact-info', undefined, {
|
||||
populate: '*',
|
||||
locale: strapiLocale,
|
||||
})
|
||||
);
|
||||
|
||||
const content = computed(() => data.value?.data.content ?? '');
|
||||
const content = computed(() => toContactInfoView(data.value));
|
||||
|
||||
watch(error, (value) => {
|
||||
if (value) {
|
||||
|
||||
@ -28,22 +28,22 @@
|
||||
<div class="document-category">
|
||||
<el-select v-model="selectedType" placeholder="选择产品类型" clearable>
|
||||
<el-option
|
||||
v-for="type in productionTypeOptions"
|
||||
:key="type.documentId"
|
||||
:label="type.type"
|
||||
:value="type.documentId"
|
||||
v-for="type in productTypeOptions"
|
||||
:key="type.id"
|
||||
:label="type.name"
|
||||
:value="type.id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="selectedProduction"
|
||||
v-model="selectedProduct"
|
||||
placeholder="选择系列产品"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="production in productionOptions"
|
||||
:key="production.documentId"
|
||||
:label="production.title"
|
||||
:value="production.documentId"
|
||||
v-for="product in productOptions"
|
||||
:key="product.id"
|
||||
:label="product.name"
|
||||
:value="product.id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input
|
||||
@ -63,37 +63,24 @@
|
||||
<script setup lang="ts">
|
||||
import { Search } from '@element-plus/icons-vue';
|
||||
|
||||
const { find } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
const { data, pending, error } = await useDocumentList();
|
||||
|
||||
const { data, pending, error } = useAsyncData('documents', () =>
|
||||
find<ProductionDocument>('production-documents', {
|
||||
populate: ['document', 'related_productions.production_type'],
|
||||
locale: strapiLocale,
|
||||
})
|
||||
const documents = computed(
|
||||
() => data?.value.map((item) => toDocumentListView(item)) ?? []
|
||||
);
|
||||
|
||||
// const documents = computed(
|
||||
// () =>
|
||||
// data.value?.data.map((item) => ({
|
||||
// ...item.document,
|
||||
// })) || []
|
||||
// );
|
||||
const documents = computed(() => data.value?.data ?? []);
|
||||
|
||||
const keyword = ref('');
|
||||
|
||||
const selectedType = ref<string | null>(null);
|
||||
const selectedProduction = ref<string | null>(null);
|
||||
const selectedType = ref<number | null>(null);
|
||||
const selectedProduct = ref<number | null>(null);
|
||||
|
||||
const productionTypeOptions = computed(() => {
|
||||
const types: ProductionType[] = [];
|
||||
documents.value.forEach((document: ProductionDocument) => {
|
||||
document.related_productions?.forEach((production: Production) => {
|
||||
const productionType = production?.production_type;
|
||||
if (!types.some((p) => p.documentId === productionType.documentId)) {
|
||||
types.push(productionType);
|
||||
const productTypeOptions = computed(() => {
|
||||
const types: DocumentListProductType[] = [];
|
||||
documents.value.forEach((doc: DocumentListView) => {
|
||||
doc.products?.forEach((product: DocumentListProduct) => {
|
||||
const productType = product.type;
|
||||
if (!types.some((item) => item.id === productType.id)) {
|
||||
types.push(productType);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -101,51 +88,48 @@
|
||||
return types;
|
||||
});
|
||||
|
||||
const productionOptions = computed(() => {
|
||||
const productOptions = computed(() => {
|
||||
if (!selectedType.value) return [];
|
||||
const productions: Production[] = [];
|
||||
documents.value.forEach((document: ProductionDocument) => {
|
||||
document.related_productions.forEach((production: Production) => {
|
||||
const products: DocumentListProduct[] = [];
|
||||
|
||||
documents.value.forEach((doc: DocumentListView) => {
|
||||
doc.products?.forEach((product: DocumentListProduct) => {
|
||||
if (
|
||||
production.production_type?.documentId === selectedType.value &&
|
||||
!productions.some((p) => p.documentId === production.documentId)
|
||||
product.type.id === selectedType.value &&
|
||||
!products.some((item) => item.id === product.id)
|
||||
) {
|
||||
productions.push(production);
|
||||
products.push(product);
|
||||
}
|
||||
});
|
||||
});
|
||||
return productions;
|
||||
|
||||
return products;
|
||||
});
|
||||
|
||||
const filteredDocuments = computed(() =>
|
||||
documents.value
|
||||
.filter((document: ProductionDocument) => {
|
||||
const matchProduction = selectedProduction.value
|
||||
? document.related_productions?.some(
|
||||
(production: Production) =>
|
||||
production.documentId === selectedProduction.value
|
||||
documents.value.filter((doc: DocumentListView) => {
|
||||
const matchProduct = selectedProduct.value
|
||||
? doc.products?.some(
|
||||
(product: DocumentListProduct) =>
|
||||
product.id === selectedProduct.value
|
||||
)
|
||||
: selectedType.value
|
||||
? doc.products?.some(
|
||||
(product: DocumentListProduct) =>
|
||||
product.type?.id === selectedType.value
|
||||
)
|
||||
: selectedType.value
|
||||
? document.related_productions?.some(
|
||||
(production: Production) =>
|
||||
production.production_type?.documentId === selectedType.value
|
||||
)
|
||||
: true;
|
||||
|
||||
const matchKeyword = keyword.value
|
||||
? document.document.caption &&
|
||||
document.document.caption.includes(keyword.value)
|
||||
: true;
|
||||
|
||||
return matchProduction && matchKeyword;
|
||||
})
|
||||
.map((item) => ({
|
||||
...item.document,
|
||||
}))
|
||||
const matchKeyword = keyword.value
|
||||
? doc.title && doc.title.includes(keyword.value)
|
||||
: true;
|
||||
|
||||
return matchProduct && matchKeyword;
|
||||
})
|
||||
);
|
||||
|
||||
watch(selectedType, () => {
|
||||
selectedProduction.value = null;
|
||||
selectedProduct.value = null;
|
||||
});
|
||||
|
||||
watch(documents, (value) => {
|
||||
|
||||
@ -34,18 +34,14 @@
|
||||
:value="type.id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="selectedProduct"
|
||||
placeholder="选择系列产品"
|
||||
clearable
|
||||
>
|
||||
<el-sel v-model="selectedProduct" placeholder="选择系列产品" clearable>
|
||||
<el-option
|
||||
v-for="production in productOptions"
|
||||
:key="production.id"
|
||||
:label="production.name"
|
||||
:value="production.id"
|
||||
v-for="product in productOptions"
|
||||
:key="product.id"
|
||||
:label="product.name"
|
||||
:value="product.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-sel>
|
||||
<el-input
|
||||
v-model="keyword"
|
||||
placeholder="输入关键词..."
|
||||
@ -105,7 +101,7 @@
|
||||
|
||||
const filteredQuestions = computed(() => {
|
||||
return questions.value.filter((question: QuestionListView) => {
|
||||
const matchProduction = selectedProduct.value
|
||||
const matchProduct = selectedProduct.value
|
||||
? question.products?.some(
|
||||
(product: QuestionListProduct) =>
|
||||
product.id === selectedProduct.value
|
||||
@ -122,7 +118,7 @@
|
||||
(question.content && question.content.includes(keyword.value))
|
||||
: true;
|
||||
|
||||
return matchProduction && matchKeyword;
|
||||
return matchProduct && matchKeyword;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ export interface CompanyProfileTranslation {
|
||||
id: number;
|
||||
company_profile_id?: CompanyProfile | string | null;
|
||||
languages_code?: Language | string | null;
|
||||
content?: 'json' | null;
|
||||
content?: string | null;
|
||||
}
|
||||
|
||||
export interface ContactInfo {
|
||||
@ -23,7 +23,7 @@ export interface ContactInfoTranslation {
|
||||
id: number;
|
||||
contact_info_id?: ContactInfo | string | null;
|
||||
languages_code?: Language | string | null;
|
||||
content?: 'json' | null;
|
||||
content?: string | null;
|
||||
}
|
||||
|
||||
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.",
|
||||
"untitled": "Untitled",
|
||||
"sections": {
|
||||
"production": "Products",
|
||||
"product": "Products",
|
||||
"solution": "Solutions",
|
||||
"support": "Support",
|
||||
"default": "Other"
|
||||
@ -21,14 +21,14 @@
|
||||
"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.",
|
||||
"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.",
|
||||
"support-desc": "24/7 professional technical support to ensure stable operation of your business.",
|
||||
"quick-links": "Quick Links",
|
||||
"utilities": "Utilities",
|
||||
"navigation": {
|
||||
"home": "Home",
|
||||
"productions": "Productions",
|
||||
"products": "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": "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-desc": "Sorry, the solution you are lokking for does not exist or has been removed.",
|
||||
"back-to-solutions": "Back to Solutions",
|
||||
"no-content-available": "No detailed information available",
|
||||
"loading": "Loading...",
|
||||
"our-productions": "Our Productions",
|
||||
"our-products": "Our Products",
|
||||
"learn-our-solutions": "Learn Our Solutions",
|
||||
"all": "All"
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
"no-query": "请输入关键字开始搜索。",
|
||||
"untitled": "未命名条目",
|
||||
"sections": {
|
||||
"production": "产品",
|
||||
"product": "产品",
|
||||
"solution": "解决方案",
|
||||
"support": "服务支持",
|
||||
"default": "其他内容"
|
||||
@ -21,14 +21,14 @@
|
||||
"company-name": "金申机械制造有限公司",
|
||||
"company-description": "专业生产一系列纸管、纸罐设备,集设计、制造、销售、服务于一体。",
|
||||
"learn-more": "了解更多",
|
||||
"productions-desc": "我们提供高质量的产品解决方案,满足各种业务需求。",
|
||||
"products-desc": "我们提供高质量的产品解决方案,满足各种业务需求。",
|
||||
"solutions-desc": "为企业提供定制化的技术解决方案,助力数字化转型。",
|
||||
"support-desc": "7x24小时专业技术支持,确保您的业务稳定运行。",
|
||||
"quick-links": "快速链接",
|
||||
"utilities": "实用工具",
|
||||
"navigation": {
|
||||
"home": "主页",
|
||||
"productions": "产品中心",
|
||||
"products": "产品中心",
|
||||
"solutions": "解决方案",
|
||||
"support": "服务支持",
|
||||
"about-us": "关于我们",
|
||||
@ -50,13 +50,13 @@
|
||||
"product-details": "产品详情",
|
||||
"product-not-found": "产品未找到",
|
||||
"product-not-found-desc": "抱歉,您访问的产品不存在或已被删除。",
|
||||
"back-to-productions": "返回产品列表",
|
||||
"back-to-products": "返回产品列表",
|
||||
"solution-not-found": "解决方案未找到",
|
||||
"solution-not-found-desc": "抱歉,您访问的解决方案不存在或已被删除",
|
||||
"back-to-solutions": "返回解决方案列表",
|
||||
"no-content-available": "暂无详细信息",
|
||||
"loading": "加载中...",
|
||||
"our-productions": "我们的产品",
|
||||
"our-products": "我们的产品",
|
||||
"learn-our-solutions": "了解我们的解决方案",
|
||||
"all": "全部"
|
||||
}
|
||||
|
||||
@ -27,16 +27,7 @@ export default defineNuxtConfig({
|
||||
? typeof process.env.MEILI_SEARCH_INDEXES === 'string'
|
||||
? process.env.MEILI_SEARCH_INDEXES.split(',').map((i) => i.trim())
|
||||
: process.env.MEILI_SEARCH_INDEXES
|
||||
: ['production', 'solution'],
|
||||
},
|
||||
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',
|
||||
: ['products', 'solutions', 'questions', 'product_documents'],
|
||||
},
|
||||
directus: {
|
||||
url: process.env.DIRECTUS_URL || 'http://localhost:8055',
|
||||
@ -132,6 +123,5 @@ export default defineNuxtConfig({
|
||||
'@unocss/nuxt',
|
||||
'@element-plus/nuxt',
|
||||
'@nuxtjs/i18n',
|
||||
'@nuxtjs/strapi',
|
||||
],
|
||||
});
|
||||
|
||||
@ -19,7 +19,6 @@
|
||||
"@nuxt/image": "1.11.0",
|
||||
"@nuxt/test-utils": "3.19.2",
|
||||
"@nuxtjs/i18n": "10.0.5",
|
||||
"@nuxtjs/strapi": "2.1.1",
|
||||
"@pinia/nuxt": "^0.11.2",
|
||||
"@types/markdown-it": "^14.1.2",
|
||||
"@unocss/nuxt": "^66.4.2",
|
||||
|
||||
172
pnpm-lock.yaml
generated
172
pnpm-lock.yaml
generated
@ -32,9 +32,6 @@ importers:
|
||||
'@nuxtjs/i18n':
|
||||
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))
|
||||
'@nuxtjs/strapi':
|
||||
specifier: 2.1.1
|
||||
version: 2.1.1(magicast@0.3.5)
|
||||
'@pinia/nuxt':
|
||||
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)))
|
||||
@ -1007,9 +1004,6 @@ packages:
|
||||
resolution: {integrity: sha512-rLQc/nEVWL0xMJf1a6+ndUpdQtxPBFzm4jeqG4o7HuXtDLn4HOe1dPdu7AsaIqq7EcsEjZ5T4mX4X8XnB8cT0Q==}
|
||||
engines: {node: '>=20.11.1'}
|
||||
|
||||
'@nuxtjs/strapi@2.1.1':
|
||||
resolution: {integrity: sha512-CNcsEqkhto4P5SEA4ZuRrGdfOT7swsZp/hvR7SNG3OW3J8eHJythE68P1LaszCq5uvYlg7j90Iue534sEdedtQ==}
|
||||
|
||||
'@oxc-minify/binding-android-arm64@0.87.0':
|
||||
resolution: {integrity: sha512-ZbJmAfXvNAamOSnXId3BiM3DiuzlD1isqKjtmRFb/hpvChHHA23FSPrFcO16w+ugZKg33sZ93FinFkKtlC4hww==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
@ -2548,14 +2542,6 @@ packages:
|
||||
resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==}
|
||||
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:
|
||||
resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
|
||||
engines: {node: '>=6'}
|
||||
@ -2968,10 +2954,6 @@ packages:
|
||||
resolution: {integrity: sha512-Sf2LSQP+bOlhKWWyhFsn0UsfdK/kCWRv1iuA2gXAwt3dyNabr6QSj00I2V10pidqz69soatm9ZwZvpQMTIOd5Q==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
dunder-proto@1.0.1:
|
||||
resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
duplexer@0.1.2:
|
||||
resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==}
|
||||
|
||||
@ -3030,21 +3012,9 @@ packages:
|
||||
errx@0.1.0:
|
||||
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:
|
||||
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:
|
||||
resolution: {integrity: sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==}
|
||||
engines: {node: '>=18'}
|
||||
@ -3362,17 +3332,9 @@ packages:
|
||||
resolution: {integrity: sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
get-intrinsic@1.3.0:
|
||||
resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
get-port-please@3.2.0:
|
||||
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:
|
||||
resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==}
|
||||
engines: {node: '>=16'}
|
||||
@ -3437,20 +3399,12 @@ packages:
|
||||
resolution: {integrity: sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
gopd@1.2.0:
|
||||
resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
graceful-fs@4.2.11:
|
||||
resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
|
||||
|
||||
graphemer@1.4.0:
|
||||
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:
|
||||
resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==}
|
||||
engines: {node: '>=10'}
|
||||
@ -3466,10 +3420,6 @@ packages:
|
||||
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
has-symbols@1.1.0:
|
||||
resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
hasown@2.0.2:
|
||||
resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@ -3898,10 +3848,6 @@ packages:
|
||||
resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==}
|
||||
hasBin: true
|
||||
|
||||
math-intrinsics@1.1.0:
|
||||
resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
mdn-data@2.0.28:
|
||||
resolution: {integrity: sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==}
|
||||
|
||||
@ -4154,10 +4100,6 @@ packages:
|
||||
engines: {node: ^14.16.0 || >=16.10.0}
|
||||
hasBin: true
|
||||
|
||||
object-inspect@1.13.4:
|
||||
resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
ofetch@1.4.1:
|
||||
resolution: {integrity: sha512-QZj2DfGplQAr2oj9KzceK9Hwz6Whxazmn85yYeVuS3u9XTMOGMRx0kO95MQ+vLsj/S/NwBDMMLU5hpxvI6Tklw==}
|
||||
|
||||
@ -4572,10 +4514,6 @@ packages:
|
||||
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
qs@6.14.0:
|
||||
resolution: {integrity: sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==}
|
||||
engines: {node: '>=0.6'}
|
||||
|
||||
quansync@0.2.11:
|
||||
resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==}
|
||||
|
||||
@ -4779,22 +4717,6 @@ packages:
|
||||
resolution: {integrity: sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==}
|
||||
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:
|
||||
resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}
|
||||
engines: {node: '>=14'}
|
||||
@ -6896,16 +6818,6 @@ snapshots:
|
||||
- uploadthing
|
||||
- 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':
|
||||
optional: true
|
||||
|
||||
@ -8379,16 +8291,6 @@ snapshots:
|
||||
|
||||
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: {}
|
||||
|
||||
caniuse-api@3.0.0:
|
||||
@ -8769,12 +8671,6 @@ snapshots:
|
||||
|
||||
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: {}
|
||||
|
||||
eastasianwidth@0.2.0: {}
|
||||
@ -8836,16 +8732,8 @@ snapshots:
|
||||
|
||||
errx@0.1.0: {}
|
||||
|
||||
es-define-property@1.0.1: {}
|
||||
|
||||
es-errors@1.3.0: {}
|
||||
|
||||
es-module-lexer@1.7.0: {}
|
||||
|
||||
es-object-atoms@1.1.1:
|
||||
dependencies:
|
||||
es-errors: 1.3.0
|
||||
|
||||
esbuild@0.25.9:
|
||||
optionalDependencies:
|
||||
'@esbuild/aix-ppc64': 0.25.9
|
||||
@ -9236,26 +9124,8 @@ snapshots:
|
||||
|
||||
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-proto@1.0.1:
|
||||
dependencies:
|
||||
dunder-proto: 1.0.1
|
||||
es-object-atoms: 1.1.1
|
||||
|
||||
get-stream@8.0.1: {}
|
||||
|
||||
get-tsconfig@4.10.1:
|
||||
@ -9329,14 +9199,10 @@ snapshots:
|
||||
slash: 5.1.0
|
||||
unicorn-magic: 0.3.0
|
||||
|
||||
gopd@1.2.0: {}
|
||||
|
||||
graceful-fs@4.2.11: {}
|
||||
|
||||
graphemer@1.4.0: {}
|
||||
|
||||
graphql@16.11.0: {}
|
||||
|
||||
gzip-size@6.0.0:
|
||||
dependencies:
|
||||
duplexer: 0.1.2
|
||||
@ -9359,8 +9225,6 @@ snapshots:
|
||||
|
||||
has-flag@4.0.0: {}
|
||||
|
||||
has-symbols@1.1.0: {}
|
||||
|
||||
hasown@2.0.2:
|
||||
dependencies:
|
||||
function-bind: 1.1.2
|
||||
@ -9811,8 +9675,6 @@ snapshots:
|
||||
punycode.js: 2.3.1
|
||||
uc.micro: 2.1.0
|
||||
|
||||
math-intrinsics@1.1.0: {}
|
||||
|
||||
mdn-data@2.0.28: {}
|
||||
|
||||
mdn-data@2.0.30:
|
||||
@ -10211,8 +10073,6 @@ snapshots:
|
||||
pkg-types: 2.3.0
|
||||
tinyexec: 1.0.1
|
||||
|
||||
object-inspect@1.13.4: {}
|
||||
|
||||
ofetch@1.4.1:
|
||||
dependencies:
|
||||
destr: 2.0.5
|
||||
@ -10683,10 +10543,6 @@ snapshots:
|
||||
|
||||
punycode@2.3.1: {}
|
||||
|
||||
qs@6.14.0:
|
||||
dependencies:
|
||||
side-channel: 1.1.0
|
||||
|
||||
quansync@0.2.11: {}
|
||||
|
||||
queue-microtask@1.2.3: {}
|
||||
@ -10957,34 +10813,6 @@ snapshots:
|
||||
|
||||
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: {}
|
||||
|
||||
simple-concat@1.0.1:
|
||||
|
||||
Reference in New Issue
Block a user