Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
csbr-daop
/
fe-data-trusted-space
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
25385d8c
authored
2025-07-11 17:24:21 +0800
by
lihua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化列宽
1 parent
1fbd8155
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
src/utils/index.ts
src/views/data_meta/components/dictFileds.vue
src/views/data_meta/standard.vue
src/utils/index.ts
View file @
25385d8
...
...
@@ -5,14 +5,14 @@ export function resolveRoutePath(basePath: string, routePath?: string) {
}
/** 计算表格列宽 */
export
const
calcColumnWidth
=
(
data
,
title
,
dataFont
,
titleFont
,
otherWidth
=
0
)
=>
{
export
const
calcColumnWidth
=
(
data
,
title
,
dataFont
,
titleFont
,
otherWidth
=
0
,
minWidth
=
96
)
=>
{
let
titleW
=
measureTextWidth
(
title
,
titleFont
||
dataFont
);
if
(
!
data
.
length
)
{
if
(
titleW
+
otherWidth
>
260
)
{
return
260
;
}
if
(
titleW
+
otherWidth
+
32
<
96
)
{
return
96
;
if
(
titleW
+
otherWidth
+
32
<
minWidth
)
{
return
minWidth
;
}
return
titleW
+
32
+
otherWidth
;
//20边距,+2px边框 + 10px间隙
}
...
...
@@ -32,8 +32,8 @@ export const calcColumnWidth = (data, title, dataFont, titleFont, otherWidth = 0
if
(
titleW
+
otherWidth
>
maxWidth
)
{
maxWidth
=
titleW
+
otherWidth
;
}
if
(
maxWidth
+
32
<
96
)
{
return
96
;
if
(
maxWidth
+
32
<
minWidth
)
{
return
minWidth
;
}
return
maxWidth
+
32
;
}
...
...
src/views/data_meta/components/dictFileds.vue
View file @
25385d8
...
...
@@ -136,7 +136,8 @@ const calcTableColumnWidth = (data: any[], prop, title, otherWidth = 0) => {
fontSize
:
14
,
fontFamily
:
"SimSun"
,
},
otherWidth
otherWidth
,
70
);
};
...
...
@@ -156,7 +157,7 @@ watch(
val
?.
slice
(
0
,
30
)
||
[],
field
.
field
,
field
.
label
,
24
10
);
});
},
...
...
src/views/data_meta/standard.vue
View file @
25385d8
...
...
@@ -249,9 +249,9 @@ function getTableFields () {
'length'
:
100
,
// 'inside_identifier': 100,
'indicate_format'
:
110
,
'other_data_relationship'
:
15
0
,
'other_data_relationship'
:
15
9
,
'unit'
:
100
,
'meta_data_type'
:
15
0
,
'meta_data_type'
:
15
6
,
'definition'
:
300
,
'explanation'
:
300
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment