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 => {
return
resp
.
data
||
resp
;
}
function
getTemplateType
()
{
export
function
getTemplateType
()
{
return
LocalStorage
.
get
(
`templateType-
${
appId
}
`
)
}
...
...
src/view/Manage/AssetManage/Component/AssetDetailPage.jsx
View file @
6ff825c7
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
LocalStorage
from
'local-storage'
;
import
{
Spin
}
from
"antd"
;
import
AssetAction
from
"./AssetAction"
;
import
{
getQueryParam
}
from
'../../../../util'
;
import
{
dispatch
}
from
'../../../../model'
;
import
'./AssetDetailPage.less'
;
import
{
getDataAssetDetail
}
from
"../../../../service/dataassetmanager"
;
import
{
appId
}
from
"../../../../App"
;
const
AssetDetailPage
=
(
props
)
=>
{
const
[
data
,
setData
]
=
useState
({
id
:
''
,
dirId
:
''
});
const
[
loading
,
setLoading
]
=
useState
(
false
)
const
[
templateType
,
setTemplateType
]
=
useState
()
const
{
id
,
dirId
}
=
data
;
useEffect
(()
=>
{
...
...
@@ -16,20 +22,48 @@ const AssetDetailPage = (props)=>{
const
_id
=
getQueryParam
(
'id'
,
props
.
location
.
search
);
const
_dirId
=
getQueryParam
(
'dirId'
,
props
.
location
.
search
);
setData
({
id
:
_id
,
dirId
:
_dirId
});
getDataAssetDetail
()
//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
(
<
div
className=
'asset-detail position-relative'
>
<
div
className=
'detail-header'
>
<
span
style=
{
{
fontSize
:
16
,
fontWeight
:
'bold'
,
color
:
'#000'
}
}
>
资产目录详情
</
span
>
</
div
>
<
div
className=
'detail-container'
>
<
div
className=
'detail-container-card'
>
<
AssetAction
id=
{
id
}
dirId=
{
dirId
}
action=
'detail'
/>
<
Spin
spinning=
{
loading
}
>
<
div
className=
'detail-container'
>
<
div
className=
'detail-container-card'
>
{
templateType
&&
<
AssetAction
id=
{
id
}
dirId=
{
dirId
}
action=
'detail'
/>
}
</
div
>
</
div
>
</
div
>
</
Spin
>
</
div
>
)
}
...
...
src/view/Manage/AssetManage/Component/AssetDirectory.jsx
View file @
6ff825c7
...
...
@@ -12,6 +12,7 @@ import Separate from './Separate';
import
record
from
'../Assets/record.png'
;
import
'./AssetDirectory.less'
;
import
{
getTemplateType
}
from
'../../../../util/axios'
;
const
{
Paragraph
,
Text
}
=
Typography
;
...
...
@@ -97,7 +98,7 @@ const AssetDirectory = (props) => {
}
const
onExportElementBtnClick
=
()
=>
{
window
.
open
(
'/api/dataassetmanager/elementApi/export'
);
window
.
open
(
`/api/dataassetmanager/elementApi/export?templateType=
${
getTemplateType
()}
`
);
}
const
onFilterElementClick
=
()
=>
{
...
...
src/view/Manage/AssetManage/Component/AssetManageTree.jsx
View file @
6ff825c7
...
...
@@ -16,6 +16,7 @@ import { highlightSearchContentByTerms } from '../../../../util';
import
'./AssetManageTree.less'
;
import
'react-contexify/dist/ReactContexify.css'
;
import
{
appId
}
from
'../../../../App'
;
import
{
getTemplateType
}
from
'../../../../util/axios'
;
const
{
Option
}
=
AutoComplete
;
...
...
@@ -466,7 +467,7 @@ const AssetManageTree = (props) => {
}
const
exportAllDir
=
()
=>
{
window
.
open
(
'/api/dataassetmanager/directoryApi/export'
);
window
.
open
(
`/api/dataassetmanager/directoryApi/export?templateType=
${
getTemplateType
()}
`
);
}
const
exportCurrentDir
=
()
=>
{
...
...
@@ -477,7 +478,7 @@ const AssetManageTree = (props) => {
dirId
:
currentDirId
},
callback
:
data
=>
{
window
.
open
(
`/api/dataassetmanager/directoryApi/export?parentPath=
${
data
.
path
}
`
);
window
.
open
(
`/api/dataassetmanager/directoryApi/export?parentPath=
${
data
.
path
}
&templateType=
${
getTemplateType
()}
`
);
}
})
}
else
{
...
...
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
6ff825c7
...
...
@@ -21,6 +21,7 @@ import StartFlowModal from "./StartFlow";
import
"./AssetTable.less"
;
import
'react-contexify/dist/ReactContexify.css'
;
import
{
getTemplateType
}
from
"../../../../util/axios"
;
const
{
Text
}
=
Typography
;
const
{
Search
}
=
Input
;
...
...
@@ -665,11 +666,11 @@ const AssetTable = (props) => {
title
:
'提示'
,
content
:
'是否导出所有资产目录?'
,
onOk
:
()
=>
{
window
.
open
(
'/api/dataassetmanager/dataAssetApi/exportByDataAssetIds?exportAll=true'
);
window
.
open
(
`/api/dataassetmanager/dataAssetApi/exportByDataAssetIds?exportAll=true&templateType=
${
getTemplateType
()}
`
);
}
})
}
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';
import
{
dispatch
}
from
'../../../../model'
;
import
{
showMessage
,
formatDate
}
from
'../../../../util'
;
import
{
AppContext
}
from
'../../../../App'
;
import
{
getTemplateType
}
from
'../../../../util/axios'
;
const
ImportAssetDrawer
=
(
props
)
=>
{
const
{
onCancel
,
onSuccess
,
visible
,
nodeId
}
=
props
;
...
...
@@ -89,7 +90,7 @@ const ImportAssetDrawer = (props) => {
},
[
visible
])
const
downloadTemplate
=
()
=>
{
window
.
open
(
"/api/dataassetmanager/dataAssetApi/getImportTemplate"
);
window
.
open
(
`/api/dataassetmanager/dataAssetApi/getImportTemplate?templateType=
${
getTemplateType
()}
`
);
}
const
getLogs
=
(
p
=
1
,
s
=
20
)
=>
{
...
...
@@ -154,30 +155,19 @@ const ImportAssetDrawer = (props) => {
setConfirmLoading
(
true
);
dispatch
({
type
:
'assetmanage.getDirectoryById'
,
payload
:
{
dirId
:
nodeId
},
type
:
'assetmanage.assetImport'
,
payload
:
{
fileList
:
fileList
,
params
:
{
env
:
`
${
app
?.
env
?.
domainId
}
` } },
callback: data => {
dispatch
({
type
:
'assetmanage.assetImport'
,
payload
:
{
fileList
:
fileList
,
params
:
{
parentPath
:
data
?.
path
||
''
,
env
:
`
${
app
?.
env
?.
domainId
}
` } },
callback: data => {
setConfirmLoading(false);
setFileList([]);
getLogs(pageNum, pageSize);
showMessage('success', '导入动作完成,详情查看日志');
onSuccess && onSuccess(data||'');
},
error: () => {
setConfirmLoading(false);
}
});
setConfirmLoading(false);
setFileList([]);
getLogs(pageNum, pageSize);
showMessage('success', '导入动作完成,详情查看日志');
onSuccess && onSuccess(data||'');
},
error: () => {
setConfirmLoading(false);
}
});
});
}
const reset = () => {
...
...
src/view/Manage/AssetManage/Component/ImportDirectory.jsx
View file @
6ff825c7
...
...
@@ -4,6 +4,7 @@ import { UploadOutlined } from '@ant-design/icons';
import
{
dispatch
}
from
'../../../../model'
;
import
{
showNotifaction
}
from
'../../../../util'
;
import
{
getTemplateType
}
from
'../../../../util/axios'
;
const
ImportDirectory
=
(
props
)
=>
{
const
{
visible
,
onCancel
,
dirId
}
=
props
;
...
...
@@ -41,7 +42,7 @@ const ImportDirectory = (props) => {
}
const
download
=
()
=>
{
window
.
open
(
'/api/dataassetmanager/directoryApi/getImportTemplate'
);
window
.
open
(
`/api/dataassetmanager/directoryApi/getImportTemplate?templateType=
${
getTemplateType
()}
`
);
}
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';
import
{
dispatchLatest
}
from
'../../../../model'
;
import
{
showMessage
}
from
'../../../../util'
;
import
{
getTemplateType
}
from
'../../../../util/axios'
;
const
ImportElement
=
(
props
)
=>
{
const
{
onCancel
,
visible
}
=
props
;
...
...
@@ -11,7 +12,7 @@ const ImportElement = (props) => {
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
downloadTemplate
=
()
=>
{
window
.
open
(
'/api/dataassetmanager/elementApi/getImportTemplate'
);
window
.
open
(
`/api/dataassetmanager/elementApi/getImportTemplate?templateType=
${
getTemplateType
()}
`
);
}
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