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
f94d2407
Commit
f94d2407
authored
Nov 30, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加管理信息
parent
4a1a9224
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
139 additions
and
56 deletions
+139
-56
EditModel.jsx
src/view/Manage/Model/Component/EditModel.jsx
+1
-1
ImportAction.jsx
src/view/Manage/Model/Component/ImportAction.jsx
+8
-0
ImportActionHeader.jsx
src/view/Manage/Model/Component/ImportActionHeader.jsx
+8
-55
ImportActionManage.jsx
src/view/Manage/Model/Component/ImportActionManage.jsx
+122
-0
_ImportActionHeader.jsx
src/view/Manage/Model/Component/_ImportActionHeader.jsx
+0
-0
No files found.
src/view/Manage/Model/Component/EditModel.jsx
View file @
f94d2407
...
...
@@ -11,7 +11,7 @@ import { Action, CatalogId, ModelerId, Hints, ModelerData, PermitCheckOut, Edita
import
HistoryAndVersionDrawer
from
'./HistoryAndVersionDrawer'
;
import
{
EditModelContext
}
from
'./ContextManage'
;
import
EditInherited
from
'./EditInherited'
;
import
{
ImportActionHeaderSubject
}
from
'./ImportAction
Header
'
;
import
{
ImportActionHeaderSubject
}
from
'./ImportAction
Manage
'
;
import
PermissionButton
from
'../../../../util/Component/PermissionButton'
;
import
'./EditModel.less'
;
...
...
src/view/Manage/Model/Component/ImportAction.jsx
View file @
f94d2407
...
...
@@ -6,6 +6,7 @@ import ImportActionHeader from './ImportActionHeader';
import
ImportActionInherited
from
'./ImportActionInherited'
;
import
{
ImportActionTable
}
from
'./ImportActionTable'
;
import
ImportActionIndex
from
'./ImportActionIndex'
;
import
ImportActionManage
from
'./ImportActionManage'
;
import
{
getInternalCurrentAnchor
,
getQueryParam
}
from
'../../../../util'
;
import
{
Action
}
from
'../../../../util/constant'
;
import
{
dispatch
}
from
'../../../../model'
;
...
...
@@ -131,6 +132,7 @@ const ImportAction = React.forwardRef((props, ref) => {
'model-import-action-technical'
,
'model-import-action-table'
,
'model-import-action-index'
,
'model-import-action-manage'
,
],
0
,
5
,
...
...
@@ -588,6 +590,7 @@ const ImportAction = React.forwardRef((props, ref) => {
<Tabs.TabPane tab='技术信息' key="model-import-action-technical" />
<Tabs.TabPane tab='数据表结构' key="model-import-action-table" />
<Tabs.TabPane tab='数据表索引' key="model-import-action-index" />
<Tabs.TabPane tab='管理信息' key="model-import-action-manage" />
</Tabs>
</div>
<div ref={setContainer} style={{ height: action==='edit-inherite-modal'?'60vh':'calc(100vh - 44px - 64px - 82px)', overflow: 'auto', padding: '0 20px' }}>
...
...
@@ -627,6 +630,11 @@ const ImportAction = React.forwardRef((props, ref) => {
editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'}
terms={terms}
/>
<ImportActionManage
form={form}
modelerData={modelerData||{}}
editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'}
/>
</div>
</div>
}
...
...
src/view/Manage/Model/Component/ImportActionHeader.jsx
View file @
f94d2407
...
...
@@ -46,31 +46,17 @@ const updateOptions = [
const
dataTypeRemark
=
'描述ETL框架中目标表的数据类型'
;
const
bindingLoadRemark
=
'描述ETL框架绑定加载列表,如chain、daily、current等'
;
export
const
ImportActionHeaderSubject
=
new
Subject
();
const
ImportActionHeader
=
(
props
)
=>
{
const
{
editable
,
form
,
modelerData
,
constraints
,
templates
,
onConstraintChange
,
onTemplateChange
,
validateReports
,
onChange
,
terms
,
supportedPartitionTypes
}
=
props
;
const
[
options
,
setOptions
]
=
useState
([]);
const
[
autoTranslate
,
setAutoTranslate
]
=
useState
(
false
);
const
[
maintenanceRecords
,
setMaintenanceRecords
]
=
useState
(
null
);
const
[
dataTypeList
,
setDataTypeList
]
=
useState
(
null
);
const
[
bindingLoadRangeList
,
setBindingLoadRangeList
]
=
useState
(
null
);
const
[
isCollapse
,
setCollapse
]
=
useState
(
true
)
useEffect
(()
=>
{
const
$$header
=
ImportActionHeaderSubject
.
subscribe
((
act
)
=>
{
if
(
act
?.
type
===
'refreshMaintenanceRecords'
)
{
getMaintenanceRecords
();
}
})
return
()
=>
{
$$header
.
unsubscribe
()
}
},
[
modelerData
])
useEffect
(()
=>
{
getDataTypeList
();
},
[])
...
...
@@ -87,30 +73,11 @@ const ImportActionHeader = (props) => {
setAutoTranslate
((
modelerData
.
name
||
''
)
===
''
);
if
(
modelerData
)
{
form
?.
setFieldsValue
(
modelerData
);
if
((
modelerData
.
id
||
''
)
!==
''
&&
maintenanceRecords
===
null
)
{
getMaintenanceRecords
();
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
modelerData
])
useEffect
(()
=>
{
if
((
maintenanceRecords
||
[]).
length
>
0
)
{
let
maintenanceDescription
=
''
;
maintenanceRecords
.
forEach
((
record
,
index
)
=>
{
if
(
index
!==
0
)
{
maintenanceDescription
+=
'/'
;
}
maintenanceDescription
+=
record
;
})
form
?.
setFieldsValue
({
maintenanceRecords
:
maintenanceDescription
});
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
maintenanceRecords
,
editable
])
//分布
const
distributionDescription
=
useMemo
(()
=>
{
let
newDistributionDescription
=
''
...
...
@@ -194,20 +161,6 @@ const ImportActionHeader = (props) => {
},
};
const
getMaintenanceRecords
=
()
=>
{
dispatch
({
type
:
'datamodel.getMaintenanceRecords'
,
payload
:
{
params
:
{
id
:
modelerData
.
id
}
},
callback
:
data
=>
{
setMaintenanceRecords
(
data
);
}
})
}
const
getDataTypeList
=
()
=>
{
dispatch
({
type
:
'datamodel.dataTypeList'
,
...
...
@@ -318,14 +271,14 @@ const ImportActionHeader = (props) => {
>
<
Row
gutter=
{
10
}
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
{
<
ItemTitle
name=
'cnName'
cnName=
'中文名称'
validateReports=
{
validateReports
}
/>
}
name=
"cnName"
rules=
{
[{
required
:
true
,
message
:
'请输入中文名称!'
}]
}
style=
{
{
marginBottom
}
}
>
<
InputDebounce
/>
</
Form
.
Item
>
<
Form
.
Item
label=
{
<
ItemTitle
name=
'cnName'
cnName=
'中文名称'
validateReports=
{
validateReports
}
/>
}
name=
"cnName"
rules=
{
[{
required
:
true
,
message
:
'请输入中文名称!'
}]
}
style=
{
{
marginBottom
}
}
>
<
InputDebounce
/>
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
...
...
src/view/Manage/Model/Component/ImportActionManage.jsx
0 → 100644
View file @
f94d2407
import
React
from
'react'
import
{
Button
,
Form
,
Descriptions
,
Input
,
Row
,
Col
}
from
'antd'
import
{
DownOutlined
,
UpOutlined
}
from
'@ant-design/icons'
import
{
Subject
}
from
'rxjs'
;
import
{
dispatch
}
from
'../../../../model'
export
const
ImportActionHeaderSubject
=
new
Subject
();
const
FC
=
(
props
)
=>
{
const
{
editable
,
form
,
modelerData
}
=
props
const
[
isCollapse
,
setCollapse
]
=
React
.
useState
(
true
)
const
[
maintenanceRecords
,
setMaintenanceRecords
]
=
React
.
useState
()
React
.
useEffect
(()
=>
{
if
(
modelerData
?.
id
)
{
getMaintenanceRecords
()
}
const
$$header
=
ImportActionHeaderSubject
.
subscribe
((
act
)
=>
{
if
(
act
?.
type
===
'refreshMaintenanceRecords'
)
{
getMaintenanceRecords
();
}
})
return
()
=>
{
$$header
.
unsubscribe
()
}
},
[
modelerData
])
const
maintenanceDescription
=
React
.
useMemo
(()
=>
{
if
((
maintenanceRecords
??[]).
length
>
0
)
{
let
newDescription
=
''
for
(
const
[
index
,
record
]
of
maintenanceRecords
.
entries
())
{
if
(
index
!==
0
)
{
newDescription
+=
'/'
}
newDescription
+=
record
}
return
newDescription
}
return
''
},
[
maintenanceRecords
])
const
getMaintenanceRecords
=
()
=>
{
dispatch
({
type
:
'datamodel.getMaintenanceRecords'
,
payload
:
{
params
:
{
id
:
modelerData
?.
id
}
},
callback
:
data
=>
{
setMaintenanceRecords
(
data
);
}
})
}
const
formItemLayout
=
{
labelCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
6
},
},
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
18
},
},
};
return
(
<
div
className=
'model-import-action-header'
>
<
div
className=
'model-import-action-manage mb-3'
style=
{
{
display
:
'flex'
,
alignItems
:
'center'
,
}
}
>
<
h2
className=
'mr-3'
style=
{
{
marginBottom
:
0
}
}
>
管理信息
</
h2
>
{
isCollapse
?
<
Button
type=
'primary'
size=
'small'
onClick=
{
()
=>
{
setCollapse
(
!
isCollapse
)
}
}
>
展开
<
DownOutlined
/></
Button
>
:
<
Button
type=
'primary'
size=
'small'
onClick=
{
()
=>
{
setCollapse
(
!
isCollapse
)
}
}
>
收起
<
UpOutlined
/></
Button
>
}
</
div
>
{
!
isCollapse
&&
<
React
.
Fragment
>
{
editable
?
(
<
Form
form=
{
form
}
{
...
formItemLayout
}
>
<
Row
gutter=
{
10
}
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"维护历史"
>
<
Input
.
TextArea
rows=
{
3
}
disabled=
{
true
}
value=
{
maintenanceDescription
}
/>
</
Form
.
Item
>
</
Col
>
</
Row
>
</
Form
>
)
:
(
<
Descriptions
column=
{
3
}
>
<
Descriptions
.
Item
label=
{
<
div
style=
{
{
textAlign
:
'right'
,
width
:
85
}
}
>
维护历史
</
div
>
}
>
<
div
style=
{
{
maxHeight
:
70
,
overflow
:
'auto'
}
}
>
{
(
maintenanceRecords
||
[]).
map
((
record
,
index
)
=>
{
return
<
div
key=
{
index
}
>
{
record
||
''
}
</
div
>;
})
}
</
div
>
</
Descriptions
.
Item
>
</
Descriptions
>
)
}
</
React
.
Fragment
>
}
</
div
>
)
}
export
default
FC
\ No newline at end of file
src/view/Manage/Model/Component/_ImportActionHeader.jsx
deleted
100644 → 0
View file @
4a1a9224
This diff is collapsed.
Click to expand it.
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