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

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

Zy dev 查看合并请求 !252
流水线 #141 已通过 于阶段
in 5 分 11 秒
...@@ -315,6 +315,7 @@ onMounted(() => { ...@@ -315,6 +315,7 @@ onMounted(() => {
.pagination-box { .pagination-box {
display: flex; display: flex;
justify-content: center; justify-content: center;
position: relative;
} }
} }
} }
......
...@@ -51,7 +51,8 @@ const onInitGraph = () => { ...@@ -51,7 +51,8 @@ const onInitGraph = () => {
rankdir: 'LR', // 布局从左向右 rankdir: 'LR', // 布局从左向右
controlPoints: true, // 节点间连线的控制点 controlPoints: true, // 节点间连线的控制点
nodesep: 10, // 同一层节点之间的距离 nodesep: 10, // 同一层节点之间的距离
ranksep: 50, // 不同层节点之间的距离 ranksep: 100, // 不同层节点之间的距离
// begin: [250, 100], // 左上角坐标
}, },
modes: { modes: {
default: [ default: [
......
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
</div> </div>
</div> </div>
<el-dialog v-model="isTreeDialog" width="1540px" top="8vh" class="viewpoint-dialog" destroy-on-close> <el-dialog v-model="isTreeDialog" width="1400px" top="8vh" class="viewpoint-dialog" destroy-on-close>
<template #header> <template #header>
<div class="viewpoint-header"> <div class="viewpoint-header">
<div class="viewpoint-title">政令举措思维导图</div> <div class="viewpoint-title">政令举措思维导图</div>
...@@ -318,20 +318,22 @@ const onDecreeMindMap = async () => { ...@@ -318,20 +318,22 @@ const onDecreeMindMap = async () => {
if (res.code === 200) { if (res.code === 200) {
let nodes = [] let nodes = []
let edges = [] let edges = []
Object.keys(res.data||{}).forEach((label, count) => { let obj = {}
nodes.push({ id:`node-${count}`, label })
}) let list = onUniqueArray(Object.values(res.data||{}).flat(1), 'sectionId')
Object.values(res.data||{}).forEach((list, count) => {
list.forEach((item, index) => { list.forEach((item, index) => {
nodes.push({ id:`node-${item.orderNum}-${item.sectionId}`, label:item.textZh, maxWidth:600, labelCfg, layer:1 })
if (item.execAgent?.length) { if (item.execAgent?.length) {
nodes.push({ id:`node-${count}-${index}`, label:item.textZh, maxWidth:600, labelCfg })
item.execAgent.forEach((label, num) => { item.execAgent.forEach((label, num) => {
nodes.push({ id:`node-${count}-${index}-${num}`, label }) if (!obj[label]) {
edges.push({ id:`edge1-${count}-${index}-${num}`, source:`node-${count}-${index}-${num}`, target:`node-${count}-${index}` }) obj[label] = `${index}-${num}`
edges.push({ id:`edge2-${count}-${index}-${num}`, source:`node-${count}`, target:`node-${count}-${index}-${num}` }) nodes.push({ id:`node-${obj[label]}`, label, layer:0 })
})
} }
edges.push({ id:`edge-${index}-${num}`, source:`node-${obj[label]}`, target:`node-${item.orderNum}-${item.sectionId}` })
}) })
} else {
edges.push({ id:`edge-${index}`, source:`root-virtual`, target:`node-${item.orderNum}-${item.sectionId}` })
}
}) })
setTimeout(() => { refMindGraph.value.onMindGraphData(nodes, edges) }, 100) setTimeout(() => { refMindGraph.value.onMindGraphData(nodes, edges) }, 100)
...@@ -341,6 +343,18 @@ const onDecreeMindMap = async () => { ...@@ -341,6 +343,18 @@ const onDecreeMindMap = async () => {
} }
} }
// 对象数组去重
const onUniqueArray = (list, key = 'id') => {
const obj = {};
return list.reduce((total, item) => {
if (!obj[String(item[key])]) {
obj[String(item[key])] = true;
total.push(item);
}
return total;
}, []);
}
// 相关实体 // 相关实体
const entityList = ref([]); const entityList = ref([]);
const onRelatedEntityData = async () => { const onRelatedEntityData = async () => {
......
...@@ -330,7 +330,7 @@ ...@@ -330,7 +330,7 @@
<div class="right-main"> <div class="right-main">
<el-empty v-if="surveyInfoList.length === 0" description="当前条件下暂无数据" :image-size="200" /> <el-empty v-if="surveyInfoList.length === 0" description="当前条件下暂无数据" :image-size="200" />
<div v-else class="right-main-item" v-for="(item, index) in surveyInfoList" :key="index" <div v-else class="right-main-item" v-for="(item, index) in surveyInfoList" :key="index"
@click="handleClickToSurveyDetail(item.sortcode)"> @click="handleClickCardToDetail(item.sortcode, item.sortName)">
<div class="item-left"> <div class="item-left">
<div class="item-left-item"> {{ formatDate(item.searchdate, 'year') }}</div> <div class="item-left-item"> {{ formatDate(item.searchdate, 'year') }}</div>
<div class="item-left-item"> {{ formatDate(item.searchdate, 'date') }}</div> <div class="item-left-item"> {{ formatDate(item.searchdate, 'date') }}</div>
...@@ -495,23 +495,11 @@ const handleClickToDetail = () => { ...@@ -495,23 +495,11 @@ const handleClickToDetail = () => {
activeIndex = carouselRef.value.activeIndex; activeIndex = carouselRef.value.activeIndex;
} }
console.log("当前 Carousel 激活索引:", activeIndex);
const id = box1DataList.value[activeIndex].SEARCHSORT; const id = box1DataList.value[activeIndex].SEARCHSORT;
window.sessionStorage.setItem("curTabName", id + "调查概览"); handleClickCardToDetail(id, id + "调查概览")
const route = router.resolve({
path: "/marketAccessLayout",
query: {
id: id
}
});
window.open(route.href, "_blank");
}; };
const handleClickCardToDetail = (id, name) => { const handleClickCardToDetail = (id, name) => {
// console.log('id',id);
window.sessionStorage.setItem("curTabName", name); window.sessionStorage.setItem("curTabName", name);
const route = router.resolve({ const route = router.resolve({
path: "/marketAccessLayout", path: "/marketAccessLayout",
...@@ -1319,16 +1307,6 @@ const handleGetSurveyList = async () => { ...@@ -1319,16 +1307,6 @@ const handleGetSurveyList = async () => {
} catch (error) { } } catch (error) { }
}; };
const handleClickToSurveyDetail = id => {
const route = router.resolve({
path: "/marketAccessLayout",
query: {
id: id
}
});
window.open(route.href, "_blank");
};
// 查看更多风险信号 // 查看更多风险信号
const handleToMoreRiskSignal = () => { const handleToMoreRiskSignal = () => {
const route = router.resolve("/viewRiskSignal"); const route = router.resolve("/viewRiskSignal");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论