|
|
@ -1,34 +1,24 @@ |
|
|
<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 { getTuijian } from '@/api/knowledge/index' |
|
|
import { getUserDetail, getZxxyNavis, 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 } 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" |
|
|
|
|
|
|
|
|
const showArea = ref(true); |
|
|
const showArea = ref(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
const props = defineProps({ |
|
|
// eslint-disable-next-line vue/require-default-prop |
|
|
// eslint-disable-next-line vue/require-default-prop |
|
|
liContent: { |
|
|
liContent: { |
|
|
type: Object, |
|
|
type: Object, |
|
|
default:()=>{ |
|
|
|
|
|
return ""; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
|
|
|
|
|
|
|
======= |
|
|
}, |
|
|
// eslint-disable-next-line vue/require-default-prop |
|
|
// eslint-disable-next-line vue/require-default-prop |
|
|
>>>>>>> v3_liwenxuan |
|
|
|
|
|
routerUrl: { |
|
|
routerUrl: { |
|
|
type: String, |
|
|
type: String, |
|
|
default:"" |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
index: { |
|
|
index: { |
|
|
@ -44,12 +34,10 @@ const props = defineProps({ |
|
|
default: 0 |
|
|
default: 0 |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
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"], |
|
|
@ -67,21 +55,11 @@ 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查询参数 |
|
|
//navi查询参数 |
|
|
const naviQueryParam = reactive<NaviQuery>({ |
|
|
const naviQueryParam = reactive<NaviQuery>({ |
|
|
atParentId: "",//知识库 |
|
|
atParentId: "",//知识库 |
|
|
userkey: userKey, |
|
|
userkey: userKey, |
|
|
usertoken: userToken, |
|
|
usertoken: userToken, |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
const pageParamTuijian = reactive<PageParam>({ |
|
|
const pageParamTuijian = reactive<PageParam>({ |
|
|
total: 0, |
|
|
total: 0, |
|
|
@ -104,78 +82,6 @@ function errorImg(e: any) { |
|
|
e.srcElement.onerror = null; //防止闪图 |
|
|
e.srcElement.onerror = null; //防止闪图 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
|
|
|
|
|
|
|
|
//console.log(props.liContent?.gParentSun) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
watch(() => [props.fatherisReady, props.liContent,props.routerUrl], (newVal, oldVal) => { |
|
|
|
|
|
//console.log(newVal, oldVal); // [11, 22], [1, 2] |
|
|
|
|
|
const routerUrl = oldVal[2] as String; |
|
|
|
|
|
const liContent = newVal[1] as any; |
|
|
|
|
|
//console.log(newVal[1]) |
|
|
|
|
|
//console.log(oldVal[2]) |
|
|
|
|
|
|
|
|
|
|
|
//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 = liContent.atId; |
|
|
|
|
|
//console.log(pageParamTuijian.gParentSun) |
|
|
|
|
|
//推荐 |
|
|
|
|
|
getTuijian(pageParamTuijian) |
|
|
|
|
|
.then(({ data }) => { |
|
|
|
|
|
tuijianPage.value = data.list |
|
|
|
|
|
pageParamTuijian.page = data.pageNum |
|
|
|
|
|
pageParamTuijian.total = data.total |
|
|
|
|
|
if(pageParamTuijian.total>0){ |
|
|
|
|
|
showCards.value = 1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 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) |
|
|
|
|
|
.then(({ data }) => { |
|
|
|
|
|
tuijianPage.value = data.list |
|
|
|
|
|
pageParamTuijian.page = data.pageNum |
|
|
|
|
|
pageParamTuijian.total = data.total |
|
|
|
|
|
console.log(tuijianPage.value) |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}) */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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] |
|
|
const routerUrl = oldVal[2] as String; |
|
|
const routerUrl = oldVal[2] as String; |
|
|
@ -225,7 +131,6 @@ watch(() => [props.fatherisReady, props.liContent, props.routerUrl], (newVal, ol |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function handleCurrentChange() { |
|
|
function handleCurrentChange() { |
|
|
|
|
|
|
|
|
getTuijian(pageParamTuijian) |
|
|
getTuijian(pageParamTuijian) |
|
|
@ -233,10 +138,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) |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -246,23 +147,15 @@ const showCards = ref(0) |
|
|
|
|
|
|
|
|
//dialog |
|
|
//dialog |
|
|
const cardContentSource = ref<Graphicform>({}); |
|
|
const cardContentSource = ref<Graphicform>({}); |
|
|
|
|
|
|
|
|
const showContentBox= ref(false); //详情弹窗 |
|
|
|
|
|
function showContentDialog(item:any){ |
|
|
|
|
|
|
|
|
|
|
|
showContentBox.value = true; |
|
|
|
|
|
cardContentSource.value=item; |
|
|
|
|
|
|
|
|
|
|
|
const showContentBox = ref(false); //详情弹窗 |
|
|
const showContentBox = ref(false); //详情弹窗 |
|
|
function showContentDialog(item: any) { |
|
|
function showContentDialog(item: any) { |
|
|
|
|
|
|
|
|
showContentBox.value = true; |
|
|
showContentBox.value = true; |
|
|
cardContentSource.value = item; |
|
|
cardContentSource.value = item; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|
<template> |
|
|
<template> |
|
|
@ -272,25 +165,12 @@ function showContentDialog(item: any) { |
|
|
<h3>{{ props.liContent?.atTitle }}</h3> |
|
|
<h3>{{ props.liContent?.atTitle }}</h3> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div v-show="!showCards" style="text-align: center;padding-top: 5%;">暂无数据</div> |
|
|
<div v-show="!showCards" style="text-align: center;padding-top: 5%;">暂无数据</div> |
|
|
<<<<<<< HEAD |
|
|
|
|
|
|
|
|
|
|
|
<div v-show="showCards" class="grid-tuijian" > |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div v-for="(item, index) in tuijianPage" :key="index" class="tuijian-card" @click="showContentDialog(item)"> |
|
|
|
|
|
|
|
|
|
|
|
<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 v-show="showCards" class="grid-tuijian"> |
|
|
<div v-show="showCards" class="grid-tuijian"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <div v-for="(item, index1) in tuijianPage" :key="index1" class="tuijian-card" @click="showContentDialog(item)"> |
|
|
<!-- <div v-for="(item, index1) in tuijianPage" :key="index1" class="tuijian-card" @click="showContentDialog(item)"> |
|
|
<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)" /> |
|
|
<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)" /> |
|
|
>>>>>>> v3_liwenxuan |
|
|
|
|
|
|
|
|
|
|
|
<div class="card-right"> |
|
|
<div class="card-right"> |
|
|
<span class="card-title" :title=item.gTitle>{{ item.gTitle }}</span> |
|
|
<span class="card-title" :title=item.gTitle>{{ item.gTitle }}</span> |
|
|
@ -332,9 +212,7 @@ function showContentDialog(item: any) { |
|
|
<style> |
|
|
<style> |
|
|
.models { |
|
|
.models { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
|
|
|
min-height: 200px; |
|
|
min-height: 200px; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
@ -347,13 +225,7 @@ function showContentDialog(item: any) { |
|
|
|
|
|
|
|
|
/* .grid-tuijian { |
|
|
/* .grid-tuijian { |
|
|
display: grid; |
|
|
display: grid; |
|
|
<<<<<<< HEAD |
|
|
|
|
|
|
|
|
|
|
|
grid-template-columns: repeat(auto-fill, 484px); |
|
|
|
|
|
|
|
|
|
|
|
======= |
|
|
|
|
|
grid-template-columns: repeat(auto-fill, 474px); |
|
|
grid-template-columns: repeat(auto-fill, 474px); |
|
|
>>>>>>> v3_liwenxuan |
|
|
|
|
|
gap: 10px; |
|
|
gap: 10px; |
|
|
grid-auto-flow: row dense; |
|
|
grid-auto-flow: row dense; |
|
|
} */ |
|
|
} */ |
|
|
@ -369,14 +241,8 @@ h3 { |
|
|
} |
|
|
} |
|
|
.tuijian-card { |
|
|
.tuijian-card { |
|
|
display: flex; |
|
|
display: flex; |
|
|
<<<<<<< HEAD |
|
|
|
|
|
|
|
|
|
|
|
width: 481px; |
|
|
|
|
|
|
|
|
|
|
|
======= |
|
|
|
|
|
/* width: 481px; */ |
|
|
/* width: 481px; */ |
|
|
width: 480px; |
|
|
width: 480px; |
|
|
>>>>>>> v3_liwenxuan |
|
|
|
|
|
height: 140px; |
|
|
height: 140px; |
|
|
padding: 3px; |
|
|
padding: 3px; |
|
|
border-radius: 8px; |
|
|
border-radius: 8px; |
|
|
@ -451,4 +317,4 @@ h3 { |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |