Commit 1bcde7bb authored by chenshouchao's avatar chenshouchao

feat: 解决工作流算子列表的mymenu组件的冒泡bug

parent 6a121979
.itemBox {
width: 334px;
height: 108px;
padding: 20px;
margin: 0 20px 20px 0;
cursor: pointer;
background: linear-gradient(180deg, #f5f7fa 0%, #ffffff 100%);
box-shadow: 0px 3px 12px 0px rgba(3, 47, 105, 0.09);
......
......@@ -52,6 +52,10 @@ const OperatorCard = observer((props: IProps) => {
});
};
const handleMenuBox = (event: any) => {
event.stopPropagation();
};
return (
<div className={styles.itemBox} onClick={handleToSeeOperator}>
<div className={styles.itemHeaderBox}>
......@@ -62,23 +66,25 @@ const OperatorCard = observer((props: IProps) => {
{operatorType[type] || ""}
</span>
</div>
<MyMenu
value=""
options={[{ label: "升级", value: "upgrade" }]}
hasTriangle={false}
setValue={onClickOperation}
sx={{
zIndex: 1601,
}}
>
<span className={styles.operationBox}>
<img
style={{ width: 16, height: 16 }}
src={expandOperationSvg}
alt=""
/>
</span>
</MyMenu>
<div className={styles.menuBox} onClick={(e) => handleMenuBox(e)}>
<MyMenu
value=""
options={[{ label: "升级", value: "upgrade" }]}
hasTriangle={false}
setValue={onClickOperation}
sx={{
zIndex: 1601,
}}
>
<span className={styles.operationBox}>
<img
style={{ width: 16, height: 16 }}
src={expandOperationSvg}
alt=""
/>
</span>
</MyMenu>
</div>
</div>
<div className={styles.itemContentBox}>
<p className={styles.infoBox}>
......
......@@ -14,7 +14,5 @@
}
.contentBox {
display: flex;
flex-wrap: wrap;
padding-left: 20px;
padding: 0 20px 24px;
}
......@@ -17,6 +17,7 @@ import MySelect from "@/components/mui/MySelect";
import MyButton from "@/components/mui/MyButton";
import OperatorCard from "./components/OperatorCard";
import AddOperator from "./components/AddOperator";
import CardTable from "@/components/CommonComponents/CardTable";
import { useStores } from "@/store";
import { getOperatorList, IOperatorListParams } from "@/api/resourceCenter";
import useMyRequest from "@/hooks/useMyRequest";
......@@ -134,15 +135,17 @@ const WorkflowOperator = observer(() => {
<MyCircularProgress loading={loading}>
{list?.length ? (
<div className={styles.contentBox}>
{list?.map((item) => {
return (
<CardTable
data={list}
renderItem={(item: any) => (
<OperatorCard
setDetailsId={setDetailsId}
operatorInfo={item}
setPageType={setPageType}
/>
);
})}
)}
itemMinWidth={377}
></CardTable>
</div>
) : (
<div style={{ height: 300 }}>
......
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