|
|
|
@ -1,6 +1,6 @@ |
|
|
|
<script lang='ts' setup> |
|
|
|
import { useUserStore } from "@/store/modules/user" |
|
|
|
import { useKnowledgeStore } from "@/store/modules/knowledge" |
|
|
|
|
|
|
|
import { ref } from 'vue' |
|
|
|
import { getUserDetail, getZxxyNavis, getTuijian, getCarousel } from '@/api/knowledge/index' |
|
|
|
import Archivestype from '@/views/knowledge/knowledge/components/archivestype.vue' |
|
|
|
@ -16,8 +16,7 @@ const active = ref(0); // 当前激活的导航索引 |
|
|
|
|
|
|
|
const userStore = useUserStore(); |
|
|
|
const { userKey, userToken } = userStore; |
|
|
|
//标题下是否有内容 |
|
|
|
const KnowledgeStore = useKnowledgeStore(); |
|
|
|
|
|
|
|
|
|
|
|
const userDetail = ref<UserDetail>({ |
|
|
|
//证件号码 |
|
|
|
@ -36,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, |
|
|
|
@ -44,6 +44,8 @@ const userQueryParam = reactive<UserQuery>({ |
|
|
|
//navi查询参数 |
|
|
|
const naviQueryParam = reactive<NaviQuery>({ |
|
|
|
atParentId: "",//知识库 |
|
|
|
userkey: userKey, |
|
|
|
usertoken: userToken, |
|
|
|
}); |
|
|
|
const pageParamTuijian = reactive<PageParam>({ |
|
|
|
total: 0, |
|
|
|
@ -66,10 +68,15 @@ function errorImg(e: any) { |
|
|
|
e.srcElement.onerror = null; //防止闪图 |
|
|
|
} |
|
|
|
const fatherisReady = ref(0); |
|
|
|
const fatherisReady1 = ref(0); |
|
|
|
|
|
|
|
const router = useRouter() |
|
|
|
const routerUrl = toRaw(router).currentRoute.value.fullPath |
|
|
|
onBeforeMount(() => { |
|
|
|
//当前登录用户详细信息 |
|
|
|
getUserDetail(userQueryParam) |
|
|
|
.then(({ data }) => { |
|
|
|
userDetail.value = data |
|
|
|
}); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
@ -88,45 +95,20 @@ 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) |
|
|
|
}).finally(()=>{ |
|
|
|
fatherisReady1.value = 9; |
|
|
|
}); |
|
|
|
getCarousel(pageParamTuijian) |
|
|
|
.then(({ data }) => { |
|
|
|
carousel.value = data.list |
|
|
|
|
|
|
|
|
|
|
|
//console.log(tuijianPage.value) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//setTimeout(function(){ fatherisReady.value = 100;}, 3000); //三秒之后执行函数 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
@ -145,8 +127,6 @@ function handleCurrentChange() { |
|
|
|
tuijianPage.value = data.list |
|
|
|
pageParamTuijian.page = data.pageNum |
|
|
|
pageParamTuijian.total = data.total |
|
|
|
|
|
|
|
//console.log(tuijianPage.value) |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
@ -156,7 +136,6 @@ const cardContentSource = ref<Graphicform>({}); |
|
|
|
const showContentBox = ref(false); //详情弹窗 |
|
|
|
|
|
|
|
function showContentDialog(item: any) { |
|
|
|
|
|
|
|
showContentBox.value = true; |
|
|
|
cardContentSource.value = item; |
|
|
|
} |
|
|
|
@ -164,7 +143,6 @@ function showContentDialog(item: any) { |
|
|
|
|
|
|
|
</script> |
|
|
|
<template> |
|
|
|
|
|
|
|
<div class="app-container"> |
|
|
|
<KnowledgeContent v-model:isShow="showContentBox" :contentSource="cardContentSource"></KnowledgeContent> |
|
|
|
<!-- 内容区域 --> |
|
|
|
@ -210,9 +188,11 @@ 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> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -224,42 +204,33 @@ function showContentDialog(item: any) { |
|
|
|
<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) :fatherisReady1="fatherisReady1" |
|
|
|
: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:89.1%; |
|
|
|
width: 89.1%; |
|
|
|
margin-left: 190px; |
|
|
|
box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px; |
|
|
|
border-radius: 5px; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* .models { |
|
|
|
|
|
|
|
min-height: 500px; |
|
|
|
|
|
|
|
|
|
|
|
} */ |
|
|
|
|
|
|
|
|
|
|
|
/* 导航栏的样式 */ |
|
|
|
.navs { |
|
|
|
|
|
|
|
/* border:black 1px solid; */ |
|
|
|
|
|
|
|
|
|
|
|
width: 192px; |
|
|
|
@ -267,8 +238,6 @@ function showContentDialog(item: any) { |
|
|
|
height: auto; |
|
|
|
top: 95px; |
|
|
|
|
|
|
|
/* box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px; */ |
|
|
|
/* box-shadow: rgb(204, 219, 232) 3px 3px 6px 0px inset, rgba(255, 255, 255, 0.5) -3px -3px 6px 1px inset; */ |
|
|
|
} |
|
|
|
|
|
|
|
.navs li { |
|
|
|
|