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
af0cb5c3
Commit
af0cb5c3
authored
Jun 17, 2022
by
wuyongsheng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-20220608-projectdata' into 'release'
fix: 查看文件一直跳转路由 See merge request
!59
parents
9705ad07
6eb41dea
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
25 deletions
+22
-25
Dialog.tsx
src/components/mui/Dialog.tsx
+15
-19
index.tsx
src/views/ConsoleLayout/components/FileItem/index.tsx
+7
-6
No files found.
src/components/mui/Dialog.tsx
View file @
af0cb5c3
...
@@ -38,24 +38,8 @@ export interface IDialogProps {
...
@@ -38,24 +38,8 @@ export interface IDialogProps {
/** 是否禁用确认按钮 */
/** 是否禁用确认按钮 */
disabledConfirm
?:
boolean
;
disabledConfirm
?:
boolean
;
children
:
React
.
ReactNode
;
children
:
React
.
ReactNode
;
}
/** 点击遮罩是否关闭 默认为false*/
clickMaskClose
?:
boolean
;
export
interface
IFooter
{
isHideFooter
?:
boolean
;
footerRender
?:
()
=>
React
.
ReactNode
;
showCancel
?:
boolean
;
/** 是否显示确定按钮 */
showConfirm
?:
boolean
;
/** 关闭弹窗时的回调函数 */
onClose
?:
()
=>
void
;
/** 点击确定按钮时的回调函数 */
onConfirm
?:
()
=>
void
;
/** 取消按钮文案 */
cancelText
?:
string
;
/** 确认按钮文案 */
okText
?:
string
;
/** 是否禁用确认按钮 */
disabledConfirm
?:
boolean
;
}
}
const
MyDialog
:
React
.
FunctionComponent
<
IDialogProps
>
=
(
props
)
=>
{
const
MyDialog
:
React
.
FunctionComponent
<
IDialogProps
>
=
(
props
)
=>
{
...
@@ -76,7 +60,19 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
...
@@ -76,7 +60,19 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
cancelText
,
cancelText
,
okText
,
okText
,
disabledConfirm
,
disabledConfirm
,
clickMaskClose
=
false
,
}
=
props
;
}
=
props
;
const
handelClose
=
(
event
:
{},
reason
:
"backdropClick"
|
"escapeKeyDown"
)
=>
{
if
(
reason
===
"backdropClick"
&&
!
clickMaskClose
)
{
return
;
}
onClose
&&
onClose
();
};
const
Footer
=
()
=>
{
const
Footer
=
()
=>
{
if
(
isHideFooter
)
return
null
;
if
(
isHideFooter
)
return
null
;
return
footerRender
?
(
return
footerRender
?
(
...
@@ -104,7 +100,7 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
...
@@ -104,7 +100,7 @@ const MyDialog: React.FunctionComponent<IDialogProps> = (props) => {
return
(
return
(
<
Dialog
<
Dialog
open=
{
open
}
open=
{
open
}
onClose=
{
on
Close
}
onClose=
{
handel
Close
}
style=
{
style
}
style=
{
style
}
className=
{
className
}
className=
{
className
}
aria
-
labelledby=
"alert-dialog-title"
aria
-
labelledby=
"alert-dialog-title"
...
...
src/views/ConsoleLayout/components/FileItem/index.tsx
View file @
af0cb5c3
import
{
toJS
}
from
"mobx"
;
import
{
toJS
}
from
"mobx"
;
import
{
useNavigate
}
from
"react-router-dom"
;
import
{
useNavigate
,
useLocation
}
from
"react-router-dom"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
{
useMemo
}
from
"react"
;
import
{
useMemo
}
from
"react"
;
...
@@ -32,6 +32,7 @@ const FileItem = observer((props: IProps) => {
...
@@ -32,6 +32,7 @@ const FileItem = observer((props: IProps) => {
const
currentProjectStore
=
toJS
(
useGlobalStore
(
"currentProjectStore"
));
const
currentProjectStore
=
toJS
(
useGlobalStore
(
"currentProjectStore"
));
const
Message
=
useMessage
();
const
Message
=
useMessage
();
const
navigate
=
useNavigate
();
const
navigate
=
useNavigate
();
const
location
:
any
=
useLocation
();
/** 时间 */
/** 时间 */
const
TimeText
=
useMemo
(()
=>
{
const
TimeText
=
useMemo
(()
=>
{
...
@@ -74,10 +75,15 @@ const FileItem = observer((props: IProps) => {
...
@@ -74,10 +75,15 @@ const FileItem = observer((props: IProps) => {
});
});
}
}
if
(
text
===
"查看文件"
)
{
if
(
text
===
"查看文件"
)
{
if
(
location
?.
state
?.
pathName
!==
fileItemInfo
?.
path
||
location
?.
pathname
!==
"/product/cadd/projectData"
)
{
navigate
(
`/product/cadd/projectData`
,
{
navigate
(
`/product/cadd/projectData`
,
{
state
:
{
pathName
:
fileItemInfo
?.
path
},
state
:
{
pathName
:
fileItemInfo
?.
path
},
});
});
}
}
}
};
};
const
speed
=
useMemo
(()
=>
{
const
speed
=
useMemo
(()
=>
{
...
@@ -88,11 +94,6 @@ const FileItem = observer((props: IProps) => {
...
@@ -88,11 +94,6 @@ const FileItem = observer((props: IProps) => {
}
}
return
val
;
return
val
;
},
[
itemInfo
?.
bytesUploaded
,
itemInfo
?.
endTime
,
itemInfo
.
startTime
]);
},
[
itemInfo
?.
bytesUploaded
,
itemInfo
?.
endTime
,
itemInfo
.
startTime
]);
console
.
log
(
Math
.
floor
((
itemInfo
?.
endTime
-
itemInfo
.
startTime
)
/
1000
),
"111111"
);
return
(
return
(
<
div
className=
{
styles
.
itemBox
}
>
<
div
className=
{
styles
.
itemBox
}
>
<
div
className=
{
styles
.
leftBox
}
>
<
div
className=
{
styles
.
leftBox
}
>
...
...
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