Skip to content

Commit e693b14

Browse files
committed
fix: Style optimization
1 parent 554b41d commit e693b14

File tree

1 file changed

+62
-12
lines changed

1 file changed

+62
-12
lines changed

frontend/src/views/ds/TableRelationship.vue

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const edgeOPtion = {
3737
attrs: {
3838
line: {
3939
stroke: '#DEE0E3',
40-
strokeWidth: 1,
40+
strokeWidth: 2,
4141
},
4242
},
4343
}
@@ -51,7 +51,7 @@ const initGraph = () => {
5151
return {
5252
position: {
5353
x: 0,
54-
y: (index + 1) * LINE_HEIGHT,
54+
y: (index + 1) * LINE_HEIGHT + 15,
5555
},
5656
angle: 0,
5757
}
@@ -65,6 +65,10 @@ const initGraph = () => {
6565
{
6666
inherit: 'rect',
6767
markup: [
68+
{
69+
tagName: 'path',
70+
selector: 'top',
71+
},
6872
{
6973
tagName: 'rect',
7074
selector: 'body',
@@ -73,12 +77,32 @@ const initGraph = () => {
7377
tagName: 'text',
7478
selector: 'label',
7579
},
80+
{
81+
tagName: 'path',
82+
selector: 'div',
83+
},
7684
],
7785
attrs: {
86+
top: {
87+
fill: '#BBBFC4',
88+
refX: 0,
89+
refY: 0,
90+
d: 'M0 5C0 2.23858 2.23858 0 5 0H175C177.761 0 180 2.23858 180 5H0Z',
91+
},
7892
rect: {
79-
strokeWidth: 1,
80-
stroke: '#F5F6F7',
93+
strokeWidth: 0.5,
94+
stroke: '#DEE0E3',
8195
fill: '#F5F6F7',
96+
refY: 5,
97+
},
98+
div: {
99+
fillRule: 'evenodd',
100+
clipRule: 'evenodd',
101+
fill: '#646A73',
102+
refX: 12,
103+
refY: 21,
104+
fontSize: 14,
105+
d: 'M1.4773 1.47724C1.67618 1.27836 1.94592 1.16663 2.22719 1.16663H11.7729C12.0541 1.16663 12.3239 1.27836 12.5227 1.47724C12.7216 1.67612 12.8334 1.94586 12.8334 2.22713V11.7728C12.8334 12.0541 12.7216 12.3238 12.5227 12.5227C12.3239 12.7216 12.0541 12.8333 11.7729 12.8333H2.22719C1.64152 12.8333 1.16669 12.3585 1.16669 11.7728V2.22713C1.16669 1.94586 1.27842 1.67612 1.4773 1.47724ZM2.33335 5.83329V8.16662H4.66669V5.83329H2.33335ZM2.33335 9.33329V11.6666H4.66669V9.33329H2.33335ZM5.83335 11.6666H8.16669V9.33329H5.83335V11.6666ZM9.33335 11.6666H11.6667V9.33329H9.33335V11.6666ZM11.6667 8.16662V5.83329H9.33335V8.16662H11.6667ZM8.16669 5.83329H5.83335V8.16662H8.16669V5.83329ZM11.6667 2.33329H2.33335V4.66663H11.6667V2.33329Z',
82106
},
83107
label: {
84108
fill: '#1F2329',
@@ -102,15 +126,15 @@ const initGraph = () => {
102126
portBody: {
103127
width: NODE_WIDTH,
104128
height: LINE_HEIGHT,
105-
strokeWidth: 1,
106-
stroke: '#1F232926',
129+
stroke: '#DEE0E3',
130+
strokeWidth: 0.5,
107131
fill: '#ffffff',
108132
magnet: true,
109133
},
110134
portNameLabel: {
111135
ref: 'portBody',
112136
refX: 12,
113-
refY: 8,
137+
refY: 9.5,
114138
fontSize: 14,
115139
textAnchor: 'left',
116140
textWrap: {
@@ -196,7 +220,7 @@ const initGraph = () => {
196220
],
197221
x: 0,
198222
y: 0,
199-
offset: { x: 165, y: 18 },
223+
offset: { x: 165, y: 28 },
200224
onClick({ view }: any) {
201225
graph.removeNode(view.cell.id)
202226
nodeIds.value = nodeIds.value.filter((ele) => ele !== view.cell.id)
@@ -234,7 +258,7 @@ const getTableData = () => {
234258
cells.value.push(
235259
graph.createNode({
236260
...item,
237-
height: LINE_HEIGHT,
261+
height: LINE_HEIGHT + 15,
238262
width: NODE_WIDTH,
239263
})
240264
)
@@ -270,15 +294,16 @@ const addNode = (node: any) => {
270294
label: {
271295
text: node.label,
272296
textAnchor: 'left',
273-
refX: 10,
297+
refX: 34,
298+
refY: 28,
274299
textWrap: {
275-
width: 140,
300+
width: 120,
276301
height: 24,
277302
ellipsis: true,
278303
},
279304
},
280305
},
281-
height: LINE_HEIGHT,
306+
height: LINE_HEIGHT + 15,
282307
width: NODE_WIDTH,
283308
})
284309
)
@@ -341,6 +366,26 @@ const save = () => {
341366
</script>
342367

343368
<template>
369+
<svg style="position: fixed; top: -9999px" xmlns:xlink="http://www.w3.org/1999/xlink">
370+
<defs>
371+
<filter
372+
x="-1"
373+
y="-1"
374+
width="3"
375+
height="3"
376+
filterUnits="objectBoundingBox"
377+
id="filter-dropShadow-v0-3329848037"
378+
>
379+
<feDropShadow
380+
stdDeviation="4"
381+
dx="1"
382+
dy="2"
383+
flood-color="#1F23291F"
384+
flood-opacity="0.65"
385+
></feDropShadow>
386+
</filter>
387+
</defs>
388+
</svg>
344389
<div v-loading="loading" v-if="!nodeIds.length" class="relationship-empty">
345390
{{ t('training.add_it_here') }}
346391
</div>
@@ -392,6 +437,7 @@ const save = () => {
392437
min-height: 600px;
393438
width: 100%;
394439
height: 100%;
440+
background-color: #f5f6f7;
395441
:deep(.x6-edge-tool) {
396442
display: none;
397443
@@ -405,5 +451,9 @@ const save = () => {
405451
fill: var(--ed-color-primary) !important;
406452
}
407453
}
454+
455+
:deep(.x6-node) {
456+
filter: url(#filter-dropShadow-v0-3329848037);
457+
}
408458
}
409459
</style>

0 commit comments

Comments
 (0)