3c46fb8e by lihua

优化关系网样式

1 parent c544c1dd
......@@ -4,7 +4,7 @@
<div class="title">{{ detailInfoLabel }}</div>
<div class="row" v-for="item in Object.keys(detailInfo)">
<span>{{ item + ':' }}</span>
<span>{{ detailInfo[item] }}</span>
<span>{{ detailInfo[item] == null ? '-' : detailInfo[item] }}</span>
</div>
</div>
</div>
......@@ -37,6 +37,10 @@ const emits = defineEmits([
const { proxy } = getCurrentInstance() as any;
const maxChineseCount = ref(14);
const maxEnglishCount = ref(26);
const detailLoading = ref(false);
const detailInfo: any = ref({});
......@@ -116,9 +120,9 @@ const detectLanguage = (text) => {
const handleLabelLength = (label: string) => {
if (detectLanguage(label) == 'English') {
return label?.length > 30 ? label.slice(0, 30) + '...' : label;
return label?.length > maxEnglishCount.value ? label.slice(0, maxEnglishCount.value) + '...' : label;
}
return label?.length > 16 ? label.slice(0, 16) + '...' : label;
return label?.length > maxChineseCount.value ? label.slice(0, maxChineseCount.value) + '...' : label;
};
insertCss(`
......@@ -161,9 +165,9 @@ const initGraph = () => {
const name = item._cfg.model?.label;
if (currentAnchor == 'text-shape') {
if (detectLanguage(name) == 'English') {
return name?.length > 30;
return name?.length > maxEnglishCount.value;
}
return name?.length > 16;
return name?.length > maxChineseCount.value;
}
return false;
},
......@@ -300,8 +304,9 @@ const initGraph = () => {
labelCfg: {
offset: 10,
style: {
fontSize: 16,
fontSize: 13,
fill: '#212121',
fontWeight: 500
},
position: !node.isField ? 'left' : 'right', //只有字段是最后一层级,不需要展开
},
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!