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
3765aba3
Commit
3765aba3
authored
Jul 05, 2024
by
和金晶
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产订阅
parent
83ce8ea8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
113 deletions
+60
-113
assetmanage.js
src/model/assetmanage.js
+7
-0
dataassetmanager.js
src/service/dataassetmanager.js
+6
-0
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+22
-5
MyApplyModal.jsx
src/view/Manage/AssetManage/Component/MyApplyModal.jsx
+25
-108
No files found.
src/model/assetmanage.js
View file @
3765aba3
...
@@ -83,6 +83,9 @@ export function* listRecycleBinDataAssetsByPage(payload) {
...
@@ -83,6 +83,9 @@ export function* listRecycleBinDataAssetsByPage(payload) {
export
function
*
getSubscriptionAssetByPage
(
payload
)
{
export
function
*
getSubscriptionAssetByPage
(
payload
)
{
return
yield
call
(
service
.
getSubscriptionAssetByPage
,
payload
);
return
yield
call
(
service
.
getSubscriptionAssetByPage
,
payload
);
}
}
export
function
*
startAssetSubscriptionFlow
(
payload
)
{
return
yield
call
(
service
.
startAssetSubscriptionFlow
,
payload
);
}
export
function
*
addOrUpdateDirectory
(
payload
)
{
export
function
*
addOrUpdateDirectory
(
payload
)
{
return
yield
call
(
service
.
addOrUpdateDirectory
,
payload
);
return
yield
call
(
service
.
addOrUpdateDirectory
,
payload
);
}
}
...
@@ -278,4 +281,7 @@ export function* listWorkbooksByType(payload) {
...
@@ -278,4 +281,7 @@ export function* listWorkbooksByType(payload) {
export
function
*
getViewUrlByWorkbookId
(
payload
)
{
export
function
*
getViewUrlByWorkbookId
(
payload
)
{
return
yield
call
(
service
.
getViewUrlByWorkbookId
,
payload
)
return
yield
call
(
service
.
getViewUrlByWorkbookId
,
payload
)
}
export
function
*
getSSOUrlByUserId
(
payload
)
{
return
yield
call
(
service
.
getSSOUrlByUserId
,
payload
)
}
}
\ No newline at end of file
src/service/dataassetmanager.js
View file @
3765aba3
...
@@ -78,6 +78,9 @@ export function listRecycleBinDataAssetsByPage(payload) {
...
@@ -78,6 +78,9 @@ export function listRecycleBinDataAssetsByPage(payload) {
export
function
getSubscriptionAssetByPage
(
payload
)
{
export
function
getSubscriptionAssetByPage
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/dataAssetApi/getSubscriptionAssetByPage"
,
payload
);
return
GetJSON
(
"/dataassetmanager/dataAssetApi/getSubscriptionAssetByPage"
,
payload
);
}
}
export
function
startAssetSubscriptionFlow
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/flowApi/startAssetSubscriptionFlow"
,
payload
);
}
export
function
loadDataAssets
(
payload
)
{
export
function
loadDataAssets
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/dataAssetApi/loadDataAssets"
,
payload
);
return
PostJSON
(
"/dataassetmanager/dataAssetApi/loadDataAssets"
,
payload
);
...
@@ -286,3 +289,6 @@ export function listWorkbooksByType(payload) {
...
@@ -286,3 +289,6 @@ export function listWorkbooksByType(payload) {
export
function
getViewUrlByWorkbookId
(
payload
)
{
export
function
getViewUrlByWorkbookId
(
payload
)
{
return
Get
(
"/dataassetmanager/reportApi/getViewUrlByWorkbookId"
,
payload
)
return
Get
(
"/dataassetmanager/reportApi/getViewUrlByWorkbookId"
,
payload
)
}
}
export
function
getSSOUrlByUserId
(
payload
)
{
return
Post
(
"/dataassetmanager/reportApi/getSSOUrlByUserId"
,
payload
)
}
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
3765aba3
...
@@ -563,6 +563,20 @@ const AssetTable = (props) => {
...
@@ -563,6 +563,20 @@ const AssetTable = (props) => {
setMyApplyVisible
(
true
);
setMyApplyVisible
(
true
);
}
}
}
}
const
openFinReport
=
()
=>
{
dispatch
({
type
:
'assetmanage.getSSOUrlByUserId'
,
payload
:
{
params
:
{
type
:
'fineReport'
}
},
callback
:
data
=>
{
window
.
open
(
data
);
},
error
:
()
=>
{
}
})
}
const
onRecursiveChange
=
(
e
)
=>
{
const
onRecursiveChange
=
(
e
)
=>
{
setRecursive
(
!
e
.
target
.
checked
);
setRecursive
(
!
e
.
target
.
checked
);
...
@@ -738,6 +752,7 @@ const AssetTable = (props) => {
...
@@ -738,6 +752,7 @@ const AssetTable = (props) => {
}
}
const
onReportAnalyseClick
=
(
val
)
=>
{
const
onReportAnalyseClick
=
(
val
)
=>
{
console
.
log
(
val
)
if
((
checkedKeys
||
[]).
length
===
0
)
{
if
((
checkedKeys
||
[]).
length
===
0
)
{
showMessage
(
'warn'
,
'请先选择一个资产'
);
showMessage
(
'warn'
,
'请先选择一个资产'
);
}
else
if
((
checkedKeys
||
[]).
length
>
1
)
{
}
else
if
((
checkedKeys
||
[]).
length
>
1
)
{
...
@@ -878,7 +893,7 @@ const AssetTable = (props) => {
...
@@ -878,7 +893,7 @@ const AssetTable = (props) => {
</
Menu
.
Item
>
</
Menu
.
Item
>
{
{
(
reference
===
AssetManageReference
||
reference
===
MyAssetReference
)
&&
reportTypes
?.
map
(
item
=>
(
reference
===
AssetManageReference
)
&&
reportTypes
?.
map
(
item
=>
<
React
.
Fragment
key=
{
item
.
code
}
>
<
React
.
Fragment
key=
{
item
.
code
}
>
<
Menu
.
Item
disabled=
{
(
checkedKeys
||
[]).
length
===
0
}
>
<
Menu
.
Item
disabled=
{
(
checkedKeys
||
[]).
length
===
0
}
>
<
div
className=
'text-center'
onClick=
{
()
=>
{
onReportAnalyseClick
(
item
)
}
}
>
<
div
className=
'text-center'
onClick=
{
()
=>
{
onReportAnalyseClick
(
item
)
}
}
>
...
@@ -934,7 +949,7 @@ const AssetTable = (props) => {
...
@@ -934,7 +949,7 @@ const AssetTable = (props) => {
(
reference
===
AssetManageReference
&&
nodeLevel
!==
1
&&
nodeType
!==
'custom'
)
&&
<
Button
onClick=
{
addAsset
}
>
新增
</
Button
>
(
reference
===
AssetManageReference
&&
nodeLevel
!==
1
&&
nodeType
!==
'custom'
)
&&
<
Button
onClick=
{
addAsset
}
>
新增
</
Button
>
}
}
{
{
(
reference
===
AssetManageReference
||
reference
===
MyAssetReference
)
?
<
Dropdown
overlay=
{
moreMenu
}
placement=
"bottomCenter"
>
(
reference
===
AssetManageReference
)
?
<
Dropdown
overlay=
{
moreMenu
}
placement=
"bottomCenter"
>
<
Button
>
其他操作
</
Button
>
<
Button
>
其他操作
</
Button
>
</
Dropdown
>
:
<
React
.
Fragment
>
</
Dropdown
>
:
<
React
.
Fragment
>
{
{
...
@@ -963,6 +978,9 @@ const AssetTable = (props) => {
...
@@ -963,6 +978,9 @@ const AssetTable = (props) => {
}
}
<
Button
onClick=
{
onFilterElementClick
}
>
可见列设置
</
Button
>
<
Button
onClick=
{
onFilterElementClick
}
>
可见列设置
</
Button
>
{
{
(
reference
==
MyAssetReference
)
&&
<
Button
onClick=
{
openFinReport
}
>
帆软报表自助分析
</
Button
>
}
{
(
reference
==
AssetBrowseReference
)
&&
<
Button
onClick=
{
onMyApply
}
>
资产订阅
</
Button
>
(
reference
==
AssetBrowseReference
)
&&
<
Button
onClick=
{
onMyApply
}
>
资产订阅
</
Button
>
}
}
</
React
.
Fragment
>
</
React
.
Fragment
>
...
@@ -976,7 +994,7 @@ const AssetTable = (props) => {
...
@@ -976,7 +994,7 @@ const AssetTable = (props) => {
(
reference
!==
AssetRecycleReference
&&
reference
!==
MyAssetReference
)
&&
<
Checkbox
onChange=
{
onFullSearchChange
}
checked=
{
fullSearch
}
>
全部数据
</
Checkbox
>
(
reference
!==
AssetRecycleReference
&&
reference
!==
MyAssetReference
)
&&
<
Checkbox
onChange=
{
onFullSearchChange
}
checked=
{
fullSearch
}
>
全部数据
</
Checkbox
>
}
}
{
{
(
reference
!==
MyAssetReference
)
&&
<
Search
<
Search
placeholder=
"请输入资产要素值"
placeholder=
"请输入资产要素值"
allowClear
allowClear
onSearch=
{
onSearchInputChange
}
onSearch=
{
onSearchInputChange
}
...
@@ -985,7 +1003,7 @@ const AssetTable = (props) => {
...
@@ -985,7 +1003,7 @@ const AssetTable = (props) => {
/>
/>
}
}
{
{
(
reference
!==
AssetRecycleReference
)
&&
<
Tooltip
title=
{
fullScreen
?
'取消全屏'
:
'全屏
'
}
>
(
reference
!==
AssetRecycleReference
&&
reference
!==
MyAssetReference
)
&&
<
Tooltip
title=
{
fullScreen
?
'取消全屏'
:
'全屏1
'
}
>
<
Button
onClick=
{
onFullScreenClick
}
icon=
{
fullScreen
?<
CancelFullScreenSvg
style=
{
{
width
:
20
,
height
:
20
}
}
/>:<
FullScreenSvg
style=
{
{
width
:
20
,
height
:
20
}
}
/>
}
type=
'text'
></
Button
>
<
Button
onClick=
{
onFullScreenClick
}
icon=
{
fullScreen
?<
CancelFullScreenSvg
style=
{
{
width
:
20
,
height
:
20
}
}
/>:<
FullScreenSvg
style=
{
{
width
:
20
,
height
:
20
}
}
/>
}
type=
'text'
></
Button
>
</
Tooltip
>
</
Tooltip
>
}
}
...
@@ -1096,7 +1114,6 @@ const AssetTable = (props) => {
...
@@ -1096,7 +1114,6 @@ const AssetTable = (props) => {
onCancel=
{
onFilterElementModalCancel
}
onCancel=
{
onFilterElementModalCancel
}
/>
/>
<
MyApplyModal
<
MyApplyModal
selectItem
=
{
selectItem
}
visible=
{
myApplyVisible
}
visible=
{
myApplyVisible
}
id=
{
(
checkedKeys
||
[]).
length
>
0
?
checkedKeys
[
0
]:
''
}
id=
{
(
checkedKeys
||
[]).
length
>
0
?
checkedKeys
[
0
]:
''
}
onCancel=
{
onMyApplyCancel
}
onCancel=
{
onMyApplyCancel
}
...
...
src/view/Manage/AssetManage/Component/MyApplyModal.jsx
View file @
3765aba3
import
React
,
{
useEffect
,
useState
,
useMemo
}
from
'react'
;
import
React
,
{
useEffect
,
useState
,
useMemo
}
from
'react'
;
import
{
Row
,
Col
,
Checkbox
,
Typography
,
Button
,
Switch
,
Modal
,
Form
,
Input
,
InputNumber
,
Select
,
DatePicker
}
from
'antd'
;
import
{
Row
,
Col
,
Checkbox
,
Typography
,
Button
,
Switch
,
Modal
,
Form
,
Input
,
InputNumber
,
Select
,
DatePicker
}
from
'antd'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
,
dispatchLatestHomepage
}
from
'../../../../model'
;
import
{
showMessage
}
from
'../../../../util'
;
import
'./FilterElementModal.less'
;
import
'./FilterElementModal.less'
;
import
moment
from
"moment"
import
moment
from
"moment"
...
@@ -14,9 +16,7 @@ const {Option} = Select
...
@@ -14,9 +16,7 @@ const {Option} = Select
const
MyApplyModal
=
(
props
)
=>
{
const
MyApplyModal
=
(
props
)
=>
{
const
{
visible
,
onCancel
,
type
=
'global'
,
id
,
selectItem
}
=
props
;
const
{
visible
,
onCancel
,
id
,
}
=
props
;
console
.
log
(
id
);
console
.
log
(
selectItem
);
const
[
elements
,
setElements
]
=
useState
([]);
const
[
elements
,
setElements
]
=
useState
([]);
const
[
typesOfElements
,
setTypesOfElements
]
=
useState
([]);
const
[
typesOfElements
,
setTypesOfElements
]
=
useState
([]);
const
[
selectedKeys
,
setSelectedKeys
]
=
useState
([]);
const
[
selectedKeys
,
setSelectedKeys
]
=
useState
([]);
...
@@ -24,69 +24,6 @@ const MyApplyModal = (props) => {
...
@@ -24,69 +24,6 @@ const MyApplyModal = (props) => {
const
[
form
]
=
Form
.
useForm
()
const
[
form
]
=
Form
.
useForm
()
useEffect
(()
=>
{
if
(
visible
)
{
getAllFilterElementIdsThenGetAllElements
();
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
visible
]);
const
getAllFilterElementIdsThenGetAllElements
=
()
=>
{
let
url
=
''
;
if
(
type
===
'global'
)
{
url
=
'assetmanage.listFilterElementIdsConfig'
;
}
else
{
url
=
'assetmanage.listFilterElementIds'
;
}
dispatch
({
type
:
url
,
callback
:
data
=>
{
setSelectedKeys
(
data
||
[]);
getAllElements
();
}
})
}
const
getAllElements
=
()
=>
{
let
url
=
''
;
if
(
type
===
'user'
)
{
url
=
'assetmanage.listUserElements'
;
}
else
{
url
=
'assetmanage.listElements'
;
}
dispatch
({
type
:
url
,
callback
:
data
=>
{
setElements
(
data
||
[]);
convertElements
(
data
||
[]);
}
})
}
const
convertElements
=
(
elements
)
=>
{
const
_typesOfElements
=
[];
const
_types
=
[];
(
elements
||
[]).
forEach
(
element
=>
{
if
(
_types
.
indexOf
(
element
.
type
||
''
)
===
-
1
)
{
_types
.
push
(
element
.
type
||
''
);
}
})
_types
.
forEach
(
type
=>
{
const
_elements
=
(
elements
||
[]).
filter
(
element
=>
(
element
.
type
||
''
)
===
type
);
_typesOfElements
.
push
({
type
,
elements
:
_elements
||
[]
});
})
setTypesOfElements
(
_typesOfElements
);
}
const
onCheckChange
=
(
e
)
=>
{
const
onCheckChange
=
(
e
)
=>
{
if
(
e
.
target
.
checked
)
{
if
(
e
.
target
.
checked
)
{
setSelectedKeys
([...
selectedKeys
,
e
.
target
.
value
]);
setSelectedKeys
([...
selectedKeys
,
e
.
target
.
value
]);
...
@@ -120,36 +57,31 @@ const MyApplyModal = (props) => {
...
@@ -120,36 +57,31 @@ const MyApplyModal = (props) => {
form
.
validateFields
().
then
((
values
)
=>
{
form
.
validateFields
().
then
((
values
)
=>
{
if
(
Object
.
keys
(
values
).
length
>
0
)
{
if
(
Object
.
keys
(
values
).
length
>
0
)
{
// 表单通过校验,做相应操作
const
tempexpiryDateEnd
=
values
.
expiryDateEnd
.
format
(
"YYYY-MM-DD"
)
console
.
log
(
'表单数据通过校验'
,
values
);
const
tempapplyReason
=
values
.
applyReason
console
.
log
(
values
)
dispatch
({
type
:
'assetmanage.startAssetSubscriptionFlow'
,
payload
:{
params
:{
dataAssetId
:
id
,
applyReason
:
tempapplyReason
,
expiryDateEnd
:
tempexpiryDateEnd
}
},
callback
:
data
=>
{
showMessage
(
"success"
,
"发送申请成功"
);
onCancel
()
},
error
:
(
err
)
=>
{
setConfirmLoading
(
false
);
}
})
}
}
}).
catch
((
errorInfo
)
=>
{
}).
catch
((
errorInfo
)
=>
{
console
.
log
(
'校验错误'
,
errorInfo
);
console
.
log
(
'校验错误'
,
errorInfo
);
});
});
// setConfirmLoading(true);
// let url = '';
// if (type === 'global') {
// url = 'assetmanage.setupFilterElementIdsConfig';
// } else {
// url = 'assetmanage.setupFilterElementIds';
// }
// dispatch({
// type: url,
// payload: {
// data: selectedKeys
// },
// callback: () => {
// reset();
// onCancel && onCancel(true);
// },
// error: () => {
// reset();
// }
// })
}
}
const
cancel
=
()
=>
{
const
cancel
=
()
=>
{
...
@@ -171,20 +103,6 @@ const MyApplyModal = (props) => {
...
@@ -171,20 +103,6 @@ const MyApplyModal = (props) => {
},
},
};
};
const
onFinish
=
(
values
)
=>
{
console
.
log
(
values
);
};
const
validateMessages
=
{
required
:
'${label} is required!'
,
types
:
{
email
:
'${label} is not a valid email!'
,
number
:
'${label} is not a valid number!'
,
},
number
:
{
range
:
'${label} must be between ${min} and ${max}'
,
},
};
const
SelectTime
=
(
props
)
=>
{
const
SelectTime
=
(
props
)
=>
{
const
{
value
,
onChange
,
disabledDate
}
=
props
const
{
value
,
onChange
,
disabledDate
}
=
props
...
@@ -228,7 +146,6 @@ const MyApplyModal = (props) => {
...
@@ -228,7 +146,6 @@ const MyApplyModal = (props) => {
}
}
const
disabledDate
=
(
current
)
=>
{
const
disabledDate
=
(
current
)
=>
{
// Can not select days before today and today
return
current
&&
current
<
moment
().
endOf
(
'day'
);
return
current
&&
current
<
moment
().
endOf
(
'day'
);
};
};
...
@@ -258,7 +175,7 @@ const disabledDate= (current) => {
...
@@ -258,7 +175,7 @@ const disabledDate= (current) => {
>
>
<
div
>
<
div
>
<
Form
{
...
layout
}
name=
"nest-messages"
style=
{
{
maxWidth
:
600
,
}
}
validateMessages=
{
validateMessages
}
form=
{
form
}
>
<
Form
{
...
layout
}
name=
"nest-messages"
style=
{
{
maxWidth
:
600
,
}
}
form=
{
form
}
>
<
Form
.
Item
label=
{
'有效时限'
}
name=
{
'expiryDateEnd'
}
rules=
{
[{
required
:
true
,
message
:
'必填项'
}]
}
>
<
Form
.
Item
label=
{
'有效时限'
}
name=
{
'expiryDateEnd'
}
rules=
{
[{
required
:
true
,
message
:
'必填项'
}]
}
>
<
SelectTime
disabledDate=
{
disabledDate
}
/>
<
SelectTime
disabledDate=
{
disabledDate
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
...
...
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