提交 52941ee8 authored 作者: Vicky's avatar Vicky

完善资源库

上级 9b95945a
...@@ -46,13 +46,26 @@ ...@@ -46,13 +46,26 @@
<script setup> <script setup>
// 导入数据(建议使用更具语义的变量名) // 导入数据(建议使用更具语义的变量名)
import sourceLibraryData from "../json/source.json"; import sourceLibraryData from "../json/source.json";
import { ref,onMounted } from "vue"; import { ref,onMounted,defineProps,watch } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import DefaultIcon1 from '@/assets/icons/default-icon1.png' import DefaultIcon1 from '@/assets/icons/default-icon1.png'
import DefaultIcon2 from '@/assets/icons/default-icon2.png' import DefaultIcon2 from '@/assets/icons/default-icon2.png'
import {getPersonResource,getPersonSummaryInfo } from "@/api/technologyFigures/technologyFigures"; import {getPersonResource,getPersonSummaryInfo } from "@/api/technologyFigures/technologyFigures";
const props = defineProps({
typeId: {
type: String,
default: "000"
}
});
watch(() => props.typeId, (val) => {
handlegetPersonResourceFn();
})
const router = useRouter(); const router = useRouter();
const total = ref(0); const total = ref(0);
...@@ -75,6 +88,9 @@ const handlegetPersonResourceFn = async () => { ...@@ -75,6 +88,9 @@ const handlegetPersonResourceFn = async () => {
currentPage: currentPage.value - 1, // Standard Spring Boot page index is 0-based currentPage: currentPage.value - 1, // Standard Spring Boot page index is 0-based
pageSize: pageSize.value pageSize: pageSize.value
}; };
if(props.typeId !== '000'){
params.personTypeId = props.typeId;
}
try { try {
const res = await getPersonResource(params,abortController.value.signal); const res = await getPersonResource(params,abortController.value.signal);
console.log("人物资源库", res); console.log("人物资源库", res);
......
...@@ -427,17 +427,17 @@ ...@@ -427,17 +427,17 @@
<div class="btn-box"> <div class="btn-box">
<div <div
class="btn" class="btn"
:class="{ btnActive: activeCate === cate }" :class="{ btnActive: activeCate === cate.typeName }"
v-for="(cate, index) in categoryList" v-for="(cate, index) in categoryList"
:key="index" :key="index"
@click="handleClickCate(cate)" @click="handleClickCate(cate)"
> >
{{ cate }} {{ cate.typeName}}
</div> </div>
</div> </div>
</div> </div>
<div class="home-main-footer-main"> <div class="home-main-footer-main">
<SourceLibrary /> <SourceLibrary :typeId="typeId"/>
</div> </div>
</div> </div>
</div> </div>
...@@ -518,6 +518,8 @@ const handlgetPersonTypeFn = async () => { ...@@ -518,6 +518,8 @@ const handlgetPersonTypeFn = async () => {
const res = await getPersonType(); const res = await getPersonType();
console.log("人物类别", res); console.log("人物类别", res);
PersonType.value = res.data; PersonType.value = res.data;
categoryList.value = res.data;
categoryList.value.unshift({typeId: '000', typeName:'全部人物'});
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} }
...@@ -919,8 +921,10 @@ const yearList = ref([ ...@@ -919,8 +921,10 @@ const yearList = ref([
const categoryList = ref(["全部人物", "国会议员", "行政主官", "科技领袖", "顶尖科学家"]); const categoryList = ref(["全部人物", "国会议员", "行政主官", "科技领袖", "顶尖科学家"]);
const activeCate = ref("全部人物"); const activeCate = ref("全部人物");
const typeId = ref("000");
const handleClickCate = cate => { const handleClickCate = cate => {
activeCate.value = cate; activeCate.value = cate.typeName;
typeId.value = cate.typeId;
}; };
// 查看更多风险信号 // 查看更多风险信号
...@@ -1922,7 +1926,7 @@ onMounted(async () => { ...@@ -1922,7 +1926,7 @@ onMounted(async () => {
.home-main-footer { .home-main-footer {
height: 1000px; height: 1000px;
overflow: hidden;
.home-main-footer-header { .home-main-footer-header {
width: 1600px; width: 1600px;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论