Commit cbeee6c2 authored by wuyongsheng's avatar wuyongsheng

feat: 流程编排初始化position

parent 2002b65e
......@@ -270,14 +270,14 @@ const Flow = (props: IProps) => {
return a - b;
});
let width = 176,
height = 66;
height = 12;
if (positionXArr?.length) {
const val = positionXArr[positionXArr.length - 1] + 144;
width = val > 176 ? val : width;
}
if (positionYArr?.length) {
const val = positionYArr[positionYArr.length - 1] + 74;
height = val > 66 ? val : height;
height = val > 12 ? val : height;
}
return {
width,
......
......@@ -36,7 +36,6 @@
display: flex;
position: relative;
width: 100%;
/* overflow: hidden; */
border-radius: 4px;
margin-bottom: 20px;
height: 562px;
......@@ -66,6 +65,7 @@
flex-direction: column;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
width: calc(100% - 368px);
}
.codeTitle {
background-color: #353942;
......
......@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-18 16:12:55
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-11-02 13:51:50
* @LastEditTime: 2022-11-04 15:07:53
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/components/AddOperator/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -548,7 +548,6 @@ const AddOperator = observer((props: IAddOperator) => {
}}
onBlur={paramsConfigBlur}
height={parametersError ? "486px" : "518px"}
width="600"
style={{ flex: 1 }}
/>
{parametersError ? (
......@@ -672,6 +671,7 @@ const AddOperator = observer((props: IAddOperator) => {
tasks={operatorList}
setTasks={setOperatorList}
type="edit"
defaultPosition={[300, 100]}
// onFlowNodeClick={handleNodeClick}
flowNodeDraggable={true}
ListenState={!inputActive}
......
......@@ -2,7 +2,7 @@
* @Author: 吴永生 15770852798@163.com
* @Date: 2022-10-17 14:35:11
* @LastEditors: 吴永生 15770852798@163.com
* @LastEditTime: 2022-11-01 10:59:40
* @LastEditTime: 2022-11-04 15:09:09
* @FilePath: /bkunyun/src/views/ResourceCenter/UserResources/WorkflowOperator/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -106,14 +106,7 @@ const OperatorDetails = observer(() => {
onSuccess: (res: any) => {
if (res.message === "success") {
/** 设置详情数据 */
const newData = res.data.map((item: any) => {
/** 初始化批算子偏移量 */
if (item.type === "BATCH") {
item.position = { x: 100, y: 100 };
}
return item;
});
setDetailData(newData);
setDetailData(res.data);
const filterData = res?.data?.filter((item: any) => {
return item.type === "BATCH";
});
......@@ -226,7 +219,7 @@ const OperatorDetails = observer(() => {
) : null}
{contentType === "flowChart" && !envId ? (
<div className={styles.contentBox}>
<Flow tasks={detailData} showControls={false} />
<Flow tasks={detailData} showControls={false} defaultPosition={[100, 100]}/>
</div>
) : null}
{contentType === "parameterList" || type === "FLOW" ? (
......
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