|
|
|
@ -1,5 +1,6 @@ |
|
|
|
<script lang='ts' setup> |
|
|
|
import { useUserStore } from "@/store/modules/user" |
|
|
|
|
|
|
|
import { ref } from 'vue' |
|
|
|
import { getUserDetail, getZxxyNavis, getTuijian, getCarousel } from '@/api/knowledge/index' |
|
|
|
import Archivestype from '@/views/knowledge/knowledge/components/archivestype.vue' |
|
|
|
@ -17,7 +18,6 @@ const userStore = useUserStore(); |
|
|
|
const { userKey, userToken } = userStore; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const userDetail = ref<UserDetail>({ |
|
|
|
//证件号码 |
|
|
|
idcardno: ["1", "2"], |
|
|
|
@ -35,6 +35,7 @@ const userDetail = ref<UserDetail>({ |
|
|
|
const tuijianPage = ref<Graphicform[]>(); |
|
|
|
|
|
|
|
const naviList = ref<Navi[]>(); |
|
|
|
const naviList1 = ref<Navi[]>(); |
|
|
|
//用户信息查询参数 |
|
|
|
const userQueryParam = reactive<UserQuery>({ |
|
|
|
userkey: userKey, |
|
|
|
@ -43,6 +44,8 @@ const userQueryParam = reactive<UserQuery>({ |
|
|
|
//navi查询参数 |
|
|
|
const naviQueryParam = reactive<NaviQuery>({ |
|
|
|
atParentId: "",//知识库 |
|
|
|
userkey: userKey, |
|
|
|
usertoken: userToken, |
|
|
|
}); |
|
|
|
const pageParamTuijian = reactive<PageParam>({ |
|
|
|
total: 0, |
|
|
|
@ -65,9 +68,15 @@ function errorImg(e: any) { |
|
|
|
e.srcElement.onerror = null; //防止闪图 |
|
|
|
} |
|
|
|
const fatherisReady = ref(0); |
|
|
|
|
|
|
|
const router = useRouter() |
|
|
|
const routerUrl = toRaw(router).currentRoute.value.fullPath |
|
|
|
onBeforeMount(() => { |
|
|
|
//当前登录用户详细信息 |
|
|
|
getUserDetail(userQueryParam) |
|
|
|
.then(({ data }) => { |
|
|
|
userDetail.value = data |
|
|
|
}); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
@ -86,42 +95,23 @@ onMounted(() => { |
|
|
|
getZxxyNavis(naviQueryParam) |
|
|
|
.then(({ data }) => { |
|
|
|
naviList.value = data |
|
|
|
//console.log(naviList.value) |
|
|
|
|
|
|
|
}).finally(() => { |
|
|
|
fatherisReady.value = 100; |
|
|
|
}) |
|
|
|
|
|
|
|
//当前登录用户详细信息 |
|
|
|
getUserDetail(userQueryParam) |
|
|
|
.then(({ data }) => { |
|
|
|
userDetail.value = data |
|
|
|
//console.log(userDetail.value) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//推荐 |
|
|
|
getTuijian(pageParamTuijian) |
|
|
|
.then(({ data }) => { |
|
|
|
tuijianPage.value = data.list |
|
|
|
pageParamTuijian.page = data.pageNum |
|
|
|
pageParamTuijian.total = data.total |
|
|
|
//console.log(tuijianPage.value) |
|
|
|
}); |
|
|
|
getCarousel(pageParamTuijian) |
|
|
|
.then(({ data }) => { |
|
|
|
carousel.value = data.list |
|
|
|
|
|
|
|
|
|
|
|
//console.log(tuijianPage.value) |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//setTimeout(function(){ fatherisReady.value = 100;}, 3000); //三秒之后执行函数 |
|
|
|
|
|
|
|
}); |
|
|
|
function jsScroll() { |
|
|
|
active.value = onScroll(); |
|
|
|
} |
|
|
|
@ -137,8 +127,6 @@ function handleCurrentChange() { |
|
|
|
tuijianPage.value = data.list |
|
|
|
pageParamTuijian.page = data.pageNum |
|
|
|
pageParamTuijian.total = data.total |
|
|
|
|
|
|
|
//console.log(tuijianPage.value) |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
@ -146,8 +134,8 @@ function handleCurrentChange() { |
|
|
|
//dialog |
|
|
|
const cardContentSource = ref<Graphicform>({}); |
|
|
|
const showContentBox = ref(false); //详情弹窗 |
|
|
|
function showContentDialog(item:any){ |
|
|
|
|
|
|
|
function showContentDialog(item: any) { |
|
|
|
showContentBox.value = true; |
|
|
|
cardContentSource.value = item; |
|
|
|
} |
|
|
|
@ -155,10 +143,10 @@ function showContentDialog(item:any){ |
|
|
|
|
|
|
|
</script> |
|
|
|
<template> |
|
|
|
<div class="know-main"> |
|
|
|
<div class="app-container"> |
|
|
|
<KnowledgeContent v-model:isShow="showContentBox" :contentSource="cardContentSource"></KnowledgeContent> |
|
|
|
<!-- 内容区域 --> |
|
|
|
<div class="content" style="margin-left: 10% ;padding-right: 15%;"> |
|
|
|
<div class="content"> |
|
|
|
|
|
|
|
<div class="models "> |
|
|
|
|
|
|
|
@ -167,16 +155,16 @@ function showContentDialog(item:any){ |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="grid-tuijian"> |
|
|
|
<el-carousel indicator-position="outside" class="mycarousel" style="width: 412px;height:290px; " arrow="always"> |
|
|
|
<el-carousel indicator-position="outside" class="mycarousel" arrow="always"> |
|
|
|
<el-carousel-item v-for="(item, index) in carousel" :key="index"> |
|
|
|
<!-- <h3 text="2xl" justify="center">{{ item.gThumbnail }}</h3> --> |
|
|
|
<img style="width: 412px; height: 300px;border-radius:16px;margin-top: 4px; margin-left: 4px;" |
|
|
|
|
|
|
|
<img style="width: 495px; height: 300px;border-radius:16px;margin-top: 4px; margin-left: 4px;" |
|
|
|
referrerpolicy="no-referrer" :src="item.gThumbnail" fit="fill" loading="lazy" @error="errorImg($event)" /> |
|
|
|
</el-carousel-item> |
|
|
|
</el-carousel> |
|
|
|
|
|
|
|
<div v-for="(item, index) in tuijianPage" :key="index" class="tuijian-card" @click="showContentDialog(item)"> |
|
|
|
<img style="width: 140px; height: 126px;border-radius:8px;margin-top: 4px; margin-left: 4px;" |
|
|
|
<img style="width: 170px; height: 126px;border-radius:8px;margin-top: 4px; margin-left: 4px;" |
|
|
|
referrerpolicy="no-referrer" :src="item.gThumbnail" fit="fill" loading="lazy" @error="errorImg($event)" /> |
|
|
|
|
|
|
|
<div class="card-right"> |
|
|
|
@ -200,58 +188,66 @@ function showContentDialog(item:any){ |
|
|
|
@current-change="handleCurrentChange" /> |
|
|
|
</div> |
|
|
|
<!-- 各知识/新闻分区 --> |
|
|
|
<Archivestype v-for="(item, index) in naviList" :liContent=item :index=(index) :fatherisReady="fatherisReady" |
|
|
|
:routerUrl="routerUrl" > |
|
|
|
</Archivestype> |
|
|
|
|
|
|
|
<template v-for="(item, index) in naviList"> |
|
|
|
<Archivestype :liContent=item :index=(index) :fatherisReady="fatherisReady" :routerUrl="routerUrl"></Archivestype> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 导航区域 --> |
|
|
|
|
|
|
|
<ul class="navs"> |
|
|
|
<li :class="{ active: active === 0 }" @click="scrollTo(0)"> |
|
|
|
推荐 |
|
|
|
</li> |
|
|
|
<Navili v-for="(item, index) in naviList" :class="{ active: active === index+1 }" :oneli=item :index=(index+1) |
|
|
|
:active=active @click="scrollTo(index+1)"></Navili> |
|
|
|
|
|
|
|
</ul> |
|
|
|
<template v-for="(item, index) in naviList"> |
|
|
|
<Navili :class="{ active: active === index+1 }" :oneli=item :index=(index+1) v-if="item.hasCard" :active=active |
|
|
|
@click="scrollTo(index + 1)"></Navili> |
|
|
|
</template> |
|
|
|
|
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped> |
|
|
|
/* 内容区的样式 */ |
|
|
|
.content { |
|
|
|
background-color: white; |
|
|
|
width: 100%; |
|
|
|
width: 89.1%; |
|
|
|
margin-left: 190px; |
|
|
|
box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px; |
|
|
|
border-radius: 5px; |
|
|
|
} |
|
|
|
|
|
|
|
.models { |
|
|
|
width: 100%; |
|
|
|
/* min-height: 500px; */ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* 导航栏的样式 */ |
|
|
|
.navs { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
width: 192px; |
|
|
|
position: fixed; |
|
|
|
top: 100px; |
|
|
|
height: auto; |
|
|
|
top: 95px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.navs li { |
|
|
|
|
|
|
|
padding: 0 40px; |
|
|
|
line-height: 2.6; |
|
|
|
font-size: 15px; |
|
|
|
text-align: center; |
|
|
|
line-height: 3; |
|
|
|
font-size: 15.5px; |
|
|
|
color: #909399; |
|
|
|
background-color: white; |
|
|
|
margin-right: 15px; |
|
|
|
} |
|
|
|
|
|
|
|
.navs li:hover { |
|
|
|
@ -265,12 +261,15 @@ function showContentDialog(item:any){ |
|
|
|
} |
|
|
|
|
|
|
|
.model-title { |
|
|
|
margin-top: -9px; |
|
|
|
height: 30px; |
|
|
|
} |
|
|
|
|
|
|
|
.grid-tuijian { |
|
|
|
|
|
|
|
|
|
|
|
display: grid; |
|
|
|
grid-template-columns: repeat(auto-fill, 415px); |
|
|
|
grid-template-columns: repeat(auto-fill, 484px); |
|
|
|
gap: 10px; |
|
|
|
grid-auto-flow: row dense; |
|
|
|
|
|
|
|
@ -278,26 +277,27 @@ function showContentDialog(item:any){ |
|
|
|
|
|
|
|
.tuijian-card { |
|
|
|
display: flex; |
|
|
|
width: 412px; |
|
|
|
width: 481px; |
|
|
|
height: 140px; |
|
|
|
padding: 3px; |
|
|
|
border-radius: 8px; |
|
|
|
flex-direction: row; |
|
|
|
flex-wrap: wrap; |
|
|
|
/* border:#909399 1px solid; */ |
|
|
|
/* box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px; */ |
|
|
|
box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px; |
|
|
|
} |
|
|
|
|
|
|
|
.mycarousel { |
|
|
|
|
|
|
|
grid-row-start: 1; |
|
|
|
grid-row-end: 3; |
|
|
|
border-radius: 15px; |
|
|
|
width: 480px; |
|
|
|
height: 290px; |
|
|
|
} |
|
|
|
|
|
|
|
.card-right { |
|
|
|
display: flex; |
|
|
|
width: 260px; |
|
|
|
width: 300px; |
|
|
|
flex-direction: column; |
|
|
|
flex-wrap: wrap; |
|
|
|
padding-left: 8px; |
|
|
|
@ -305,15 +305,6 @@ function showContentDialog(item:any){ |
|
|
|
|
|
|
|
.card-title { |
|
|
|
|
|
|
|
/* height: 1.5em !important; |
|
|
|
overflow: hidden; |
|
|
|
text-overflow: ellipsis; |
|
|
|
display: -webkit-box; |
|
|
|
-webkit-line-clamp: 3; |
|
|
|
-webkit-box-orient: vertical; |
|
|
|
line-height: 25px; |
|
|
|
height: 85px; */ |
|
|
|
|
|
|
|
|
|
|
|
height: 1.5em !important; |
|
|
|
display: -webkit-box; |
|
|
|
|