提交 1e67cba0 authored 作者: coderBryanFu's avatar coderBryanFu

feat:更新关系图配置

上级 c3dec961
......@@ -4,7 +4,7 @@
<template #node="{ node }">
<div class="custom-node" :style="{
backgroundColor: node.color || 'var(--color-primary-50)'
}">
}" >
<span :style="{
color: node.fontColor || '#ffffff',
fontSize: node.customFontSize || '24px',
......@@ -12,8 +12,8 @@
textAlign: 'center',
wordBreak: 'break-word',
padding: '0 8px'
}">
{{ node.text }}
}" :title="node.text">
{{ truncateText(node.text, 10) }}
</span>
</div>
</template>
......@@ -26,6 +26,11 @@ import RelationGraph from "relation-graph-vue3";
const graphRef = ref(null);
const truncateText = (text, maxLen) => {
if (!text) return '';
return text.length > maxLen ? text.slice(0, maxLen) + '...' : text;
};
// 定义 Props
const props = defineProps({
isVerticalChart: {
......@@ -49,7 +54,7 @@ const emit = defineEmits(["nodeClick", "lineClick"]);
const baseGraphOptionsH = {
layout: {
layoutName: "tree",
min_per_height: "auto"
// min_per_height: "auto",
},
defaultLineMarker: {
markerWidth: 12,
......@@ -60,6 +65,7 @@ const baseGraphOptionsH = {
},
defaultNodeShape: 1,
defaultNodeWidth: 35,
maxNodeHeight: 240,
defaultLineShape: 4,
defaultJunctionPoint: "tb",
defaultNodeBorderWidth: 2,
......
......@@ -49,18 +49,22 @@
import { onMounted, ref, computed, onUnmounted, nextTick, watch, watchEffect } from "vue";
import router from "@/router/index";
import { useWrittingAsstaintStore } from "@/stores/writtingAsstaintStore";
import { goToSearch } from "@/utils/goToPage";
const store = useWrittingAsstaintStore();
const handleSearch = () => {
window.sessionStorage.setItem("curTabName", `搜索-${store.searchBillText}`);
const curRoute = router.resolve({
path: "/searchResults",
query: {
searchText: store.searchBillText,
areaName: store.searchData.areaName
}
});
window.open(curRoute.href, "_blank");
// window.sessionStorage.setItem("curTabName", `搜索-${store.searchBillText}`);
// const curRoute = router.resolve({
// path: "/searchResults",
// query: {
// searchText: store.searchBillText,
// areaName: store.searchData.areaName
// }
// });
// window.open(curRoute.href, "_blank");
goToSearch(store.searchBillText, store.searchData.areaName)
};
let containerRef = computed(() => store.searchData.containerRef);
const handleToPosi = id => {
......
......@@ -50,7 +50,7 @@ const graphData = ref({
rootId: "a",
nodes: [
{ id: "a", text: "a" },
{ id: "b", text: "b" },
{ id: "b", text: "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" },
{ id: "b1", text: "b1" },
{ id: "b1-1", text: "b1-1" },
{ id: "b1-2", text: "b1-2" },
......
......@@ -4,7 +4,7 @@ import getQuarterRange from './getQuarterRange';
import * as echarts from 'echarts'
import 'echarts-wordcloud';
import router from '@/router/index'
import { goToDataCountryBill, goToDataDecree } from './goToPage';
import { goToDataCountryBill, goToDataDecree, goToDataThinkTank } from './goToPage';
const setChart = (option, chartId, allowClick, selectParam, otherAreaList) => {
let chartDom = document.getElementById(chartId);
if (!chartDom) {
......@@ -105,11 +105,11 @@ const setChart = (option, chartId, allowClick, selectParam, otherAreaList) => {
const year = params.name.slice(0, 4)
const quatarNum = Number(params.name[params.name.length - 1])
selectParam.selectedDate = JSON.stringify(getQuarterRange(year, quatarNum))
openDataThinkTank(selectParam);
goToDataThinkTank(selectParam);
return
} else if (selectParam.key === 2) {
selectParam.domains = params.name
openDataThinkTank(selectParam);
goToDataThinkTank(selectParam);
return
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论