提交 32486bbe authored 作者: 张伊明's avatar 张伊明

合并分支 'zym-dev' 到 'pre'

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