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
Administrator
bkunyun
Commits
6eb41dea
Commit
6eb41dea
authored
Jun 17, 2022
by
吴永生#A02208
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 查看文件一直跳转路由
parent
b6f92ed7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
28 deletions
+25
-28
Dialog.tsx
src/components/mui/Dialog.tsx
+15
-19
index.tsx
src/views/ConsoleLayout/components/FileItem/index.tsx
+10
-9
No files found.
src/components/mui/Dialog.tsx
View file @
6eb41dea
...
@@ -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 @
6eb41dea
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,9 +75,14 @@ const FileItem = observer((props: IProps) => {
...
@@ -74,9 +75,14 @@ const FileItem = observer((props: IProps) => {
});
});
}
}
if
(
text
===
"查看文件"
)
{
if
(
text
===
"查看文件"
)
{
navigate
(
`/product/cadd/projectData`
,
{
if
(
state
:
{
pathName
:
fileItemInfo
?.
path
},
location
?.
state
?.
pathName
!==
fileItemInfo
?.
path
||
});
location
?.
pathname
!==
"/product/cadd/projectData"
)
{
navigate
(
`/product/cadd/projectData`
,
{
state
:
{
pathName
:
fileItemInfo
?.
path
},
});
}
}
}
};
};
...
@@ -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