Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaochengxiang
szse
Commits
789ff5fd
Commit
789ff5fd
authored
Jan 24, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型ji基本信息展开
parent
006f8d94
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
35 deletions
+47
-35
ImportActionHeader.jsx
src/view/Manage/Model/Component/ImportActionHeader.jsx
+7
-4
ImportActionHeader.less
src/view/Manage/Model/Component/ImportActionHeader.less
+1
-1
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+23
-18
SuggestTable.jsx
src/view/Manage/Model/Component/SuggestTable.jsx
+16
-12
No files found.
src/view/Manage/Model/Component/ImportActionHeader.jsx
View file @
789ff5fd
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Form
,
Input
,
Row
,
Col
,
Descriptions
,
Select
,
AutoComplete
,
Checkbox
}
from
'antd'
;
import
{
Form
,
Input
,
Row
,
Col
,
Descriptions
,
Select
,
AutoComplete
,
Checkbox
,
Button
}
from
'antd'
;
import
{
DownOutlined
,
UpOutlined
}
from
'@ant-design/icons'
;
import
{
highlightSearchContentByTerms
,
generateUUID
}
from
'../../../../util'
;
import
{
highlightSearchContentByTerms
,
generateUUID
}
from
'../../../../util'
;
import
{
dispatchLatest
}
from
'../../../../model'
;
import
{
dispatchLatest
}
from
'../../../../model'
;
...
@@ -423,8 +424,8 @@ const ImportActionHeader = (props) => {
...
@@ -423,8 +424,8 @@ const ImportActionHeader = (props) => {
}
}
}
}
const
onOnlyShowRequireChange
=
(
e
)
=>
{
const
onOnlyShowRequireChange
=
()
=>
{
setOnlyShowRequireChange
(
e
.
target
.
checked
);
setOnlyShowRequireChange
(
!
onlyShowRequireChange
);
}
}
let
distributionDescription
=
''
,
primaryDescription
=
''
,
partitionsDescription
=
''
,
semiPrimaryDescription
=
''
;
let
distributionDescription
=
''
,
primaryDescription
=
''
,
partitionsDescription
=
''
,
semiPrimaryDescription
=
''
;
...
@@ -488,7 +489,9 @@ const ImportActionHeader = (props) => {
...
@@ -488,7 +489,9 @@ const ImportActionHeader = (props) => {
}
}
}
}
>
>
<
h2
>
基本信息
</
h2
>
<
h2
>
基本信息
</
h2
>
<
Checkbox
onChange=
{
onOnlyShowRequireChange
}
defaultChecked=
{
onlyShowRequireChange
}
value=
{
onlyShowRequireChange
}
>
仅显示必填项
</
Checkbox
>
{
onlyShowRequireChange
?
<
Button
type=
'text'
style=
{
{
padding
:
0
,
color
:
'#0069AC'
}
}
onClick=
{
onOnlyShowRequireChange
}
>
展开
<
DownOutlined
/></
Button
>
:
<
Button
type=
'text'
style=
{
{
padding
:
0
,
color
:
'#0069AC'
}
}
onClick=
{
onOnlyShowRequireChange
}
>
收起
<
UpOutlined
/></
Button
>
}
</
div
>
</
div
>
{
{
editable
?
(
editable
?
(
...
...
src/view/Manage/Model/Component/ImportActionHeader.less
View file @
789ff5fd
.model-import-action-header {
.model-import-action-header {
.yy-form-item {
.yy-form-item
:nth-last-col
{
margin-bottom: 24px;
margin-bottom: 24px;
}
}
...
...
src/view/Manage/Model/Component/ModelTable.jsx
View file @
789ff5fd
...
@@ -118,6 +118,7 @@ const ModelTable = (props) => {
...
@@ -118,6 +118,7 @@ const ModelTable = (props) => {
id
:
MENU_ID
,
id
:
MENU_ID
,
});
});
const
[
tableWidth
,
setTableWidth
]
=
useState
(
0
);
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
([]);
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
([]);
const
[
subSelectedRowKeys
,
setSubSelectedRowKeys
]
=
useState
([]);
const
[
subSelectedRowKeys
,
setSubSelectedRowKeys
]
=
useState
([]);
// const [ mouseEnterKey, setMouseEnterKey ] = useState(null);
// const [ mouseEnterKey, setMouseEnterKey ] = useState(null);
...
@@ -620,31 +621,35 @@ const ModelTable = (props) => {
...
@@ -620,31 +621,35 @@ const ModelTable = (props) => {
<
div
className=
{
classes
}
>
<
div
className=
{
classes
}
>
<
ResizeObserver
<
ResizeObserver
onResize=
{
({
width
})
=>
{
onResize=
{
({
width
})
=>
{
let
newColumns
=
[...
cols
];
if
(
tableWidth
!==
width
)
{
setTableWidth
(
width
);
if
((
modelId
||
''
)
!==
''
)
{
newColumns
=
cols
.
filter
(
item
=>
item
.
dataIndex
!==
'key'
);
}
else
if
((
modelId
||
''
)
===
''
&&
(
view
===
'state'
||
(
keyword
||
''
)
!==
''
))
{
let
newColumns
=
[...
cols
];
newColumns
=
cols
.
splice
(
3
,
0
,
pathColumn
);
}
newColumns
.
forEach
((
column
,
index
)
=>
{
if
((
modelId
||
''
)
!==
''
)
{
if
(
!
column
.
width
)
{
newColumns
=
cols
.
filter
(
item
=>
item
.
dataIndex
!==
'key'
);
const
rowWidth
=
(
columns
.
reduce
((
preVal
,
col
)
=>
(
col
.
width
?
col
.
width
:
0
)
+
preVal
,
0
))
+
50
;
if
(
width
>
rowWidth
)
{
}
else
if
((
modelId
||
''
)
===
''
&&
(
view
===
'state'
||
(
keyword
||
''
)
!==
''
))
{
column
.
width
=
(
width
-
rowWidth
)
>
200
?(
width
-
rowWidth
):
200
;
newColumns
=
cols
.
splice
(
3
,
0
,
pathColumn
);
}
else
{
column
.
width
=
200
;
}
}
}
});
newColumns
.
forEach
((
column
,
index
)
=>
{
setColumns
(
newColumns
);
if
(
!
column
.
width
)
{
const
rowWidth
=
(
columns
.
reduce
((
preVal
,
col
)
=>
(
col
.
width
?
col
.
width
:
0
)
+
preVal
,
0
))
+
50
;
if
(
width
>
rowWidth
)
{
column
.
width
=
(
width
-
rowWidth
)
>
200
?(
width
-
rowWidth
):
200
;
}
else
{
column
.
width
=
200
;
}
}
});
setColumns
(
newColumns
);
}
}
}
}
}
>
>
<
Table
<
Table
...
...
src/view/Manage/Model/Component/SuggestTable.jsx
View file @
789ff5fd
...
@@ -41,6 +41,7 @@ const ResizeableHeaderCell = props => {
...
@@ -41,6 +41,7 @@ const ResizeableHeaderCell = props => {
const
SuggestTable
=
(
props
)
=>
{
const
SuggestTable
=
(
props
)
=>
{
const
{
suggests
,
onSelect
}
=
props
;
const
{
suggests
,
onSelect
}
=
props
;
const
[
tableWidth
,
setTableWidth
]
=
useState
(
0
);
const
cols
=
[
const
cols
=
[
{
{
...
@@ -174,23 +175,26 @@ const SuggestTable = (props) => {
...
@@ -174,23 +175,26 @@ const SuggestTable = (props) => {
<
ResizeObserver
<
ResizeObserver
onResize=
{
({
width
})
=>
{
onResize=
{
({
width
})
=>
{
let
newColumns
=
[...
cols
];
if
(
tableWidth
!==
width
)
{
setTableWidth
(
width
);
let
newColumns
=
[...
cols
];
newColumns
.
forEach
((
column
,
index
)
=>
{
newColumns
.
forEach
((
column
,
index
)
=>
{
if
(
!
column
.
width
)
{
if
(
!
column
.
width
)
{
const
rowWidth
=
(
columns
.
reduce
((
preVal
,
col
)
=>
(
col
.
width
?
col
.
width
:
0
)
+
preVal
,
0
))
+
50
;
const
rowWidth
=
(
columns
.
reduce
((
preVal
,
col
)
=>
(
col
.
width
?
col
.
width
:
0
)
+
preVal
,
0
))
+
50
;
if
(
width
>
rowWidth
)
{
if
(
width
>
rowWidth
)
{
column
.
width
=
(
width
-
rowWidth
)
>
200
?(
width
-
rowWidth
):
200
;
column
.
width
=
(
width
-
rowWidth
)
>
200
?(
width
-
rowWidth
):
200
;
}
else
{
}
else
{
column
.
width
=
200
;
column
.
width
=
200
;
}
}
}
}
});
});
setColumns
(
newColumns
);
setColumns
(
newColumns
);
}
}
}
}
}
>
>
<
Table
<
Table
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment