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
be9a0e36
Commit
be9a0e36
authored
Oct 18, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资源草稿
parent
4b3260a7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
114 additions
and
5 deletions
+114
-5
assetmanage.js
src/model/assetmanage.js
+5
-0
dataassetmanager.js
src/service/dataassetmanager.js
+5
-0
Table.less
src/util/Component/Table.less
+8
-1
AttributeRelationModal.jsx
...w/Manage/AssetManage/Component/AttributeRelationModal.jsx
+5
-0
table.jsx
src/view/Manage/AssetResourceManage/table.jsx
+91
-4
No files found.
src/model/assetmanage.js
View file @
be9a0e36
...
@@ -290,6 +290,10 @@ export function* resourceBatchEdit(payload) {
...
@@ -290,6 +290,10 @@ export function* resourceBatchEdit(payload) {
return
yield
call
(
service
.
resourceBatchEdit
,
payload
)
return
yield
call
(
service
.
resourceBatchEdit
,
payload
)
}
}
export
function
*
getResourceDraft
(
payload
)
{
return
yield
call
(
service
.
getResourceDraft
,
payload
)
}
export
function
*
getTasks
(
payload
)
{
export
function
*
getTasks
(
payload
)
{
return
yield
call
(
service
.
getTasks
,
payload
)
return
yield
call
(
service
.
getTasks
,
payload
)
}
}
\ No newline at end of file
src/service/dataassetmanager.js
View file @
be9a0e36
...
@@ -280,6 +280,10 @@ export function getPreviewRangeByDirId(payload) {
...
@@ -280,6 +280,10 @@ export function getPreviewRangeByDirId(payload) {
return
PostJSON
(
"/dataassetmanager/resourceApi/batchEdit"
,
payload
)
return
PostJSON
(
"/dataassetmanager/resourceApi/batchEdit"
,
payload
)
}
}
export
function
getResourceDraft
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/resourceApi/getDraft"
,
payload
)
}
export
function
getTasks
(
payload
)
{
export
function
getTasks
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/resource/taskApi/listTasksByPage"
,
payload
)
return
GetJSON
(
"/dataassetmanager/resource/taskApi/listTasksByPage"
,
payload
)
}
}
\ No newline at end of file
src/util/Component/Table.less
View file @
be9a0e36
...
@@ -38,8 +38,15 @@
...
@@ -38,8 +38,15 @@
}
}
tr.@{ant-prefix}-table-expanded-row > td {
tr.@{ant-prefix}-table-expanded-row > td {
background: #fff !important;
padding: 0 !important;
background: #fff !important;
}
}
tr.@{ant-prefix}-table-expanded-row {
.@{ant-prefix}-table {
margin: 0 !important;
}
}
.@{ant-prefix}-table-thead > tr > th {
.@{ant-prefix}-table-thead > tr > th {
background-color: #F2F5FC !important;
background-color: #F2F5FC !important;
...
...
src/view/Manage/AssetManage/Component/AttributeRelationModal.jsx
View file @
be9a0e36
...
@@ -164,6 +164,11 @@ const AttributeRelationModal = (props) => {
...
@@ -164,6 +164,11 @@ const AttributeRelationModal = (props) => {
const
getRelAttrByModel
=
()
=>
{
const
getRelAttrByModel
=
()
=>
{
dispatch
({
dispatch
({
type
:
'assetmanage.getRelAttrByModel'
,
type
:
'assetmanage.getRelAttrByModel'
,
payload
:
{
params
:
{
dataAssetType
:
getAssetType
(
type
),
}
},
callback
:
data
=>
{
callback
:
data
=>
{
let
_fieldsValue
=
{};
let
_fieldsValue
=
{};
(
data
||
[]).
forEach
(
item
=>
{
(
data
||
[]).
forEach
(
item
=>
{
...
...
src/view/Manage/AssetResourceManage/table.jsx
View file @
be9a0e36
...
@@ -3,6 +3,7 @@ import classNames from 'classnames'
...
@@ -3,6 +3,7 @@ import classNames from 'classnames'
import
{
Tooltip
,
Typography
,
Space
,
Dropdown
,
Button
,
Menu
,
Checkbox
,
Input
,
Select
,
Modal
}
from
'antd'
import
{
Tooltip
,
Typography
,
Space
,
Dropdown
,
Button
,
Menu
,
Checkbox
,
Input
,
Select
,
Modal
}
from
'antd'
import
ResizeObserver
from
'rc-resize-observer'
import
ResizeObserver
from
'rc-resize-observer'
import
{
debounceTime
,
Subject
}
from
'rxjs'
import
{
debounceTime
,
Subject
}
from
'rxjs'
import
{
DownOutlined
,
UpOutlined
}
from
"@ant-design/icons"
import
{
defaultPage
,
usePage
}
from
'../../../util/hooks/page'
import
{
defaultPage
,
usePage
}
from
'../../../util/hooks/page'
import
Table
from
'../../../util/Component/Table'
import
Table
from
'../../../util/Component/Table'
...
@@ -45,6 +46,7 @@ const FC = (props) => {
...
@@ -45,6 +46,7 @@ const FC = (props) => {
const
[
compact
,
setCompact
]
=
React
.
useState
(
false
)
const
[
compact
,
setCompact
]
=
React
.
useState
(
false
)
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
loadingElements
,
setLoadingElements
]
=
React
.
useState
(
false
)
const
[
loadingElements
,
setLoadingElements
]
=
React
.
useState
(
false
)
const
[
columns
,
setColumns
]
=
React
.
useState
()
const
[
elements
,
setElements
]
=
React
.
useState
()
const
[
elements
,
setElements
]
=
React
.
useState
()
const
[
data
,
setData
]
=
React
.
useState
()
const
[
data
,
setData
]
=
React
.
useState
()
const
[
total
,
setTotal
]
=
React
.
useState
()
const
[
total
,
setTotal
]
=
React
.
useState
()
...
@@ -287,7 +289,7 @@ const FC = (props) => {
...
@@ -287,7 +289,7 @@ const FC = (props) => {
}
}
]
]
const
columns
=
React
.
useMemo
(()
=>
{
React
.
useEffect
(()
=>
{
const
newColumns
=
[]
const
newColumns
=
[]
let
index
=
0
let
index
=
0
for
(
const
element
of
elements
??[])
{
for
(
const
element
of
elements
??[])
{
...
@@ -336,7 +338,7 @@ const FC = (props) => {
...
@@ -336,7 +338,7 @@ const FC = (props) => {
newColumns
.
push
(
col
)
newColumns
.
push
(
col
)
}
}
return
[...
newColumns
,
...
notElementCol
]
setColumns
([...
newColumns
,
...
notElementCol
])
},
[
elements
])
},
[
elements
])
const
tableData
=
React
.
useMemo
(()
=>
{
const
tableData
=
React
.
useMemo
(()
=>
{
...
@@ -850,6 +852,7 @@ const FC = (props) => {
...
@@ -850,6 +852,7 @@ const FC = (props) => {
setArgsAndPage({ sortingStatus: value })
setArgsAndPage({ sortingStatus: value })
}}
}}
style={{ width: 100 }}
style={{ width: 100 }}
allowClear
>
>
{
{
(sortStatus??[]).map((item, index) => {
(sortStatus??[]).map((item, index) => {
...
@@ -865,6 +868,7 @@ const FC = (props) => {
...
@@ -865,6 +868,7 @@ const FC = (props) => {
setArgsAndPage({ resourceStatus: value })
setArgsAndPage({ resourceStatus: value })
}}
}}
style={{ width: 100 }}
style={{ width: 100 }}
allowClear
>
>
{
{
(relatedMetadataStatus??[]).map((item, index) => {
(relatedMetadataStatus??[]).map((item, index) => {
...
@@ -948,7 +952,36 @@ const FC = (props) => {
...
@@ -948,7 +952,36 @@ const FC = (props) => {
onChange: (selectedRowKeys, selectedRows) => {
onChange: (selectedRowKeys, selectedRows) => {
setSelectedRows(selectedRows)
setSelectedRows(selectedRows)
},
},
getCheckboxProps: (record) => ({
disabled: record.draft,
}),
}}
}}
expandable={(data??[]).findIndex(item => item.resourceExtraAttribute?.existDraft) !== -1 ? {
expandedRowRender: (record) => (
<ExpandedRow
id={record.id}
columns={columns}
onRowClick={(event, value) => {
event.stopPropagation()
setRow(value)
onClick?.(value)
}}
/>
),
rowExpandable: (record) => record.resourceExtraAttribute?.existDraft,
expandIcon: ({ expanded, onExpand, record }) => {
if (!record.resourceExtraAttribute?.existDraft) return null
return expanded ? (
<UpOutlined onClick={e => onExpand(record, e)} />
) : (
<DownOutlined onClick={e => onExpand(record, e)} />
)
},
indentSize: 0,
columnWidth: 30,
} : null
}
/>
/>
</ResizeObserver>
</ResizeObserver>
</div>
</div>
...
@@ -1054,4 +1087,58 @@ const FC = (props) => {
...
@@ -1054,4 +1087,58 @@ const FC = (props) => {
)
)
}
}
export default FC
export default FC
\ No newline at end of file
const ExpandedRow = ({ id, columns, onRowClick }) => {
const [loading, setLoading] = React.useState(false)
const [data, setData] = React.useState()
const tableData = React.useMemo(() => {
const newTableData = []
if (data) {
const newAsset = {...data}
let index = 0
for (const elementValue of (data?.elementValues??[])) {
newAsset[`
element$
{
++
index
}
`] = elementValue
}
newTableData.push(newAsset)
}
return newTableData
}, [data])
React.useEffect(() => {
if (id) {
getDraft()
}
}, [id])
const getDraft = () => {
setLoading(true)
dispatch({
type: 'assetmanage.getResourceDraft',
payload: {
resourceId: id,
range: getAssetRange(ResourceManageReference)
},
callback: (data) => {
setLoading(false)
setData(data)
}
})
}
return (
<div style={{ padding: 10 }}>
<Table
loading={loading}
columns={columns}
dataSource={tableData}
pagination={false}
onRowClick={(event, value) => {
onRowClick?.(event, value)
}}
/>
</div>
)
}
\ No newline at end of file
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