Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bkunyun
Project
Project
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
sunyihao
bkunyun
Commits
7221f132
Commit
7221f132
authored
Jun 17, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-20220608-projectdata' into 'release'
cn- feat: 文件下载功能和一些样式优化 See merge request
!50
parents
a15174b5
ce0e6735
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
7 deletions
+57
-7
CloudEController.ts
src/api/fileserver/CloudEController.ts
+27
-4
index.tsx
src/views/Project/ProjectData/index.tsx
+11
-0
index.module.css
...ews/Project/components/ProjectListPopper/index.module.css
+15
-1
index.tsx
src/views/Project/components/ProjectListPopper/index.tsx
+4
-2
No files found.
src/api/fileserver/CloudEController.ts
View file @
7221f132
...
...
@@ -106,10 +106,12 @@ class CloudEController {
if
(
getLoaclStorageOfKey
(
"userinfo"
))
{
url
=
urlToken
(
filetoken
,
projectId
)
+
"&q="
+
url
;
}
return
axios
.
get
(
APIOPTION
()
+
"/search"
+
base
+
url
+
"&showhidden="
+
showHide
,
{
headers
:
headers
,
})
return
axios
.
get
(
APIOPTION
()
+
"/search"
+
base
+
url
+
"&showhidden="
+
showHide
,
{
headers
:
headers
,
}
);
}
}
...
...
@@ -170,5 +172,26 @@ class CloudEController {
});
}
}
// 文件下载
static
JobFileDownload
(
url
:
any
,
filetoken
:
string
,
projectId
:
string
)
{
if
(
ApiUtils
.
getAuthorizationHeaders
(
headers
))
{
url
=
url
+
urlToken
(
filetoken
,
projectId
);
headers
[
"Content-Type"
]
=
"multipart/form-data"
;
const
div
=
document
.
createElement
(
"div"
);
const
elink
:
any
=
document
.
createElement
(
"a"
);
elink
.
style
.
display
=
"none"
;
elink
.
href
=
APIOPTION
()
+
"/download"
+
url
;
document
.
body
.
appendChild
(
div
);
div
.
appendChild
(
elink
);
div
.
addEventListener
(
"click"
,
(
event
)
=>
{
event
.
stopPropagation
();
});
elink
.
click
();
URL
.
revokeObjectURL
(
elink
.
href
);
// 释放URL 对象
div
.
removeChild
(
elink
);
document
.
body
.
removeChild
(
div
);
}
}
}
export
default
CloudEController
;
src/views/Project/ProjectData/index.tsx
View file @
7221f132
...
...
@@ -373,6 +373,7 @@ const ProjectData = observer(() => {
variant=
"text"
size=
"small"
disabled=
{
selectIds
.
length
>
0
||
!
isPass
(
"PROJECT_DATA_DOWNLOAD"
)
}
onClick=
{
()
=>
hanleDownloadFile
(
item
)
}
>
下载
</
Button
>
...
...
@@ -427,6 +428,16 @@ const ProjectData = observer(() => {
addFolderRef
.
current
.
showDialog
();
};
// 下载文件
const
hanleDownloadFile
=
(
item
:
any
)
=>
{
const
downloadPath
=
path
+
item
.
name
;
CloudEController
.
JobFileDownload
(
downloadPath
,
fileToken
as
string
,
projectId
as
string
);
};
// 文件移动
let
moveFileRef
:
any
=
React
.
createRef
();
...
...
src/views/Project/components/ProjectListPopper/index.module.css
View file @
7221f132
...
...
@@ -69,14 +69,28 @@
font-size
:
14px
;
font-weight
:
600
;
margin-bottom
:
4px
;
width
:
166px
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
display
:
block
;
overflow
:
hidden
;
}
.projectOwnerTime
{
display
:
flex
;
justify-content
:
flex-start
;
}
.projectOwner
{
color
:
#565c66
;
line-height
:
20px
;
font-size
:
14px
;
margin-right
:
32px
;
max-width
:
60px
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
display
:
block
;
overflow
:
hidden
;
}
.
createdAt
{
.
projectTime
{
color
:
#8a9099
;
line-height
:
20px
;
font-size
:
14px
;
...
...
src/views/Project/components/ProjectListPopper/index.tsx
View file @
7221f132
...
...
@@ -25,7 +25,7 @@ const ProjectListPopper = observer((props: any) => {
const
handleProjectBox
=
(
e
:
React
.
SyntheticEvent
)
=>
{
e
.
nativeEvent
.
stopImmediatePropagation
();
}
}
;
return
(
<
div
className=
{
style
.
projectBox
}
onClick=
{
handleProjectBox
}
>
...
...
@@ -66,7 +66,9 @@ const ProjectListPopper = observer((props: any) => {
<
div
className=
{
style
.
projectliInfo
}
>
<
div
className=
{
style
.
projectName
}
>
{
item
.
name
}
</
div
>
<
div
className=
{
style
.
projectOwnerTime
}
>
<
span
className=
{
style
.
projectOwner
}
>
{
item
.
owner
}
</
span
>
<
span
className=
{
style
.
projectOwner
}
title=
{
item
.
owner
}
>
{
item
.
owner
}
</
span
>
<
span
className=
{
style
.
projectTime
}
>
{
moment
(
item
.
createdAt
).
format
(
"YYYY-MM-DD"
)
}
</
span
>
...
...
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