|
|
|
@ -9,7 +9,7 @@ import Navili from './components/Navili.vue' |
|
|
|
import KnowledgeContent from './components/KnowledgeContent.vue' |
|
|
|
|
|
|
|
import { UserQuery, UserDetail, NaviQuery, Navi, Graphicform, PageParam } from '@/api/knowledge/types' |
|
|
|
import { onScroll, scrollTo, formatDate } from '@/api/knowledge/scroll' |
|
|
|
import { onScroll, formatDate } from '@/api/knowledge/scroll' |
|
|
|
import { useRouter } from 'vue-router' |
|
|
|
import errimg from '@/assets/404_images/imgNotFound.png' |
|
|
|
|
|
|
|
@ -93,7 +93,26 @@ onBeforeMount(() => { |
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
// 监听滚动事件 |
|
|
|
window.addEventListener('scroll', jsScroll, false) |
|
|
|
//window.addEventListener('scroll', jsScroll, false) |
|
|
|
document.querySelector('.app-container')!.addEventListener('scroll', jsScroll, false) |
|
|
|
|
|
|
|
document.querySelector('.navs')!.addEventListener('wheel', (e) => { |
|
|
|
//阻止默认行为(页面的滚动行为) |
|
|
|
e.preventDefault() |
|
|
|
}, { |
|
|
|
//这里一定要显式设置为false,因为默认是true |
|
|
|
passive: false, |
|
|
|
}) //has-logo sidebar-container |
|
|
|
|
|
|
|
document.querySelector('.sidebar-container')!.addEventListener('wheel', (e) => { |
|
|
|
//阻止默认行为(页面的滚动行为) |
|
|
|
e.preventDefault() |
|
|
|
}, { |
|
|
|
//这里一定要显式设置为false,因为默认是true |
|
|
|
passive: false, |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (routerUrl.endsWith("index")) {//此时页面为知识库 |
|
|
|
naviQueryParam.atParentId = '16213848089876281' |
|
|
|
@ -105,6 +124,7 @@ onMounted(() => { |
|
|
|
getZxxyNavis(naviQueryParam) |
|
|
|
.then(({ data }) => { |
|
|
|
naviList.value = data |
|
|
|
<<<<<<< HEAD |
|
|
|
//console.log(naviList.value) |
|
|
|
|
|
|
|
}).finally(() => { |
|
|
|
@ -120,6 +140,11 @@ onMounted(() => { |
|
|
|
fatherisReady.value = 100; |
|
|
|
}) |
|
|
|
|
|
|
|
======= |
|
|
|
}).finally(() => { |
|
|
|
fatherisReady.value = 100; |
|
|
|
}) |
|
|
|
>>>>>>> v3_liwenxuan |
|
|
|
//推荐 |
|
|
|
getTuijian(pageParamTuijian) |
|
|
|
.then(({ data }) => { |
|
|
|
@ -177,11 +202,40 @@ function showContentDialog(item: any) { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//跳转至相关内容 start |
|
|
|
function scrollTo(index: any) { |
|
|
|
nextTick(() => { |
|
|
|
//console.log(index) |
|
|
|
const ele = document?.querySelector<HTMLElement>(`.content .models:nth-child(${index + 1})`)! |
|
|
|
ele.scrollIntoView() |
|
|
|
active.value = index |
|
|
|
}) |
|
|
|
} |
|
|
|
//跳转至相关内容 end |
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
<template> |
|
|
|
|
|
|
|
<div class="app-container"> |
|
|
|
<KnowledgeContent v-model:isShow="showContentBox" :contentSource="cardContentSource"></KnowledgeContent> |
|
|
|
|
|
|
|
<!-- 导航区域 --> |
|
|
|
|
|
|
|
<div class="uldiv"> |
|
|
|
<ul class="navs"> |
|
|
|
<li :class="{ active: active === 0 }" @click="scrollTo(0)"> |
|
|
|
推荐 |
|
|
|
</li> |
|
|
|
|
|
|
|
<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> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 内容区域 --> |
|
|
|
<div class="content"> |
|
|
|
|
|
|
|
@ -236,10 +290,11 @@ v-if="pageParamTuijian.total > 0" v-model:current-page="pageParamTuijian.page" |
|
|
|
</Archivestype> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
<!-- 内容详情组件 --> |
|
|
|
<KnowledgeContent v-model:isShow="showContentBox" :contentSource="cardContentSource"></KnowledgeContent> |
|
|
|
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
|
|
|
<!-- 导航区域 --> |
|
|
|
|
|
|
|
@ -257,6 +312,9 @@ v-if="pageParamTuijian.total > 0" v-model:current-page="pageParamTuijian.page" |
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
======= |
|
|
|
|
|
|
|
>>>>>>> v3_liwenxuan |
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
@ -264,6 +322,7 @@ v-if="pageParamTuijian.total > 0" v-model:current-page="pageParamTuijian.page" |
|
|
|
|
|
|
|
|
|
|
|
<style scoped> |
|
|
|
<<<<<<< HEAD |
|
|
|
|
|
|
|
/* 内容区的样式 */ |
|
|
|
.content { |
|
|
|
@ -292,17 +351,40 @@ v-if="pageParamTuijian.total > 0" v-model:current-page="pageParamTuijian.page" |
|
|
|
border-radius: 5px; |
|
|
|
} |
|
|
|
} |
|
|
|
======= |
|
|
|
.app-container { |
|
|
|
height: calc(100vh - 125px); |
|
|
|
width: 100%; |
|
|
|
overflow: auto; |
|
|
|
padding: 0 10px 0 30px; |
|
|
|
display: grid; |
|
|
|
/* 声明了三列,宽度分别为 200px 100px 200px */ |
|
|
|
grid-template-columns: 200px auto; |
|
|
|
} |
|
|
|
|
|
|
|
.content { |
|
|
|
background-color: white; |
|
|
|
width: auto; |
|
|
|
max-width: 87%; |
|
|
|
padding-left: 9%; |
|
|
|
box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px; |
|
|
|
border-radius: 5px; |
|
|
|
} |
|
|
|
|
|
|
|
h3 { |
|
|
|
margin-left: 10px; |
|
|
|
} |
|
|
|
|
|
|
|
/* 导航栏的样式 */ |
|
|
|
.navs { |
|
|
|
>>>>>>> v3_liwenxuan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
width: 192px; |
|
|
|
/* 导航栏的样式 */ |
|
|
|
.navs { |
|
|
|
width: 142px; |
|
|
|
position: fixed; |
|
|
|
height: auto; |
|
|
|
<<<<<<< HEAD |
|
|
|
top: 95px; |
|
|
|
|
|
|
|
|
|
|
|
@ -322,17 +404,42 @@ v-if="pageParamTuijian.total > 0" v-model:current-page="pageParamTuijian.page" |
|
|
|
color: #909399; |
|
|
|
background-color: white; |
|
|
|
margin-right: 15px; |
|
|
|
======= |
|
|
|
top: 105px; |
|
|
|
text-align: center; |
|
|
|
line-height: 5; |
|
|
|
font-size: 11.5px; |
|
|
|
color: #909399; |
|
|
|
background-color: white; |
|
|
|
padding: 10px; |
|
|
|
border-radius: 9.5px; |
|
|
|
box-shadow: rgba(0, 0, 0, 0.04) 0px 2px 5px; |
|
|
|
} |
|
|
|
|
|
|
|
li { |
|
|
|
padding-left: 12px; |
|
|
|
text-align: left; |
|
|
|
line-height: 2.7; |
|
|
|
font-size: 15.5px; |
|
|
|
color: #909399; |
|
|
|
background-color: white; |
|
|
|
|
|
|
|
>>>>>>> v3_liwenxuan |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.navs li:hover { |
|
|
|
li:hover { |
|
|
|
cursor: pointer; |
|
|
|
background-color: #F2F3F5; |
|
|
|
color: #409EFF; |
|
|
|
border-radius: 6px; |
|
|
|
} |
|
|
|
|
|
|
|
/* 当导航被点亮后改变颜色 */ |
|
|
|
.navs .active { |
|
|
|
color: #409EFF; |
|
|
|
|
|
|
|
background-color: #EAF2FF; |
|
|
|
border-radius: 6px; |
|
|
|
} |
|
|
|
|
|
|
|
.model-title { |
|
|
|
|