Commit 73d75f33 authored by rocosen's avatar rocosen

fix:bug

parent 30de630e
...@@ -8,6 +8,7 @@ import OutlinedInput from "@mui/material/OutlinedInput"; ...@@ -8,6 +8,7 @@ import OutlinedInput from "@mui/material/OutlinedInput";
import SearchIcon from "@mui/icons-material/Search"; import SearchIcon from "@mui/icons-material/Search";
import Checkbox from '@mui/material/Checkbox'; import Checkbox from '@mui/material/Checkbox';
import CloseOutlinedIcon from '@mui/icons-material/CloseOutlined'; import CloseOutlinedIcon from '@mui/icons-material/CloseOutlined';
import noData from '../../../../../assets/project/noTemplate.svg'
import _ from "lodash"; import _ from "lodash";
const AddTemplate = (props: any) => { const AddTemplate = (props: any) => {
...@@ -45,6 +46,16 @@ const AddTemplate = (props: any) => { ...@@ -45,6 +46,16 @@ const AddTemplate = (props: any) => {
</Button> </Button>
</Box> </Box>
{
addTemplateList.length === 0 && <Box sx={{
display: 'flex', alignItems: 'center', flexDirection: 'column', minHeight: 'calc(100vh - 376px)',
justifyContent: 'center'
}}>
<img alt="" src={noData} />
<Typography sx={{ fontSize: '12px', fontWeight: '400', color: '#8A9099' }}>暂未相关模版</Typography>
</Box>
}
<Box sx={{ display: "flex", flexWrap: 'wrap', overflowX: 'hidden', overflowY: 'overlay', marginLeft: '-8px' }} > <Box sx={{ display: "flex", flexWrap: 'wrap', overflowX: 'hidden', overflowY: 'overlay', marginLeft: '-8px' }} >
{ {
addTemplateList.map((item: any, key: any) => { addTemplateList.map((item: any, key: any) => {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx * @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
import { memo, useCallback, useEffect, useMemo, useState } from "react"; import { memo, SetStateAction, useCallback, useEffect, useMemo, useState } from "react";
import { Box, Typography } from "@mui/material"; import { Box, Typography } from "@mui/material";
import styles from "./index.module.css"; import styles from "./index.module.css";
import OutlinedInput from "@mui/material/OutlinedInput"; import OutlinedInput from "@mui/material/OutlinedInput";
...@@ -29,9 +29,13 @@ import _ from "lodash"; ...@@ -29,9 +29,13 @@ import _ from "lodash";
import { IResponse, useHttp } from "@/api/http"; import { IResponse, useHttp } from "@/api/http";
import { useStores } from "@/store"; import { useStores } from "@/store";
import usePass from "@/hooks/usePass"; import usePass from "@/hooks/usePass";
import { toJS } from "mobx";
import { observer } from "mobx-react-lite";
const ProjectMembers = () => { const ProjectMembers = observer(() => {
const { currentProjectStore } = useStores(); const { currentProjectStore } = useStores();
const projectIdData = toJS(currentProjectStore.currentProjectInfo.id);
const isPass = usePass(); const isPass = usePass();
/** 搜索模板名称 */ /** 搜索模板名称 */
...@@ -92,6 +96,12 @@ const ProjectMembers = () => { ...@@ -92,6 +96,12 @@ const ProjectMembers = () => {
}); });
}, [currentProjectStore.currentProjectInfo.id, getTemplateInfo]); }, [currentProjectStore.currentProjectInfo.id, getTemplateInfo]);
useEffect(() => {
console.log('projectIdData: ', projectIdData);
}, [projectIdData])
/** 点击添加工作流模版 */ /** 点击添加工作流模版 */
const onAddMember = () => { const onAddMember = () => {
// setAddMemberDialog(true); // setAddMemberDialog(true);
...@@ -159,11 +169,17 @@ const ProjectMembers = () => { ...@@ -159,11 +169,17 @@ const ProjectMembers = () => {
} }
const searchChange = (data: any) => {
setTemplateName(data.length > 30 ? data.slice(0, 30) : data);
}
useEffect(() => { useEffect(() => {
getTemplateInfo({ setTimeout(() => {
projectId: currentProjectStore.currentProjectInfo.id as string, getTemplateInfo({
title: templateName projectId: currentProjectStore.currentProjectInfo.id as string,
}); title: templateName
});
}, 300)
}, [templateName]); }, [templateName]);
return ( return (
...@@ -172,10 +188,9 @@ const ProjectMembers = () => { ...@@ -172,10 +188,9 @@ const ProjectMembers = () => {
<Box className={styles.tabBox} > <Box className={styles.tabBox} >
<OutlinedInput <OutlinedInput
onChange={(e: any) => { onChange={(e: any) => {
_.debounce(() => { searchChange(e.target.value)
setTemplateName(e.target.value);
}, 200)();
}} }}
value={templateName}
placeholder="输入关键词搜索" placeholder="输入关键词搜索"
size="small" size="small"
sx={{ width: 340, height: 32 }} sx={{ width: 340, height: 32 }}
...@@ -197,7 +212,7 @@ const ProjectMembers = () => { ...@@ -197,7 +212,7 @@ const ProjectMembers = () => {
</Box> </Box>
{ {
templateList.length === 0 && !isPass("PROJECT_WORKBENCH_FLOES_ADD", 'MANAGER') && templateList.length === 0 && templateName.length > 0 &&
<Box sx={{ <Box sx={{
display: 'flex', alignItems: 'center', flexDirection: 'column', minHeight: 'calc(100vh - 376px)', display: 'flex', alignItems: 'center', flexDirection: 'column', minHeight: 'calc(100vh - 376px)',
justifyContent: 'center' justifyContent: 'center'
...@@ -216,7 +231,7 @@ const ProjectMembers = () => { ...@@ -216,7 +231,7 @@ const ProjectMembers = () => {
</Box> </Box>
} }
{ {
templateList.length === 0 && isPass("PROJECT_WORKBENCH_FLOES_ADD", 'MANAGER') && <Box className={styles.addNewTemplate} templateList.length === 0 && templateName.length === 0 && isPass("PROJECT_WORKBENCH_FLOES_ADD", 'MANAGER') && <Box className={styles.addNewTemplate}
onClick={addTemplateBlock} onClick={addTemplateBlock}
> >
<Add sx={{ color: "#565C66", fontSize: "20px", width: "30px", height: '30px' }} /> <Add sx={{ color: "#565C66", fontSize: "20px", width: "30px", height: '30px' }} />
...@@ -244,6 +259,6 @@ const ProjectMembers = () => { ...@@ -244,6 +259,6 @@ const ProjectMembers = () => {
</Box> </Box>
); );
}; });
export default memo(ProjectMembers); export default memo(ProjectMembers);
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