Compare commits

...

2 Commits

  1. 4
      api/layout/index.ts
  2. 3
      components/AppFooter.vue
  3. 2
      composables/useServerRequest.ts
  4. 4
      layouts/default.vue
  5. 29
      pages/components/CompanyStyle.vue
  6. 121
      pages/components/Djzt.vue
  7. 167
      pages/components/ImportantInformation.vue
  8. 80
      pages/index.vue

4
api/layout/index.ts

@ -3,13 +3,13 @@ import type { ApiResult } from '@/api';
import type { User } from '@/api/system/user/model'; import type { User } from '@/api/system/user/model';
import type { UpdatePasswordParam } from './model'; import type { UpdatePasswordParam } from './model';
import { MODULES_API_URL, SERVER_API_URL } from '~/config'; import { MODULES_API_URL, SERVER_API_URL } from '~/config';
import type {Website} from "~/api/cms/website/model";
import type {CmsWebsite} from "~/api/cms/cmsWebsite/model";
/** /**
* *
*/ */
export async function getSiteInfo() { export async function getSiteInfo() {
const res = await request.get<ApiResult<Website>>(
const res = await request.get<ApiResult<CmsWebsite>>(
MODULES_API_URL + '/cms/website/getSiteInfo' MODULES_API_URL + '/cms/website/getSiteInfo'
); );
if (res.data.code === 0 && res.data.data) { if (res.data.code === 0 && res.data.data) {

3
components/AppFooter.vue

@ -69,7 +69,7 @@
</div> </div>
<div class="tools flex gap-xl items-center opacity-80 hover:opacity-90"> <div class="tools flex gap-xl items-center opacity-80 hover:opacity-90">
<el-tooltip :content="`管理后台`" v-if="config.showAdminIcon"> <el-tooltip :content="`管理后台`" v-if="config.showAdminIcon">
<a :href="`https://${website.tenantId}.websoft.top`" target="_blank"><img src="@/assets/svg/websoft-mark-white.svg" alt="github" width="28" class="text-gray-400" /></a>
<a :href="`https://website.websoft.top`" target="_blank"><img src="@/assets/svg/websoft-mark-white.svg" alt="github" width="28" class="text-gray-400" /></a>
</el-tooltip> </el-tooltip>
</div> </div>
</div> </div>
@ -97,6 +97,7 @@ import type {Config} from "~/types/global";
const config = useConfigInfo(); const config = useConfigInfo();
const website = useWebsite(); const website = useWebsite();
const subMenu = useSubMenu(); const subMenu = useSubMenu();
const SysDomain = localStorage.getItem('SysDomain');
console.log('---------config---------',config.value) console.log('---------config---------',config.value)
console.log('---------website---------',website.value) console.log('---------website---------',website.value)
console.log('---------subMenu---------',subMenu.value) console.log('---------subMenu---------',subMenu.value)

2
composables/useServerRequest.ts

@ -16,7 +16,7 @@ export const useServerRequest = <T>(url: string, opts?: UseFetchOptions<T, unkno
baseUrl.value = runtimeConfig.public.apiServer; baseUrl.value = runtimeConfig.public.apiServer;
// 开发环境 // 开发环境
if(process.env.NODE_ENV === 'development'){ if(process.env.NODE_ENV === 'development'){
baseUrl.value = `http://127.0.0.1:9002/api`
// baseUrl.value = `http://127.0.0.1:9002/api`
} }
// 登录凭证token // 登录凭证token
const token = useToken(); const token = useToken();

4
layouts/default.vue

@ -95,6 +95,10 @@ const reload = async () => {
if (website.value.bottomNavs) { if (website.value.bottomNavs) {
subMenu.value = website.value?.bottomNavs; subMenu.value = website.value?.bottomNavs;
} }
if(website.value.config){
localStorage.setItem('Domain',website.value.config.Domain);
localStorage.setItem('SysDomain',website.value.config.SysDomain);
}
} }
// TODO 3 // TODO 3

29
pages/components/CompanyStyle.vue

@ -1,5 +1,5 @@
<template> <template>
<div class="w-full bg-gray-100 pb-20">
<div class="w-full bg-gray-100 pb-20 bg-white">
<div class="text-center flex flex-col items-center py-15 relative "> <div class="text-center flex flex-col items-center py-15 relative ">
<div class="sub-title"> <div class="sub-title">
<p class="text-gray-200 text-5xl font-bold dark:text-gray-700 py-0 line-height-5"> <p class="text-gray-200 text-5xl font-bold dark:text-gray-700 py-0 line-height-5">
@ -13,16 +13,16 @@
<div class="xl:w-screen-xl m-auto text-xl right-to-left hidden-sm-and-down" v-if="show"> <div class="xl:w-screen-xl m-auto text-xl right-to-left hidden-sm-and-down" v-if="show">
<el-carousel :interval="4000" type="card" height="350px" arrow="never" indicator-position="none"> <el-carousel :interval="4000" type="card" height="350px" arrow="never" indicator-position="none">
<el-carousel-item class="relative" v-for="(item,index) in list" :key="index"> <el-carousel-item class="relative" v-for="(item,index) in list" :key="index">
<el-image :src="item.path" class="cursor-pointer scale-img w-full" />
<div class="absolute bg-[#e65a01]/75 w-full py-2 z-100 text-center text-sm text-white bottom-0" v-if="item.comments">{{ item.comments }}</div>
<el-image :src="item.image" class="cursor-pointer scale-img w-full" />
<div class="absolute bg-[#e65a01]/75 w-full py-2 z-100 text-center text-sm text-white bottom-0" v-if="item.comments" @click="openSpmUrl(`/detail`,item,item.articleId,true)">{{ item.comments }}</div>
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
</div> </div>
<div class="xl:w-screen-xl m-auto text-xl right-to-left hidden-sm-and-up"> <div class="xl:w-screen-xl m-auto text-xl right-to-left hidden-sm-and-up">
<el-carousel :interval="4000" type="card" height="350px" arrow="never" indicator-position="none"> <el-carousel :interval="4000" type="card" height="350px" arrow="never" indicator-position="none">
<el-carousel-item class="relative" v-for="(item,index) in list" :key="index"> <el-carousel-item class="relative" v-for="(item,index) in list" :key="index">
<el-image :src="item.path" class="cursor-pointer scale-img w-full" />
<div class="absolute bg-[#e65a01]/75 w-full py-2 z-100 text-center text-sm text-white bottom-0" v-if="item.comments">{{ item.comments }}</div>
<el-image :src="item.image" class="cursor-pointer scale-img w-full" @click="openSpmUrl(`/detail`,item,item.articleId,true)" />
<div class="absolute bg-[#e65a01]/75 w-full py-2 z-100 text-center text-sm text-white bottom-0" v-if="item.comments" >{{ item.comments }}</div>
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
</div> </div>
@ -35,6 +35,7 @@
import {useServerRequest} from "~/composables/useServerRequest"; import {useServerRequest} from "~/composables/useServerRequest";
import type {ApiResult, PageResult} from "~/api"; import type {ApiResult, PageResult} from "~/api";
import type {FileRecord} from "~/api/system/file/model"; import type {FileRecord} from "~/api/system/file/model";
import type {CmsArticle} from "~/api/cms/cmsArticle/model";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
@ -54,13 +55,13 @@ const emit = defineEmits<{
(e: 'done'): void; (e: 'done'): void;
}>(); }>();
const list = ref<FileRecord[]>([])
const list = ref<CmsArticle[]>([])
const reload = async () => { const reload = async () => {
const {data: response} = await useServerRequest<ApiResult<PageResult<FileRecord>>>('/file/page',{
baseURL: 'https://server.gxwebsoft.com/api',
query: {
groupId: props.groupId
const {data: response} = await useServerRequest<ApiResult<PageResult<CmsArticle>>>('/cms/cms-article/page', {
params: {
categoryId: 989,
limit: 8
} }
}) })
if(response.value?.data){ if(response.value?.data){
@ -68,6 +69,12 @@ const reload = async () => {
list.value = response.value?.data.list list.value = response.value?.data.list
} }
} }
// const {data: response} = await useServerRequest<ApiResult<PageResult<FileRecord>>>('/file/page',{
// baseURL: 'https://server.gxwebsoft.com/api',
// query: {
// groupId: props.groupId
// }
// })
} }
const show = ref(false) const show = ref(false)
@ -75,7 +82,7 @@ watch(
() => [props.groupId, props.scrollTop], () => [props.groupId, props.scrollTop],
() => { () => {
reload(); reload();
if (props.scrollTop >= 2280) show.value = true
if (props.scrollTop >= 1580) show.value = true
}, },
{immediate: true} {immediate: true}

121
pages/components/Djzt.vue

@ -0,0 +1,121 @@
<template>
<div class="w-full bg-gray-100 pb-20">
<div class="text-center flex flex-col items-center py-15 relative ">
<div class="sub-title">
<p class="text-gray-200 text-5xl font-bold dark:text-gray-700 py-0 line-height-5">
{{ comments }}
</p>
</div>
<h2 class="text-3xl font-bold tracking-tight text-[#ff0000] dark:text-white sm:text-4xl lg:text-5xl">
{{ title }}
</h2>
</div>
<div class="xl:w-screen-xl m-auto text-xl right-to-left hidden-sm-and-down" v-if="show">
<el-carousel :interval="4000" type="card" height="450px" arrow="never" indicator-position="none">
<el-carousel-item class="relative" v-for="(item,index) in list" :key="index">
<el-image :src="item.image" class="cursor-pointer scale-img w-full" />
<div class="absolute bg-[#e65a01]/75 w-full py-2 z-100 text-center text-sm text-white bottom-0" v-if="item.comments" @click="openSpmUrl(`/detail`,item,item.articleId,true)">{{ item.comments }}</div>
</el-carousel-item>
</el-carousel>
</div>
<div class="xl:w-screen-xl m-auto text-xl right-to-left hidden-sm-and-up">
<el-carousel :interval="4000" type="card" height="350px" arrow="never" indicator-position="none">
<el-carousel-item class="relative" v-for="(item,index) in list" :key="index">
<el-image :src="item.image" class="cursor-pointer scale-img w-full" @click="openSpmUrl(`/detail`,item,item.articleId,true)" />
<div class="absolute bg-[#e65a01]/75 w-full py-2 z-100 text-center text-sm text-white bottom-0" v-if="item.comments" >{{ item.comments }}</div>
</el-carousel-item>
</el-carousel>
</div>
</div>
</template>
<script setup lang="ts">
import {useServerRequest} from "~/composables/useServerRequest";
import type {ApiResult, PageResult} from "~/api";
import type {FileRecord} from "~/api/system/file/model";
import type {CmsArticle} from "~/api/cms/cmsArticle/model";
const props = withDefaults(
defineProps<{
config?: any;
groupId?: number;
title?: string;
comments?: string;
scrollTop: number;
}>(),
{
title: '卡片标题',
comments: '卡片描述'
}
);
const emit = defineEmits<{
(e: 'done'): void;
}>();
const list = ref<CmsArticle[]>([])
const reload = async () => {
const {data: response} = await useServerRequest<ApiResult<PageResult<CmsArticle>>>('/cms/cms-article/page', {
params: {
categoryId: 990,
limit: 8
}
})
if(response.value?.data){
if(response.value?.data.list){
list.value = response.value?.data.list
}
}
// const {data: response} = await useServerRequest<ApiResult<PageResult<FileRecord>>>('/file/page',{
// baseURL: 'https://server.gxwebsoft.com/api',
// query: {
// groupId: props.groupId
// }
// })
}
const show = ref(false)
watch(
() => [props.groupId, props.scrollTop],
() => {
reload();
if (props.scrollTop >= 2240) show.value = true
},
{immediate: true}
);
</script>
<style lang="less" scoped>
.scale-img:hover {
animation: scale;
animation-duration: 0.5s;
animation-fill-mode: forwards;
}
@keyframes scale {
from {
transform: scale(1);
}
to {
transform: scale(1.1);
}
}
.right-to-left {
animation: right-to-left-ani;
animation-duration: 0.5s;
animation-fill-mode: forwards;
}
@keyframes right-to-left-ani {
from {
transform: translateX(100%);
}
to {
transform: translateX(0);
}
}
</style>

167
pages/components/ImportantInformation.vue

@ -0,0 +1,167 @@
<template>
<div class="xl:w-screen-2xl m-auto text-xl">
<el-row :gutter="20">
<el-col :span="12">
<el-card shadow="hover" class="bg-gray-50 w-full h-[150px]">
<template #header>
<div class="card-header">
<span class="font-bold text-[#ff0000]">重大信息公开</span>
</div>
</template>
<template v-for="(item,index) in list" :key="index">
<li class="flex justify-between py-2">
<a class="line-clamp-1 max-w-2xl" :class="`item-${index}`"
:href="getSpmUrl(`/detail`,item,item.articleId)" target="_blank">{{ item.title }}</a>
<span class="text-gray-400 font-200">{{ dayjs(item.createTime).format('YYYY-MM-DD') }}</span>
</li>
</template>
</el-card>
</el-col>
<el-col :span="12">
<el-card shadow="hover" class="bg-gray-50 w-full h-[150px]">
<template #header>
<div class="card-header">
<span class="font-bold text-[#ff0000]">党建专题</span>
</div>
</template>
<div class="flex justify-between">
<div class="flex flex-col">
<span class="text-[#ff0000]">2023关于2023年三重一大的启动通知</span>
<span class="text-sm text-gray-500">2023-03-07</span>
</div>
<div class="flex flex-col items-end">
<span class="text-[#ff0000]">2023关于2023年三重一大的启动通知</span>
</div>
</div>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script setup lang="ts">
import {getSpmUrl, openSpmUrl} from "~/utils/common";
import dayjs from "dayjs";
import {useServerRequest} from "~/composables/useServerRequest";
import type {ApiResult, PageResult} from "~/api";
import type {CmsArticle} from "~/api/cms/cmsArticle/model";
import type {CompanyParam} from "~/api/system/company/model";
import {TENANT_ID} from "~/config";
import type {CmsNavigation} from "~/api/cms/cmsNavigation/model";
const props = withDefaults(
defineProps<{
config?: any;
scrollTop: number;
parentId?: any;
disabled?: boolean;
title?: string;
comments?: string;
}>(),
{
title: '卡片标题',
comments: '卡片描述'
}
);
const emit = defineEmits<{
(e: 'done'): void;
}>();
const category = ref<ApiResult<CmsNavigation[]>>();
const list = ref<CmsArticle[]>([]);
const hotList = ref<CmsArticle[]>([]);
const categoryId = ref();
//
const where = reactive<CompanyParam>({
keywords: ''
});
const handleClick = () => {
reload();
}
//
const {data: hotResponse} = await useServerRequest<ApiResult<PageResult<CmsArticle>>>('/cms/cms-article/page', {
params: {
recommend: 1,
limit: 5
}
})
if (hotResponse.value?.data) {
hotList.value = hotResponse.value?.data.list
}
//
const getCategory = async () => {
const {data: categoryInfo} = await useServerRequest<ApiResult<CmsNavigation[]>>('/cms/cms-navigation', {
params: {
parentId: props.parentId
}
})
if (categoryInfo.value) {
category.value = categoryInfo.value
categoryId.value = categoryInfo.value?.data && categoryInfo.value?.data[0].navigationId
}
await reload();
}
//
const reload = async () => {
const {data: response} = await useServerRequest<ApiResult<PageResult<CmsArticle>>>('/cms/cms-article/page', {
params: {
categoryId: Number(categoryId.value),
limit: 8
}
})
if (response.value?.data) {
list.value = response.value?.data.list
}
}
const showNews = ref(false)
watch(
() => [props.parentId, props.scrollTop],
([parentId, scrollTop]) => {
getCategory();
if (props.scrollTop > 70) showNews.value = true
},
{immediate: true}
);
</script>
<style lang="less" scoped>
.left-2-right {
animation: left-2-right-ani;
animation-duration: 0.5s;
animation-fill-mode: forwards;
}
@keyframes left-2-right-ani {
from {
transform: translateX(100%);
}
to {
transform: translateX(0);
}
}
.right-to-left {
animation: right-to-left-ani;
animation-duration: 0.5s;
animation-fill-mode: forwards;
}
@keyframes right-to-left-ani {
from {
transform: translateX(-100%);
}
to {
transform: translateX(0);
}
}
//.hidden-sm-and-down .carousel{display: none;}
</style>

80
pages/index.vue

@ -9,10 +9,49 @@
<AboutUs :scrollTop="scrollTop" title="关于我们" v-if="config" :config="config" comments="About Us"/> <AboutUs :scrollTop="scrollTop" title="关于我们" v-if="config" :config="config" comments="About Us"/>
<VideoCenter :scrollTop="scrollTop" title="视频中心" v-if="config" :config="config" comments="Video Center"/>
<CompanyStyle :scrollTop="scrollTop" title="公司风采" v-if="config" :groupId="groupId" :config="config" comments="Company Style"/>
<CompanyStyle :scrollTop="scrollTop" title="重大信息公开" v-if="config" :groupId="groupId" :config="config" comments="Important Information"/>
<Djzt :scrollTop="scrollTop" title="党建专题" v-if="config" :groupId="groupId" :config="config" comments="Party Building Topic"/>
<!-- <div class="xl:w-screen-2xl m-auto text-xl">-->
<!-- <el-row :gutter="30">-->
<!-- <el-col :span="12">-->
<!-- <el-card shadow="hover">-->
<!-- <template #header>-->
<!-- <div class="card-header">-->
<!-- <span class="font-bold">重大信息公开</span>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-for="(item,index) in list989" :key="index">-->
<!-- <li class="flex justify-between py-2">-->
<!-- <a class="line-clamp-1 max-w-2xl" :class="`item-${index}`"-->
<!-- :href="getSpmUrl(`/detail`,item,item.articleId)" target="_blank">{{ item.title }}</a>-->
<!-- <span class="text-gray-400 font-200">{{ dayjs(item.createTime).format('YYYY-MM-DD') }}</span>-->
<!-- </li>-->
<!-- </template>-->
<!-- </el-card>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-card shadow="hover">-->
<!-- <template #header>-->
<!-- <div class="card-header">-->
<!-- <span class="font-bold">党建专题</span>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-for="(item,index) in list990" :key="index">-->
<!-- <li class="flex justify-between py-2">-->
<!-- <a class="line-clamp-1 max-w-2xl" :class="`item-${index}`"-->
<!-- :href="getSpmUrl(`/detail`,item,item.articleId)" target="_blank">{{ item.title }}</a>-->
<!-- <span class="text-gray-400 font-200">{{ dayjs(item.createTime).format('YYYY-MM-DD') }}</span>-->
<!-- </li>-->
<!-- </template>-->
<!-- </el-card>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </div>-->
<!-- <VideoCenter :scrollTop="scrollTop" title="视频中心" v-if="config" :config="config" comments="Video Center"/>-->
<!-- <CompanyList :param="{official: true,recommend: true,limit: 4}" :fit="`cover`" title="产品服务" comments="拥抱开源、坚守品质;致力于打造安全稳定高可用的WEB应用!"/>--> <!-- <CompanyList :param="{official: true,recommend: true,limit: 4}" :fit="`cover`" title="产品服务" comments="拥抱开源、坚守品质;致力于打造安全稳定高可用的WEB应用!"/>-->
@ -25,11 +64,17 @@ import type {BreadcrumbItem, Config} from "~/types/global";
import Flash from './components/Flash.vue'; import Flash from './components/Flash.vue';
import ArticleList from './components/ArticleList.vue'; import ArticleList from './components/ArticleList.vue';
import NewsCenter from "~/pages/components/NewsCenter.vue"; import NewsCenter from "~/pages/components/NewsCenter.vue";
import Information from '~/pages/components/ImportantInformation.vue';
import AboutUs from "~/pages/components/AboutUs.vue"; import AboutUs from "~/pages/components/AboutUs.vue";
import VideoCenter from "~/pages/components/VideoCenter.vue"; import VideoCenter from "~/pages/components/VideoCenter.vue";
import CompanyStyle from "~/pages/components/CompanyStyle.vue"; import CompanyStyle from "~/pages/components/CompanyStyle.vue";
import Djzt from "~/pages/components/Djzt.vue";
import dayjs from "dayjs";
import Carousel from "~/pages/components/Carousel.vue"; import Carousel from "~/pages/components/Carousel.vue";
import type {ApiResult} from "~/api";
import type {ApiResult, PageResult} from "~/api";
import {getSpmUrl} from "~/utils/common";
import type {CmsArticle} from "~/api/cms/cmsArticle/model";
import {useServerRequest} from "~/composables/useServerRequest";
// //
const route = useRoute(); const route = useRoute();
@ -39,6 +84,8 @@ const config = useConfigInfo();
const groupId = ref() const groupId = ref()
const parentId = ref() const parentId = ref()
const breadcrumb = ref<BreadcrumbItem>(); const breadcrumb = ref<BreadcrumbItem>();
const list989 = ref<CmsArticle[]>([]);
const list990 = ref<CmsArticle[]>([]);
const scrollTop = ref(0) const scrollTop = ref(0)
window.onscroll = e => { window.onscroll = e => {
@ -67,6 +114,29 @@ const reload = async () => {
groupId.value = config.value?.IndexPhotoGroupId; groupId.value = config.value?.IndexPhotoGroupId;
parentId.value = config.value?.IndexNewsCenterParentId; parentId.value = config.value?.IndexNewsCenterParentId;
} }
//
// const {data: response989} = await useServerRequest<ApiResult<PageResult<CmsArticle>>>('/cms/cms-article/page', {
// params: {
// categoryId: 989,
// limit: 8
// }
// })
// if (response989.value?.data) {
// list989.value = response989.value?.data.list
// }
//
// const {data: response990} = await useServerRequest<ApiResult<PageResult<CmsArticle>>>('/cms/cms-article/page', {
// params: {
// categoryId: 990,
// limit: 8
// }
// })
//
// if (response990.value?.data) {
// list990.value = response990.value?.data.list
// }
// seo // seo
useHead({ useHead({
title: `构建现代WEB应用 · WEBSOFT`, title: `构建现代WEB应用 · WEBSOFT`,

Loading…
Cancel
Save