Commit cbeee6c2 authored by wuyongsheng's avatar wuyongsheng

feat: 流程编排初始化position

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