提交 6d438cac authored 作者: 徐先红's avatar 徐先红

合并分支 'xxh-dev' 到 'master'

Xxh dev 查看合并请求 !67
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
"axios": "^1.12.2", "axios": "^1.12.2",
"d3": "^7.9.0", "d3": "^7.9.0",
"d3-cloud": "^1.2.7", "d3-cloud": "^1.2.7",
"default-passive-events": "^4.0.0",
"echarts": "^5.4.3", "echarts": "^5.4.3",
"echarts-liquidfill": "^3.1.0", "echarts-liquidfill": "^3.1.0",
"echarts-wordcloud": "^2.1.0", "echarts-wordcloud": "^2.1.0",
...@@ -3045,6 +3046,12 @@ ...@@ -3045,6 +3046,12 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/default-passive-events": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/default-passive-events/-/default-passive-events-4.0.0.tgz",
"integrity": "sha512-0whk/GqfDOjc0AJIpacXUSqX6kV9TjL3GFSXIxFvuXQYcK+bEdJ6rpJnAEfP4YYMYWibM+jhlwmdlVrlifoepg==",
"license": "MIT"
},
"node_modules/define-property": { "node_modules/define-property": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmmirror.com/define-property/-/define-property-2.0.2.tgz", "resolved": "https://registry.npmmirror.com/define-property/-/define-property-2.0.2.tgz",
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
"axios": "^1.12.2", "axios": "^1.12.2",
"d3": "^7.9.0", "d3": "^7.9.0",
"d3-cloud": "^1.2.7", "d3-cloud": "^1.2.7",
"default-passive-events": "^4.0.0",
"echarts": "^5.4.3", "echarts": "^5.4.3",
"echarts-liquidfill": "^3.1.0", "echarts-liquidfill": "^3.1.0",
"echarts-wordcloud": "^2.1.0", "echarts-wordcloud": "^2.1.0",
......
...@@ -12,18 +12,18 @@ ...@@ -12,18 +12,18 @@
</div> </div>
</div> </div>
<div class="main"> <div class="main">
<div v-for="item in list" :key="item.id" class="item"> <div v-for="item in CharacterProposal" :key="item.id" class="item">
<div class="img-box"> <div class="img-box">
<img :src="item.img" alt="" class="img" /> <img :src="item.img" alt="" class="img" />
<div class="info"> <div class="info">
<div class="title">{{ item.title }}</div> <div class="title">{{ item.title }}</div>
<div> <div>
<span <span
v-for="(tag, index) in item.tie" v-for="tag in item.tie"
:key="tag" :key="tag"
class="tag" class="tag"
:class="{ 'tag-1': index == 0, 'tag-2': index == 1 }" :class="{ 'tag-1': tag.status == 1, 'tag-2': tag.status == 8, 'tag-3': tag.status == 4 }"
>{{ tag }}</span >{{ tag.industryName }}</span
> >
</div> </div>
</div> </div>
...@@ -49,10 +49,12 @@ ...@@ -49,10 +49,12 @@
<!-- 分页 --> <!-- 分页 -->
<div class="pagination-container"> <div class="pagination-container">
<el-pagination <el-pagination
@current-change="handleCurrentChange"
:page-size="pageSize"
:current-page="currentPage"
background background
layout="prev, pager, next" layout="prev, pager, next"
:total="100" :total="total"
v-model:current-page="currentPage"
class="custom-pagination" class="custom-pagination"
/> />
</div> </div>
...@@ -60,14 +62,82 @@ ...@@ -60,14 +62,82 @@
</template> </template>
<script setup> <script setup>
import { ref } from "vue"; import { ref, onMounted } from "vue";
import { Search } from "@element-plus/icons-vue"; import { Search } from "@element-plus/icons-vue";
import img from "./assets/img.png"; import img from "./assets/img.png";
import { getCharacterProposal } from "@/api/characterPage/characterPage.js";
const currentPage = ref(1);
// 处理页码改变事件
const handleCurrentChange = page => {
currentPage.value = page;
getCharacterProposalFn();
};
// 获取历史提案
const CharacterProposal = ref({});
const total = ref(0);
const pageSize = ref(7);
const loading = ref(false);
const abortController = ref(null);
const getCharacterProposalFn = async () => {
// 取消上一次未完成的请求
if (abortController.value) {
abortController.value.abort();
}
// 创建新的 AbortController
abortController.value = new AbortController();
loading.value = true;
const params = {
personId: window.sessionStorage.getItem("personId") || "Y000064",
industryId: 1,
currentPage: currentPage.value - 1,
pageSize: pageSize.value
};
try{
const res = await getCharacterProposal(params, abortController.value.signal);
console.log("历史提案", res);
if (res.code === 200) {
if (res.data&& res.data.content) {
CharacterProposal.value = res.data.content.map(item => ({
id: item.billId,
title: item.name,
tie: item.industryList,
disc: item.description,
state: item.status,
time: item.time,
img: item.imageUrl || img
}));
total.value = res.data.totalElements;
}else {
CharacterProposal.value = [];
total.value = 0;
}
}else {
CharacterProposal.value = [];
total.value = 0;
}
loading.value = false;
}catch (error) {
if (error.name !== "AbortError") {
console.error(error);
loading.value = false;
}
}
};
onMounted(() => {
getCharacterProposalFn();
});
const searchText = ref(""); const searchText = ref("");
const value1 = ref("全部法案"); const value1 = ref("全部法案");
const value2 = ref("全部领域"); const value2 = ref("全部领域");
const currentPage = ref(2);
const list = ref([ const list = ref([
{ {
...@@ -227,6 +297,11 @@ const list = ref([ ...@@ -227,6 +297,11 @@ const list = ref([
color: rgba(250, 173, 20, 1); color: rgba(250, 173, 20, 1);
border-color: rgba(255, 241, 184, 1); border-color: rgba(255, 241, 184, 1);
} }
.tag-3 {
background-color: rgba(255, 241, 240, 1);
color: rgba(245, 34, 45, 1);
border-color: rgba(255, 163, 158, 1);
}
} }
} }
.info-box { .info-box {
...@@ -251,6 +326,11 @@ const list = ref([ ...@@ -251,6 +326,11 @@ const list = ref([
font-family: "Microsoft YaHei"; font-family: "Microsoft YaHei";
line-height: 24px; line-height: 24px;
color: rgb(59, 65, 75); color: rgb(59, 65, 75);
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
text-overflow: ellipsis;
} }
} }
} }
......
...@@ -18,9 +18,8 @@ ...@@ -18,9 +18,8 @@
:teleported="false" :teleported="false"
size="small" size="small"
> >
<el-option label="近五年" value="近五年"></el-option> <el-option @click="" v-for="item in yearList" :key="item.value"
<el-option label="近十年" value="近十年"></el-option> :label="item.label" :value="item.value" />
<el-option label="近一年" value="近一年"></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
...@@ -59,8 +58,8 @@ ...@@ -59,8 +58,8 @@
<span class="title-text">科技法案</span> <span class="title-text">科技法案</span>
<img src="./assets/bottom.png" alt="" class="title-bottom" /> <img src="./assets/bottom.png" alt="" class="title-bottom" />
</div> </div>
<div class="main-box-content"> <div class="main-box-content" style="height: 300px;">
<div v-for="item in billList" :key="item.id" class="item"> <div v-for="item in relationBillsList" :key="item.id" class="item">
<img :src="item.img" alt="" class="item-img" /> <img :src="item.img" alt="" class="item-img" />
<div> <div>
<div class="item-name">{{ item.name }}</div> <div class="item-name">{{ item.name }}</div>
...@@ -76,8 +75,8 @@ ...@@ -76,8 +75,8 @@
<span class="title-text">科技政令</span> <span class="title-text">科技政令</span>
<img src="./assets/bottom.png" alt="" class="title-bottom" /> <img src="./assets/bottom.png" alt="" class="title-bottom" />
</div> </div>
<div class="main-box-content"> <div class="main-box-content" style="height: 142px;">
<div v-for="item in twoList" :key="item.id" class="item"> <div v-for="item in relationAdList" :key="item.id" class="item">
<div> <div>
<div class="item-name">{{ item.name }}</div> <div class="item-name">{{ item.name }}</div>
<div class="item-date">{{ item.date }}</div> <div class="item-date">{{ item.date }}</div>
...@@ -92,8 +91,8 @@ ...@@ -92,8 +91,8 @@
<span class="title-text">科技智库</span> <span class="title-text">科技智库</span>
<img src="./assets/bottom.png" alt="" class="title-bottom" /> <img src="./assets/bottom.png" alt="" class="title-bottom" />
</div> </div>
<div class="main-box-content"> <div class="main-box-content" style="height: 142px;">
<div v-for="item in billList2" :key="item.id" class="item"> <div v-for="item in relationThinkTankList" :key="item.id" class="item">
<img :src="item.img" alt="" class="item-img" /> <img :src="item.img" alt="" class="item-img" />
<div> <div>
<div class="item-name">{{ item.name }}</div> <div class="item-name">{{ item.name }}</div>
...@@ -124,10 +123,90 @@ import book6 from "./assets/book6.png"; ...@@ -124,10 +123,90 @@ import book6 from "./assets/book6.png";
import type1 from "./assets/type1.png"; import type1 from "./assets/type1.png";
import type2 from "./assets/type2.png"; import type2 from "./assets/type2.png";
import { getCharacterRelatedEntity } from "@/api/characterPage/characterPage.js";
const selectedOption = ref(1);
const yearList = ref([
{
label: "近一年",
value: 1
},
{
label: "近两年",
value: 2
},
{
label: "近五年",
value: 5
}
]);
function getDateYearsAgo(years) {
// 获取当前日期
const currentDate = new Date();
// 计算指定年数之前的日期
const pastDate = new Date(currentDate.getFullYear() - years, currentDate.getMonth(), currentDate.getDate());
// 格式化日期为 "YYYY-MM-DD" 的形式
const year = pastDate.getFullYear();
const month = String(pastDate.getMonth() + 1).padStart(2, "0"); // 月份从0开始,需要加1
const day = String(pastDate.getDate()).padStart(2, "0");
return `${year}-${month}-${day}`;
}
//获取相关实体
const relationBillsList = ref({});
const relationAdList = ref({});
const relationThinkTankList = ref({});
const getCharacterRelatedEntityFn = async () => {
const params = {
personId: window.sessionStorage.getItem("personId") || "Y000064",
startTime: getDateYearsAgo(selectedOption.value) || "2025-01-01"
};
try{
const res = await getCharacterRelatedEntity(params);
if (res.code === 200) {
console.log("人物相关实体", res);
if (res.data) {
relationBillsList.value = res.data.relationBillsList.map(item=>{
return{
id: item.billId,
name: item.billName,
type: item.industryList,
date: item.billTime,
img: book1 //待加
}
});
relationAdList.value = res.data.relationAdList.map(item=>{
return{
id: item.id,
name: item.adName,
type: item.adType,
date: item.adTime
}
});
relationThinkTankList.value = res.data.relationThinkTankList.map(item=>{
return{
id: item.reportId,
name: item.reportName,
type: type1, //缺属性
date: item.reportTime,
img: item.thinkTankUrl
}
});
}
}
}catch(error){
}
};
const searchText = ref(""); const searchText = ref("");
const selectedOption = ref("近五年");
const billList = ref([ const billList = ref([
{ {
...@@ -375,6 +454,7 @@ const makeOption = el => { ...@@ -375,6 +454,7 @@ const makeOption = el => {
}; };
onMounted(() => { onMounted(() => {
getCharacterRelatedEntityFn();
const el = document.querySelector(".echarts"); const el = document.querySelector(".echarts");
if (!el) return; if (!el) return;
chart = echarts.init(el); chart = echarts.init(el);
...@@ -628,8 +708,8 @@ const setLayout = type => { ...@@ -628,8 +708,8 @@ const setLayout = type => {
} }
.main-box-content { .main-box-content {
width: 100%; width: 100%;
min-height: 142px;
padding: 12px 0; padding: 12px 0;
overflow-y: scroll;
.item { .item {
width: 100%; width: 100%;
height: 53px; height: 53px;
...@@ -666,15 +746,18 @@ const setLayout = type => { ...@@ -666,15 +746,18 @@ const setLayout = type => {
font-family: "Microsoft YaHei"; font-family: "Microsoft YaHei";
line-height: 20px; line-height: 20px;
padding: 1px 8px; padding: 1px 8px;
border-radius: 4px;
border: 1px solid;
} }
.type-ai { .type-ai {
border-radius: 4px;
border: 1px solid;
color: rgba(19, 168, 168, 1); color: rgba(19, 168, 168, 1);
border-color: rgba(135, 232, 222, 1); border-color: rgba(135, 232, 222, 1);
background-color: rgba(230, 255, 251, 1); background-color: rgba(230, 255, 251, 1);
} }
.type-energy { .type-energy {
border-radius: 4px;
border: 1px solid;
color: rgba(245, 34, 45, 1); color: rgba(245, 34, 45, 1);
border-color: rgba(255, 163, 158, 1); border-color: rgba(255, 163, 158, 1);
background-color: rgba(255, 241, 240, 1); background-color: rgba(255, 241, 240, 1);
......
...@@ -18,9 +18,8 @@ ...@@ -18,9 +18,8 @@
:teleported="false" :teleported="false"
size="small" size="small"
> >
<el-option label="近五年" value="近五年"></el-option> <el-option @click="" v-for="item in yearList" :key="item.value"
<el-option label="近十年" value="近十年"></el-option> :label="item.label" :value="item.value" />
<el-option label="近一年" value="近一年"></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
...@@ -59,8 +58,8 @@ ...@@ -59,8 +58,8 @@
<span class="title-text">科技法案</span> <span class="title-text">科技法案</span>
<img src="./assets/bottom.png" alt="" class="title-bottom" /> <img src="./assets/bottom.png" alt="" class="title-bottom" />
</div> </div>
<div class="main-box-content"> <div class="main-box-content" style="height: 300px;">
<div v-for="item in billList" :key="item.id" class="item"> <div v-for="item in relationBillsList" :key="item.id" class="item">
<img :src="item.img" alt="" class="item-img" /> <img :src="item.img" alt="" class="item-img" />
<div> <div>
<div class="item-name">{{ item.name }}</div> <div class="item-name">{{ item.name }}</div>
...@@ -76,8 +75,8 @@ ...@@ -76,8 +75,8 @@
<span class="title-text">科技政令</span> <span class="title-text">科技政令</span>
<img src="./assets/bottom.png" alt="" class="title-bottom" /> <img src="./assets/bottom.png" alt="" class="title-bottom" />
</div> </div>
<div class="main-box-content"> <div class="main-box-content" style="height: 142px;">
<div v-for="item in twoList" :key="item.id" class="item"> <div v-for="item in relationAdList" :key="item.id" class="item">
<div> <div>
<div class="item-name">{{ item.name }}</div> <div class="item-name">{{ item.name }}</div>
<div class="item-date">{{ item.date }}</div> <div class="item-date">{{ item.date }}</div>
...@@ -92,8 +91,8 @@ ...@@ -92,8 +91,8 @@
<span class="title-text">科技智库</span> <span class="title-text">科技智库</span>
<img src="./assets/bottom.png" alt="" class="title-bottom" /> <img src="./assets/bottom.png" alt="" class="title-bottom" />
</div> </div>
<div class="main-box-content"> <div class="main-box-content" style="height: 142px;">
<div v-for="item in billList2" :key="item.id" class="item"> <div v-for="item in relationThinkTankList" :key="item.id" class="item">
<img :src="item.img" alt="" class="item-img" /> <img :src="item.img" alt="" class="item-img" />
<div> <div>
<div class="item-name">{{ item.name }}</div> <div class="item-name">{{ item.name }}</div>
...@@ -124,10 +123,90 @@ import book6 from "./assets/book6.png"; ...@@ -124,10 +123,90 @@ import book6 from "./assets/book6.png";
import type1 from "./assets/type1.png"; import type1 from "./assets/type1.png";
import type2 from "./assets/type2.png"; import type2 from "./assets/type2.png";
import { getCharacterRelatedEntity } from "@/api/characterPage/characterPage.js";
const selectedOption = ref(1);
const yearList = ref([
{
label: "近一年",
value: 1
},
{
label: "近两年",
value: 2
},
{
label: "近五年",
value: 5
}
]);
function getDateYearsAgo(years) {
// 获取当前日期
const currentDate = new Date();
// 计算指定年数之前的日期
const pastDate = new Date(currentDate.getFullYear() - years, currentDate.getMonth(), currentDate.getDate());
// 格式化日期为 "YYYY-MM-DD" 的形式
const year = pastDate.getFullYear();
const month = String(pastDate.getMonth() + 1).padStart(2, "0"); // 月份从0开始,需要加1
const day = String(pastDate.getDate()).padStart(2, "0");
return `${year}-${month}-${day}`;
}
//获取相关实体
const relationBillsList = ref({});
const relationAdList = ref({});
const relationThinkTankList = ref({});
const getCharacterRelatedEntityFn = async () => {
const params = {
personId: window.sessionStorage.getItem("personId") || "Y000064",
startTime: getDateYearsAgo(selectedOption.value) || "2025-01-01"
};
try{
const res = await getCharacterRelatedEntity(params);
if (res.code === 200) {
console.log("人物相关实体", res);
if (res.data) {
relationBillsList.value = res.data.relationBillsList.map(item=>{
return{
id: item.billId,
name: item.billName,
type: item.industryList,
date: item.billTime,
img: book1 //待加
}
});
relationAdList.value = res.data.relationAdList.map(item=>{
return{
id: item.id,
name: item.adName,
type: item.adType,
date: item.adTime
}
});
relationThinkTankList.value = res.data.relationThinkTankList.map(item=>{
return{
id: item.reportId,
name: item.reportName,
type: type1, //缺属性
date: item.reportTime,
img: item.thinkTankUrl
}
});
}
}
}catch(error){
}
};
const searchText = ref(""); const searchText = ref("");
const selectedOption = ref("近五年");
const billList = ref([ const billList = ref([
{ {
...@@ -375,6 +454,7 @@ const makeOption = el => { ...@@ -375,6 +454,7 @@ const makeOption = el => {
}; };
onMounted(() => { onMounted(() => {
getCharacterRelatedEntityFn();
const el = document.querySelector(".echarts"); const el = document.querySelector(".echarts");
if (!el) return; if (!el) return;
chart = echarts.init(el); chart = echarts.init(el);
...@@ -628,8 +708,8 @@ const setLayout = type => { ...@@ -628,8 +708,8 @@ const setLayout = type => {
} }
.main-box-content { .main-box-content {
width: 100%; width: 100%;
min-height: 142px;
padding: 12px 0; padding: 12px 0;
overflow-y: scroll;
.item { .item {
width: 100%; width: 100%;
height: 53px; height: 53px;
...@@ -666,15 +746,18 @@ const setLayout = type => { ...@@ -666,15 +746,18 @@ const setLayout = type => {
font-family: "Microsoft YaHei"; font-family: "Microsoft YaHei";
line-height: 20px; line-height: 20px;
padding: 1px 8px; padding: 1px 8px;
border-radius: 4px;
border: 1px solid;
} }
.type-ai { .type-ai {
border-radius: 4px;
border: 1px solid;
color: rgba(19, 168, 168, 1); color: rgba(19, 168, 168, 1);
border-color: rgba(135, 232, 222, 1); border-color: rgba(135, 232, 222, 1);
background-color: rgba(230, 255, 251, 1); background-color: rgba(230, 255, 251, 1);
} }
.type-energy { .type-energy {
border-radius: 4px;
border: 1px solid;
color: rgba(245, 34, 45, 1); color: rgba(245, 34, 45, 1);
border-color: rgba(255, 163, 158, 1); border-color: rgba(255, 163, 158, 1);
background-color: rgba(255, 241, 240, 1); background-color: rgba(255, 241, 240, 1);
......
...@@ -53,13 +53,13 @@ ...@@ -53,13 +53,13 @@
</div> </div>
<!-- 主要内容 --> <!-- 主要内容 -->
<div class="num-list"> <div class="num-list">
<div v-for="item in num" :key="item" :class="{ active: item === numActive }" @click="numActive = item"> <div v-for="item in num" :key="item" :class="{ active: item === numActive }" @click="handleChangeYear(item)">
{{ item }} {{ item }}
</div> </div>
</div> </div>
<!-- echarts 图表 --> <!-- echarts 图表 -->
<div class="echarts"> <div class="echarts" id="wordCloudChart">
<div class="row" v-for="(row, index) in wordCloudData" :key="index"> <!-- <div class="row" v-for="(row, index) in wordCloudData" :key="index">
<span <span
v-for="(item, idx) in row" v-for="(item, idx) in row"
:key="idx" :key="idx"
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
> >
{{ item.text }} {{ item.text }}
</span> </span>
</div> </div> -->
</div> </div>
</div> </div>
<div class="left-bottom"> <div class="left-bottom">
...@@ -261,8 +261,10 @@ ...@@ -261,8 +261,10 @@
<script setup> <script setup>
import { ref, onMounted } from "vue"; import { ref, onMounted } from "vue";
import setChart from "@/utils/setChart";
import CharacterRelationships from "./components/characterRelationships/index.vue"; import CharacterRelationships from "./components/characterRelationships/index.vue";
import RelevantSituation from "./components/relevantSituation/index.vue"; import RelevantSituation from "./components/relevantSituation/index.vue";
import getWordCloudChart from "../../utils/worldCloudChart";
import { getCharacterGlobalInfo, import { getCharacterGlobalInfo,
getCharacterBasicInfo, getCharacterBasicInfo,
getCharacterView, getCharacterView,
...@@ -394,14 +396,19 @@ const characterView = ref({}); ...@@ -394,14 +396,19 @@ const characterView = ref({});
const getCharacterViewFn = async () => { const getCharacterViewFn = async () => {
const params = { const params = {
personId: window.sessionStorage.getItem("personId") || "Y000064", personId: window.sessionStorage.getItem("personId") || "Y000064",
year: numActive.value || 2025 year: numActive.value
}; };
try{ try{
const res = await getCharacterView(params); const res = await getCharacterView(params);
if (res.code === 200) { if (res.code === 200) {
console.log("人物观点", res); console.log("人物观点", res);
if (res.data) { if (res.data) {
characterView.value = res.data; characterView.value = res.data.map(item=>{
return{
name:item.option,
value:item.count
};
});
} }
} }
}catch(error){ }catch(error){
...@@ -410,6 +417,18 @@ const getCharacterViewFn = async () => { ...@@ -410,6 +417,18 @@ const getCharacterViewFn = async () => {
}; };
const handleCharacterView = async () => {
await getCharacterViewFn();
const wordCloudChart = getWordCloudChart(characterView.value);
setChart(wordCloudChart, "wordCloudChart");
};
const handleChangeYear = (item) => {
numActive.value = item;
characterView.value = [];
handleCharacterView();
};
// 获取领域观点 // 获取领域观点
const CharacterFieldView = ref({}); const CharacterFieldView = ref({});
const getCharacterFieldViewFn = async () => { const getCharacterFieldViewFn = async () => {
...@@ -528,6 +547,8 @@ const getCharacterResumeFn = async () => { ...@@ -528,6 +547,8 @@ const getCharacterResumeFn = async () => {
}; };
const info = ref(["人物详情", "人物关系", "相关情况"]); const info = ref(["人物详情", "人物关系", "相关情况"]);
const infoActive = ref("人物详情"); const infoActive = ref("人物详情");
const num = ref(["2025", "2024", "2023", "2022", "2021", "2020"]); const num = ref(["2025", "2024", "2023", "2022", "2021", "2020"]);
...@@ -716,10 +737,11 @@ const dialogData = ref([ ...@@ -716,10 +737,11 @@ const dialogData = ref([
onMounted(() => { onMounted(() => {
getCharacterGlobalInfoFn(); getCharacterGlobalInfoFn();
getCharacterBasicInfoFn(); getCharacterBasicInfoFn();
getCharacterViewFn(); // getCharacterViewFn();
getCharacterLatestDynamicFn(); getCharacterLatestDynamicFn();
getCharacterResumeFn(); getCharacterResumeFn();
getCharacterFieldViewFn(); getCharacterFieldViewFn();
handleCharacterView();
}); });
</script> </script>
......
...@@ -73,14 +73,84 @@ ...@@ -73,14 +73,84 @@
</template> </template>
<script setup> <script setup>
import { ref } from "vue"; import { ref, onMounted } from "vue";
import { Search } from "@element-plus/icons-vue"; import { Search } from "@element-plus/icons-vue";
import img from "./assets/img.png"; import img from "./assets/img.png";
import { getCharacterAchievementReport } from "@/api/characterPage/characterPage.js";
const currentPage = ref(1);
// 处理页码改变事件
const handleCurrentChange = page => {
currentPage.value = page;
getCharacterProposalFn();
};
// 获取成果报告
const CharacterAchievementReport = ref({});
const total = ref(0);
const pageSize = ref(7);
const loading = ref(false);
const abortController = ref(null);
const getCharacterAchievementReportFn = async () => {
// 取消上一次未完成的请求
if (abortController.value) {
abortController.value.abort();
}
// 创建新的 AbortController
abortController.value = new AbortController();
loading.value = true;
const params = {
personId: window.sessionStorage.getItem("personId") || "Y000064",
industryId: 1,
year: 2025,
currentPage: currentPage.value - 1,
pageSize: pageSize.value
};
try{
const res = await getCharacterAchievementReport(params, abortController.value.signal);
console.log("成功报告", res);
if (res.code === 200) {
if (res.data&& res.data.content) {
CharacterAchievementReport.value = res.data.content.map(item => ({
id: item.billId,
title: item.name,
tie: item.industryList,
disc: item.description,
state: item.status,
time: item.time,
img: item.imageUrl || img
}));
total.value = res.data.totalElements;
}else {
CharacterAchievementReport.value = [];
total.value = 0;
}
}else {
CharacterAchievementReport.value = [];
total.value = 0;
}
loading.value = false;
}catch (error) {
if (error.name !== "AbortError") {
console.error(error);
loading.value = false;
}
}
};
onMounted(() => {
getCharacterAchievementReportFn();
});
const searchText = ref(""); const searchText = ref("");
const value1 = ref("全部法案"); const value1 = ref("全部法案");
const value2 = ref("全部领域"); const value2 = ref("全部领域");
const currentPage = ref(2);
const list = ref([ const list = ref([
{ {
......
...@@ -18,9 +18,8 @@ ...@@ -18,9 +18,8 @@
:teleported="false" :teleported="false"
size="small" size="small"
> >
<el-option label="近五年" value="近五年"></el-option> <el-option @click="" v-for="item in yearList" :key="item.value"
<el-option label="近十年" value="近十年"></el-option> :label="item.label" :value="item.value" />
<el-option label="近一年" value="近一年"></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
...@@ -59,8 +58,8 @@ ...@@ -59,8 +58,8 @@
<span class="title-text">科技法案</span> <span class="title-text">科技法案</span>
<img src="./assets/bottom.png" alt="" class="title-bottom" /> <img src="./assets/bottom.png" alt="" class="title-bottom" />
</div> </div>
<div class="main-box-content"> <div class="main-box-content" style="height: 300px;">
<div v-for="item in billList" :key="item.id" class="item"> <div v-for="item in relationBillsList" :key="item.id" class="item">
<img :src="item.img" alt="" class="item-img" /> <img :src="item.img" alt="" class="item-img" />
<div> <div>
<div class="item-name">{{ item.name }}</div> <div class="item-name">{{ item.name }}</div>
...@@ -76,8 +75,8 @@ ...@@ -76,8 +75,8 @@
<span class="title-text">科技政令</span> <span class="title-text">科技政令</span>
<img src="./assets/bottom.png" alt="" class="title-bottom" /> <img src="./assets/bottom.png" alt="" class="title-bottom" />
</div> </div>
<div class="main-box-content"> <div class="main-box-content" style="height: 142px;">
<div v-for="item in twoList" :key="item.id" class="item"> <div v-for="item in relationAdList" :key="item.id" class="item">
<div> <div>
<div class="item-name">{{ item.name }}</div> <div class="item-name">{{ item.name }}</div>
<div class="item-date">{{ item.date }}</div> <div class="item-date">{{ item.date }}</div>
...@@ -92,8 +91,8 @@ ...@@ -92,8 +91,8 @@
<span class="title-text">科技智库</span> <span class="title-text">科技智库</span>
<img src="./assets/bottom.png" alt="" class="title-bottom" /> <img src="./assets/bottom.png" alt="" class="title-bottom" />
</div> </div>
<div class="main-box-content"> <div class="main-box-content" style="height: 142px;">
<div v-for="item in billList2" :key="item.id" class="item"> <div v-for="item in relationThinkTankList" :key="item.id" class="item">
<img :src="item.img" alt="" class="item-img" /> <img :src="item.img" alt="" class="item-img" />
<div> <div>
<div class="item-name">{{ item.name }}</div> <div class="item-name">{{ item.name }}</div>
...@@ -124,10 +123,90 @@ import book6 from "./assets/book6.png"; ...@@ -124,10 +123,90 @@ import book6 from "./assets/book6.png";
import type1 from "./assets/type1.png"; import type1 from "./assets/type1.png";
import type2 from "./assets/type2.png"; import type2 from "./assets/type2.png";
import { getCharacterRelatedEntity } from "@/api/characterPage/characterPage.js";
const selectedOption = ref(1);
const yearList = ref([
{
label: "近一年",
value: 1
},
{
label: "近两年",
value: 2
},
{
label: "近五年",
value: 5
}
]);
function getDateYearsAgo(years) {
// 获取当前日期
const currentDate = new Date();
// 计算指定年数之前的日期
const pastDate = new Date(currentDate.getFullYear() - years, currentDate.getMonth(), currentDate.getDate());
// 格式化日期为 "YYYY-MM-DD" 的形式
const year = pastDate.getFullYear();
const month = String(pastDate.getMonth() + 1).padStart(2, "0"); // 月份从0开始,需要加1
const day = String(pastDate.getDate()).padStart(2, "0");
return `${year}-${month}-${day}`;
}
//获取相关实体
const relationBillsList = ref({});
const relationAdList = ref({});
const relationThinkTankList = ref({});
const getCharacterRelatedEntityFn = async () => {
const params = {
personId: window.sessionStorage.getItem("personId") || "Y000064",
startTime: getDateYearsAgo(selectedOption.value) || "2025-01-01"
};
try{
const res = await getCharacterRelatedEntity(params);
if (res.code === 200) {
console.log("人物相关实体", res);
if (res.data) {
relationBillsList.value = res.data.relationBillsList.map(item=>{
return{
id: item.billId,
name: item.billName,
type: item.industryList,
date: item.billTime,
img: book1 //待加
}
});
relationAdList.value = res.data.relationAdList.map(item=>{
return{
id: item.id,
name: item.adName,
type: item.adType,
date: item.adTime
}
});
relationThinkTankList.value = res.data.relationThinkTankList.map(item=>{
return{
id: item.reportId,
name: item.reportName,
type: type1, //缺属性
date: item.reportTime,
img: item.thinkTankUrl
}
});
}
}
}catch(error){
}
};
const searchText = ref(""); const searchText = ref("");
const selectedOption = ref("近五年");
const billList = ref([ const billList = ref([
{ {
...@@ -375,6 +454,7 @@ const makeOption = el => { ...@@ -375,6 +454,7 @@ const makeOption = el => {
}; };
onMounted(() => { onMounted(() => {
getCharacterRelatedEntityFn();
const el = document.querySelector(".echarts"); const el = document.querySelector(".echarts");
if (!el) return; if (!el) return;
chart = echarts.init(el); chart = echarts.init(el);
...@@ -628,8 +708,8 @@ const setLayout = type => { ...@@ -628,8 +708,8 @@ const setLayout = type => {
} }
.main-box-content { .main-box-content {
width: 100%; width: 100%;
min-height: 142px;
padding: 12px 0; padding: 12px 0;
overflow-y: scroll;
.item { .item {
width: 100%; width: 100%;
height: 53px; height: 53px;
...@@ -666,15 +746,18 @@ const setLayout = type => { ...@@ -666,15 +746,18 @@ const setLayout = type => {
font-family: "Microsoft YaHei"; font-family: "Microsoft YaHei";
line-height: 20px; line-height: 20px;
padding: 1px 8px; padding: 1px 8px;
border-radius: 4px;
border: 1px solid;
} }
.type-ai { .type-ai {
border-radius: 4px;
border: 1px solid;
color: rgba(19, 168, 168, 1); color: rgba(19, 168, 168, 1);
border-color: rgba(135, 232, 222, 1); border-color: rgba(135, 232, 222, 1);
background-color: rgba(230, 255, 251, 1); background-color: rgba(230, 255, 251, 1);
} }
.type-energy { .type-energy {
border-radius: 4px;
border: 1px solid;
color: rgba(245, 34, 45, 1); color: rgba(245, 34, 45, 1);
border-color: rgba(255, 163, 158, 1); border-color: rgba(255, 163, 158, 1);
background-color: rgba(255, 241, 240, 1); background-color: rgba(255, 241, 240, 1);
......
...@@ -14,16 +14,53 @@ ...@@ -14,16 +14,53 @@
</template> </template>
<script setup> <script setup>
import { ref } from 'vue'; import { ref, onMounted } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import TechLeader from './components/techLeader/index.vue'; import TechLeader from './components/techLeader/index.vue';
import MemberOfCongress from './components/memberOfCongress/index.vue'; import MemberOfCongress from './components/memberOfCongress/index.vue';
import ThinkTankPerson from './components/thinkTankPerson/index.vue'; import ThinkTankPerson from './components/thinkTankPerson/index.vue';
import { getCharacterGlobalInfo } from "@/api/characterPage/characterPage.js";
// 获取路由参数,1为科技领袖,2为国会议员,3为智库研究人员 // 获取路由参数,1为科技领袖,2为国会议员,3为智库研究人员
const route = useRoute(); const route = useRoute();
const type = ref(route.query.type || 1); const type = ref(route.query.type || 1);
// 获取人物全局信息
const characterInfo = ref({});
const getCharacterGlobalInfoFn = async () => {
const params = {
personId: window.sessionStorage.getItem("personId") || "Y000064"
};
try{
const res = await getCharacterGlobalInfo(params);
if (res.code === 200) {
console.log("人物全局信息111", res);
if (res.data) {
characterInfo.value = res.data;
const personType = characterInfo.value.personType;
if(personType === "002"){
type.value = 1;
}
else if(personType === "004"){
type.value = 2;
}
else if(personType === "005"){
type.value = 3;
}
}
}
}catch(error){
}
};
onMounted(() => {
getCharacterGlobalInfoFn();
});
</script> </script>
......
const getWordCloudChart = (data) => {
const option = {
grid: {
left: 0,
top: 0,
right: 0,
bottom: 0,
},
series: [
{
type: "wordCloud",
width: '80%',
height: '80%',
shape: "rect", //
// 其他形状你可以使用形状路径
// 或者自定义路径
// shape: 'circle' // 圆形(默认)
// shape: 'rect' // 矩形
// shape: 'roundRect' // 圆角矩形
// shape: 'triangle' // 三角形
// shape: 'diamond' // 菱形
// shape: 'pentagon' // 五边形
// shape: 'star' // 星形
// shape: 'cardioid' // 心形
gridSize: 15, // 网格大小,影响词间距。
sizeRange: [10, 30], // 定义词云中文字大小的范围
rotationRange: [0, 0],
rotationStep: 15,
drawOutOfBound: false, // 是否超出画布
// 字体
textStyle: {
// normal: {
// color: function () {
// return 'rgb(' + [
// Math.round(Math.random() * 160),
// Math.round(Math.random() * 160),
// Math.round(Math.random() * 160)
// ].join(',') + ')';
// }
// },
color: function () {
let colors = [
"rgba(189, 33, 33, 1)",
"rgba(232, 151, 21, 1)",
"rgba(220, 190, 68, 1)",
"rgba(96, 58, 186, 1)",
"rgba(32, 121, 69, 1)",
"rgba(22, 119, 255, 1)",
];
return colors[parseInt(Math.random() * colors.length)];
},
emphasis: {
shadowBlur: 5,
shadowColor: "#333",
},
},
// 设置词云数据
data: data,
},
],
}
return option
}
export default getWordCloudChart
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论