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
caaf76c8
Commit
caaf76c8
authored
Nov 02, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
46a77f72
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
19 deletions
+29
-19
App.js
src/App.js
+3
-1
axios.js
src/util/axios.js
+15
-9
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+2
-2
AssetDirectory.jsx
src/view/Manage/AssetManage/Component/AssetDirectory.jsx
+2
-2
AssetManageTree.jsx
src/view/Manage/AssetManage/Component/AssetManageTree.jsx
+3
-2
AssetTree.jsx
src/view/Manage/AssetManage/Component/AssetTree.jsx
+4
-3
No files found.
src/App.js
View file @
caaf76c8
...
@@ -4,12 +4,14 @@ import {
...
@@ -4,12 +4,14 @@ import {
Route
,
Switch
Route
,
Switch
}
from
'react-router-dom'
;
}
from
'react-router-dom'
;
import
{
$hostParams
,
ContextPath
}
from
'./util'
;
import
{
$hostParams
,
ContextPath
,
generateUUID
}
from
'./util'
;
import
loadable
from
"./util/loadable"
;
import
loadable
from
"./util/loadable"
;
import
localStorage
from
'local-storage'
;
import
{
AssetBrowseReference
,
AssetMountReference
}
from
'./util/constant'
;
import
{
AssetBrowseReference
,
AssetMountReference
}
from
'./util/constant'
;
export
const
AppContext
=
React
.
createContext
();
export
const
AppContext
=
React
.
createContext
();
export
const
appId
=
generateUUID
();
const
Signin
=
loadable
(()
=>
import
(
'./view/Signin'
));
const
Signin
=
loadable
(()
=>
import
(
'./view/Signin'
));
const
Home
=
loadable
(()
=>
import
(
'./view/Home'
));
const
Home
=
loadable
(()
=>
import
(
'./view/Home'
));
...
...
src/util/axios.js
View file @
caaf76c8
...
@@ -3,7 +3,8 @@ import axios from 'axios';
...
@@ -3,7 +3,8 @@ import axios from 'axios';
import
qs
from
'qs'
;
import
qs
from
'qs'
;
import
LocalStorage
from
'local-storage'
;
import
LocalStorage
from
'local-storage'
;
import
{
IsArr
,
showMessage
,
isSzseEnv
}
from
'./index'
;
import
{
IsArr
,
showMessage
,
isSzseEnv
,
generateUUID
}
from
'./index'
;
import
{
appId
}
from
'../App'
;
const
CancelToken
=
axios
.
CancelToken
;
const
CancelToken
=
axios
.
CancelToken
;
const
baseURL
=
'/api/'
;
const
baseURL
=
'/api/'
;
...
@@ -114,9 +115,13 @@ const callback = resp => {
...
@@ -114,9 +115,13 @@ const callback = resp => {
return
resp
.
data
||
resp
;
return
resp
.
data
||
resp
;
}
}
function
getTemplateType
()
{
return
LocalStorage
.
get
(
`templateType-
${
appId
}
`
)
}
export
function
Get
(
url
,
params
)
{
export
function
Get
(
url
,
params
)
{
const
cancelToken
=
__source
?
__source
.
token
:
null
;
const
cancelToken
=
__source
?
__source
.
token
:
null
;
const
templateType
=
LocalStorage
.
get
(
'templateType'
);
const
templateType
=
getTemplateType
(
);
return
textplain
.
get
(
url
,
{
return
textplain
.
get
(
url
,
{
params
:
{...
params
,
templateType
},
cancelToken
params
:
{...
params
,
templateType
},
cancelToken
...
@@ -127,7 +132,7 @@ export function Get(url, params) {
...
@@ -127,7 +132,7 @@ export function Get(url, params) {
export
function
GetJSON
(
url
,
params
)
{
export
function
GetJSON
(
url
,
params
)
{
const
cancelToken
=
__source
?
__source
.
token
:
null
;
const
cancelToken
=
__source
?
__source
.
token
:
null
;
const
templateType
=
LocalStorage
.
get
(
'templateType'
);
const
templateType
=
getTemplateType
(
);
return
instance
.
get
(
url
,
{
return
instance
.
get
(
url
,
{
params
:
{...
params
,
templateType
},
cancelToken
,
params
:
{...
params
,
templateType
},
cancelToken
,
...
@@ -139,7 +144,7 @@ export function GetJSON(url, params) {
...
@@ -139,7 +144,7 @@ export function GetJSON(url, params) {
export
const
GetJSONRaw
=
(
url
,
params
)
=>
{
export
const
GetJSONRaw
=
(
url
,
params
)
=>
{
const
cancelToken
=
__source
?
__source
.
token
:
null
;
const
cancelToken
=
__source
?
__source
.
token
:
null
;
const
templateType
=
LocalStorage
.
get
(
'templateType'
);
const
templateType
=
getTemplateType
(
);
return
instanceRow
.
get
(
url
,
{
return
instanceRow
.
get
(
url
,
{
params
:
{...
params
,
templateType
},
cancelToken
,
params
:
{...
params
,
templateType
},
cancelToken
,
...
@@ -151,7 +156,7 @@ export const GetJSONRaw = (url, params) => {
...
@@ -151,7 +156,7 @@ export const GetJSONRaw = (url, params) => {
export
function
Delete
(
url
,
params
)
{
export
function
Delete
(
url
,
params
)
{
const
cancelToken
=
__source
?
__source
.
token
:
null
;
const
cancelToken
=
__source
?
__source
.
token
:
null
;
const
templateType
=
LocalStorage
.
get
(
'templateType'
);
const
templateType
=
getTemplateType
(
);
return
instance
.
delete
(
url
,
{
return
instance
.
delete
(
url
,
{
params
:
{...
params
,
templateType
},
cancelToken
,
params
:
{...
params
,
templateType
},
cancelToken
,
...
@@ -163,7 +168,7 @@ export function Delete(url, params) {
...
@@ -163,7 +168,7 @@ export function Delete(url, params) {
export
function
PostJSON
(
url
,
payload
)
{
export
function
PostJSON
(
url
,
payload
)
{
const
{
params
=
null
,
data
=
null
}
=
payload
||
{};
const
{
params
=
null
,
data
=
null
}
=
payload
||
{};
const
cancelToken
=
__source
?
__source
.
token
:
null
;
const
cancelToken
=
__source
?
__source
.
token
:
null
;
const
templateType
=
LocalStorage
.
get
(
'templateType'
);
const
templateType
=
getTemplateType
(
);
return
IsArr
(
data
)
?
instance
.
post
(
url
,
data
,
{
return
IsArr
(
data
)
?
instance
.
post
(
url
,
data
,
{
params
:
{...
params
,
templateType
},
cancelToken
params
:
{...
params
,
templateType
},
cancelToken
...
@@ -179,7 +184,7 @@ export function PostJSON(url, payload) {
...
@@ -179,7 +184,7 @@ export function PostJSON(url, payload) {
export
function
Post
(
url
,
payload
)
{
export
function
Post
(
url
,
payload
)
{
const
{
params
=
null
,
data
=
null
}
=
payload
||
{};
const
{
params
=
null
,
data
=
null
}
=
payload
||
{};
const
cancelToken
=
__source
?
__source
.
token
:
null
;
const
cancelToken
=
__source
?
__source
.
token
:
null
;
const
templateType
=
LocalStorage
.
get
(
'templateType'
);
const
templateType
=
getTemplateType
(
);
return
textplain
.
post
(
url
,
null
,
{
return
textplain
.
post
(
url
,
null
,
{
params
:
{...
params
,
templateType
},
data
,
cancelToken
params
:
{...
params
,
templateType
},
data
,
cancelToken
...
@@ -190,7 +195,7 @@ export function Post(url, payload) {
...
@@ -190,7 +195,7 @@ export function Post(url, payload) {
export
function
PostFile
(
url
,
payload
)
{
export
function
PostFile
(
url
,
payload
)
{
const
{
fileList
=
null
,
params
=
null
}
=
payload
||
{};
const
{
fileList
=
null
,
params
=
null
}
=
payload
||
{};
const
templateType
=
LocalStorage
.
get
(
'templateType'
);
const
templateType
=
getTemplateType
(
);
let
formData
=
new
FormData
();
let
formData
=
new
FormData
();
(
fileList
||
[]).
forEach
(
file
=>
{
(
fileList
||
[]).
forEach
(
file
=>
{
...
@@ -212,7 +217,8 @@ let config = {
...
@@ -212,7 +217,8 @@ let config = {
export
const
callFetchRaw
=
(
method
,
url
,
options
)
=>
{
export
const
callFetchRaw
=
(
method
,
url
,
options
)
=>
{
const
{
params
,
...
reqConfig
}
=
options
;
const
{
params
,
...
reqConfig
}
=
options
;
const
templateType
=
LocalStorage
.
get
(
'templateType'
);
const
templateType
=
getTemplateType
();
var
bodyFormData
=
new
FormData
();
var
bodyFormData
=
new
FormData
();
Object
.
keys
(
params
||
[]).
forEach
(
key
=>
{
Object
.
keys
(
params
||
[]).
forEach
(
key
=>
{
...
...
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
caaf76c8
...
@@ -6,7 +6,7 @@ import LocalStorage from 'local-storage';
...
@@ -6,7 +6,7 @@ import LocalStorage from 'local-storage';
import
MetadataInfo
from
'./MetadataInfo'
;
import
MetadataInfo
from
'./MetadataInfo'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
highlightSearchContentByTerms
,
showMessage
,
paginate
}
from
'../../../../util'
;
import
{
highlightSearchContentByTerms
,
showMessage
,
paginate
}
from
'../../../../util'
;
import
{
AppContext
}
from
'../../../../App'
;
import
{
AppContext
,
appId
}
from
'../../../../App'
;
import
Tag
from
'../../Tag'
;
import
Tag
from
'../../Tag'
;
import
Separate
from
'./Separate'
;
import
Separate
from
'./Separate'
;
import
AssetTagModal
from
'./AssetTagModal'
;
import
AssetTagModal
from
'./AssetTagModal'
;
...
@@ -584,7 +584,7 @@ const AssetAction = (props) => {
...
@@ -584,7 +584,7 @@ const AssetAction = (props) => {
if
(
item
.
resourceType
===
'innerSource'
||
item
.
resourceType
===
'outerSource'
)
{
if
(
item
.
resourceType
===
'innerSource'
||
item
.
resourceType
===
'outerSource'
)
{
window
.
open
(
`/center-home/menu/asset-resource-browse?
${
AnchorId
}
=
${
item
?.
dataAssetId
}
&
$
{
AnchorDirId
}
=
$
{
item
?.
dirId
}
&
timestamp
=
$
{
timestamp
}
`);
window
.
open
(
`/center-home/menu/asset-resource-browse?
${
AnchorId
}
=
${
item
?.
dataAssetId
}
&
$
{
AnchorDirId
}
=
$
{
item
?.
dirId
}
&
timestamp
=
$
{
timestamp
}
`);
} else if (item.resourceType==='dataAsset') {
} else if (item.resourceType==='dataAsset') {
window.open(`
/
center
-
home
/
menu
/
asset
-
browse
?
$
{
AnchorId
}
=
$
{
item
?.
dataAssetId
}
&
$
{
AnchorDirId
}
=
$
{
item
?.
dirId
}
&
templateType
=
$
{
LocalStorage
.
get
(
'templateType'
)}
&
timestamp
=
$
{
timestamp
}
`);
window.open(`
/
center
-
home
/
menu
/
asset
-
browse
?
$
{
AnchorId
}
=
$
{
item
?.
dataAssetId
}
&
$
{
AnchorDirId
}
=
$
{
item
?.
dirId
}
&
templateType
=
$
{
LocalStorage
.
get
(
`templateType-
${
appId
}
`
)}
&
timestamp
=
$
{
timestamp
}
`);
} else {
} else {
showMessage('warn', '资产目录类型不是资源也不是资产!');
showMessage('warn', '资产目录类型不是资源也不是资产!');
}
}
...
...
src/view/Manage/AssetManage/Component/AssetDirectory.jsx
View file @
caaf76c8
...
@@ -262,7 +262,7 @@ const AssetDirectory = (props) => {
...
@@ -262,7 +262,7 @@ const AssetDirectory = (props) => {
</
div
>
</
div
>
</
div
>
</
div
>
{
{
/* {
(reference===AssetManageReference) && <Dropdown overlay={elementManageMenu} placement="bottomCenter">
(reference===AssetManageReference) && <Dropdown overlay={elementManageMenu} placement="bottomCenter">
<div
<div
className='flex more-container'
className='flex more-container'
...
@@ -277,7 +277,7 @@ const AssetDirectory = (props) => {
...
@@ -277,7 +277,7 @@ const AssetDirectory = (props) => {
<span style={{ fontSize: 10 }}>更多</span>
<span style={{ fontSize: 10 }}>更多</span>
</div>
</div>
</Dropdown>
</Dropdown>
}
}
*/
}
</
div
>
</
div
>
...
...
src/view/Manage/AssetManage/Component/AssetManageTree.jsx
View file @
caaf76c8
...
@@ -15,6 +15,7 @@ import { highlightSearchContentByTerms } from '../../../../util';
...
@@ -15,6 +15,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'
;
const
{
Option
}
=
AutoComplete
;
const
{
Option
}
=
AutoComplete
;
...
@@ -131,7 +132,7 @@ const AssetManageTree = (props) => {
...
@@ -131,7 +132,7 @@ const AssetManageTree = (props) => {
setTemplates
(
data
)
setTemplates
(
data
)
if
((
data
??[]).
length
>
0
)
{
if
((
data
??[]).
length
>
0
)
{
setTemplateType
(
data
[
0
].
type
)
setTemplateType
(
data
[
0
].
type
)
LocalStorage
.
set
(
'templateType'
,
data
[
0
].
type
)
LocalStorage
.
set
(
`templateType-
${
appId
}
`
,
data
[
0
].
type
)
onSelect
?.(
''
,
''
)
onSelect
?.(
''
,
''
)
getAllDirectoryAsTree
(
false
)
getAllDirectoryAsTree
(
false
)
}
}
...
@@ -753,7 +754,7 @@ const AssetManageTree = (props) => {
...
@@ -753,7 +754,7 @@ const AssetManageTree = (props) => {
value=
{
currentTemplateType
}
value=
{
currentTemplateType
}
onChange=
{
(
val
)
=>
{
onChange=
{
(
val
)
=>
{
setTemplateType
(
val
)
setTemplateType
(
val
)
LocalStorage
.
set
(
'templateType'
,
val
);
LocalStorage
.
set
(
`templateType-${appId}`
,
val
);
setCurrentDirId
();
setCurrentDirId
();
onSelect
?.(
''
,
''
);
onSelect
?.(
''
,
''
);
getAllDirectoryAsTree
(
false
)
getAllDirectoryAsTree
(
false
)
...
...
src/view/Manage/AssetManage/Component/AssetTree.jsx
View file @
caaf76c8
...
@@ -12,6 +12,7 @@ import { highlightSearchContentByTerms } from '../../../../util';
...
@@ -12,6 +12,7 @@ import { highlightSearchContentByTerms } from '../../../../util';
import
'./AssetTree.less'
;
import
'./AssetTree.less'
;
import
'react-contexify/dist/ReactContexify.css'
;
import
'react-contexify/dist/ReactContexify.css'
;
import
{
appId
}
from
'../../../../App'
;
const
{
Option
}
=
AutoComplete
;
const
{
Option
}
=
AutoComplete
;
...
@@ -125,9 +126,9 @@ const AssetTree = (props) => {
...
@@ -125,9 +126,9 @@ const AssetTree = (props) => {
const
_dirId
=
getQueryParam
(
AnchorDirId
,
props
?.
location
?.
search
)
const
_dirId
=
getQueryParam
(
AnchorDirId
,
props
?.
location
?.
search
)
if
(
_templateType
)
{
if
(
_templateType
)
{
LocalStorage
.
set
(
'templateType'
,
_templateType
)
LocalStorage
.
set
(
`templateType-
${
appId
}
`
,
_templateType
)
}
else
{
}
else
{
LocalStorage
.
set
(
'templateType'
,
data
[
0
].
type
)
LocalStorage
.
set
(
`templateType-
${
appId
}
`
,
data
[
0
].
type
)
}
}
if
(
_dirId
)
{
if
(
_dirId
)
{
...
@@ -577,7 +578,7 @@ const AssetTree = (props) => {
...
@@ -577,7 +578,7 @@ const AssetTree = (props) => {
value=
{
currentTemplateType
}
value=
{
currentTemplateType
}
onChange=
{
(
val
)
=>
{
onChange=
{
(
val
)
=>
{
setTemplateType
(
val
)
setTemplateType
(
val
)
LocalStorage
.
set
(
'templateType'
,
val
);
LocalStorage
.
set
(
`templateType-${appId}`
,
val
);
setCurrentDirId
();
setCurrentDirId
();
onSelect
?.(
''
,
''
);
onSelect
?.(
''
,
''
);
getAllDirectoryAsTree
(
false
)
getAllDirectoryAsTree
(
false
)
...
...
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