diff --git a/src/components/FlowModal/index.js b/src/components/FlowModal/index.js new file mode 100644 index 0000000..7f64532 --- /dev/null +++ b/src/components/FlowModal/index.js @@ -0,0 +1,55 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { ReactFlow, ReactFlowProvider } from "@xyflow/react"; +import { Button, Modal } from "antd"; +import { useEffect, useState } from "react"; +import { NS_EIGHTWORK } from "~/enumerate/namespace"; +import { getFlowData } from "~/utils/flow"; + +function FlowModal(props) { + const [flowNodes, setFlowNodes] = useState([]); + const [flowEdges, setFlowEdges] = useState([]); + + const getData = async () => { + const { data } = await props["eightworkTaskLogFlowChart"]({ workId: props.id }); + const { nodes, edges } = getFlowData(data); + setFlowNodes(nodes); + setFlowEdges(edges); + }; + + useEffect(() => { + getData(); + }, []); + + return ( + 取消, + ]} + > + +
+ + +
+
+
+ ); +} + +export default Connect([NS_EIGHTWORK], true)(FlowModal); diff --git a/src/components/ForceTerminationModal/index.js b/src/components/ForceTerminationModal/index.js new file mode 100644 index 0000000..c64737f --- /dev/null +++ b/src/components/ForceTerminationModal/index.js @@ -0,0 +1,42 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Modal } from "antd"; +import FormBuilder from "zy-react-library/components/FormBuilder"; +import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import { NS_EIGHTWORK } from "~/enumerate/namespace"; + +const ForceTerminationModal = (props) => { + const [form] = FormBuilder.useForm(); + + const onSubmit = async () => { + + }; + + return ( + +
+
请确认是否强制关闭作业票?
+ +
+
+ ); +}; + +export default Connect([NS_EIGHTWORK], true)(ForceTerminationModal); diff --git a/src/pages/Container/Enterprise/HotWork/Homework/List/index.js b/src/pages/Container/Enterprise/HotWork/Homework/List/index.js index a0723d3..17daf71 100644 --- a/src/pages/Container/Enterprise/HotWork/Homework/List/index.js +++ b/src/pages/Container/Enterprise/HotWork/Homework/List/index.js @@ -1,8 +1,6 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime"; -import { ReactFlow, ReactFlowProvider } from "@xyflow/react"; -import { Button, Modal, Space } from "antd"; +import { Button, Space } from "antd"; import { useEffect, useState } from "react"; -import FormBuilder from "zy-react-library/components/FormBuilder"; import Page from "zy-react-library/components/Page"; import Search from "zy-react-library/components/Search"; import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj"; @@ -11,9 +9,10 @@ import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import useTable from "zy-react-library/hooks/useTable"; import { getLabelName } from "zy-react-library/utils"; +import FlowModal from "~/components/FlowModal"; +import ForceTerminationModal from "~/components/ForceTerminationModal"; import { STATUS_ENUM, WORK_TYPE_ENUM } from "~/enumerate/constant"; import { NS_EIGHTWORK } from "~/enumerate/namespace"; -import { getFlowData } from "~/utils/flow"; import "@xyflow/react/dist/style.css"; function List(props) { @@ -179,88 +178,4 @@ function List(props) { ); } -const ForceTerminationModalComponent = (props) => { - const [form] = FormBuilder.useForm(); - - const onSubmit = async () => { - - }; - - return ( - -
-
请确认是否强制关闭作业票?
- -
-
- ); -}; - -function FlowModalComponent(props) { - const [flowNodes, setFlowNodes] = useState([]); - const [flowEdges, setFlowEdges] = useState([]); - - const getData = async () => { - const { data } = await props["eightworkTaskLogFlowChart"]({ workId: props.id }); - const { nodes, edges } = getFlowData(data); - setFlowNodes(nodes); - setFlowEdges(edges); - }; - - useEffect(() => { - getData(); - }, []); - - return ( - 取消, - ]} - > - -
- - -
-
-
- ); -} - -const ForceTerminationModal = Connect([NS_EIGHTWORK], true)(ForceTerminationModalComponent); -const FlowModal = Connect([NS_EIGHTWORK], true)(FlowModalComponent); export default Connect([NS_EIGHTWORK], true)(List);