|
|
@ -1,17 +1,13 @@ |
|
|
<script lang='ts' setup> |
|
|
<script lang='ts' setup> |
|
|
import { useUserStore } from "@/store/modules/user" |
|
|
import { useUserStore } from "@/store/modules/user" |
|
|
import { ref, watch } from 'vue' |
|
|
import { ref, watch } from 'vue' |
|
|
import { getUserDetail, getZxxyNavis, getTuijian } from '@/api/knowledge/index' |
|
|
import { getTuijian } from '@/api/knowledge/index' |
|
|
import KnowledgeContent from '@/views/knowledge/knowledge/components/KnowledgeContent.vue' |
|
|
import KnowledgeContent from '@/views/knowledge/knowledge/components/KnowledgeContent.vue' |
|
|
import { UserQuery, UserDetail, NaviQuery, Navi, Graphicform, PageParam, ShowTitle } from '@/api/knowledge/types' |
|
|
import { UserDetail, NaviQuery, Navi, Graphicform, PageParam, ShowTitle } from '@/api/knowledge/types' |
|
|
import { formatDate } from '@/api/knowledge/scroll' |
|
|
import { formatDate } from '@/api/knowledge/scroll' |
|
|
import { useRouter } from 'vue-router' |
|
|
|
|
|
import errimg from '@/assets/404_images/imgNotFound.png' |
|
|
import errimg from '@/assets/404_images/imgNotFound.png' |
|
|
import { useKnowledgeStore } from "@/store/modules/knowledge" |
|
|
import { useKnowledgeStore } from "@/store/modules/knowledge" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const showArea = ref(true); |
|
|
const showArea = ref(true); |
|
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
const props = defineProps({ |
|
|
@ -40,9 +36,6 @@ const props = defineProps({ |
|
|
|
|
|
|
|
|
const userStore = useUserStore(); |
|
|
const userStore = useUserStore(); |
|
|
const { userKey, userToken } = userStore; |
|
|
const { userKey, userToken } = userStore; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const userDetail = ref<UserDetail>({ |
|
|
const userDetail = ref<UserDetail>({ |
|
|
//证件号码 |
|
|
//证件号码 |
|
|
idcardno: ["1", "2"], |
|
|
idcardno: ["1", "2"], |
|
|
@ -59,15 +52,12 @@ const userDetail = ref<UserDetail>({ |
|
|
}); |
|
|
}); |
|
|
const tuijianPage = ref<Graphicform[]>(); |
|
|
const tuijianPage = ref<Graphicform[]>(); |
|
|
|
|
|
|
|
|
/* const naviList = ref<Navi[]>(); */ |
|
|
|
|
|
/* //用户信息查询参数 |
|
|
|
|
|
const userQueryParam = reactive<UserQuery>({ |
|
|
|
|
|
userkey: userKey, |
|
|
|
|
|
usertoken: userToken, |
|
|
|
|
|
}); */ |
|
|
|
|
|
//navi查询参数 |
|
|
//navi查询参数 |
|
|
const naviQueryParam = reactive<NaviQuery>({ |
|
|
const naviQueryParam = reactive<NaviQuery>({ |
|
|
atParentId: "",//知识库 |
|
|
atParentId: "",//知识库 |
|
|
|
|
|
userkey: userKey, |
|
|
|
|
|
usertoken: userToken, |
|
|
}); |
|
|
}); |
|
|
const pageParamTuijian = reactive<PageParam>({ |
|
|
const pageParamTuijian = reactive<PageParam>({ |
|
|
total: 0, |
|
|
total: 0, |
|
|
@ -89,14 +79,6 @@ function errorImg(e: any) { |
|
|
//这一句没用,如果默认图片的路径错了还是会一直闪屏,在方法的前面加个.once只让它执行一次也没用 |
|
|
//这一句没用,如果默认图片的路径错了还是会一直闪屏,在方法的前面加个.once只让它执行一次也没用 |
|
|
e.srcElement.onerror = null; //防止闪图 |
|
|
e.srcElement.onerror = null; //防止闪图 |
|
|
} |
|
|
} |
|
|
onMounted(() => { |
|
|
|
|
|
|
|
|
|
|
|
//console.log(props.liContent?.gParentSun) |
|
|
|
|
|
|
|
|
|
|
|
//console.log(useKnowledgeStore().$state) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
watch(() => [props.fatherisReady, props.liContent, props.routerUrl], (newVal, oldVal) => { |
|
|
watch(() => [props.fatherisReady, props.liContent, props.routerUrl], (newVal, oldVal) => { |
|
|
//console.log(newVal, oldVal); // [11, 22], [1, 2] |
|
|
//console.log(newVal, oldVal); // [11, 22], [1, 2] |
|
|
@ -115,68 +97,37 @@ watch(() => [props.fatherisReady, props.liContent, props.routerUrl], (newVal, ol |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
pageParamTuijian.gParentSun = liContent.atId; |
|
|
pageParamTuijian.gParentSun = liContent.atId; |
|
|
//console.log(pageParamTuijian.gParentSun) |
|
|
|
|
|
//推荐 |
|
|
//推荐 |
|
|
getTuijian(pageParamTuijian) |
|
|
if (props.liContent?.hasCard == true) { |
|
|
.then(({ data }) => { |
|
|
//console.log(props.liContent?.hasCard) |
|
|
tuijianPage.value = data.list |
|
|
|
|
|
//console.log(tuijianPage.value) |
|
|
|
|
|
pageParamTuijian.page = data.pageNum |
|
|
|
|
|
pageParamTuijian.total = data.total |
|
|
|
|
|
if (pageParamTuijian.total > 0) { |
|
|
|
|
|
showCards.value = 1; |
|
|
|
|
|
} |
|
|
|
|
|
const KnowledgeStore = useKnowledgeStore(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tuijianPage.value.length > 0) { |
|
|
|
|
|
//本标题下有数据 |
|
|
|
|
|
KnowledgeStore.$patch((state) => { |
|
|
|
|
|
state.knowledgeTitlesShow.push({ atIdAndGParentSun: liContent.atId, hasCard: true }) |
|
|
|
|
|
}) |
|
|
|
|
|
showArea.value = true; |
|
|
|
|
|
}else{ |
|
|
|
|
|
KnowledgeStore.$patch((state) => { |
|
|
|
|
|
state.knowledgeTitlesShow.push({ atIdAndGParentSun: liContent.atId, hasCard: false }) |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
showArea.value = false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* watch(props.fatherisReady, (value) => { |
|
|
|
|
|
console.log(props); |
|
|
|
|
|
//childList.value = nweProps.listData |
|
|
|
|
|
let router = useRouter() |
|
|
|
|
|
let routerUrl = toRaw(router).currentRoute.value.fullPath |
|
|
|
|
|
console.log(routerUrl) |
|
|
|
|
|
if (routerUrl.endsWith("index")) {//此时页面为知识库 |
|
|
|
|
|
naviQueryParam.atParentId = '16213848089876281' |
|
|
|
|
|
pageParamTuijian.archivesTypeAtParentId = '16213848089876281' |
|
|
|
|
|
} else if (routerUrl.endsWith("news")) {//此时页面为新闻资讯 |
|
|
|
|
|
naviQueryParam.atParentId = '16213847972425134' |
|
|
|
|
|
pageParamTuijian.archivesTypeAtParentId = '16213847972425134' |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pageParamTuijian.gParentSun = props.liContent?.gParentSun; |
|
|
|
|
|
//推荐 |
|
|
|
|
|
getTuijian(pageParamTuijian) |
|
|
getTuijian(pageParamTuijian) |
|
|
.then(({ data }) => { |
|
|
.then(({ data }) => { |
|
|
tuijianPage.value = data.list |
|
|
tuijianPage.value = data.list |
|
|
|
|
|
//console.log(tuijianPage.value) |
|
|
pageParamTuijian.page = data.pageNum |
|
|
pageParamTuijian.page = data.pageNum |
|
|
pageParamTuijian.total = data.total |
|
|
pageParamTuijian.total = data.total |
|
|
console.log(tuijianPage.value) |
|
|
if (pageParamTuijian.total > 0) { |
|
|
|
|
|
showCards.value = 1; |
|
|
|
|
|
} |
|
|
|
|
|
const KnowledgeStore = useKnowledgeStore(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tuijianPage.value.length > 0) { |
|
|
|
|
|
//本标题下有数据 |
|
|
|
|
|
KnowledgeStore.$patch((state) => { |
|
|
|
|
|
state.knowledgeTitlesShow.push({ atIdAndGParentSun: liContent.atId, hasCard: true }) |
|
|
|
|
|
}) |
|
|
|
|
|
showArea.value = true; |
|
|
|
|
|
} else { |
|
|
|
|
|
KnowledgeStore.$patch((state) => { |
|
|
|
|
|
state.knowledgeTitlesShow.push({ atIdAndGParentSun: liContent.atId, hasCard: false }) |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
//showArea.value = false; |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
}) */ |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function handleCurrentChange() { |
|
|
function handleCurrentChange() { |
|
|
|
|
|
|
|
|
@ -185,8 +136,6 @@ function handleCurrentChange() { |
|
|
tuijianPage.value = data.list |
|
|
tuijianPage.value = data.list |
|
|
pageParamTuijian.page = data.pageNum |
|
|
pageParamTuijian.page = data.pageNum |
|
|
pageParamTuijian.total = data.total |
|
|
pageParamTuijian.total = data.total |
|
|
|
|
|
|
|
|
console.log(tuijianPage.value) |
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -208,7 +157,7 @@ function showContentDialog(item: any) { |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|
<template> |
|
|
<template> |
|
|
<div class="models " v-if="showArea"> |
|
|
<div class="models "> |
|
|
<KnowledgeContent v-model:isShow="showContentBox" :contentSource="cardContentSource"></KnowledgeContent> |
|
|
<KnowledgeContent v-model:isShow="showContentBox" :contentSource="cardContentSource"></KnowledgeContent> |
|
|
<div class="model-title"> |
|
|
<div class="model-title"> |
|
|
<h3>{{ props.liContent?.atTitle }}</h3> |
|
|
<h3>{{ props.liContent?.atTitle }}</h3> |
|
|
|