Commit ed810906 authored by rocosen's avatar rocosen

fix:bug

parent fcdfe186
...@@ -41,7 +41,9 @@ const MenuLayout = observer(() => { ...@@ -41,7 +41,9 @@ const MenuLayout = observer(() => {
return ( return (
<Box className={style.container}> <Box className={style.container}>
<Box className={style.aside}> <Box className={style.aside}>
<CurrentProject /> {
pathname.indexOf('userCenter') < 0 && <CurrentProject />
}
<List <List
sx={{ sx={{
paddingTop: 0, paddingTop: 0,
......
...@@ -349,8 +349,8 @@ const BaseInfo = observer(() => { ...@@ -349,8 +349,8 @@ const BaseInfo = observer(() => {
[style.projectInfoTextarea]: true, [style.projectInfoTextarea]: true,
})} })}
onChange={descChange} onChange={descChange}
placeholder="项目描述限制100字以内" placeholder="项目描述限制300字以内"
maxLength={100} maxLength={300}
></textarea> ></textarea>
{/* <MyInput {/* <MyInput
value={projectInfo.desc} value={projectInfo.desc}
......
...@@ -100,7 +100,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -100,7 +100,7 @@ const ConfigForm = (props: ConfigFormProps) => {
}; };
const checkName = (name: string = "") => { const checkName = (name: string = "") => {
const reg = new RegExp(/^[a-zA-Z0-9\u4e00-\u9fa5-_]{3,30}$/); const reg = new RegExp(/^[a-zA-Z0-9\u4e00-\u9fa5-_]{3,50}$/);
if (!name) { if (!name) {
setNameHelp({ setNameHelp({
error: true, error: true,
...@@ -117,7 +117,7 @@ const ConfigForm = (props: ConfigFormProps) => { ...@@ -117,7 +117,7 @@ const ConfigForm = (props: ConfigFormProps) => {
setNameHelp({ setNameHelp({
error: true, error: true,
helperText: helperText:
"请输入正确任务名称(3~30字符,可包含大小写字母、数字、中文、特殊符号“-”、“_”)", "请输入正确任务名称(3~50字符,可包含大小写字母、数字、中文、特殊符号“-”、“_”)",
}); });
return true; return true;
} }
......
...@@ -69,6 +69,7 @@ const currencies = [ ...@@ -69,6 +69,7 @@ const currencies = [
let timer: string | number | NodeJS.Timeout | null | undefined = null; let timer: string | number | NodeJS.Timeout | null | undefined = null;
const ProjectMembers = observer(() => { const ProjectMembers = observer(() => {
const { currentProjectStore } = useStores(); const { currentProjectStore } = useStores();
const projectId = toJS(currentProjectStore.currentProjectInfo.id); const projectId = toJS(currentProjectStore.currentProjectInfo.id);
const isPass = usePass(); const isPass = usePass();
const [jobName, setJobName] = useState(""); const [jobName, setJobName] = useState("");
...@@ -125,7 +126,7 @@ const ProjectMembers = observer(() => { ...@@ -125,7 +126,7 @@ const ProjectMembers = observer(() => {
}, },
}); });
// 删除作业 // 中止作业
const { run: cancelWorkflowJobInfo } = useMyRequest(cancelWorkflowJob, { const { run: cancelWorkflowJobInfo } = useMyRequest(cancelWorkflowJob, {
onSuccess: (result: any) => { onSuccess: (result: any) => {
setOpenDialog(false); setOpenDialog(false);
...@@ -428,21 +429,22 @@ const ProjectMembers = observer(() => { ...@@ -428,21 +429,22 @@ const ProjectMembers = observer(() => {
{item.state === "RUNNING" && {item.state === "RUNNING" &&
isPass("PROJECT_WORKBENCH_JOBS_STOP", "USER") && ( isPass("PROJECT_WORKBENCH_JOBS_STOP", "USER") && (
<Box className={styles.tabBoxJobOperate}> <Box className={styles.tabBoxJobOperate}>
<img {
alt="" currentProjectStore.currentProjectInfo.projectRole === "USER" && (item.creator !== JSON.parse(localStorage.getItem("userInfo") || "{}")?.name) ? "" : <img
src={jobStop} alt=""
style={{ cursor: "pointer" }} src={jobStop}
onClick={(event) => { style={{ cursor: "pointer" }}
event.stopPropagation(); onClick={(event) => {
event.nativeEvent.stopImmediatePropagation(); event.stopPropagation();
setJobData(item.id); event.nativeEvent.stopImmediatePropagation();
setOpenDialog(true); setJobData(item.id);
setDialogType("stop"); setOpenDialog(true);
}} setDialogType("stop");
/> }}
/>
}
</Box> </Box>
)} )}
{item.state !== "RUNNING" && {item.state !== "RUNNING" &&
isPass("PROJECT_WORKBENCH_JOBS_DELETE", "MANAGER") && ( isPass("PROJECT_WORKBENCH_JOBS_DELETE", "MANAGER") && (
<Box className={styles.tabBoxJobOperate}> <Box className={styles.tabBoxJobOperate}>
......
import { MenuItem } from "@mui/material"; import { MenuItem } from "@mui/material";
import React, { useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
import { useNavigate } from "react-router-dom";
import MyInput from "@/components/mui/MyInput"; import MyInput from "@/components/mui/MyInput";
import MyDialog from "@/components/mui/MyDialog"; import MyDialog from "@/components/mui/MyDialog";
...@@ -29,6 +30,7 @@ type IAddProjectProps = { ...@@ -29,6 +30,7 @@ type IAddProjectProps = {
const AddProject = (props: IAddProjectProps) => { const AddProject = (props: IAddProjectProps) => {
const { addOpen, setAddOpen } = props; const { addOpen, setAddOpen } = props;
const { currentProjectStore } = useStores(); const { currentProjectStore } = useStores();
const navigate = useNavigate();
const message = useMessage(); const message = useMessage();
const [name, setName] = useState(""); const [name, setName] = useState("");
const [nameCheck, setNameCheck] = useState({ const [nameCheck, setNameCheck] = useState({
...@@ -74,6 +76,7 @@ const AddProject = (props: IAddProjectProps) => { ...@@ -74,6 +76,7 @@ const AddProject = (props: IAddProjectProps) => {
project.filetoken = res; project.filetoken = res;
currentProjectStore.changeProject(project); currentProjectStore.changeProject(project);
}); });
navigate(`/product/cadd/projectOverview`)
} }
}, },
onError: () => { onError: () => {
...@@ -134,11 +137,11 @@ const AddProject = (props: IAddProjectProps) => { ...@@ -134,11 +137,11 @@ const AddProject = (props: IAddProjectProps) => {
const handleDescChange = (e: any) => { const handleDescChange = (e: any) => {
const desc = e.target.value; const desc = e.target.value;
setDesc(desc.slice(0,100)); setDesc(desc.slice(0,300));
// if (desc.length > 100) { // if (desc.length > 300) {
// setDescCheck({ // setDescCheck({
// error: true, // error: true,
// help: "格式不正确,必须在100字符以内", // help: "格式不正确,必须在300字符以内",
// }); // });
// } else { // } else {
// setDescCheck({ // setDescCheck({
...@@ -224,7 +227,7 @@ const AddProject = (props: IAddProjectProps) => { ...@@ -224,7 +227,7 @@ const AddProject = (props: IAddProjectProps) => {
color: desc.length >= 100 ? "#d32f2f" : "#C2C6CC" color: desc.length >= 100 ? "#d32f2f" : "#C2C6CC"
}} }}
> >
{desc.length}/100 {desc.length}/300
</span> </span>
</div> </div>
</div> </div>
......
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