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
b19f5f62
Commit
b19f5f62
authored
Jul 13, 2022
by
吴永生#A02208
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 项目成员标准版不可看
parent
f7c30356
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
134 additions
and
137 deletions
+134
-137
index.tsx
src/views/ConsoleLayout/components/FileItem/index.tsx
+128
-126
index.tsx
src/views/Project/ProjectSetting/index.tsx
+4
-1
index.tsx
src/views/Project/ProjectSubmitWork/index.tsx
+2
-10
No files found.
src/views/ConsoleLayout/components/FileItem/index.tsx
View file @
b19f5f62
...
...
@@ -22,138 +22,140 @@ import styles from "./index.module.css";
*/
interface
IProps
{
fileItemInfo
:
IUploadInfo
;
fileItemInfo
:
IUploadInfo
;
}
const
FileItem
=
observer
((
props
:
IProps
)
=>
{
const
{
fileItemInfo
}
=
props
;
const
itemInfo
=
toJS
(
fileItemInfo
)?.
info
;
const
{
statusMsg
=
""
}
=
itemInfo
||
{};
const
uploadInfoStore
=
toJS
(
useGlobalStore
(
"fileListStore"
));
const
currentProjectStore
=
toJS
(
useGlobalStore
(
"currentProjectStore"
));
const
Message
=
useMessage
();
const
navigate
=
useNavigate
();
const
location
:
any
=
useLocation
();
const
{
fileItemInfo
}
=
props
;
const
itemInfo
=
toJS
(
fileItemInfo
)?.
info
;
const
{
statusMsg
=
""
}
=
itemInfo
||
{};
const
uploadInfoStore
=
toJS
(
useGlobalStore
(
"fileListStore"
));
const
currentProjectStore
=
toJS
(
useGlobalStore
(
"currentProjectStore"
));
const
Message
=
useMessage
();
const
navigate
=
useNavigate
();
const
location
:
any
=
useLocation
();
/** 时间 */
const
TimeText
=
useMemo
(()
=>
{
const
val
=
itemInfo
?.
endTime
-
itemInfo
?.
startTime
;
return
formatTime
(
val
)
||
""
;
},
[
itemInfo
?.
endTime
,
itemInfo
?.
startTime
]);
/** 时间 */
const
TimeText
=
useMemo
(()
=>
{
const
val
=
itemInfo
?.
endTime
-
itemInfo
?.
startTime
;
return
formatTime
(
val
)
||
""
;
},
[
itemInfo
?.
endTime
,
itemInfo
?.
startTime
]);
const
text
=
useMemo
(()
=>
{
let
result
=
""
;
if
(
statusMsg
===
"上传失败"
)
{
result
=
"重新上传"
;
}
if
(
statusMsg
===
"正在上传"
)
{
if
(
itemInfo
?.
isSuspend
)
{
result
=
"重新上传"
;
}
else
{
result
=
"暂停"
;
}
}
if
(
statusMsg
===
"上传成功"
)
{
result
=
"查看文件"
;
}
return
result
;
},
[
itemInfo
?.
isSuspend
,
statusMsg
]);
const
text
=
useMemo
(()
=>
{
let
result
=
""
;
if
(
statusMsg
===
"上传失败"
)
{
result
=
"重新上传"
;
}
if
(
statusMsg
===
"正在上传"
)
{
if
(
itemInfo
?.
isSuspend
)
{
result
=
"重新上传"
;
}
else
{
result
=
"暂停"
;
}
}
if
(
statusMsg
===
"上传成功"
)
{
result
=
"查看文件"
;
}
return
result
;
},
[
itemInfo
?.
isSuspend
,
statusMsg
]);
/** 操作合集 */
const
onOperation
=
()
=>
{
if
(
text
===
"暂停"
)
{
itemInfo
?.
upload
?.
abort
(
true
).
then
(()
=>
{
Message
.
info
(
"暂停成功!"
);
uploadInfoStore
.
setUploadInfoList
(
fileItemInfo
?.
id
,
{
isSuspend
:
true
,
});
});
}
if
(
text
===
"重新上传"
)
{
itemInfo
?.
upload
?.
start
();
uploadInfoStore
.
setUploadInfoList
(
fileItemInfo
?.
id
,
{
isSuspend
:
false
,
});
}
if
(
text
===
"查看文件"
)
{
if
(
location
?.
state
?.
pathName
!==
fileItemInfo
?.
path
||
location
?.
pathname
!==
"/product/cadd/projectData"
)
{
navigate
(
`/product/cadd/projectData`
,
{
state
:
{
pathName
:
fileItemInfo
?.
path
},
});
}
}
};
/** 操作合集 */
const
onOperation
=
()
=>
{
if
(
text
===
"暂停"
)
{
itemInfo
?.
upload
?.
abort
(
true
).
then
(()
=>
{
Message
.
info
(
"暂停成功!"
);
uploadInfoStore
.
setUploadInfoList
(
fileItemInfo
?.
id
,
{
isSuspend
:
true
,
});
});
}
if
(
text
===
"重新上传"
)
{
itemInfo
?.
upload
?.
start
();
uploadInfoStore
.
setUploadInfoList
(
fileItemInfo
?.
id
,
{
isSuspend
:
false
,
});
}
if
(
text
===
"查看文件"
)
{
if
(
location
?.
state
?.
pathName
!==
fileItemInfo
?.
path
||
location
?.
pathname
!==
"/product/cadd/projectData"
)
{
navigate
(
`/product/cadd/projectData`
,
{
state
:
{
pathName
:
fileItemInfo
?.
path
},
});
}
}
};
const
speed
=
useMemo
(()
=>
{
let
val
=
0
;
const
time
=
Math
.
floor
((
itemInfo
?.
endTime
-
itemInfo
.
startTime
)
/
1000
);
if
(
time
>
0
)
{
val
=
Math
.
floor
(
itemInfo
?.
bytesUploaded
/
time
);
}
return
val
;
},
[
itemInfo
?.
bytesUploaded
,
itemInfo
?.
endTime
,
itemInfo
.
startTime
]);
return
(
<
div
className=
{
styles
.
itemBox
}
>
<
div
className=
{
styles
.
leftBox
}
>
<
img
src=
{
bkunyunFile
}
alt=
""
style=
{
{
marginRight
:
16
}
}
/>
<
div
>
<
div
>
<
b
className=
{
styles
.
fileNameBox
}
title=
{
itemInfo
?.
name
||
""
}
>
{
itemInfo
?.
name
||
""
}
</
b
>
{
statusMsg
===
"上传失败"
?
(
<
span
className=
{
styles
.
span
}
style=
{
{
marginLeft
:
16
,
color
:
"#FF4E4E"
}
}
>
{
`(${statusMsg})`
}
</
span
>
)
:
(
<
span
className=
{
styles
.
span
}
style=
{
{
marginLeft
:
16
}
}
>
{
TimeText
}
</
span
>
)
}
</
div
>
{
statusMsg
!==
"上传成功"
?
(
<
LinearProgress
sx=
{
{
width
:
300
,
borderRadius
:
2
,
margin
:
"6px 0"
,
color
:
"red"
,
}
}
variant=
"determinate"
value=
{
itemInfo
?.
percentage
}
/>
)
:
null
}
<
div
style=
{
{
fontSize
:
12
}
}
>
{
statusMsg
===
"上传成功"
?
(
<>
<
span
style=
{
{
color
:
"#8A9099"
}
}
>
已上传至
</
span
>
<
span
style=
{
{
color
:
"#565C66"
,
marginLeft
:
12
}
}
>
{
`CADD - ${
currentProjectStore?.currentProjectInfo?.name || ""
}`
}
</
span
>
</>
)
:
(
<
div
className=
{
styles
.
speedBox
}
>
<
span
className=
{
styles
.
span
}
>
{
`${storageUnitFromB(
itemInfo?.bytesUploaded || 0
)}/${storageUnitFromB(itemInfo?.bytesTotal || 0)}`
}
</
span
>
{
statusMsg
!==
'上传失败'
?
<
span
className=
{
styles
.
span
}
>
{
`${storageUnitFromB(
speed
)}/s`
}
</
span
>
:
null
}
</
div
>
)
}
</
div
>
</
div
>
</
div
>
<
div
className=
{
styles
.
rightBox
}
onClick=
{
onOperation
}
>
{
text
}
</
div
>
</
div
>
);
const
speed
=
useMemo
(()
=>
{
let
val
=
0
;
const
time
=
Math
.
floor
((
itemInfo
?.
endTime
-
itemInfo
.
startTime
)
/
1000
);
if
(
time
>
0
)
{
val
=
Math
.
floor
(
itemInfo
?.
bytesUploaded
/
time
);
}
return
val
;
},
[
itemInfo
?.
bytesUploaded
,
itemInfo
?.
endTime
,
itemInfo
.
startTime
]);
return
(
<
div
className=
{
styles
.
itemBox
}
>
<
div
className=
{
styles
.
leftBox
}
>
<
img
src=
{
bkunyunFile
}
alt=
""
style=
{
{
marginRight
:
16
}
}
/>
<
div
>
<
div
>
<
b
className=
{
styles
.
fileNameBox
}
title=
{
itemInfo
?.
name
||
""
}
>
{
itemInfo
?.
name
||
""
}
</
b
>
{
statusMsg
===
"上传失败"
?
(
<
span
className=
{
styles
.
span
}
style=
{
{
marginLeft
:
16
,
color
:
"#FF4E4E"
}
}
>
{
`(${statusMsg})`
}
</
span
>
)
:
(
<
span
className=
{
styles
.
span
}
style=
{
{
marginLeft
:
16
}
}
>
{
TimeText
}
</
span
>
)
}
</
div
>
{
statusMsg
!==
"上传成功"
?
(
<
LinearProgress
sx=
{
{
width
:
300
,
borderRadius
:
2
,
margin
:
"6px 0"
,
color
:
"red"
,
}
}
variant=
"determinate"
value=
{
itemInfo
?.
percentage
}
/>
)
:
null
}
<
div
style=
{
{
fontSize
:
12
}
}
>
{
statusMsg
===
"上传成功"
?
(
<>
<
span
style=
{
{
color
:
"#8A9099"
}
}
>
已上传至
</
span
>
<
span
style=
{
{
color
:
"#565C66"
,
marginLeft
:
12
}
}
>
{
`CADD - ${
currentProjectStore?.currentProjectInfo?.name || ""
}`
}
</
span
>
</>
)
:
(
<
div
className=
{
styles
.
speedBox
}
>
<
span
className=
{
styles
.
span
}
>
{
`${storageUnitFromB(
itemInfo?.bytesUploaded || 0
)}/${storageUnitFromB(itemInfo?.bytesTotal || 0)}`
}
</
span
>
{
statusMsg
!==
"上传失败"
?
(
<
span
className=
{
styles
.
span
}
>
{
`${storageUnitFromB(
speed
)}/s`
}
</
span
>
)
:
null
}
</
div
>
)
}
</
div
>
</
div
>
</
div
>
<
div
className=
{
styles
.
rightBox
}
onClick=
{
onOperation
}
>
{
text
}
</
div
>
</
div
>
);
});
export
default
FileItem
;
src/views/Project/ProjectSetting/index.tsx
View file @
b19f5f62
...
...
@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-0
6-07 20:23:02
* @LastEditTime: 2022-0
7-13 16:51:56
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -16,14 +16,17 @@ import projectImg from "@/assets/project/projectIconSmall.svg";
import
ProjectMembers
from
"./ProjectMembers"
;
import
BaseInfo
from
"./BaseInfo"
;
import
Tabs
from
"@/components/mui/Tabs"
;
import
usePass
from
"@/hooks/usePass"
;
const
ProjectSetting
=
observer
(()
=>
{
const
{
currentProjectStore
}
=
useStores
();
const
isPass
=
usePass
();
const
tabList
=
useMemo
(()
=>
{
return
[
{
label
:
"项目成员"
,
value
:
"projectMember"
,
hide
:
!
isPass
(
"PROJECT_SETTING_MEMBER"
),
component
:
<
ProjectMembers
/>,
},
{
...
...
src/views/Project/ProjectSubmitWork/index.tsx
View file @
b19f5f62
...
...
@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-21 20:03:56
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-07-
07 10:53:41
* @LastEditTime: 2022-07-
13 16:24:06
* @FilePath: /bkunyun/src/views/Project/ProjectSubmitWork/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -228,17 +228,10 @@ const ProjectSubmitWork = observer(() => {
{
fullScreenShow
?
null
:
(
<
div
className=
{
styles
.
swHeader
}
>
<
div
className=
{
styles
.
swHeaderLeft
}
>
{
/* <MyPopconfirm
title="返回后,当前页面已填写内容将不保存,确认返回吗?"
onConfirm={handleGoBack}
> */
}
<
IconButton
color=
"primary"
onClick=
{
(
e
:
any
)
=>
handleShowPopper
(
e
,
"返回后,当前页面已填写内容将不保存,确认返回吗?"
)
handleShowPopper
(
e
,
"返回将放弃当前页面所有操作,确认返回吗?"
)
}
aria
-
label=
"upload picture"
component=
"span"
...
...
@@ -252,7 +245,6 @@ const ProjectSubmitWork = observer(() => {
}
}
/>
</
IconButton
>
{
/* </MyPopconfirm> */
}
<
div
className=
{
styles
.
swTemplateTitle
}
>
{
templateConfigInfo
?.
title
}
...
...
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