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