Commit 13ffe776 authored by chenshouchao's avatar chenshouchao

feat: 构建应用环境清空搜索框内容

parent f8baa77d
...@@ -27,10 +27,11 @@ import { getTokenInfo } from "@/utils/util"; ...@@ -27,10 +27,11 @@ import { getTokenInfo } from "@/utils/util";
type IAddEnvironmentProps = { type IAddEnvironmentProps = {
setAddopen: any; setAddopen: any;
setTitle: any;
}; };
const AddEnvironment = (props: IAddEnvironmentProps) => { const AddEnvironment = (props: IAddEnvironmentProps) => {
const { setAddopen } = props; const { setAddopen, setTitle } = props;
const Message = useMessage(); const Message = useMessage();
let tokenInfo = getTokenInfo(); let tokenInfo = getTokenInfo();
const [hpczoneList, setHpczoneList] = useState<Array<any>>([]); // 计算区列表 通过计算区列表和计算区id拿fileServerEndPoint const [hpczoneList, setHpczoneList] = useState<Array<any>>([]); // 计算区列表 通过计算区列表和计算区id拿fileServerEndPoint
...@@ -176,6 +177,7 @@ const AddEnvironment = (props: IAddEnvironmentProps) => { ...@@ -176,6 +177,7 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
{ {
onSuccess: () => { onSuccess: () => {
Message.success("开始构建应用环境"); Message.success("开始构建应用环境");
setTitle("");
setAddopen(false); setAddopen(false);
}, },
} }
...@@ -351,7 +353,10 @@ const AddEnvironment = (props: IAddEnvironmentProps) => { ...@@ -351,7 +353,10 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
<SwitchBatchFolw <SwitchBatchFolw
active={taskType} active={taskType}
setActive={setTaskType} setActive={setTaskType}
goBack={() => setAddopen(false)} goBack={() => {
setTitle("");
setAddopen(false);
}}
></SwitchBatchFolw> ></SwitchBatchFolw>
</div> </div>
<div className={style.right}> <div className={style.right}>
......
...@@ -198,6 +198,7 @@ const UserResourcesEnvironment = () => { ...@@ -198,6 +198,7 @@ const UserResourcesEnvironment = () => {
<div className={style.environment}> <div className={style.environment}>
<div className={style.top}> <div className={style.top}>
<div className={style.topLeft}> <div className={style.topLeft}>
{!addOpen && (
<SearchInput <SearchInput
sx={{ width: 340, marginRight: "16px" }} sx={{ width: 340, marginRight: "16px" }}
onKeyUp={(e: any) => { onKeyUp={(e: any) => {
...@@ -206,6 +207,7 @@ const UserResourcesEnvironment = () => { ...@@ -206,6 +207,7 @@ const UserResourcesEnvironment = () => {
} }
}} }}
></SearchInput> ></SearchInput>
)}
{!addOpen && ( {!addOpen && (
<MySelect <MySelect
options={[ options={[
...@@ -264,7 +266,12 @@ const UserResourcesEnvironment = () => { ...@@ -264,7 +266,12 @@ const UserResourcesEnvironment = () => {
setSortState={setSortState} setSortState={setSortState}
></MyTable> ></MyTable>
</div> </div>
{addOpen && <AddEnvironment setAddopen={setAddopen}></AddEnvironment>} {addOpen && (
<AddEnvironment
setAddopen={setAddopen}
setTitle={setTitle}
></AddEnvironment>
)}
{deleteOpen && ( {deleteOpen && (
<DeleteEnvironment <DeleteEnvironment
id={id} id={id}
......
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