Commit d701429c authored by chenshouchao's avatar chenshouchao

feat: 基础信息样式修改

parent 87a6abe5
......@@ -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>
);
......
......@@ -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
......
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