提交 c0cc1a5f authored 作者: 付康's avatar 付康

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

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