Commit 73d75f33 authored by rocosen's avatar rocosen

fix:bug

parent 30de630e
......@@ -8,6 +8,7 @@ import OutlinedInput from "@mui/material/OutlinedInput";
import SearchIcon from "@mui/icons-material/Search";
import Checkbox from '@mui/material/Checkbox';
import CloseOutlinedIcon from '@mui/icons-material/CloseOutlined';
import noData from '../../../../../assets/project/noTemplate.svg'
import _ from "lodash";
const AddTemplate = (props: any) => {
......@@ -45,6 +46,16 @@ const AddTemplate = (props: any) => {
</Button>
</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' }} >
{
addTemplateList.map((item: any, key: any) => {
......
......@@ -6,7 +6,7 @@
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @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 styles from "./index.module.css";
import OutlinedInput from "@mui/material/OutlinedInput";
......@@ -29,9 +29,13 @@ import _ from "lodash";
import { IResponse, useHttp } from "@/api/http";
import { useStores } from "@/store";
import usePass from "@/hooks/usePass";
import { toJS } from "mobx";
import { observer } from "mobx-react-lite";
const ProjectMembers = () => {
const ProjectMembers = observer(() => {
const { currentProjectStore } = useStores();
const projectIdData = toJS(currentProjectStore.currentProjectInfo.id);
const isPass = usePass();
/** 搜索模板名称 */
......@@ -92,6 +96,12 @@ const ProjectMembers = () => {
});
}, [currentProjectStore.currentProjectInfo.id, getTemplateInfo]);
useEffect(() => {
console.log('projectIdData: ', projectIdData);
}, [projectIdData])
/** 点击添加工作流模版 */
const onAddMember = () => {
// setAddMemberDialog(true);
......@@ -159,11 +169,17 @@ const ProjectMembers = () => {
}
const searchChange = (data: any) => {
setTemplateName(data.length > 30 ? data.slice(0, 30) : data);
}
useEffect(() => {
getTemplateInfo({
projectId: currentProjectStore.currentProjectInfo.id as string,
title: templateName
});
setTimeout(() => {
getTemplateInfo({
projectId: currentProjectStore.currentProjectInfo.id as string,
title: templateName
});
}, 300)
}, [templateName]);
return (
......@@ -172,10 +188,9 @@ const ProjectMembers = () => {
<Box className={styles.tabBox} >
<OutlinedInput
onChange={(e: any) => {
_.debounce(() => {
setTemplateName(e.target.value);
}, 200)();
searchChange(e.target.value)
}}
value={templateName}
placeholder="输入关键词搜索"
size="small"
sx={{ width: 340, height: 32 }}
......@@ -197,7 +212,7 @@ const ProjectMembers = () => {
</Box>
{
templateList.length === 0 && !isPass("PROJECT_WORKBENCH_FLOES_ADD", 'MANAGER') &&
templateList.length === 0 && templateName.length > 0 &&
<Box sx={{
display: 'flex', alignItems: 'center', flexDirection: 'column', minHeight: 'calc(100vh - 376px)',
justifyContent: 'center'
......@@ -216,7 +231,7 @@ const ProjectMembers = () => {
</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}
>
<Add sx={{ color: "#565C66", fontSize: "20px", width: "30px", height: '30px' }} />
......@@ -244,6 +259,6 @@ const ProjectMembers = () => {
</Box>
);
};
});
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