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
eb4e992d
Commit
eb4e992d
authored
Nov 24, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
规范目录详情
parent
80c467a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
27 deletions
+68
-27
rule-list.jsx
src/view/Manage/ModelConfig/Component/rule-list.jsx
+48
-15
rule-tree.jsx
src/view/Manage/ModelConfig/Component/rule-tree.jsx
+20
-12
No files found.
src/view/Manage/ModelConfig/Component/rule-list.jsx
View file @
eb4e992d
import
React
from
"react"
import
{
Typography
,
Tooltip
,
Divider
,
Space
,
Input
,
Select
,
Modal
}
from
"antd"
import
{
Typography
,
Tooltip
,
Divider
,
Space
,
Input
,
Select
,
Modal
,
Row
,
Col
}
from
"antd"
import
{
dispatch
}
from
'../../../../model'
import
Table
from
'../../../../util/Component/Table'
...
...
@@ -8,6 +8,17 @@ import UpdateRule from './update-rule'
import
UpdateRuleTemplate
from
'./update-rule-template'
import
PermissionButton
from
'../../../../util/Component/PermissionButton'
import
{
showMessage
}
from
"../../../../util"
import
{
render
}
from
"@testing-library/react"
const
nodeItems
=
[
{
key
:
'name'
,
title
:
'名称'
},
{
key
:
'statusName'
,
title
:
'状态'
},
{
key
:
'ownerName'
,
title
:
'维护人'
},
{
key
:
'maintenanceContent'
,
title
:
'维护说明'
},
{
key
:
'remark'
,
title
:
'描述'
},
{
key
:
'modifiedTs'
,
title
:
'维护时间'
,
render
:
(
text
)
=>
text
?
new
Date
(
text
).
toLocaleString
():
''
},
{
key
:
'modifiedTs'
,
title
:
'版本'
,
render
:
(
text
)
=>
text
?
`V_
${
new
Date
(
text
).
toLocaleString
()}
`
:
''
},
]
const
FC
=
(
props
)
=>
{
const
{
node
}
=
props
...
...
@@ -308,7 +319,27 @@ const FC = (props) => {
return (
<div className='pl-4'>
<div className='d-flex mb-3' style={{ justifyContent: 'space-between', alignItems: 'center' }}>
<div className='py-3' style={{ borderBottom: '1px solid #EFEFEF' }}>
<Row gutter={[8, 8]}>
{
(nodeItems??[]).map(item => {
let val = node?.[item.key]
if (item.render) {
val = item.render(val)
}
return (
<Col key={item.title} span={6}>
<Tooltip title={val}>
<Typography.Text ellipsis={true}>{`
$
{
item
.
title
}:
$
{
val
??
''
}
`}</Typography.Text>
</Tooltip>
</Col>
)
})
}
</Row>
</div>
<div className='d-flex py-3' style={{ justifyContent: 'space-between', alignItems: 'center', borderBottom: '1px solid #EFEFEF' }}>
<Space>
<PermissionButton
onClick={onAddClick}
...
...
@@ -369,19 +400,21 @@ const FC = (props) => {
/>
</Space>
</div>
<Table
extraColWidth={32}
loading={loading}
columns={cols??[]}
dataSource={tableData??[]}
pagination={false}
rowSelection={{
selectedRowKeys: (selectedRows??[]).map(item => item.id),
onChange: (selectedRowKeys, selectedRows) => {
setSelectedRows(selectedRows)
},
}}
/>
<div className='pt-3'>
<Table
extraColWidth={32}
loading={loading}
columns={cols??[]}
dataSource={tableData??[]}
pagination={false}
rowSelection={{
selectedRowKeys: (selectedRows??[]).map(item => item.id),
onChange: (selectedRowKeys, selectedRows) => {
setSelectedRows(selectedRows)
},
}}
/>
</div>
<AddRule
{...addRuleParams}
onCancel={(refresh) => {
...
...
src/view/Manage/ModelConfig/Component/rule-tree.jsx
View file @
eb4e992d
import
React
from
'react'
import
produce
from
'immer'
import
{
Modal
,
Tooltip
,
Button
,
Spin
}
from
'antd'
import
{
Modal
,
Tooltip
,
Button
,
Spin
,
Space
}
from
'antd'
import
{
PlusOutlined
,
ReloadOutlined
}
from
'@ant-design/icons'
import
{
dispatch
}
from
'../../../../model'
...
...
@@ -162,17 +162,25 @@ const FC = (props) => {
return
(
<
div
>
<
div
className=
'header p-3'
>
<
PermissionButton
defaultPermission=
{
true
}
tip=
"新增目录"
type=
"text"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
onAddClick
}
/>
<
Tooltip
title=
"刷新目录"
>
<
Button
type=
"text"
icon=
{
<
ReloadOutlined
/>
}
onClick=
{
onRefreshClick
}
/>
</
Tooltip
>
<
div
className=
'px-3'
style=
{
{
display
:
'flex'
,
width
:
'100%'
,
height
:
40
,
alignItems
:
'center'
,
borderBottom
:
'1px solid #EFEFEF'
,
}
}
>
<
Space
>
<
PermissionButton
defaultPermission=
{
true
}
tip=
"新增目录"
type=
"text"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
onAddClick
}
/>
<
Tooltip
title=
"刷新目录"
>
<
Button
type=
"text"
icon=
{
<
ReloadOutlined
/>
}
onClick=
{
onRefreshClick
}
/>
</
Tooltip
>
</
Space
>
</
div
>
<
div
className=
'p-3'
>
<
Spin
spinning=
{
loading
}
>
...
...
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