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
265bf08d
Commit
265bf08d
authored
Jan 16, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
岗位新增资产
parent
8e4946ef
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
50 deletions
+31
-50
AddAssetModel.jsx
src/view/Manage/AssetManage/Component/AddAssetModel.jsx
+29
-39
AddAssetModel.less
src/view/Manage/AssetManage/Component/AddAssetModel.less
+0
-7
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+0
-0
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+2
-4
No files found.
src/view/Manage/AssetManage/Component/AddAssetModel.jsx
View file @
265bf08d
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
useState
}
from
'react'
;
import
{
Modal
,
Form
,
Space
,
Button
}
from
'antd'
;
import
{
Modal
,
Form
,
Space
,
Button
,
Spin
}
from
'antd'
;
import
{
showMessage
}
from
'../../../../util'
;
import
{
showMessage
}
from
'../../../../util'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
import
AssetAction
from
'./AssetAction'
;
import
AssetAction
from
'./AssetAction'
;
import
'./AddAssetModel.less'
;
const
AddAssetModel
=
(
props
)
=>
{
const
AddAssetModel
=
(
props
)
=>
{
const
{
onCancel
,
visible
,
nodeId
}
=
props
;
const
{
onCancel
,
visible
,
nodeId
}
=
props
;
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
waiting
,
setWaiting
]
=
useState
(
false
);
const
[
metadataId
,
setMetadataId
]
=
useState
(
''
);
const
[
elements
,
setElements
]
=
useState
([]);
const
[
elements
,
setElements
]
=
useState
([]);
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
...
@@ -19,14 +15,15 @@ const AddAssetModel = (props) => {
...
@@ -19,14 +15,15 @@ const AddAssetModel = (props) => {
setElements
(
value
);
setElements
(
value
);
}
}
const
onMetadataChange
=
(
value
)
=>
{
const
close
=
(
refresh
=
false
)
=>
{
setMetadataId
(
value
);
setWaiting
(
false
)
form
?.
resetFields
()
onCancel
?.(
refresh
)
}
}
const
onOk
=
async
()
=>
{
const
onOk
=
async
()
=>
{
try
{
try
{
const
row
=
await
form
?.
validateFields
();
const
row
=
await
form
?.
validateFields
();
const
newElements
=
[...
elements
];
const
newElements
=
[...
elements
];
(
newElements
||
[]).
forEach
(
element
=>
{
(
newElements
||
[]).
forEach
(
element
=>
{
if
(
row
.
hasOwnProperty
(
element
.
name
))
{
if
(
row
.
hasOwnProperty
(
element
.
name
))
{
...
@@ -34,15 +31,7 @@ const AddAssetModel = (props) => {
...
@@ -34,15 +31,7 @@ const AddAssetModel = (props) => {
}
}
});
});
const
params
=
{
setWaiting
(
true
);
dirId
:
nodeId
,
}
if
((
metadataId
||
''
)
!==
''
)
{
params
.
metadataId
=
metadataId
;
}
setConfirmLoading
(
true
);
dispatch
({
dispatch
({
type
:
'assetmanage.checkCodeIsExist'
,
type
:
'assetmanage.checkCodeIsExist'
,
...
@@ -51,62 +40,63 @@ const AddAssetModel = (props) => {
...
@@ -51,62 +40,63 @@ const AddAssetModel = (props) => {
},
},
callback
:
isExist
=>
{
callback
:
isExist
=>
{
if
(
isExist
===
'true'
)
{
if
(
isExist
===
'true'
)
{
set
ConfirmLoad
ing
(
false
);
set
Wait
ing
(
false
);
showMessage
(
'warn'
,
'已存在相同的资产目录编号,请重新输入'
);
showMessage
(
'warn'
,
'已存在相同的资产目录编号,请重新输入'
);
}
else
{
}
else
{
dispatch
({
dispatch
({
type
:
'assetmanage.addOrUpdateDataAsset'
,
type
:
'assetmanage.addOrUpdateDataAsset'
,
payload
:
{
payload
:
{
params
,
params
:
{
dirId
:
nodeId
,
},
data
:
{
elements
:
newElements
}
data
:
{
elements
:
newElements
}
},
},
callback
:
()
=>
{
callback
:
()
=>
{
setConfirmLoading
(
false
);
showMessage
(
"success"
,
"新增成功"
);
showMessage
(
"success"
,
"新增成功"
);
onCancel
&&
onCancel
(
true
);
close
(
true
)
},
},
error
:
()
=>
{
error
:
()
=>
{
set
ConfirmLoad
ing
(
false
);
set
Wait
ing
(
false
);
}
}
})
})
}
}
},
},
error
:
()
=>
{
error
:
()
=>
{
set
ConfirmLoad
ing
(
false
);
set
Wait
ing
(
false
);
}
}
})
})
}
catch
(
errInfo
)
{
}
catch
(
errInfo
)
{
console
.
log
(
'Validate Failed:'
,
errInfo
);
console
.
log
(
'Validate Failed:'
,
errInfo
);
set
ConfirmLoad
ing
(
false
);
set
Wait
ing
(
false
);
}
}
}
}
return
(
return
(
<
Modal
<
Modal
forceRender
destroyOnClose
className=
'asset-add'
className=
'asset-add'
title=
'新增资产目录信息'
title=
'新增资产目录信息'
visible=
{
visible
}
visible=
{
visible
}
width=
{
600
}
centered
onCancel=
{
()
=>
{
onCancel
&&
onCancel
();
}
}
width=
{
800
}
onCancel=
{
()
=>
{
close
()
}
}
footer=
{
footer=
{
<
Space
>
<
Space
>
<
Button
onClick=
{
()
=>
onCancel
&&
onCancel
()
}
>
取消
</
Button
>
<
Button
onClick=
{
()
=>
onCancel
&&
onCancel
()
}
>
取消
</
Button
>
<
Button
type=
"primary"
onClick=
{
onOk
}
loading=
{
confirmLoad
ing
}
>
确定
</
Button
>
<
Button
type=
"primary"
onClick=
{
onOk
}
disabled=
{
wait
ing
}
>
确定
</
Button
>
</
Space
>
</
Space
>
}
}
bodyStyle=
{
{
padding
:
'10px
'
}
}
bodyStyle=
{
{
overflowX
:
'auto'
,
height
:
'80vh
'
}
}
>
>
{
<
Spin
spinning=
{
waiting
}
>
visible
&&
<
AssetAction
<
AssetAction
form=
{
form
}
form=
{
form
}
dirId=
{
nodeId
}
dirId=
{
nodeId
}
action=
'add'
action=
'add'
onMetadataChange=
{
onMetadataChange
}
onElementsChange=
{
onElementsChange
}
onElementsChange=
{
onElementsChange
}
/>
/>
</
Spin
>
}
</
Modal
>
</
Modal
>
);
);
}
}
...
...
src/view/Manage/AssetManage/Component/AddAssetModel.less
deleted
100644 → 0
View file @
8e4946ef
.asset-add {
.yy-modal-body {
max-height: 500px !important;
overflow: auto !important;
}
}
\ No newline at end of file
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
265bf08d
This diff is collapsed.
Click to expand it.
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
265bf08d
...
@@ -13,7 +13,7 @@ import ImportAssetDrawer from './ImportAssetDrawer';
...
@@ -13,7 +13,7 @@ import ImportAssetDrawer from './ImportAssetDrawer';
import
AssetEdit
from
'./AddAssetModel'
;
import
AssetEdit
from
'./AddAssetModel'
;
import
AssetDetailDrawer
from
"./AssetDetailDrawer"
;
import
AssetDetailDrawer
from
"./AssetDetailDrawer"
;
import
{
dispatch
,
dispatchLatestHomepage
}
from
'../../../../model'
;
import
{
dispatch
,
dispatchLatestHomepage
}
from
'../../../../model'
;
import
{
showMessage
,
showNotifaction
,
getQueryParam
,
inputWidth
,
isSzseEnv
,
highlightSearchContentByTerms
}
from
'../../../../util'
;
import
{
showMessage
,
showNotifaction
,
getQueryParam
,
inputWidth
,
isSzseEnv
,
highlightSearchContentByTerms
,
isPostAsset
}
from
'../../../../util'
;
import
{
AnchorId
,
AnchorDirId
,
AnchorTimestamp
,
AssetBrowseReference
,
AssetManageReference
,
AssetRecycleReference
,
ResourceBrowseReference
}
from
'../../../../util/constant'
;
import
{
AnchorId
,
AnchorDirId
,
AnchorTimestamp
,
AssetBrowseReference
,
AssetManageReference
,
AssetRecycleReference
,
ResourceBrowseReference
}
from
'../../../../util/constant'
;
import
{
FullScreenSvg
,
CancelFullScreenSvg
}
from
'./AssetSvg'
;
import
{
FullScreenSvg
,
CancelFullScreenSvg
}
from
'./AssetSvg'
;
import
AssetDeleteModal
from
'./AssetDeleteModal'
;
import
AssetDeleteModal
from
'./AssetDeleteModal'
;
...
@@ -935,7 +935,6 @@ const AssetTable = (props) => {
...
@@ -935,7 +935,6 @@ const AssetTable = (props) => {
</
Menu
.
Item
>
</
Menu
.
Item
>
}
}
{
{
//自定义目录下的资产不允许新增 删除
(
nodeType
!==
'custom'
)
&&
<
Menu
.
Item
disabled=
{
(
checkedKeys
||
[]).
length
===
0
}
>
(
nodeType
!==
'custom'
)
&&
<
Menu
.
Item
disabled=
{
(
checkedKeys
||
[]).
length
===
0
}
>
<
div
className=
'text-center'
onClick=
{
deleteAssets
}
>
<
div
className=
'text-center'
onClick=
{
deleteAssets
}
>
删除
删除
...
@@ -987,8 +986,7 @@ const AssetTable = (props) => {
...
@@ -987,8 +986,7 @@ const AssetTable = (props) => {
>
>
<
Space
size=
{
15
}
>
<
Space
size=
{
15
}
>
{
{
//栏目和自定义目录 不允许新增资产
(
reference
===
AssetManageReference
&&
isPostAsset
(
getTemplateType
())
&&
nodeId
)
&&
<
Button
onClick=
{
addAsset
}
>
新增
</
Button
>
// (reference===AssetManageReference && nodeLevel!==1 && nodeType!=='custom') && <Button onClick=
{
addAsset
}
>
新增
<
/Button>
}
}
{
{
...
...
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