Commit 53c15328 authored by 邓超's avatar 邓超

fix: 修改流程图超出样式

parent dc0d645a
Pipeline #65843 passed with stages
...@@ -152,6 +152,7 @@ const WorkflowHomePage = () => { ...@@ -152,6 +152,7 @@ const WorkflowHomePage = () => {
flowID: val.FlowID, flowID: val.FlowID,
chartLoading: false, chartLoading: false,
activeKey: activeKey.current, activeKey: activeKey.current,
flowTree: flowList,
}, },
}); });
} else { } else {
......
...@@ -209,11 +209,10 @@ ...@@ -209,11 +209,10 @@
align-items: center; align-items: center;
width: 100%; width: 100%;
margin-top: 1px; margin-top: 1px;
height: 130px;
overflow: hidden;
img { img {
width: 230px; width: 320px;
// height: 125px;
// height: 350px;
} }
} }
......
...@@ -8,7 +8,7 @@ const FlowBoard = () => { ...@@ -8,7 +8,7 @@ const FlowBoard = () => {
const history = useHistory(); const history = useHistory();
useEffect(() => {}, []); useEffect(() => {}, []);
const { flowData, flowID, chartLoading, activeKey } = history.location.state; const { flowData, flowID, chartLoading, activeKey, flowTree } = history.location.state;
return ( return (
<div className={styles.flowChartContainer}> <div className={styles.flowChartContainer}>
<FlowChart <FlowChart
...@@ -16,6 +16,7 @@ const FlowBoard = () => { ...@@ -16,6 +16,7 @@ const FlowBoard = () => {
flowID={flowID} flowID={flowID}
chartLoading={chartLoading} chartLoading={chartLoading}
activeKey={activeKey} activeKey={activeKey}
flowTree={flowTree}
/> />
</div> </div>
); );
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
.myOverviewDiv { .myOverviewDiv {
position: absolute; position: absolute;
height: 150px; height: 142px;
width: 300px; width: 234px;
left: 0; left: 0;
bottom: 0; bottom: 0;
background-color: #ccc; background-color: #ccc;
......
/* eslint-disable global-require */ /* eslint-disable global-require */
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { useHistory, Prompt } from 'react-router-dom'; import { useHistory, Prompt } from 'react-router-dom';
import { Button, Modal, notification, Spin, Tooltip, message } from 'antd'; import { Button, Modal, notification, Spin, Empty, Tooltip, message, TreeSelect } from 'antd';
import lodash from 'lodash'; import lodash from 'lodash';
import { import {
SaveNodeChange, SaveNodeChange,
...@@ -28,6 +28,7 @@ import gatewayParallel from '@/assets/images/workFlow/gatewayParallel.svg'; ...@@ -28,6 +28,7 @@ import gatewayParallel from '@/assets/images/workFlow/gatewayParallel.svg';
import gatewayJoin from '@/assets/images/workFlow/gatewayJoin.svg'; import gatewayJoin from '@/assets/images/workFlow/gatewayJoin.svg';
const { confirm } = Modal; const { confirm } = Modal;
const { TreeNode } = TreeSelect;
let diagram = null; let diagram = null;
let myPaletteNode = null; let myPaletteNode = null;
let myPaletteGateway = null; let myPaletteGateway = null;
...@@ -36,7 +37,7 @@ let myOverview = null; ...@@ -36,7 +37,7 @@ let myOverview = null;
const FlowChart = props => { const FlowChart = props => {
const history = useHistory(); const history = useHistory();
const { flowData, flowID, chartLoading, msg, treeVisible, activeKey } = props; const { flowData, flowID, chartLoading, msg, treeVisible, activeKey, flowTree } = props;
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const [lineVisible, setLineVisible] = useState(false); const [lineVisible, setLineVisible] = useState(false);
const [editMsg, setEditMsg] = useState({}); // 编辑节点的信息 const [editMsg, setEditMsg] = useState({}); // 编辑节点的信息
...@@ -56,6 +57,7 @@ const FlowChart = props => { ...@@ -56,6 +57,7 @@ const FlowChart = props => {
}); // 组件内得流程图数据 }); // 组件内得流程图数据
const [showLeaveTip, setShowLeaveTip] = useState(false); // 离开路由是否又提醒 const [showLeaveTip, setShowLeaveTip] = useState(false); // 离开路由是否又提醒
const [buttonLoading, setButtonLoading] = useState(); // 发布按钮保存loading const [buttonLoading, setButtonLoading] = useState(); // 发布按钮保存loading
const [selectValue, setSelectValue] = useState();
const [flag, setFlag] = useState(0); const [flag, setFlag] = useState(0);
const currentNode = useRef(); const currentNode = useRef();
const afterNodes = useRef(new Map([])); // 当前节点后所有节点 const afterNodes = useRef(new Map([])); // 当前节点后所有节点
...@@ -1228,7 +1230,28 @@ const FlowChart = props => { ...@@ -1228,7 +1230,28 @@ const FlowChart = props => {
} }
}); });
}; };
const treeChange = newValue => {
setSelectValue(newValue);
};
const mapAppTree = org => {
const haveChildren = Array.isArray(org.children) && org.children.length > 0;
let value;
let text;
if (org.name) {
value = org.name;
text = org.name;
}
if (org.Code) {
value = org.Code;
text = org.FlowName;
}
return (
<TreeNode value={value} title={text} key={value} disabled={org.name}>
{haveChildren ? org.children.map(item => mapAppTree(item)) : null}
</TreeNode>
);
};
return ( return (
<> <>
<Prompt message="编辑的内容还未保存,确定要离开该页面吗?" when={showLeaveTip} /> <Prompt message="编辑的内容还未保存,确定要离开该页面吗?" when={showLeaveTip} />
...@@ -1253,6 +1276,25 @@ const FlowChart = props => { ...@@ -1253,6 +1276,25 @@ const FlowChart = props => {
{/* <Button type="link" onClick={() => copyNode()}> {/* <Button type="link" onClick={() => copyNode()}>
复制 复制
</Button> */} </Button> */}
{/* <Button type="link" onClick={() => copyNode()}>
<TreeSelect
value={selectValue}
showSearch
style={{ width: '200px' }}
treeNodeFilterProp="title"
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="请选择流程"
treeDefaultExpandAll
onChange={treeChange}
treeIcon
>
{flowTree ? (
flowTree.map(item => mapAppTree(item))
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)}
</TreeSelect>
</Button> */}
<Button <Button
onClick={() => onClick={() =>
history.push({ history.push({
......
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