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
3ea0b4dd
Commit
3ea0b4dd
authored
Oct 11, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型未输入中英文,点击保存,滚动轴要和必填提示同步
parent
384d07e3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
16 deletions
+29
-16
EditModel.jsx
src/view/Manage/Model/Component/EditModel.jsx
+5
-8
ImportAction.jsx
src/view/Manage/Model/Component/ImportAction.jsx
+24
-8
No files found.
src/view/Manage/Model/Component/EditModel.jsx
View file @
3ea0b4dd
...
@@ -3,7 +3,7 @@ import { Form, Button, Space, Tooltip } from 'antd';
...
@@ -3,7 +3,7 @@ import { Form, Button, Space, Tooltip } from 'antd';
import
LocalStorage
from
'local-storage'
;
import
LocalStorage
from
'local-storage'
;
import
{
useMount
,
useUnmount
}
from
'ahooks'
;
import
{
useMount
,
useUnmount
}
from
'ahooks'
;
import
ImportAction
from
'./ImportAction'
;
import
ImportAction
,
{
ImportActionSubject
}
from
'./ImportAction'
;
import
CatalogModal
from
'./CatalogModal'
;
import
CatalogModal
from
'./CatalogModal'
;
import
{
dispatchLatest
,
dispatch
}
from
'../../../../model'
;
import
{
dispatchLatest
,
dispatch
}
from
'../../../../model'
;
import
{
getDataModelerRole
,
getQueryParam
,
showMessage
,
showNotifaction
}
from
'../../../../util'
;
import
{
getDataModelerRole
,
getQueryParam
,
showMessage
,
showNotifaction
}
from
'../../../../util'
;
...
@@ -21,7 +21,6 @@ const EditModel = (props) => {
...
@@ -21,7 +21,6 @@ const EditModel = (props) => {
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
catalogModalVisible
,
setCatalogModalVisible
]
=
useState
(
false
);
const
[
catalogModalVisible
,
setCatalogModalVisible
]
=
useState
(
false
);
const
[
historyAndVersionDrawerVisible
,
setHistoryAndVersionDrawerVisible
]
=
useState
(
false
);
const
[
historyAndVersionDrawerVisible
,
setHistoryAndVersionDrawerVisible
]
=
useState
(
false
);
const
[
autoTabKey
,
setAutoTabKey
]
=
useState
(
null
);
const
[
user
,
setUser
]
=
useState
();
const
[
user
,
setUser
]
=
useState
();
const
actionRef
=
useRef
(
''
);
const
actionRef
=
useRef
(
''
);
...
@@ -129,15 +128,13 @@ const EditModel = (props) => {
...
@@ -129,15 +128,13 @@ const EditModel = (props) => {
})
})
if
(
repeat
)
{
if
(
repeat
)
{
setAutoTabKey
(
'2'
);
ImportActionSubject
.
next
({
type
:
'tabChangeEvent'
,
key
:
'model-import-action-table'
});
setTerms
(
terms
);
setTerms
(
terms
);
}
}
}
}
const
save
=
async
(
e
,
cid
=
''
)
=>
{
const
save
=
async
(
e
,
cid
=
''
)
=>
{
setAutoTabKey
(
null
);
try
{
try
{
const
row
=
await
form
.
validateFields
();
const
row
=
await
form
.
validateFields
();
...
@@ -228,7 +225,7 @@ const EditModel = (props) => {
...
@@ -228,7 +225,7 @@ const EditModel = (props) => {
}
catch
(
errInfo
)
{
}
catch
(
errInfo
)
{
console
.
log
(
'Validate Failed:'
,
errInfo
);
console
.
log
(
'Validate Failed:'
,
errInfo
);
setAutoTabKey
(
'1'
);
ImportActionSubject
.
next
({
type
:
'tabChangeEvent'
,
key
:
'model-import-action-basic'
}
);
}
}
}
}
...
@@ -362,7 +359,7 @@ const EditModel = (props) => {
...
@@ -362,7 +359,7 @@ const EditModel = (props) => {
</div> */
}
</div> */
}
<
div
className=
'edit-container'
>
<
div
className=
'edit-container'
>
<
div
className=
'edit-container-card'
>
<
div
className=
'edit-container-card'
>
<
ImportAction
hints=
{
hints
}
onChange=
{
onActionChange
}
action=
{
action
}
modelerId=
{
modelerId
}
ddl=
{
ddl
}
form=
{
form
}
terms=
{
terms
}
roughModelerData=
{
roughModelerData
}
permitCheckOut=
{
permitCheckOut
}
stateId=
{
stateId
}
versionId=
{
versionId
}
autoTabKey=
{
autoTabKey
}
logicId=
{
logicId
}
metadataId=
{
metadataId
}
catalogId=
{
catalogId
}
{
...
props
}
/>
<
ImportAction
hints=
{
hints
}
onChange=
{
onActionChange
}
action=
{
action
}
modelerId=
{
modelerId
}
ddl=
{
ddl
}
form=
{
form
}
terms=
{
terms
}
roughModelerData=
{
roughModelerData
}
permitCheckOut=
{
permitCheckOut
}
stateId=
{
stateId
}
versionId=
{
versionId
}
logicId=
{
logicId
}
metadataId=
{
metadataId
}
catalogId=
{
catalogId
}
{
...
props
}
/>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
'edit-footer'
>
<
div
className=
'edit-footer'
>
...
...
src/view/Manage/Model/Component/ImportAction.jsx
View file @
3ea0b4dd
import
React
,
{
useState
,
useEffect
,
useRef
,
useImperativeHandle
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
,
useImperativeHandle
}
from
'react'
;
import
{
Spin
,
Tabs
,
Anchor
,
Affix
,
Button
}
from
'antd'
;
import
{
Spin
,
Tabs
,
Anchor
,
Affix
,
Button
}
from
'antd'
;
import
LocalStorage
from
'local-storage'
;
import
LocalStorage
from
'local-storage'
;
import
{
Subject
}
from
'rxjs'
import
ImportActionHeader
from
'./ImportActionHeader'
;
import
ImportActionHeader
from
'./ImportActionHeader'
;
import
{
ImportActionTable
}
from
'./ImportActionTable'
;
import
{
ImportActionTable
}
from
'./ImportActionTable'
;
...
@@ -15,6 +16,8 @@ import { dispatch } from '../../../../model';
...
@@ -15,6 +16,8 @@ import { dispatch } from '../../../../model';
import
'./ImportAction.less'
import
'./ImportAction.less'
import
ImportActionProcess
from
'./ImportActionProcess'
;
import
ImportActionProcess
from
'./ImportActionProcess'
;
export
const
ImportActionSubject
=
new
Subject
();
const
ImportAction
=
React
.
forwardRef
((
props
,
ref
)
=>
{
const
ImportAction
=
React
.
forwardRef
((
props
,
ref
)
=>
{
const
{
action
,
hints
,
onChange
,
form
,
modelerId
,
terms
,
ddl
,
roughModelerData
,
versionId
,
permitCheckOut
,
catalogId
,
logicId
,
metadataId
}
=
props
;
const
{
action
,
hints
,
onChange
,
form
,
modelerId
,
terms
,
ddl
,
roughModelerData
,
versionId
,
permitCheckOut
,
catalogId
,
logicId
,
metadataId
}
=
props
;
...
@@ -41,6 +44,26 @@ const ImportAction = React.forwardRef((props, ref) => {
...
@@ -41,6 +44,26 @@ const ImportAction = React.forwardRef((props, ref) => {
}
}
}),
[
loading
])
}),
[
loading
])
const
onTabChange
=
(
val
)
=>
{
setActiveValue
(
val
);
var
targetElement
=
container
?.
querySelector
(
`.
${
val
}
`
);
// 找到目标元素
if
(
targetElement
)
{
animating
.
current
=
true
;
targetElement
.
scrollIntoView
();
}
}
useEffect
(()
=>
{
const
$$action
=
ImportActionSubject
.
subscribe
((
act
)
=>
{
if
(
act
?.
type
===
'tabChangeEvent'
&&
act
?.
key
)
{
onTabChange
(
act
?.
key
)
}
})
return
()
=>
{
$$action
.
unsubscribe
()
}
},
[
onTabChange
])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
((
action
||
''
)
===
''
)
return
;
if
((
action
||
''
)
===
''
)
return
;
...
@@ -630,14 +653,7 @@ const ImportAction = React.forwardRef((props, ref) => {
...
@@ -630,14 +653,7 @@ const ImportAction = React.forwardRef((props, ref) => {
(action==='detail' && ((modelerData||{}).optionList||[]).findIndex(item => item.enabled && item.name==='查看') === -1) ? <div style={{ padding: '10px 20px', height: 60 }}>
(action==='detail' && ((modelerData||{}).optionList||[]).findIndex(item => item.enabled && item.name==='查看') === -1) ? <div style={{ padding: '10px 20px', height: 60 }}>
{loading?'':'暂无权限'}
{loading?'':'暂无权限'}
</div> : <div className='import-action'>
</div> : <div className='import-action'>
<Tabs activeKey={activeValue} centered onChange={(val) => {
<Tabs activeKey={activeValue} centered onChange={onTabChange}>
setActiveValue(val);
var targetElement = container?.querySelector(`
.
$
{
val
}
`); // 找到目标元素
if (targetElement) {
animating.current = true;
targetElement.scrollIntoView();
}
}}>
<Tabs.TabPane tab='基本信息' key="model-import-action-basic" />
<Tabs.TabPane tab='基本信息' key="model-import-action-basic" />
<Tabs.TabPane tab='技术信息' key="model-import-action-technical" />
<Tabs.TabPane tab='技术信息' key="model-import-action-technical" />
<Tabs.TabPane tab='数据表结构' key="model-import-action-table" />
<Tabs.TabPane tab='数据表结构' key="model-import-action-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