Commit 24b9ce7c authored by chenshouchao's avatar chenshouchao

feat: 修改WorkFlowEdit组件引用位置

parent 9b9cdbe0
...@@ -11,15 +11,12 @@ import Checkbox from "@mui/material/Checkbox"; ...@@ -11,15 +11,12 @@ import Checkbox from "@mui/material/Checkbox";
import useMyRequest from "@/hooks/useMyRequest"; import useMyRequest from "@/hooks/useMyRequest";
import AddIcon from "@mui/icons-material/Add"; import AddIcon from "@mui/icons-material/Add";
import { useStores } from "@/store"; import { useStores } from "@/store";
import WorkFlowEdit from "@/views/WorkFlowEdit";
import _ from "lodash"; import _ from "lodash";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import noData from "../../../../../../assets/project/noTemplate.svg"; import noData from "../../../../../../assets/project/noTemplate.svg";
import { import { ICustomTemplate } from "../../interface";
getWorkbenchTemplate, import { getAddWorkbenchTemplate } from "@/api/workbench_api";
deleteWorkbenchTemplate,
getAddWorkbenchTemplate,
addWorkbenchTemplate,
} from "@/api/workbench_api";
import { toJS } from "mobx"; import { toJS } from "mobx";
type IAddTemplateProps = { type IAddTemplateProps = {
...@@ -72,6 +69,13 @@ const AddTemplate = observer((props: IAddTemplateProps) => { ...@@ -72,6 +69,13 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
}, },
}); });
/** 是否显示自定义模版编辑并带有参数 */
const [customTemplateInfo, setCustomTemplateInfo] = useState<ICustomTemplate>(
{
show: true,
}
);
useEffect(() => { useEffect(() => {
getAddTemplateList({ getAddTemplateList({
projectId: projectId as string, projectId: projectId as string,
...@@ -245,6 +249,7 @@ const AddTemplate = observer((props: IAddTemplateProps) => { ...@@ -245,6 +249,7 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
})} })}
</div> </div>
</div> </div>
{customTemplateInfo?.show ? <WorkFlowEdit /> : null}
</div> </div>
); );
}); });
......
...@@ -29,9 +29,7 @@ import { ...@@ -29,9 +29,7 @@ import {
addWorkbenchTemplate, addWorkbenchTemplate,
} from "@/api/workbench_api"; } from "@/api/workbench_api";
import usePass from "@/hooks/usePass"; import usePass from "@/hooks/usePass";
import WorkFlowEdit from "@/views/WorkFlowEdit";
import { useStores } from "@/store"; import { useStores } from "@/store";
import { ICustomTemplate } from "./interface";
import styles from "./index.module.css"; import styles from "./index.module.css";
...@@ -56,13 +54,6 @@ const ProjectMembers = observer(() => { ...@@ -56,13 +54,6 @@ const ProjectMembers = observer(() => {
/** 已选择增加的模板列表 */ /** 已选择增加的模板列表 */
const [selectTemplateData, setSelectTemplateData] = useState<string[]>([]); const [selectTemplateData, setSelectTemplateData] = useState<string[]>([]);
/** 是否显示自定义模版编辑并带有参数 */
const [customTemplateInfo, setCustomTemplateInfo] = useState<ICustomTemplate>(
{
show: false,
}
);
const [showAddTemplate, setShowAddTemplate] = useState(false); const [showAddTemplate, setShowAddTemplate] = useState(false);
// 获取模板列表 // 获取模板列表
...@@ -280,8 +271,6 @@ const ProjectMembers = observer(() => { ...@@ -280,8 +271,6 @@ const ProjectMembers = observer(() => {
<AddTemplate setShowAddTemplate={setShowAddTemplate} /> <AddTemplate setShowAddTemplate={setShowAddTemplate} />
)} )}
{customTemplateInfo?.show ? <WorkFlowEdit /> : null}
<SimpleDialog <SimpleDialog
text={"确认移除该模板吗?"} text={"确认移除该模板吗?"}
title={"删除模板"} 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