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
6ff825c7
Commit
6ff825c7
authored
Nov 06, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
f7c0ca97
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
62 additions
and
33 deletions
+62
-33
axios.js
src/util/axios.js
+1
-1
AssetDetailPage.jsx
src/view/Manage/AssetManage/Component/AssetDetailPage.jsx
+39
-5
AssetDirectory.jsx
src/view/Manage/AssetManage/Component/AssetDirectory.jsx
+2
-1
AssetManageTree.jsx
src/view/Manage/AssetManage/Component/AssetManageTree.jsx
+3
-2
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+3
-2
ImportAssetDrawer.jsx
src/view/Manage/AssetManage/Component/ImportAssetDrawer.jsx
+10
-20
ImportDirectory.jsx
src/view/Manage/AssetManage/Component/ImportDirectory.jsx
+2
-1
ImportElement.jsx
src/view/Manage/AssetManage/Component/ImportElement.jsx
+2
-1
No files found.
src/util/axios.js
View file @
6ff825c7
...
@@ -115,7 +115,7 @@ const callback = resp => {
...
@@ -115,7 +115,7 @@ const callback = resp => {
return
resp
.
data
||
resp
;
return
resp
.
data
||
resp
;
}
}
function
getTemplateType
()
{
export
function
getTemplateType
()
{
return
LocalStorage
.
get
(
`templateType-
${
appId
}
`
)
return
LocalStorage
.
get
(
`templateType-
${
appId
}
`
)
}
}
...
...
src/view/Manage/AssetManage/Component/AssetDetailPage.jsx
View file @
6ff825c7
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
LocalStorage
from
'local-storage'
;
import
{
Spin
}
from
"antd"
;
import
AssetAction
from
"./AssetAction"
;
import
AssetAction
from
"./AssetAction"
;
import
{
getQueryParam
}
from
'../../../../util'
;
import
{
getQueryParam
}
from
'../../../../util'
;
import
{
dispatch
}
from
'../../../../model'
;
import
'./AssetDetailPage.less'
;
import
'./AssetDetailPage.less'
;
import
{
getDataAssetDetail
}
from
"../../../../service/dataassetmanager"
;
import
{
appId
}
from
"../../../../App"
;
const
AssetDetailPage
=
(
props
)
=>
{
const
AssetDetailPage
=
(
props
)
=>
{
const
[
data
,
setData
]
=
useState
({
id
:
''
,
dirId
:
''
});
const
[
data
,
setData
]
=
useState
({
id
:
''
,
dirId
:
''
});
const
[
loading
,
setLoading
]
=
useState
(
false
)
const
[
templateType
,
setTemplateType
]
=
useState
()
const
{
id
,
dirId
}
=
data
;
const
{
id
,
dirId
}
=
data
;
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -16,20 +22,48 @@ const AssetDetailPage = (props)=>{
...
@@ -16,20 +22,48 @@ const AssetDetailPage = (props)=>{
const
_id
=
getQueryParam
(
'id'
,
props
.
location
.
search
);
const
_id
=
getQueryParam
(
'id'
,
props
.
location
.
search
);
const
_dirId
=
getQueryParam
(
'dirId'
,
props
.
location
.
search
);
const
_dirId
=
getQueryParam
(
'dirId'
,
props
.
location
.
search
);
setData
({
id
:
_id
,
dirId
:
_dirId
});
setData
({
id
:
_id
,
dirId
:
_dirId
});
getDataAssetDetail
()
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[])
},
[])
const
getDataAssetDetail
=
()
=>
{
const
_id
=
getQueryParam
(
'id'
,
props
.
location
.
search
);
const
_dirId
=
getQueryParam
(
'dirId'
,
props
.
location
.
search
);
dispatch
({
type
:
'assetmanage.getDataAssetDetail'
,
payload
:
{
dataAssetId
:
_id
,
dirId
:
_dirId
||
''
,
checkPermission
:
true
},
callback
:
data
=>
{
setLoading
(
false
);
LocalStorage
.
set
(
`templateType-
${
appId
}
`
,
data
?.
templateType
)
setTemplateType
(
data
?.
templateType
)
},
error
:
()
=>
{
setLoading
(
false
);
}
})
}
return
(
return
(
<
div
className=
'asset-detail position-relative'
>
<
div
className=
'asset-detail position-relative'
>
<
div
className=
'detail-header'
>
<
div
className=
'detail-header'
>
<
span
style=
{
{
fontSize
:
16
,
fontWeight
:
'bold'
,
color
:
'#000'
}
}
>
资产目录详情
</
span
>
<
span
style=
{
{
fontSize
:
16
,
fontWeight
:
'bold'
,
color
:
'#000'
}
}
>
资产目录详情
</
span
>
</
div
>
</
div
>
<
div
className=
'detail-container'
>
<
Spin
spinning=
{
loading
}
>
<
div
className=
'detail-container-card'
>
<
div
className=
'detail-container'
>
<
AssetAction
id=
{
id
}
dirId=
{
dirId
}
action=
'detail'
/>
<
div
className=
'detail-container-card'
>
{
templateType
&&
<
AssetAction
id=
{
id
}
dirId=
{
dirId
}
action=
'detail'
/>
}
</
div
>
</
div
>
</
div
>
</
div
>
</
Spin
>
</
div
>
</
div
>
)
)
}
}
...
...
src/view/Manage/AssetManage/Component/AssetDirectory.jsx
View file @
6ff825c7
...
@@ -12,6 +12,7 @@ import Separate from './Separate';
...
@@ -12,6 +12,7 @@ import Separate from './Separate';
import
record
from
'../Assets/record.png'
;
import
record
from
'../Assets/record.png'
;
import
'./AssetDirectory.less'
;
import
'./AssetDirectory.less'
;
import
{
getTemplateType
}
from
'../../../../util/axios'
;
const
{
Paragraph
,
Text
}
=
Typography
;
const
{
Paragraph
,
Text
}
=
Typography
;
...
@@ -97,7 +98,7 @@ const AssetDirectory = (props) => {
...
@@ -97,7 +98,7 @@ const AssetDirectory = (props) => {
}
}
const
onExportElementBtnClick
=
()
=>
{
const
onExportElementBtnClick
=
()
=>
{
window
.
open
(
'/api/dataassetmanager/elementApi/export'
);
window
.
open
(
`/api/dataassetmanager/elementApi/export?templateType=
${
getTemplateType
()}
`
);
}
}
const
onFilterElementClick
=
()
=>
{
const
onFilterElementClick
=
()
=>
{
...
...
src/view/Manage/AssetManage/Component/AssetManageTree.jsx
View file @
6ff825c7
...
@@ -16,6 +16,7 @@ import { highlightSearchContentByTerms } from '../../../../util';
...
@@ -16,6 +16,7 @@ import { highlightSearchContentByTerms } from '../../../../util';
import
'./AssetManageTree.less'
;
import
'./AssetManageTree.less'
;
import
'react-contexify/dist/ReactContexify.css'
;
import
'react-contexify/dist/ReactContexify.css'
;
import
{
appId
}
from
'../../../../App'
;
import
{
appId
}
from
'../../../../App'
;
import
{
getTemplateType
}
from
'../../../../util/axios'
;
const
{
Option
}
=
AutoComplete
;
const
{
Option
}
=
AutoComplete
;
...
@@ -466,7 +467,7 @@ const AssetManageTree = (props) => {
...
@@ -466,7 +467,7 @@ const AssetManageTree = (props) => {
}
}
const
exportAllDir
=
()
=>
{
const
exportAllDir
=
()
=>
{
window
.
open
(
'/api/dataassetmanager/directoryApi/export'
);
window
.
open
(
`/api/dataassetmanager/directoryApi/export?templateType=
${
getTemplateType
()}
`
);
}
}
const
exportCurrentDir
=
()
=>
{
const
exportCurrentDir
=
()
=>
{
...
@@ -477,7 +478,7 @@ const AssetManageTree = (props) => {
...
@@ -477,7 +478,7 @@ const AssetManageTree = (props) => {
dirId
:
currentDirId
dirId
:
currentDirId
},
},
callback
:
data
=>
{
callback
:
data
=>
{
window
.
open
(
`/api/dataassetmanager/directoryApi/export?parentPath=
${
data
.
path
}
`
);
window
.
open
(
`/api/dataassetmanager/directoryApi/export?parentPath=
${
data
.
path
}
&templateType=
${
getTemplateType
()}
`
);
}
}
})
})
}
else
{
}
else
{
...
...
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
6ff825c7
...
@@ -21,6 +21,7 @@ import StartFlowModal from "./StartFlow";
...
@@ -21,6 +21,7 @@ import StartFlowModal from "./StartFlow";
import
"./AssetTable.less"
;
import
"./AssetTable.less"
;
import
'react-contexify/dist/ReactContexify.css'
;
import
'react-contexify/dist/ReactContexify.css'
;
import
{
getTemplateType
}
from
"../../../../util/axios"
;
const
{
Text
}
=
Typography
;
const
{
Text
}
=
Typography
;
const
{
Search
}
=
Input
;
const
{
Search
}
=
Input
;
...
@@ -665,11 +666,11 @@ const AssetTable = (props) => {
...
@@ -665,11 +666,11 @@ const AssetTable = (props) => {
title
:
'提示'
,
title
:
'提示'
,
content
:
'是否导出所有资产目录?'
,
content
:
'是否导出所有资产目录?'
,
onOk
:
()
=>
{
onOk
:
()
=>
{
window
.
open
(
'/api/dataassetmanager/dataAssetApi/exportByDataAssetIds?exportAll=true'
);
window
.
open
(
`/api/dataassetmanager/dataAssetApi/exportByDataAssetIds?exportAll=true&templateType=
${
getTemplateType
()}
`
);
}
}
})
})
}
else
{
}
else
{
window
.
open
(
`/api/dataassetmanager/dataAssetApi/exportByDataAssetIds?dataAssetIds=
${
checkedKeys
.
join
(
','
)}
`
);
window
.
open
(
`/api/dataassetmanager/dataAssetApi/exportByDataAssetIds?dataAssetIds=
${
checkedKeys
.
join
(
','
)}
&templateType=
${
getTemplateType
()}
`
);
}
}
}
}
...
...
src/view/Manage/AssetManage/Component/ImportAssetDrawer.jsx
View file @
6ff825c7
...
@@ -5,6 +5,7 @@ import { UploadOutlined, DownloadOutlined } from '@ant-design/icons';
...
@@ -5,6 +5,7 @@ import { UploadOutlined, DownloadOutlined } from '@ant-design/icons';
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
showMessage
,
formatDate
}
from
'../../../../util'
;
import
{
showMessage
,
formatDate
}
from
'../../../../util'
;
import
{
AppContext
}
from
'../../../../App'
;
import
{
AppContext
}
from
'../../../../App'
;
import
{
getTemplateType
}
from
'../../../../util/axios'
;
const
ImportAssetDrawer
=
(
props
)
=>
{
const
ImportAssetDrawer
=
(
props
)
=>
{
const
{
onCancel
,
onSuccess
,
visible
,
nodeId
}
=
props
;
const
{
onCancel
,
onSuccess
,
visible
,
nodeId
}
=
props
;
...
@@ -89,7 +90,7 @@ const ImportAssetDrawer = (props) => {
...
@@ -89,7 +90,7 @@ const ImportAssetDrawer = (props) => {
},
[
visible
])
},
[
visible
])
const
downloadTemplate
=
()
=>
{
const
downloadTemplate
=
()
=>
{
window
.
open
(
"/api/dataassetmanager/dataAssetApi/getImportTemplate"
);
window
.
open
(
`/api/dataassetmanager/dataAssetApi/getImportTemplate?templateType=
${
getTemplateType
()}
`
);
}
}
const
getLogs
=
(
p
=
1
,
s
=
20
)
=>
{
const
getLogs
=
(
p
=
1
,
s
=
20
)
=>
{
...
@@ -154,30 +155,19 @@ const ImportAssetDrawer = (props) => {
...
@@ -154,30 +155,19 @@ const ImportAssetDrawer = (props) => {
setConfirmLoading
(
true
);
setConfirmLoading
(
true
);
dispatch
({
dispatch
({
type
:
'assetmanage.getDirectoryById'
,
type
:
'assetmanage.assetImport'
,
payload
:
{
payload
:
{
fileList
:
fileList
,
params
:
{
env
:
`
${
app
?.
env
?.
domainId
}
` } },
dirId
:
nodeId
},
callback: data => {
callback: data => {
dispatch
({
setConfirmLoading(false);
type
:
'assetmanage.assetImport'
,
setFileList([]);
payload
:
{
fileList
:
fileList
,
params
:
{
parentPath
:
data
?.
path
||
''
,
env
:
`
${
app
?.
env
?.
domainId
}
` } },
getLogs(pageNum, pageSize);
callback: data => {
showMessage('success', '导入动作完成,详情查看日志');
setConfirmLoading(false);
onSuccess && onSuccess(data||'');
setFileList([]);
getLogs(pageNum, pageSize);
showMessage('success', '导入动作完成,详情查看日志');
onSuccess && onSuccess(data||'');
},
error: () => {
setConfirmLoading(false);
}
});
},
},
error: () => {
error: () => {
setConfirmLoading(false);
setConfirmLoading(false);
}
}
});
});
}
}
const reset = () => {
const reset = () => {
...
...
src/view/Manage/AssetManage/Component/ImportDirectory.jsx
View file @
6ff825c7
...
@@ -4,6 +4,7 @@ import { UploadOutlined } from '@ant-design/icons';
...
@@ -4,6 +4,7 @@ import { UploadOutlined } from '@ant-design/icons';
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
showNotifaction
}
from
'../../../../util'
;
import
{
showNotifaction
}
from
'../../../../util'
;
import
{
getTemplateType
}
from
'../../../../util/axios'
;
const
ImportDirectory
=
(
props
)
=>
{
const
ImportDirectory
=
(
props
)
=>
{
const
{
visible
,
onCancel
,
dirId
}
=
props
;
const
{
visible
,
onCancel
,
dirId
}
=
props
;
...
@@ -41,7 +42,7 @@ const ImportDirectory = (props) => {
...
@@ -41,7 +42,7 @@ const ImportDirectory = (props) => {
}
}
const
download
=
()
=>
{
const
download
=
()
=>
{
window
.
open
(
'/api/dataassetmanager/directoryApi/getImportTemplate'
);
window
.
open
(
`/api/dataassetmanager/directoryApi/getImportTemplate?templateType=
${
getTemplateType
()}
`
);
}
}
const
upload
=
async
(
ignoreRepeatPath
=
false
)
=>
{
const
upload
=
async
(
ignoreRepeatPath
=
false
)
=>
{
...
...
src/view/Manage/AssetManage/Component/ImportElement.jsx
View file @
6ff825c7
...
@@ -4,6 +4,7 @@ import { DownloadOutlined, UploadOutlined } from '@ant-design/icons';
...
@@ -4,6 +4,7 @@ import { DownloadOutlined, UploadOutlined } from '@ant-design/icons';
import
{
dispatchLatest
}
from
'../../../../model'
;
import
{
dispatchLatest
}
from
'../../../../model'
;
import
{
showMessage
}
from
'../../../../util'
;
import
{
showMessage
}
from
'../../../../util'
;
import
{
getTemplateType
}
from
'../../../../util/axios'
;
const
ImportElement
=
(
props
)
=>
{
const
ImportElement
=
(
props
)
=>
{
const
{
onCancel
,
visible
}
=
props
;
const
{
onCancel
,
visible
}
=
props
;
...
@@ -11,7 +12,7 @@ const ImportElement = (props) => {
...
@@ -11,7 +12,7 @@ const ImportElement = (props) => {
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
downloadTemplate
=
()
=>
{
const
downloadTemplate
=
()
=>
{
window
.
open
(
'/api/dataassetmanager/elementApi/getImportTemplate'
);
window
.
open
(
`/api/dataassetmanager/elementApi/getImportTemplate?templateType=
${
getTemplateType
()}
`
);
}
}
const
uploadProps
=
{
const
uploadProps
=
{
...
...
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