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
80c467a9
Commit
80c467a9
authored
Nov 24, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
规则增删改
parent
6fe3d7f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
6 deletions
+75
-6
rule-list.jsx
src/view/Manage/ModelConfig/Component/rule-list.jsx
+46
-4
update-rule-template.jsx
...iew/Manage/ModelConfig/Component/update-rule-template.jsx
+29
-2
No files found.
src/view/Manage/ModelConfig/Component/rule-list.jsx
View file @
80c467a9
...
@@ -5,6 +5,7 @@ import { dispatch } from '../../../../model'
...
@@ -5,6 +5,7 @@ import { dispatch } from '../../../../model'
import
Table
from
'../../../../util/Component/Table'
import
Table
from
'../../../../util/Component/Table'
import
AddRule
from
'./add-rule'
import
AddRule
from
'./add-rule'
import
UpdateRule
from
'./update-rule'
import
UpdateRule
from
'./update-rule'
import
UpdateRuleTemplate
from
'./update-rule-template'
import
PermissionButton
from
'../../../../util/Component/PermissionButton'
import
PermissionButton
from
'../../../../util/Component/PermissionButton'
import
{
showMessage
}
from
"../../../../util"
import
{
showMessage
}
from
"../../../../util"
...
@@ -30,6 +31,11 @@ const FC = (props) => {
...
@@ -30,6 +31,11 @@ const FC = (props) => {
visible
:
false
,
visible
:
false
,
item
:
undefined
,
item
:
undefined
,
})
})
const
[
updateRuleTemplateParams
,
setUpdateRuleTemplateParams
]
=
React
.
useState
({
visible
:
false
,
type
:
undefined
,
item
:
undefined
})
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
()
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
()
...
@@ -58,9 +64,7 @@ const FC = (props) => {
...
@@ -58,9 +64,7 @@ const FC = (props) => {
render
:
(
text
,
record
)
=>
(
render
:
(
text
,
record
)
=>
(
<
Tooltip
title=
{
text
}
>
<
Tooltip
title=
{
text
}
>
<
Typography
.
Text
ellipsis=
{
true
}
>
<
Typography
.
Text
ellipsis=
{
true
}
>
<
a
>
{
text
}
{
text
}
</
a
>
</
Typography
.
Text
>
</
Typography
.
Text
>
</
Tooltip
>
</
Tooltip
>
)
)
...
@@ -112,7 +116,7 @@ const FC = (props) => {
...
@@ -112,7 +116,7 @@ const FC = (props) => {
{
{
title
:
'操作'
,
title
:
'操作'
,
key
:
'action'
,
key
:
'action'
,
width
:
12
0
,
width
:
20
0
,
render
:
(
text
,
record
)
=>
{
render
:
(
text
,
record
)
=>
{
return
(
return
(
<
div
style=
{
{
display
:
'flex'
,
alignItems
:
'center'
}
}
>
<
div
style=
{
{
display
:
'flex'
,
alignItems
:
'center'
}
}
>
...
@@ -120,6 +124,26 @@ const FC = (props) => {
...
@@ -120,6 +124,26 @@ const FC = (props) => {
type=
'link'
type=
'link'
size=
'small'
size=
'small'
onClick=
{
()
=>
{
onClick=
{
()
=>
{
setUpdateRuleTemplateParams
({
visible
:
true
,
type
:
'detail'
,
item
:
{
id
:
record
?.
ruleTemplateId
},
})
}
}
style=
{
{
padding
:
0
}
}
defaultPermission=
{
true
}
>
规则详情
</
PermissionButton
>
<
div
style=
{
{
margin
:
'0 5px'
}
}
>
<
Divider
type=
'vertical'
/>
</
div
>
<
PermissionButton
type=
'link'
size=
'small'
onClick=
{
()
=>
{
setUpdateRuleParams
({
setUpdateRuleParams
({
visible
:
true
,
visible
:
true
,
item
:
record
,
item
:
record
,
...
@@ -233,7 +257,13 @@ const FC = (props) => {
...
@@ -233,7 +257,13 @@ const FC = (props) => {
return
return
}
}
window
.
open
(
`/api/shandatamodeler/easyDataModelerRule/exportRules?catalogId=
${
node
?.
id
}
`)
modal
.
confirm
({
title
:
'提示'
,
content
:
'确定导出该规范吗?'
,
onOk
:
()
=>
{
window
.
open
(
`/api/shandatamodeler/easyDataModelerRule/exportRules?catalogId=
${
node
?.
id
}
`)
}
})
}
}
const onBatchDeteteClick = () => {
const onBatchDeteteClick = () => {
...
@@ -374,6 +404,18 @@ const FC = (props) => {
...
@@ -374,6 +404,18 @@ const FC = (props) => {
refresh && getRules()
refresh && getRules()
}}
}}
/>
/>
<UpdateRuleTemplate
{...updateRuleTemplateParams}
onCancel={(refresh) => {
setUpdateRuleTemplateParams({
visible: false,
type: undefined,
item: undefined,
})
refresh && getRules()
}}
/>
{contextHolder}
{contextHolder}
</div>
</div>
)
)
...
...
src/view/Manage/ModelConfig/Component/update-rule-template.jsx
View file @
80c467a9
...
@@ -6,10 +6,18 @@ import { IsArr } from "../../../../util"
...
@@ -6,10 +6,18 @@ import { IsArr } from "../../../../util"
const
FC
=
(
props
)
=>
{
const
FC
=
(
props
)
=>
{
const
{
visible
,
type
,
item
,
onCancel
}
=
props
const
{
visible
,
type
,
item
,
onCancel
}
=
props
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
[
data
,
setData
]
=
React
.
useState
()
const
basicRef
=
React
.
useRef
()
const
basicRef
=
React
.
useRef
()
React
.
useEffect
(()
=>
{
if
(
item
?.
id
)
{
getDetail
()
}
},
[
item
])
const
title
=
React
.
useMemo
(()
=>
{
const
title
=
React
.
useMemo
(()
=>
{
if
(
type
===
'add'
)
return
'新增检查规则'
if
(
type
===
'add'
)
return
'新增检查规则'
if
(
type
===
'edit'
)
return
'修改检查规则'
if
(
type
===
'edit'
)
return
'修改检查规则'
...
@@ -18,8 +26,27 @@ const FC = (props) => {
...
@@ -18,8 +26,27 @@ const FC = (props) => {
return
''
return
''
},
[
type
])
},
[
type
])
const
getDetail
=
()
=>
{
setLoading
(
true
)
dispatch
({
type
:
'datamodel.getRuleTemplateDetail'
,
payload
:
{
ruleTemplateId
:
item
?.
id
},
callback
:
data
=>
{
setLoading
(
false
)
setData
(
data
)
},
error
:
()
=>
{
setLoading
(
false
)
}
})
}
const
close
=
(
refresh
=
false
)
=>
{
const
close
=
(
refresh
=
false
)
=>
{
setLoading
(
false
)
setWaiting
(
false
)
setWaiting
(
false
)
setData
()
onCancel
?.(
refresh
)
onCancel
?.(
refresh
)
}
}
...
@@ -81,8 +108,8 @@ const FC = (props) => {
...
@@ -81,8 +108,8 @@ const FC = (props) => {
centered
destroyOnClose
centered
destroyOnClose
onCancel=
{
()
=>
{
close
()
}
}
onCancel=
{
()
=>
{
close
()
}
}
>
>
<
Spin
spinning=
{
waiting
}
>
<
Spin
spinning=
{
waiting
||
loading
}
>
<
Basic
ref=
{
basicRef
}
type=
{
type
}
item=
{
item
}
/>
<
Basic
ref=
{
basicRef
}
type=
{
type
}
item=
{
data
}
/>
</
Spin
>
</
Spin
>
</
Modal
>
</
Modal
>
)
)
...
...
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