Commit 9b33af5f authored by chenshouchao's avatar chenshouchao

Merge branch 'feat-20220801' into 'release'

Feat 20220801

See merge request !53
parents 41e296fd 48397525
...@@ -69,7 +69,7 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => { ...@@ -69,7 +69,7 @@ const MyPopconfirm = (props: IMyPopconfirmProps) => {
bgcolor: "#fff", bgcolor: "#fff",
minWidth: "200px", minWidth: "200px",
borderRadius: "4px", borderRadius: "4px",
fontSize:"14px", fontSize: "14px",
padding: "20px 16px", padding: "20px 16px",
boxShadow: "0px 3px 10px 0px rgba(0, 24, 57, 0.14)", boxShadow: "0px 3px 10px 0px rgba(0, 24, 57, 0.14)",
}} }}
......
...@@ -115,7 +115,7 @@ const Tabs = (props: IProps) => { ...@@ -115,7 +115,7 @@ const Tabs = (props: IProps) => {
return ( return (
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<TabContext value={value}> <TabContext value={value}>
<Box sx={{ borderBottom: 1, borderColor: "#F0F2F5" }}> <Box sx={{ borderBottom: 1, borderColor: "#EDEFF2" }}>
<TabList <TabList
onChange={(e: any, val: string) => { onChange={(e: any, val: string) => {
onChange(val); onChange(val);
......
.topApp { .topApp {
height: 56px; height: 56px;
background-color: white; background-color: white;
border-bottom: #e6e8eb 1px solid; border-bottom: #dde1e6 1px solid;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
margin-top: -10px; margin-top: -10px;
} }
.uploadIconBox{ .uploadIconBox {
width: 32px; width: 32px;
height: 32px; height: 32px;
display: flex; display: flex;
...@@ -26,13 +26,12 @@ ...@@ -26,13 +26,12 @@
margin-right: 16px; margin-right: 16px;
} }
.uploadIconBox:hover{ .uploadIconBox:hover {
background-color: #f0f2f5; background-color: #f0f2f5;
border-radius: 2px; border-radius: 2px;
cursor: pointer; cursor: pointer;
} }
.topRightBox { .topRightBox {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
justify-content: center; justify-content: center;
} }
.aside { .aside {
border-right: 1px solid #e6e8eb; border-right: 1px solid #dde1e6;
width: 10%; width: 10%;
min-width: 220px; min-width: 220px;
height: calc(100vh - 57px); height: calc(100vh - 57px);
......
...@@ -21,7 +21,6 @@ import { toJS } from "mobx"; ...@@ -21,7 +21,6 @@ import { toJS } from "mobx";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import InformationDisplay from "@/components/CommonComponents/InformationDisplay"; import InformationDisplay from "@/components/CommonComponents/InformationDisplay";
import classnames from "classnames"; import classnames from "classnames";
import { TextField } from "@mui/material";
import LoadingButton from "@mui/lab/LoadingButton"; import LoadingButton from "@mui/lab/LoadingButton";
import InputAdornment from "@mui/material/InputAdornment"; import InputAdornment from "@mui/material/InputAdornment";
import { useMessage } from "@/components/MySnackbar"; import { useMessage } from "@/components/MySnackbar";
...@@ -29,11 +28,8 @@ import Loading from "@/views/Loading"; ...@@ -29,11 +28,8 @@ import Loading from "@/views/Loading";
import MyDialog from "@/components/mui/MyDialog"; import MyDialog from "@/components/mui/MyDialog";
import { getProjectList } from "../../project"; import { getProjectList } from "../../project";
import { checkIsNumberLetterChinese } from "@/utils/util"; import { checkIsNumberLetterChinese } from "@/utils/util";
import {
setFileServerEndPointLocalStorage,
getFiletokenAccordingToId,
} from "@/views/Project/project";
import MyButton from "@/components/mui/MyButton"; import MyButton from "@/components/mui/MyButton";
import MySelect, { optionsTransform } from "@/components/mui/MySelect";
import MyInput from "@/components/mui/MyInput"; import MyInput from "@/components/mui/MyInput";
type zoneIdOption = { type zoneIdOption = {
...@@ -205,7 +201,11 @@ const BaseInfo = observer(() => { ...@@ -205,7 +201,11 @@ const BaseInfo = observer(() => {
showMessage && message.error(help); showMessage && message.error(help);
return false; return false;
} else if (budget) { } else if (budget) {
if (isNaN(Number(budget)) || Number(budget) > 10000000 || Number(budget) < 0) { if (
isNaN(Number(budget)) ||
Number(budget) > 10000000 ||
Number(budget) < 0
) {
help = "格式错误,请输入0~10000000之间的数值,结果最高保留两位小数。"; help = "格式错误,请输入0~10000000之间的数值,结果最高保留两位小数。";
setBudgetCheck({ setBudgetCheck({
error: true, error: true,
...@@ -229,7 +229,7 @@ const BaseInfo = observer(() => { ...@@ -229,7 +229,7 @@ const BaseInfo = observer(() => {
showMessage && message.error(help); showMessage && message.error(help);
return false; return false;
} }
} };
const budgetChange = (e: any) => { const budgetChange = (e: any) => {
setProjectInfo({ setProjectInfo({
...@@ -237,13 +237,16 @@ const BaseInfo = observer(() => { ...@@ -237,13 +237,16 @@ const BaseInfo = observer(() => {
projectBudget: e.target.value, projectBudget: e.target.value,
}); });
checkBudget(e.target.value); checkBudget(e.target.value);
} };
const budgetBlur = (e: any) => { const budgetBlur = (e: any) => {
if (e.target.value.indexOf(" ") == -1 && e.target.value) { if (e.target.value.indexOf(" ") === -1 && e.target.value) {
setProjectInfo({ setProjectInfo({
...projectInfo, ...projectInfo,
projectBudget: Number(e.target.value) || Number(e.target.value) == 0 ? Number(e.target.value).toFixed(2) : e.target.value, projectBudget:
Number(e.target.value) || Number(e.target.value) === 0
? Number(e.target.value).toFixed(2)
: e.target.value,
}); });
} }
}; };
...@@ -262,7 +265,10 @@ const BaseInfo = observer(() => { ...@@ -262,7 +265,10 @@ const BaseInfo = observer(() => {
// 修改项目 // 修改项目
const handleClickUpdate = () => { const handleClickUpdate = () => {
if (checkName(projectInfo.name, true) && checkBudget(projectInfo.projectBudget, true)) { if (
checkName(projectInfo.name, true) &&
checkBudget(projectInfo.projectBudget, true)
) {
updateProjectRun({ ...projectInfo, product: "cadd" }); updateProjectRun({ ...projectInfo, product: "cadd" });
} else { } else {
return; return;
...@@ -276,20 +282,9 @@ const BaseInfo = observer(() => { ...@@ -276,20 +282,9 @@ const BaseInfo = observer(() => {
const projectList = await getProjectList(); const projectList = await getProjectList();
currentProjectStore.setProjectList(projectList); currentProjectStore.setProjectList(projectList);
// 项目删完了 // 项目删完了
// if (projectList.length === 0) {
currentProjectStore.changeProject({}); currentProjectStore.changeProject({});
localStorage.setItem("fileServerEndPoint", ""); localStorage.setItem("fileServerEndPoint", "");
setProjectInfo({}); setProjectInfo({});
// } else {
// projectList[0].filetoken = getFiletokenAccordingToId(projectList[0].id);
// currentProjectStore.changeProject(projectList[0]);
// setFileServerEndPointLocalStorage(projectList[0].zoneId);
// getFiletokenAccordingToId(projectList[0].id).then((res) => {
// projectList[0].filetoken = res;
// currentProjectStore.changeProject(projectList[0]);
// });
// setProjectInfo(projectList[0]);
// }
}, },
}); });
...@@ -352,31 +347,15 @@ const BaseInfo = observer(() => { ...@@ -352,31 +347,15 @@ const BaseInfo = observer(() => {
placeholder="项目描述限制300字以内" placeholder="项目描述限制300字以内"
maxLength={300} maxLength={300}
></textarea> ></textarea>
{/* <MyInput
value={projectInfo.desc}
multiline
rows={4}
placeholder="项目描述限制100字以内"
onChange={descChange}
/> */}
</div> </div>
<div className={style.projectInfoListLi}> <div className={style.projectInfoListLi}>
<div className={style.projectInfoListLiLabel}>计算区</div> <div className={style.projectInfoListLiLabel}>计算区</div>
<select <MySelect
value={projectInfo.zoneId} value={projectInfo.zoneId}
disabled disabled
className={classnames({ options={optionsTransform(zoneIdOptions, "name", "id")}
[style.projectInfoListLiValue]: true, sx={{ width: "560px" }}
[style.projectInfoSelect]: true, ></MySelect>
[style.disable]: true,
})}
>
{zoneIdOptions.map((option) => (
<option key={option.id} value={option.id}>
{option.name}
</option>
))}
</select>
</div> </div>
<div className={style.projectInfoListLi}> <div className={style.projectInfoListLi}>
<div className={style.projectInfoListLiLabel}>创建人</div> <div className={style.projectInfoListLiLabel}>创建人</div>
...@@ -410,8 +389,8 @@ const BaseInfo = observer(() => { ...@@ -410,8 +389,8 @@ const BaseInfo = observer(() => {
padding: "6.5px 2px", padding: "6.5px 2px",
}, },
"& .MuiTypography-root": { "& .MuiTypography-root": {
fontSize: '14px' fontSize: "14px",
} },
}} }}
/> />
</div> </div>
...@@ -425,32 +404,32 @@ const BaseInfo = observer(() => { ...@@ -425,32 +404,32 @@ const BaseInfo = observer(() => {
</div> </div>
<div className={style.projectInfoListLi}> <div className={style.projectInfoListLi}>
<LoadingButton <LoadingButton
variant="outlined" variant="contained"
className={style.updateButton} className={style.updateButton}
onClick={handleClickUpdate} onClick={handleClickUpdate}
loading={updateLoading} loading={updateLoading}
sx={{ sx={{
height:"32px" height: "32px",
}} }}
> >
保存修改 保存修改
</LoadingButton> </LoadingButton>
</div> </div>
<div className={style.projectInfoListLi}> <div className={style.projectInfoListLi}>
<div className={style.projectInfoListLiLabel}>删除项目</div> <div
className={style.projectInfoListLiLabel}
style={{ paddingTop: "12px" }}
>
删除项目
</div>
<div className={style.projectInfoListLiText}> <div className={style.projectInfoListLiText}>
删除项目将删除其存储的数据和所有相关资源,并且已删除的项目无法恢复!请谨慎操作! 删除项目将删除其存储的数据和所有相关资源,并且已删除的项目无法恢复!请谨慎操作!
</div> </div>
<MyButton <MyButton
text="删除项目" text="删除项目"
variant="contained" variant="outlined"
onClick={() => setDialogOpen(true)} onClick={() => setDialogOpen(true)}
color="error" color="error"
// style={{
// backgroundColor: "#fff",
// color: "#FF4E4E",
// border: "1px solid #FF4E4E",
// }}
/> />
</div> </div>
<MyDialog <MyDialog
......
...@@ -12,7 +12,6 @@ import { Box } from "@mui/system"; ...@@ -12,7 +12,6 @@ import { Box } from "@mui/system";
import { useStores } from "@/store/index"; import { useStores } from "@/store/index";
import NoProject from "@/components/BusinessComponents/NoProject"; import NoProject from "@/components/BusinessComponents/NoProject";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
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";
...@@ -35,13 +34,22 @@ const ProjectSetting = observer(() => { ...@@ -35,13 +34,22 @@ const ProjectSetting = observer(() => {
component: <BaseInfo />, component: <BaseInfo />,
}, },
]; ];
}, []); }, [isPass]);
if (currentProjectStore.currentProjectInfo.name) { if (currentProjectStore.currentProjectInfo.name) {
return ( return (
<div style={{ padding:'28px 24px 24px' }}> <div style={{ padding: "28px 24px 24px" }}>
<div style={{ display: "flex", alignItems: "center" }}> <div style={{ display: "flex", alignItems: "center" }}>
<span style={{ fontSize: "18px", lineHeight: "26px", fontWeight: "600", color: "#1E2633" }}>项目设置</span> <span
style={{
fontSize: "18px",
lineHeight: "26px",
fontWeight: "600",
color: "#1E2633",
}}
>
项目设置
</span>
</div> </div>
<Box sx={{ width: "100%", typography: "body1" }}> <Box sx={{ width: "100%", typography: "body1" }}>
<Tabs tabList={tabList} /> <Tabs tabList={tabList} />
......
...@@ -63,6 +63,7 @@ const OperatorItem = (props: IOperatorItemProps) => { ...@@ -63,6 +63,7 @@ const OperatorItem = (props: IOperatorItemProps) => {
item?.edges.map((every) => { item?.edges.map((every) => {
return { return {
...every, ...every,
id: `${every.id}_${count}`,
source: `${every.source}_${count}`, source: `${every.source}_${count}`,
target: `${every.target}_${count}`, target: `${every.target}_${count}`,
}; };
...@@ -75,7 +76,7 @@ const OperatorItem = (props: IOperatorItemProps) => { ...@@ -75,7 +76,7 @@ const OperatorItem = (props: IOperatorItemProps) => {
x: item.type === "BATCH" ? x : item.position?.x, x: item.type === "BATCH" ? x : item.position?.x,
y: item.type === "BATCH" ? y : item.position?.y, y: item.type === "BATCH" ? y : item.position?.y,
}, },
edges: newEdges?.length ? newEdges : item?.edges, edges: newEdges?.length ? newEdges : [],
}; };
}); });
return newVal; return newVal;
......
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