|
@@ -70,7 +70,7 @@ import { useSSrSimpleDataLoader } from '@/composeable/SimpleDataLoader';
|
|
|
import { DateUtils } from '@imengyu/imengyu-utils';
|
|
import { DateUtils } from '@imengyu/imengyu-utils';
|
|
|
import type { IChannel } from '~~/server/api/ecms/channel/[id]';
|
|
import type { IChannel } from '~~/server/api/ecms/channel/[id]';
|
|
|
import SimplePagination from '~/components/content/SimplePagination.vue';
|
|
import SimplePagination from '~/components/content/SimplePagination.vue';
|
|
|
-import { solveChannelData } from '~/composeable/InternalData';
|
|
|
|
|
|
|
+import { getNeedJumpToInternalPage, solveChannelData } from '~/composeable/InternalData';
|
|
|
|
|
|
|
|
const carouselConfig : (typeof Carousel['props']) = {
|
|
const carouselConfig : (typeof Carousel['props']) = {
|
|
|
itemsToShow: 1,
|
|
itemsToShow: 1,
|
|
@@ -79,6 +79,8 @@ const carouselConfig : (typeof Carousel['props']) = {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
|
|
+const router = useRouter();
|
|
|
|
|
+
|
|
|
const channelId = parseInt(route.params.id as string);
|
|
const channelId = parseInt(route.params.id as string);
|
|
|
|
|
|
|
|
const channelData = await useSSrSimpleDataLoader('channel' + channelId, async () => {
|
|
const channelData = await useSSrSimpleDataLoader('channel' + channelId, async () => {
|
|
@@ -89,6 +91,15 @@ const channelData = await useSSrSimpleDataLoader('channel' + channelId, async ()
|
|
|
childs: IChannel[];
|
|
childs: IChannel[];
|
|
|
parents: IChannel[];
|
|
parents: IChannel[];
|
|
|
};
|
|
};
|
|
|
|
|
+ const internalPage = getNeedJumpToInternalPage(data.childs);
|
|
|
|
|
+ if (internalPage) {
|
|
|
|
|
+ if (import.meta.client) {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ router.push(internalPage + '?parent_channel_id=' + channelId);
|
|
|
|
|
+ }, 200);
|
|
|
|
|
+ }
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
return {
|
|
return {
|
|
|
...data,
|
|
...data,
|
|
|
childs: solveChannelData(data.childs),
|
|
childs: solveChannelData(data.childs),
|