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
caf227d9
Commit
caf227d9
authored
Jan 11, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
已有用户编辑的发布模型,查看详情时需要保持编辑按钮,提示不可编辑原因 提Bug
parent
5100bb95
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
9 deletions
+22
-9
constant.js
src/util/constant.js
+2
-0
EditModel.jsx
src/view/Manage/Model/Component/EditModel.jsx
+18
-7
index.jsx
src/view/Manage/Model/index.jsx
+2
-2
No files found.
src/util/constant.js
View file @
caf227d9
...
@@ -13,3 +13,4 @@ export const PermitCheckOut = 'permitCheckOut';
...
@@ -13,3 +13,4 @@ export const PermitCheckOut = 'permitCheckOut';
export
const
StateId
=
'sid'
;
export
const
StateId
=
'sid'
;
export
const
VersionId
=
'vid'
;
export
const
VersionId
=
'vid'
;
export
const
TemplateId
=
'tid'
;
export
const
TemplateId
=
'tid'
;
export
const
Holder
=
'holder'
;
\ No newline at end of file
src/view/Manage/Model/Component/EditModel.jsx
View file @
caf227d9
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Form
,
Button
,
Space
}
from
'antd'
;
import
{
Form
,
Button
,
Space
,
Tooltip
}
from
'antd'
;
import
LocalStorage
from
'local-storage'
;
import
LocalStorage
from
'local-storage'
;
import
ImportAction
from
'./ImportAction'
;
import
ImportAction
from
'./ImportAction'
;
import
CatalogModal
from
'./CatalogModal'
;
import
CatalogModal
from
'./CatalogModal'
;
import
{
dispatchLatest
}
from
'../../../../model'
;
import
{
dispatchLatest
}
from
'../../../../model'
;
import
{
getQueryParam
,
showMessage
}
from
'../../../../util'
;
import
{
getQueryParam
,
showMessage
}
from
'../../../../util'
;
import
{
Action
,
CatalogId
,
ModelerId
,
Hints
,
ModelerData
,
PermitCheckOut
,
Editable
,
StateId
,
VersionId
}
from
'../../../../util/constant'
;
import
{
Action
,
CatalogId
,
ModelerId
,
Hints
,
ModelerData
,
PermitCheckOut
,
Editable
,
StateId
,
VersionId
,
Holder
}
from
'../../../../util/constant'
;
import
HistoryAndVersionDrawer
from
'./HistoryAndVersionDrawer'
;
import
HistoryAndVersionDrawer
from
'./HistoryAndVersionDrawer'
;
import
'./EditModel.less'
;
import
'./EditModel.less'
;
...
@@ -22,7 +22,7 @@ const EditModel = (props) => {
...
@@ -22,7 +22,7 @@ const EditModel = (props) => {
const
[
historyAndVersionDrawerVisible
,
setHistoryAndVersionDrawerVisible
]
=
useState
(
false
);
const
[
historyAndVersionDrawerVisible
,
setHistoryAndVersionDrawerVisible
]
=
useState
(
false
);
const
[
autoTabKey
,
setAutoTabKey
]
=
useState
(
null
);
const
[
autoTabKey
,
setAutoTabKey
]
=
useState
(
null
);
const
{
action
,
catalogId
,
modelerId
,
hints
,
roughModelerData
,
permitCheckOut
,
editable
,
stateId
,
versionId
}
=
actionData
;
const
{
action
,
catalogId
,
modelerId
,
hints
,
roughModelerData
,
permitCheckOut
,
editable
,
stateId
,
versionId
,
holder
}
=
actionData
;
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
...
@@ -36,6 +36,7 @@ const EditModel = (props) => {
...
@@ -36,6 +36,7 @@ const EditModel = (props) => {
const
_editable
=
getQueryParam
(
Editable
,
props
.
location
.
search
);
const
_editable
=
getQueryParam
(
Editable
,
props
.
location
.
search
);
const
_stateId
=
getQueryParam
(
StateId
,
props
.
location
.
search
);
const
_stateId
=
getQueryParam
(
StateId
,
props
.
location
.
search
);
const
_versionId
=
getQueryParam
(
VersionId
,
props
.
location
.
search
);
const
_versionId
=
getQueryParam
(
VersionId
,
props
.
location
.
search
);
const
_holder
=
getQueryParam
(
Holder
,
props
.
location
.
search
);
let
_hints
=
[];
let
_hints
=
[];
if
((
_hintsStr
||
''
)
!==
''
)
{
if
((
_hintsStr
||
''
)
!==
''
)
{
...
@@ -49,7 +50,7 @@ const EditModel = (props) => {
...
@@ -49,7 +50,7 @@ const EditModel = (props) => {
judgeAttributeRepeat
(
_roughModelerData
.
easyDataModelerDataModelAttributes
);
judgeAttributeRepeat
(
_roughModelerData
.
easyDataModelerDataModelAttributes
);
}
}
setActionData
({
action
:
_action
,
catalogId
:
_catalogId
,
modelerId
:
_modelerId
,
hints
:
_hints
,
roughModelerData
:
_roughModelerData
,
permitCheckOut
:
(
_permitCheckOut
===
'true'
),
editable
:
(
_editable
===
'true'
),
stateId
:
_stateId
,
versionId
:
_versionId
});
setActionData
({
action
:
_action
,
catalogId
:
_catalogId
,
modelerId
:
_modelerId
,
hints
:
_hints
,
roughModelerData
:
_roughModelerData
,
permitCheckOut
:
(
_permitCheckOut
===
'true'
),
editable
:
(
_editable
===
'true'
),
stateId
:
_stateId
,
versionId
:
_versionId
,
holder
:
_holder
});
const
interval
=
setInterval
(()
=>
{
const
interval
=
setInterval
(()
=>
{
heartbeat
();
heartbeat
();
...
@@ -227,14 +228,24 @@ const EditModel = (props) => {
...
@@ -227,14 +228,24 @@ const EditModel = (props) => {
</
Space
>
</
Space
>
)
)
}
else
if
(
action
===
'detail'
)
{
}
else
if
(
action
===
'detail'
)
{
let
editTip
=
''
;
if
(
!
editable
)
{
if
(
stateId
===
'2'
)
{
editTip
=
'待发布的模型不允许编辑'
;
}
else
if
(
stateId
===
'4'
)
{
editTip
=
`
${
holder
||
''
}
正在编辑中, 不允许再编辑`
;
}
}
actionsBtn
=
(
actionsBtn
=
(
<
Space
>
<
Space
>
<
Button
type=
'primary'
onClick=
{
onHistory
}
danger
>
版本历史
</
Button
>
<
Button
type=
'primary'
onClick=
{
onHistory
}
danger
>
版本历史
</
Button
>
{
<
Tooltip
title=
{
editTip
}
>
editable
&&
<
Button
type=
'primary'
onClick=
{
edit
}
danger
>
<
Button
type=
'primary'
onClick=
{
edit
}
disabled=
{
!
editable
}
danger
>
编辑
编辑
</
Button
>
</
Button
>
}
</
Tooltip
>
</
Space
>
</
Space
>
);
);
}
else
if
(
action
===
'edit'
)
{
}
else
if
(
action
===
'edit'
)
{
...
...
src/view/Manage/Model/index.jsx
View file @
caf227d9
...
@@ -15,7 +15,7 @@ import HistoryAndVersionDrawer from './Component/HistoryAndVersionDrawer';
...
@@ -15,7 +15,7 @@ import HistoryAndVersionDrawer from './Component/HistoryAndVersionDrawer';
import
StartFlowModal
from
'./Component/StartFlowModal'
;
import
StartFlowModal
from
'./Component/StartFlowModal'
;
import
{
showMessage
,
showNotifaction
,
inputWidth
,
DeleteTipModal
}
from
'../../../util'
;
import
{
showMessage
,
showNotifaction
,
inputWidth
,
DeleteTipModal
}
from
'../../../util'
;
import
{
dispatch
,
dispatchLatestHomepage
}
from
'../../../model'
;
import
{
dispatch
,
dispatchLatestHomepage
}
from
'../../../model'
;
import
{
Action
,
CatalogId
,
ModelerId
,
Hints
,
ModelerData
,
PermitCheckOut
,
Editable
,
StateId
}
from
'../../../util/constant'
;
import
{
Action
,
CatalogId
,
ModelerId
,
Hints
,
ModelerData
,
PermitCheckOut
,
Editable
,
StateId
,
Holder
}
from
'../../../util/constant'
;
import
{
AppContext
}
from
'../../../App'
;
import
{
AppContext
}
from
'../../../App'
;
import
'./index.less'
;
import
'./index.less'
;
...
@@ -175,7 +175,7 @@ class Model extends React.Component {
...
@@ -175,7 +175,7 @@ class Model extends React.Component {
this
.
setState
({
importModalAction
:
action
,
modelerId
:
record
.
id
},
()
=>
{
this
.
setState
({
importModalAction
:
action
,
modelerId
:
record
.
id
},
()
=>
{
const
{
catalogId
,
importModalAction
,
modelerId
}
=
this
.
state
;
const
{
catalogId
,
importModalAction
,
modelerId
}
=
this
.
state
;
window
.
open
(
`/data-govern/data-model-action?
${
Action
}
=
${
importModalAction
}
&
${
CatalogId
}
=
${
catalogId
}
&
${
ModelerId
}
=
${
modelerId
}
&
${
PermitCheckOut
}
=
${
record
.
permitCheckOut
||
false
}
&
${
Editable
}
=
${
record
.
editable
||
false
}
&
${
StateId
}
=
${
record
.
state
?.
id
||
''
}
`);
window
.
open
(
`/data-govern/data-model-action?
${
Action
}
=
${
importModalAction
}
&
${
CatalogId
}
=
${
catalogId
}
&
${
ModelerId
}
=
${
modelerId
}
&
${
PermitCheckOut
}
=
${
record
.
permitCheckOut
||
false
}
&
${
Editable
}
=
${
record
.
editable
||
false
}
&
${
StateId
}
=
${
record
.
state
?.
id
||
''
}
&
$
{
Holder
}
=
$
{
record
.
holder
||
''
}
`);
});
});
}
}
...
...
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