Commit 2f2e8e21 authored by chenshouchao's avatar chenshouchao

UI: 样式优化

parent 2a73807b
.addTemplateBox {
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.78);
z-index: 100;
display: flex;
flex-direction: column;
}
.closeBox {
display: flex;
justify-content: flex-end;
height: 40px;
align-items: center;
/* background-color: ; */
}
.content { .content {
flex: 1; flex: 1;
background-color: #fff; background-color: #fff;
......
import { useEffect, useState, useMemo, useCallback } from "react"; import { useEffect, useState, useMemo, useCallback } from "react";
import style from "./index.module.css"; import style from "./index.module.css";
import classNames from "classnames"; import classNames from "classnames";
import CloseOutlinedIcon from "@mui/icons-material/CloseOutlined";
import { Box, Typography } from "@mui/material"; import { Box, Typography } from "@mui/material";
import RadioGroupOfButtonStyle from "@/components/CommonComponents/RadioGroupOfButtonStyle"; import RadioGroupOfButtonStyle from "@/components/CommonComponents/RadioGroupOfButtonStyle";
import SearchIcon from "@mui/icons-material/Search"; import SearchIcon from "@mui/icons-material/Search";
import MyButton from "@/components/mui/MyButton"; import MyButton from "@/components/mui/MyButton";
import OutlinedInput from "@mui/material/OutlinedInput"; import OutlinedInput from "@mui/material/OutlinedInput";
import FullScreenDrawer from "@/components/CommonComponents/FullScreenDrawer";
import Checkbox from "@mui/material/Checkbox"; 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 WorkFlowEdit from "@/views/WorkFlowEdit"; import WorkFlowEdit from "@/views/WorkFlowEdit";
import _ from "lodash"; import _ from "lodash";
import { observer } from "mobx-react-lite";
import noData from "../../../../../../assets/project/noTemplate.svg"; import noData from "../../../../../../assets/project/noTemplate.svg";
import { ICustomTemplate } from "../../interface"; import { ICustomTemplate } from "../../interface";
import { useMessage } from "@/components/MySnackbar"; import { useMessage } from "@/components/MySnackbar";
...@@ -21,11 +19,12 @@ import { ...@@ -21,11 +19,12 @@ import {
getAddWorkbenchTemplate, getAddWorkbenchTemplate,
addWorkbenchTemplate, addWorkbenchTemplate,
} from "@/api/workbench_api"; } from "@/api/workbench_api";
import { toJS } from "mobx";
type IAddTemplateProps = { type IAddTemplateProps = {
setShowAddTemplate: any; setShowAddTemplate: any;
getTemplateInfo: any; getTemplateInfo: any;
projectId: string;
productId: string;
}; };
const radioOptions = [ const radioOptions = [
...@@ -39,12 +38,9 @@ const radioOptions = [ ...@@ -39,12 +38,9 @@ const radioOptions = [
}, },
]; ];
const AddTemplate = observer((props: IAddTemplateProps) => { const AddTemplate = (props: IAddTemplateProps) => {
const { currentProjectStore } = useStores();
const Message = useMessage(); const Message = useMessage();
const projectId = toJS(currentProjectStore.currentProjectInfo.id); const { setShowAddTemplate, getTemplateInfo, projectId, productId } = props;
const productId = toJS(currentProjectStore.currentProductInfo.id);
const { setShowAddTemplate, getTemplateInfo } = props;
const [title, setTitle] = useState(""); const [title, setTitle] = useState("");
/** 可增加模板列表 */ /** 可增加模板列表 */
...@@ -75,7 +71,7 @@ const AddTemplate = observer((props: IAddTemplateProps) => { ...@@ -75,7 +71,7 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
onSuccess: (result: any) => { onSuccess: (result: any) => {
Message.success("添加成功"); Message.success("添加成功");
setSelectTemplateData([]); setSelectTemplateData([]);
setShowAddTemplate(false); setShowAddTemplate();
getTemplateInfo({ getTemplateInfo({
projectId: projectId as string, projectId: projectId as string,
}); });
...@@ -151,7 +147,6 @@ const AddTemplate = observer((props: IAddTemplateProps) => { ...@@ -151,7 +147,6 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
templateType, templateType,
title, title,
]); ]);
// title,
useEffect(() => { useEffect(() => {
getAddTemplateListFun(); getAddTemplateListFun();
...@@ -168,15 +163,7 @@ const AddTemplate = observer((props: IAddTemplateProps) => { ...@@ -168,15 +163,7 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
}, [addTemplateList, templateType]); }, [addTemplateList, templateType]);
return ( return (
<div className={style.addTemplateBox}> <FullScreenDrawer handleClose={setShowAddTemplate}>
<div className={style.closeBox}>
<CloseOutlinedIcon
sx={{ color: "#ffffff", marginRight: "10px", cursor: "pointer" }}
onClick={() => {
setShowAddTemplate(false);
}}
/>
</div>
<div className={style.content}> <div className={style.content}>
<Typography <Typography
sx={{ fontSize: "18px", fontWeight: "600", color: "#1E2633" }} sx={{ fontSize: "18px", fontWeight: "600", color: "#1E2633" }}
...@@ -336,8 +323,8 @@ const AddTemplate = observer((props: IAddTemplateProps) => { ...@@ -336,8 +323,8 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
}} }}
/> />
) : null} ) : null}
</div> </FullScreenDrawer>
); );
}); };
export default AddTemplate; export default AddTemplate;
...@@ -32,7 +32,7 @@ import styles from "./index.module.css"; ...@@ -32,7 +32,7 @@ import styles from "./index.module.css";
const ProjectMembers = observer(() => { const ProjectMembers = observer(() => {
const { currentProjectStore } = useStores(); const { currentProjectStore } = useStores();
const projectIdData = toJS(currentProjectStore.currentProjectInfo.id); const projectIdData = toJS(currentProjectStore.currentProjectInfo.id);
const productId = toJS(currentProjectStore.currentProductInfo.id);
const isPass = usePass(); const isPass = usePass();
/** 搜索模板名称 */ /** 搜索模板名称 */
...@@ -187,8 +187,10 @@ const ProjectMembers = observer(() => { ...@@ -187,8 +187,10 @@ const ProjectMembers = observer(() => {
{showAddTemplate && ( {showAddTemplate && (
<AddTemplate <AddTemplate
setShowAddTemplate={setShowAddTemplate} setShowAddTemplate={() => setShowAddTemplate(false)}
getTemplateInfo={getTemplateInfo} getTemplateInfo={getTemplateInfo}
productId={productId as string}
projectId={projectIdData as string}
/> />
)} )}
......
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