提交 4c8d4b2f authored 作者: 张伊明's avatar 张伊明

feat 新增新闻跳转、实体关联

上级 20ed4d87
流水线 #158 已通过 于阶段
in 1 分 46 秒
...@@ -125,9 +125,11 @@ import defaultNew from "../assets/images/default-icon-news.png"; ...@@ -125,9 +125,11 @@ import defaultNew from "../assets/images/default-icon-news.png";
import defaultA from "../assets/images/default-icon1.png"; import defaultA from "../assets/images/default-icon1.png";
import { getBillBackground, getBillPersonAnalyze, getBillInfoEvent, getBillPersonAnalyzeDy } from "@/api/bill"; import { getBillBackground, getBillPersonAnalyze, getBillInfoEvent, getBillPersonAnalyzeDy } from "@/api/bill";
import { useGotoNewsDetail } from "@/router/modules/news";
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const gotoNewsDetail = useGotoNewsDetail();
const handleNewsImgError = e => { const handleNewsImgError = e => {
e.target.src = defaultNew; e.target.src = defaultNew;
...@@ -135,13 +137,9 @@ const handleNewsImgError = e => { ...@@ -135,13 +137,9 @@ const handleNewsImgError = e => {
// 跳转到相关新闻 // 跳转到相关新闻
const handleClickEvent = item => { const handleClickEvent = item => {
const routeData = router.resolve({ const newsId = item?.id || item?.newsId;
path: "/newsAnalysis", if (!newsId) return;
query: { gotoNewsDetail(newsId);
newsId: item.id
}
});
window.open(routeData.href, "_blank");
}; };
...@@ -281,7 +279,7 @@ const handleGetBillPersonAnalyze = async isOppose => { ...@@ -281,7 +279,7 @@ const handleGetBillPersonAnalyze = async isOppose => {
const { members, industryCounts } = res.data; const { members, industryCounts } = res.data;
// 更新人员列表 // 更新人员列表
personList.value = members || []; personList.value = members || [];
personList.value.forEach((item, index) => { personList.value.forEach(item => {
// 优先使用接口返回的图片,没有则使用默认头像 defaultA // 优先使用接口返回的图片,没有则使用默认头像 defaultA
item.image = item.imageUrl || defaultA; item.image = item.imageUrl || defaultA;
item.icon = userIcon; item.icon = userIcon;
......
...@@ -123,8 +123,9 @@ ...@@ -123,8 +123,9 @@
<DivideHeader id="position2" class="divide2" :titleText="'资讯要闻'"></DivideHeader> <DivideHeader id="position2" class="divide2" :titleText="'资讯要闻'"></DivideHeader>
<div class="center-center"> <div class="center-center">
<NewsList :newsList="newsList" img="newsImage" title="newsTitle" from="from" content="newsContent" /> <NewsList :newsList="newsList" img="newsImage" title="newsTitle" from="from" content="newsContent"
<MessageBubble :messageList="messageList" imageUrl="personImage" @more-click="handleToSocialDetail" @item-click="handleClickNewsDetail" />
<MessageBubble :messageList="messageList" imageUrl="personImage" @more-click="handleToSocialDetail"
@person-click="handleClickToCharacter" name="personName" content="remarks" source="orgName" /> @person-click="handleClickToCharacter" name="personName" content="remarks" source="orgName" />
</div> </div>
...@@ -293,6 +294,7 @@ import iconCommit from "./assets/icons/icon-commit.png"; ...@@ -293,6 +294,7 @@ import iconCommit from "./assets/icons/icon-commit.png";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { Calendar } from "@element-plus/icons-vue"; import { Calendar } from "@element-plus/icons-vue";
import { useGotoNewsDetail } from "@/router/modules/news";
// 跳转人物主页 // 跳转人物主页
const handleClickToCharacter = async (id, name) => { const handleClickToCharacter = async (id, name) => {
...@@ -500,6 +502,13 @@ const aiPaneLoading = ref({ ...@@ -500,6 +502,13 @@ const aiPaneLoading = ref({
box9: false box9: false
}); });
const gotoNewsDetail = useGotoNewsDetail();
const handleClickNewsDetail = news => {
const newsId = news?.newsId || news?.id;
if (!newsId) return;
gotoNewsDetail(newsId);
};
const buildAiChartPayload = key => { const buildAiChartPayload = key => {
if (key === "box5") { if (key === "box5") {
const title = Array.isArray(box5Data.value.title) ? box5Data.value.title : []; const title = Array.isArray(box5Data.value.title) ? box5Data.value.title : [];
......
...@@ -285,10 +285,22 @@ const onFormatNode = (item) => { ...@@ -285,10 +285,22 @@ const onFormatNode = (item) => {
const onDecreeRelatedEntitie = async (id) => { const onDecreeRelatedEntitie = async (id) => {
try { try {
const res = await getDecreeRelatedEntitie({ id }); const res = await getDecreeRelatedEntitie({
orgId: id,
rule: false,
withSanInfo: false,
});
if (res.code === 200) { if (res.code === 200) {
graphInfo.links = (res.data || []).map(onFormatLink); const data = res.data || {};
graphInfo.nodes = (res.data || []).map(onFormatNode); const parentList = Array.isArray(data.parentOrgList) ? data.parentOrgList : [];
const childrenList = Array.isArray(data.childrenOrgList) ? data.childrenOrgList : [];
const relationList = [...parentList, ...childrenList].map((item) => ({
...item,
relation: item.description || "",
companyName: item.companyName || item.name || "",
}));
graphInfo.links = relationList.map(onFormatLink);
graphInfo.nodes = relationList.map(onFormatNode);
if (entityInfo.node?.id) graphInfo.nodes.unshift(onFormatNode(entityInfo.node)); if (entityInfo.node?.id) graphInfo.nodes.unshift(onFormatNode(entityInfo.node));
} }
} catch (error) { } catch (error) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论