Commit b19f5f62 authored by 吴永生#A02208's avatar 吴永生#A02208

feat: 项目成员标准版不可看

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