update:bug修复

This commit is contained in:
2026-03-26 17:01:09 +08:00
parent 76bc67aa9a
commit 2cb46ac13d
4 changed files with 59 additions and 75 deletions

View File

@@ -109,7 +109,7 @@
</template>
<script setup lang="ts">
import { onMounted, ref, watch } from 'vue';
import { onBeforeUnmount, onMounted, ref, watch } from 'vue';
import { delHpcJobsApi, queryHpcResourceApi, queryJobsApi, stopHpcJobApi } from '@/api/pbs/pbs';
import Dialog from '@/components/common/dialog/index.vue';
import BaseTable from '@/components/common/table/baseTable.vue';
@@ -410,8 +410,22 @@ const getJobFileListFun = async (row: any) => {
return;
};
const timer = ref<any>(null);
const refrehFun = () => {
if (baseTableRef.value) {
baseTableRef.value.resetFun();
}
};
onMounted(async () => {
await getAppInfo();
timer.value = setInterval(() => {
refrehFun();
}, 60 * 1000);
});
onBeforeUnmount(() => {
clearInterval(timer.value);
});
</script>

View File

@@ -80,8 +80,9 @@
</div>
</div>
<div class="run-flow-box" v-show="!leftFullScreen && !rightFullScreen">
<div class="flow-box-inner" v-if="runInfo.flowTemplate && showPage">
<div class="flow-box-inner" v-if="runInfo.flowTemplate">
<runFlowPage
ref="runFlowPageRef"
:run-info="runInfo"
@change="changeCurrentFlowNodeFun"
@update="updateFlowPageParamListFun"
@@ -182,7 +183,7 @@
<flowNodeParamTable
ref="flowNodeParamTableRef"
v-show="nodeActiveName === 'info' && showPage"
v-show="nodeActiveName === 'info'"
:node-params="nodeParamDataList"
:current-node="flowNode"
:page-info="flowNodeData"
@@ -451,6 +452,7 @@ const statusList = ref<any>({
error: '异常',
waiting_for_user: '待操作',
});
const runFlowPageRef = ref();
const flowNodeParamTableRef = ref();
const executeMode = ref('MANUAL');
const visible = ref(false);
@@ -560,6 +562,11 @@ const resetTableDataFun = (obj: any, list: any) => {
const currentRunNodeInfo = ref<any>({});
// 更新执行流程节点信息
const refreshFlowPage = async () => {
await runFlowPageRef.value.updateDataJsonInfoFun();
};
// 开始执行任务
const startTaskRunJobFun = async () => {
// 在开始执行任务之前,保存每个节点的参数后再调用执行任务的接口
@@ -585,8 +592,7 @@ const startTaskRunJobFun = async () => {
});
if (res && res.code === 200) {
ElMessage.success(res.message);
showPage.value = false;
refreshRunFlowInfo();
await refreshFlowPage();
emits('update', { status: RUN_STATUS.RUNNING });
// }
} else {
@@ -806,8 +812,7 @@ const continueStartRunJobFun = async () => {
flowelementType: flowNodeData.value.nodeDetailInfo.type,
});
if (res && res.code === 200) {
// showPage.value = false;
// refreshRunFlowInfo();
refreshFlowPage();
}
};
@@ -949,8 +954,7 @@ const retryFailedNodeFun = async () => {
const res: any = await retryFailedNodeApi(param);
if (res && res.code === 200) {
ElMessage.success('节点已重新执行!');
showPage.value = false;
refreshRunFlowInfo();
await refreshFlowPage();
}
} catch (error) {
console.error(error);
@@ -1165,44 +1169,14 @@ const getdeviceuuidFun = async () => {
}
};
// 刷新节点页面信息
const refreshRunFlowInfo = () => {
setTimeout(() => {
showPage.value = true;
});
};
const refreshFun = () => {
showPage.value = false;
refreshRunFlowInfo();
refreshFlowPage();
};
// const FlowNodeExecuteModeChangeFun = async () => {
// const inputParams = {
// ...flowNodeData.value.userParams,
// executeMode: executeMode.value,
// };
// const params = {
// nodeUuid: flowNodeParamData.value?.flowNodeInfo?.uuid,
// runId: props.runInfo.uuid,
// inputParams,
// };
// try {
// const res: any = await saveNodeParamsApi(params);
// if (res && res.code === 200) {
// ElMessage.success('操作成功');
// refreshFun();
// } else {
// }
// } catch {}
// };
const refreshFlowNodeParamFun = async (data: any) => {
const { flag }: any = data;
if (flag === false) {
await retryFailedNodeFun();
showPage.value = false;
refreshRunFlowInfo();
}
if (flag === true) {
@@ -1302,16 +1276,6 @@ const uploadFinishedFun = async (data: any) => {
// 开始任务执行
if (data.callbackFlag === 'START_FLOW') {
uploadFileFlag.value--;
// const res: any = await startProcessInstanceApi({
// runId: props.runInfo.uuid,
// });
// if (res && res.code === 200) {
// ElMessage.success(res.message);
// showPage.value = false;
// refreshRunFlowInfo();
// emits('update', { status: RUN_STATUS.RUNNING });
// }
}
// 重复执行失败节点
@@ -1356,13 +1320,10 @@ const timer = ref<any>(null);
onMounted(async () => {
await getDictionaryDataFun();
emitter.on('UPLOAD_FINISHED', uploadFinishedFun);
// 5分钟自动刷新一次流程信息
// timer.value = setInterval(
// () => {
// refreshFun();
// },
// 5 * 60 * 1000
// );
// 1分钟一次流程信息
timer.value = setInterval(() => {
refreshFun();
}, 60 * 1000);
});
onBeforeUnmount(() => {

View File

@@ -1,6 +1,6 @@
<template>
<div class="run-flow-page">
<div class="flow-content" id="flow-view-content" v-loading="contentLoading"></div>
<div class="flow-content" id="flow-view-content"></div>
<TeleportContainer />
</div>
</template>
@@ -65,13 +65,12 @@ const getFlowDetail = async (uuid: string) => {
ElMessage.error(res.message);
}
}
};
const dataJson = ref<any>({});
const setGraphNodeInfFun = (viewContent: any) => {
const dataJson = JSON.parse(viewContent);
dataJson.value = JSON.parse(viewContent);
// // 过滤起始节点和结束节点
const beginandend = dataJson.cells.filter((item: any) => {
const beginandend = dataJson.value.cells.filter((item: any) => {
return (
item.type === 'local' || item?.data?.label === '起始节点' || item?.data?.label === '结束节点'
);
@@ -79,14 +78,14 @@ const setGraphNodeInfFun = (viewContent: any) => {
const ids = beginandend.map((item: any) => {
return item.id;
});
dataJson.cells = dataJson.cells.filter((item: any) => {
dataJson.value.cells = dataJson.value.cells.filter((item: any) => {
return (
!ids.includes(item.id) &&
!ids.includes(item?.source?.cell) &&
!ids.includes(item?.target?.cell)
);
});
const nodes = dataJson.cells.filter((item: any) => {
const nodes = dataJson.value.cells.filter((item: any) => {
return item?.type;
});
@@ -102,23 +101,23 @@ const setGraphNodeInfFun = (viewContent: any) => {
});
// // 避免两个节点重合了
for (let i = 0; i < dataJson.cells.length; i++) {
if (dataJson.cells[i].type) {
dataJson.cells[i].size.width = 220;
const index = position.indexOf(dataJson.cells[i].position.x);
for (let i = 0; i < dataJson.value.cells.length; i++) {
if (dataJson.value.cells[i].type) {
dataJson.value.cells[i].size.width = 220;
const index = position.indexOf(dataJson.value.cells[i].position.x);
dataJson.cells[i].position.x = dataJson.cells[i].position.x + index * 70;
dataJson.value.cells[i].position.x = dataJson.value.cells[i].position.x + index * 70;
// num > 5 ? dataJson.cells[i].position.x : dataJson.cells[i].position.x + i * 20;
for (let j = 0; j < nodeDataList.value.length; j++) {
if (dataJson.cells[i].id === nodeDataList.value[j].nodeId) {
dataJson.cells[i].data.flowNodeInfo = nodeDataList.value[j];
if (dataJson.value.cells[i].id === nodeDataList.value[j].nodeId) {
dataJson.value.cells[i].data.flowNodeInfo = nodeDataList.value[j];
}
}
}
}
const paramNode = dataJson.cells.filter((item: any) => {
const paramNode = dataJson.value.cells.filter((item: any) => {
return item.type;
});
@@ -141,14 +140,14 @@ const setGraphNodeInfFun = (viewContent: any) => {
});
setTimeout(() => {
graph.value.fromJSON(dataJson);
graph.value.fromJSON(dataJson.value);
graph.value.centerContent();
contentLoading.value = false;
if (graph.value) {
setCurrentNodeFun();
}
}, 1000);
}, 500);
};
const selectNode = ref<any>({});
@@ -285,6 +284,16 @@ const setCurrentNodeFun = () => {
});
};
// 不刷新界面的情况下,更新每个节点的数据信息
const updateDataJsonInfoFun = async () => {
await querLlistSimulationFlowNode(props.runInfo.uuid);
await getFlowDetail(props.runInfo.flowTemplate);
};
defineExpose({
updateDataJsonInfoFun,
});
watch(
() => props.runInfo,
async (newVal) => {

View File

@@ -251,7 +251,7 @@ onMounted(async () => {
refrehFun();
timer.value = setInterval(() => {
refrehFun();
}, 30 * 1000);
}, 60 * 1000);
}
await getAppInfo();