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
3cae61f7
Commit
3cae61f7
authored
Dec 06, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加操作
parent
afe7beab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
2 deletions
+60
-2
index.jsx
src/view/Manage/AssetDraft/index.jsx
+60
-2
No files found.
src/view/Manage/AssetDraft/index.jsx
View file @
3cae61f7
import
React
from
"react"
import
React
from
"react"
import
{
Space
,
Select
,
Button
,
Tooltip
,
Input
,
Typography
,
Modal
,
Pagination
}
from
'antd'
import
{
Space
,
Select
,
Button
,
Tooltip
,
Input
,
Typography
,
Modal
,
Pagination
,
Divider
}
from
'antd'
import
LocalStorage
from
'local-storage'
import
LocalStorage
from
'local-storage'
import
{
useDebounceEffect
}
from
'ahooks'
import
{
useDebounceEffect
}
from
'ahooks'
...
@@ -8,6 +8,7 @@ import { dispatch } from '../../../model'
...
@@ -8,6 +8,7 @@ import { dispatch } from '../../../model'
import
Table
from
'../ResizeableTable'
import
Table
from
'../ResizeableTable'
import
{
isSzseEnv
,
showMessage
}
from
"../../../util"
import
{
isSzseEnv
,
showMessage
}
from
"../../../util"
import
{
AssetItem
}
from
"../AssetManage/Component/AssetTable"
import
{
AssetItem
}
from
"../AssetManage/Component/AssetTable"
import
{
recommandEnglishWords
}
from
"../../../service/datamodeler"
const
isAdmin
=
false
const
isAdmin
=
false
const
specialCol
=
[
'数据关键用户'
,
'业务数据owner'
,
'it责任人'
,
'创建人'
,
'更新人'
]
const
specialCol
=
[
'数据关键用户'
,
'业务数据owner'
,
'it责任人'
,
'创建人'
,
'更新人'
]
...
@@ -27,6 +28,7 @@ const FC = (props) => {
...
@@ -27,6 +28,7 @@ const FC = (props) => {
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
data
,
setData
]
=
React
.
useState
()
const
[
data
,
setData
]
=
React
.
useState
()
const
[
users
,
setUsers
]
=
React
.
useState
()
const
[
users
,
setUsers
]
=
React
.
useState
()
const
[
row
,
setRow
]
=
React
.
useState
()
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
...
@@ -48,6 +50,25 @@ const FC = (props) => {
...
@@ -48,6 +50,25 @@ const FC = (props) => {
}
}
},
[
currentTemplateValue
,
keyword
,
currentElementValue
,
pagination
],
{
wait
:
300
})
},
[
currentTemplateValue
,
keyword
,
currentElementValue
,
pagination
],
{
wait
:
300
})
const
actionCol
=
{
title
:
'操作'
,
dataIndex
:
'action'
,
width
:
120
,
fixed
:
'right'
,
render
:
(
_
,
record
)
=>
(
<
Space
size=
{
5
}
split=
{
<
Divider
type=
'vertical'
style=
{
{
margin
:
0
}
}
/>
}
>
<
a
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
()
onEditClick
(
record
)
}
}
>
编辑
</
a
>
<
a
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
()
onDeleteClick
(
record
)
}
}
>
删除
</
a
>
</
Space
>
)
}
const
[
columns
,
tableData
,
total
]
=
React
.
useMemo
(()
=>
{
const
[
columns
,
tableData
,
total
]
=
React
.
useMemo
(()
=>
{
const
[
newColumns
,
newTableData
]
=
[[],
[]]
const
[
newColumns
,
newTableData
]
=
[[],
[]]
...
@@ -95,6 +116,8 @@ const FC = (props) => {
...
@@ -95,6 +116,8 @@ const FC = (props) => {
}
}
}
}
newColumns
.
push
(
actionCol
)
if
(
!
loadingFilterElements
)
{
if
(
!
loadingFilterElements
)
{
for
(
const
item
of
(
data
?.
data
??[]))
{
for
(
const
item
of
(
data
?.
data
??[]))
{
let
index
=
0
let
index
=
0
...
@@ -122,7 +145,7 @@ const FC = (props) => {
...
@@ -122,7 +145,7 @@ const FC = (props) => {
}
}
return
[
newColumns
,
newTableData
,
data
?.
total
??
0
]
return
[
newColumns
,
newTableData
,
data
?.
total
??
0
]
},
[
filterElements
,
data
,
loadingFilterElements
,
users
])
},
[
filterElements
,
data
,
loadingFilterElements
,
users
,
actionCol
])
const
getUsers
=
()
=>
{
const
getUsers
=
()
=>
{
dispatch
({
dispatch
({
...
@@ -260,6 +283,31 @@ const FC = (props) => {
...
@@ -260,6 +283,31 @@ const FC = (props) => {
})
})
}
}
const onEditClick = (record) => {
}
const onDeleteClick = (record) => {
modal.confirm({
title: '是否确认删除该条资产目录',
onOk: () => {
dispatch({
type: 'assetmanage.deleteDrafts',
payload: {
params: {
isAdmin,
},
data: record?.id
},
callback: () => {
showMessage("success","删除成功")
getDrafts()
}
})
}
})
}
return (
return (
<div style={{ backgroundColor: '#fff', height: '100%' }}>
<div style={{ backgroundColor: '#fff', height: '100%' }}>
<div className='flex p-3' style={{
<div className='flex p-3' style={{
...
@@ -326,6 +374,16 @@ const FC = (props) => {
...
@@ -326,6 +374,16 @@ const FC = (props) => {
setSelectedRows(selectedRows)
setSelectedRows(selectedRows)
}
}
}}
}}
onRow={(record) => {
return {
onClick: (e) => {
setRow(record)
}
}
}}
rowClassName={(record, index) => {
return (record?.id === row?.id) ? 'yy-table-select-row' : ''
}}
scroll={{ y: 'calc(100vh - 209px - 72px)' }}
scroll={{ y: 'calc(100vh - 209px - 72px)' }}
/>
/>
<Pagination
<Pagination
...
...
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