Commit 13ffe776 authored by chenshouchao's avatar chenshouchao

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

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