Commit 1bcde7bb authored by chenshouchao's avatar chenshouchao

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

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