fix:bug单修复

This commit is contained in:
2025-12-09 19:01:15 +08:00
parent 2c0d198c95
commit 73d3a522ab
5 changed files with 170 additions and 159 deletions

View File

@@ -1,8 +1,14 @@
<template>
<Dialog v-model="diaVisible" diaTitle="数据分析" width="90%" height="90%" @close="closeFun">
<div class="content">
<div class="filter-analysis-content">
<el-checkbox class="check-all" v-model="checkAll" label="全选" value="all" @change="checkAllChangeFun" />
<div class="filter-analysis-content" v-if="getcheckListLength()">
<el-checkbox
class="check-all"
v-model="checkAll"
label="全选"
value="all"
@change="checkAllChangeFun"
/>
<el-checkbox-group class="check-all" v-model="checkAnalysisList">
<template v-for="item in analysisTypeList" :key="item.value">
<el-checkbox
@@ -15,7 +21,12 @@
</el-checkbox-group>
<el-button @click="exportPdfFun">导出PDF</el-button>
</div>
<div class="check-table-content" id="compare-content" ref="contentToConvertRef" v-loading="isLoading">
<div
class="check-table-content"
id="compare-content"
ref="contentToConvertRef"
v-loading="isLoading"
>
<div class="loadcase-table-content">
<BaseTable
v-if="checkTableName"
@@ -34,7 +45,11 @@
</div>
<div class="analysis-type-content-item" v-if="checktableData.length">
<template v-if="item.value === 'model'">
<modelFileResult v-if="showComponents" :check-task-info="modelData" :cloumn-width="cloumnWidth">
<modelFileResult
v-if="showComponents"
:check-task-info="modelData"
:cloumn-width="cloumnWidth"
>
</modelFileResult>
</template>
<template v-if="item.value === 'calculationFile'">
@@ -52,15 +67,27 @@
></performanceAnalysis>
</template>
<template v-if="item.value === 'result'">
<cloudImage v-if="showComponents" :check-task-info="resultData" :cloumn-width="cloumnWidth">
<cloudImage
v-if="showComponents"
:check-task-info="resultData"
:cloumn-width="cloumnWidth"
>
</cloudImage>
</template>
<template v-if="item.value === 'curve'">
<curveResult v-if="showComponents" :check-task-info="curveData" :cloumn-width="cloumnWidth">
<curveResult
v-if="showComponents"
:check-task-info="curveData"
:cloumn-width="cloumnWidth"
>
</curveResult>
</template>
<template v-if="item.value === 'report'">
<reportComparison v-if="showComponents" :check-task-info="reportData" :cloumn-width="cloumnWidth">
<reportComparison
v-if="showComponents"
:check-task-info="reportData"
:cloumn-width="cloumnWidth"
>
</reportComparison>
</template>
</div>
@@ -97,7 +124,7 @@ import { getRunPerformanceApi } from '@/api/task/taskpool';
const props = defineProps({
analysisData: {
type: Object,
default: () => { },
default: () => {},
},
});
@@ -158,7 +185,6 @@ const getConvertData = async (flag: any, type: any) => {
const tasklist = checktableData.value;
if (flag === 'numericalResult') {
if (type === '仿真工况' || type === '仿真算例') {
if (type === '仿真工况') {
for (let i = 0; i < tasklist.length; i++) {
@@ -166,19 +192,16 @@ const getConvertData = async (flag: any, type: any) => {
data = data.concat(list);
}
} else {
for (let i = 0; i < tasklist.length; i++) {
const list = (await getRunPerformanceFn(tasklist[i]));
const list = await getRunPerformanceFn(tasklist[i]);
data = data.concat(list);
}
}
performanceData.value = data;
} else {
performanceData.value = checktableData.value;
}
} else if (flag === 'model') {
modelData.value = [];
if (type === '仿真工况' || type === '仿真算例') {
@@ -204,7 +227,6 @@ const getConvertData = async (flag: any, type: any) => {
} else {
modelData.value = checktableData.value;
}
} else if (flag === 'calculationFile') {
calculationFileData.value = [];
if (type === '仿真工况' || type === '仿真算例') {
@@ -218,7 +240,6 @@ const getConvertData = async (flag: any, type: any) => {
}
const runs = data || [];
if (runs.length) {
for (let i = 0; i < runs.length; i++) {
const datas = await getFileInfo(runs[i], 3);
calculationFileData.value = calculationFileData.value.concat(datas);
@@ -227,7 +248,6 @@ const getConvertData = async (flag: any, type: any) => {
} else {
calculationFileData.value = checktableData.value;
}
} else if (flag === 'result') {
resultData.value = [];
@@ -242,7 +262,6 @@ const getConvertData = async (flag: any, type: any) => {
}
const runs = data || [];
if (runs.length) {
for (let i = 0; i < runs.length; i++) {
const datas = await getFileInfo(runs[i], 5);
resultData.value = resultData.value.concat(datas);
@@ -251,7 +270,6 @@ const getConvertData = async (flag: any, type: any) => {
} else {
resultData.value = checktableData.value;
}
} else if (flag === 'curve') {
curveData.value = [];
if (type === '仿真工况' || type === '仿真算例') {
@@ -265,7 +283,6 @@ const getConvertData = async (flag: any, type: any) => {
}
const runs = data || [];
if (runs.length) {
for (let i = 0; i < runs.length; i++) {
const datas = await getFileInfo(runs[i], 4);
curveData.value = curveData.value.concat(datas);
@@ -273,13 +290,10 @@ const getConvertData = async (flag: any, type: any) => {
}
} else {
curveData.value = checktableData.value;
}
} else if (flag === 'report') {
reportData.value = [];
if (type === '仿真工况' || type === '仿真算例') {
if (type === '仿真工况') {
for (let i = 0; i < tasklist.length; i++) {
const list = (await getAllRunResultByTaskIdFun(tasklist[i].uuid))?.runs;
@@ -295,16 +309,12 @@ const getConvertData = async (flag: any, type: any) => {
reportData.value = reportData.value.concat(datas);
}
}
} else {
reportData.value = checktableData.value;
}
}
return data || [];
};
const getAllRunResultByTaskIdFun = async (id: any) => {
@@ -314,7 +324,6 @@ const getAllRunResultByTaskIdFun = async (id: any) => {
try {
const res: any = await getAllRunResultByTaskIdApi(param);
if (res && res.code === 200) {
let performanceList: any = [];
const runs: any = [];
@@ -338,12 +347,10 @@ const getAllRunResultByTaskIdFun = async (id: any) => {
}
} catch (error) {
console.log(error);
}
};
const analysisTypeList = ref<any>([
{
value: 'model',
name: '模型文件',
@@ -376,10 +383,21 @@ const analysisTypeList = ref<any>([
},
]);
const getcheckListLength = () => {
const list = analysisTypeList.value.filter((item: any) => {
return item.includes.includes(analysisType.value);
});
if (list.length > 1) {
return true;
} else {
return false;
}
};
const checkTableName = ref<any>('');
const getFileInfo = async (data: any, fileType: any) => {
console.log(data, 'datadatadata');
const res: any = await getSimulationTaskFileApi({
@@ -413,8 +431,8 @@ const getFileInfo = async (data: any, fileType: any) => {
}
};
const getRunPerformanceFn = async (data:any) => {
const res:any = await getRunPerformanceApi({
const getRunPerformanceFn = async (data: any) => {
const res: any = await getRunPerformanceApi({
runId: data.uuid,
});
@@ -425,28 +443,32 @@ const getRunPerformanceFn = async (data:any) => {
}
};
watch(() => props.analysisData, async (newVal) => {
if (newVal) {
analysisType.value = newVal.flag;
analysisTableData.value = newVal.data;
watch(
() => props.analysisData,
async (newVal) => {
if (newVal) {
analysisType.value = newVal.flag;
analysisTableData.value = newVal.data;
checkTableName.value = newVal.tableName;
const list = analysisTypeList.value.filter((item: any) => {
return item.includes.includes(analysisType.value);
});
checkTableName.value = newVal.tableName;
const list = analysisTypeList.value.filter((item: any) => {
return item.includes.includes(analysisType.value);
});
checkAnalysisList.value = list.map((item: any) => {
return item.value;
});
checkAnalysisList.value = list.map((item: any) => {
return item.value;
});
setTimeout(async () => {
checkTableRef.value?.setDataFun(analysisTableData.value);
}, 1000);
setTimeout(async () => {
checkTableRef.value?.setDataFun(analysisTableData.value);
}, 1000);
}
},
{
deep: true,
immediate: true,
}
}, {
deep: true,
immediate: true,
});
);
const checkChangeFun = (flag: any) => {
console.log(flag, 'flag');
@@ -460,14 +482,11 @@ const checkChangeFun = (flag: any) => {
checkAll.value = true;
} else {
checkAll.value = false;
}
};
const checkAll = ref(true);
const checkAllChangeFun = () => {
const list = analysisTypeList.value.filter((item: any) => {
return item.includes.includes(analysisType.value);
});
@@ -501,7 +520,6 @@ const exportPdfFun = async () => {
pdf.addImage(imgData, 'PNG', 0, 0, imgWidth, imgHeight);
pdf.save(`分析报告_${dayjs().format('YYYYMMDDHHmm')}.pdf`); // 保存PDF文件
};
</script>
<style lang="scss" scoped>
@@ -524,10 +542,10 @@ const exportPdfFun = async () => {
.check-table-content {
width: 100%;
padding: 20px;
.loadcase-table-content {
width: 100%;
}
.analysis-type-content {
@@ -545,14 +563,12 @@ const exportPdfFun = async () => {
font-size: 16px;
font-weight: 600;
}
}
.analysis-type-content-item {
width: 100%;
}
}
}
}
</style>

View File

@@ -184,10 +184,8 @@
:head="compareListHead"
:table-name="''"
:hide-pagination="true"
:action-list="cmpareActionList"
>
<template #operate="{ row }">
<el-button type="danger" link @click="deleteCompareDataFun(row)">删除</el-button>
</template>
</BaseTable>
</div>
</Dialog>
@@ -693,11 +691,6 @@ const compareListHead = ref([
key: 'compareType',
isShow: true,
},
{
title: '操作',
key: 'operate',
isShow: true,
},
]);
const compareListVisible = ref(false);
@@ -770,6 +763,16 @@ const updatePerformanceFun = async (data: any) => {
}
};
const cmpareActionList = ref([
{
title: '删除',
type: 'danger',
click: (row: any) => {
deleteCompareDataFun(row)
},
},
])
onMounted(() => {
getProjectOptionsFun();
});

View File

@@ -33,18 +33,17 @@
<el-icon class="info" title="未开始" v-else>
<InfoFilled />
</el-icon>
<span class="status-title">{{
currentRunNodeInfo?.status ? statusList[currentRunNodeInfo?.status] : '未开始'
}}</span>
</div>
</div>
<div class="task-time">
节点执行时间
作业流执行时间
<el-icon class="blue">
<Odometer />
</el-icon>
<span class="name"> {{ flowNodeData?.nodeDetailInfo?.durationFormatted || '--' }}</span>
<span class="name"> {{ runFlowPocesInfo.durationFormatted || '--' }}</span>
</div>
</div>
<div class="task-operate">
@@ -161,32 +160,27 @@ import { continueServiceTaskApi } from '@/api/flowable/process';
const props = defineProps({
runInfo: {
type: Object,
default: () => { },
default: () => {},
},
});
const statusList = ref([
'未开始', '进行中', '已完成', '回传中', '异常',
]);
const statusList = ref(['未开始', '进行中', '已完成', '回传中', '异常']);
const visible = ref(false);
const nodeActiveName = ref('param');
const taskActiveName = ref('job-list');
const showPage = ref(true);
const handleLeftClickFun = () => {
const handleLeftClickFun = () => {};
};
const handleRightClickFun = () => {
};
const handleRightClickFun = () => {};
const nodeParamDataList = ref<any>([]);
const flowNode = ref<any>({});
const flowNodeData = ref<any>({});
const flowNodeParamData = ref<any>({});
const runFlowPocesInfo = ref<any>({});
const changeCurrentFlowNodeFun = (info: any) => {
const { node, data }: any = info;
const { node, data, process }: any = info;
console.log(info, 'info');
@@ -194,7 +188,7 @@ const changeCurrentFlowNodeFun = (info: any) => {
flowNodeData.value = data;
nodeParamDataList.value = flowNode.value?.store?.data?.data?.pageConfigList || [];
flowNodeParamData.value = flowNode.value?.store?.data?.data || {};
runFlowPocesInfo.value = process;
};
const currentRunNodeInfo = ref<any>({});
@@ -212,7 +206,6 @@ const startTaskRunJobFun = async () => {
};
const continueStartRunJobFun = async () => {
const res: any = await continueServiceTaskApi({
processInstanceId: flowNodeData.value.processInstanceId,
taskDefinitionKey: flowNodeData.value.nodeId,
@@ -222,12 +215,10 @@ const continueStartRunJobFun = async () => {
showPage.value = false;
refreshRunFlowInfo();
}
};
// 启动应用
const startLocalAppFun = async () => {
if (flowNodeParamData.value?.nodeTypeValue != '1') {
ElMessage.warning('只有本地应用才能手动启动');
return;
@@ -237,23 +228,18 @@ const startLocalAppFun = async () => {
await getdeviceuuidFun();
const uuid = localStorage.getItem('USER_UUID');
if (uuid) {
const res = await execApi({
path: appPath,
param: '',
});
if (res) {
ElMessage.success('应用正在启动中,请等待');
} else {
}
} else {
return;
}
};
const getdeviceuuidFun = async () => {
@@ -278,9 +264,7 @@ const getdeviceuuidFun = async () => {
const refreshRunFlowInfo = () => {
setTimeout(() => {
showPage.value = true;
});
};
const refreshFun = () => {
@@ -288,16 +272,18 @@ const refreshFun = () => {
refreshRunFlowInfo();
};
watch(() => props.runInfo, (newVal) => {
if (newVal) {
currentRunNodeInfo.value = newVal;
watch(
() => props.runInfo,
(newVal) => {
if (newVal) {
currentRunNodeInfo.value = newVal;
}
},
{
immediate: true,
deep: true,
}
}, {
immediate: true,
deep: true,
});
);
</script>
<style lang="scss" scoped>

View File

@@ -70,7 +70,7 @@ onMounted(() => {
if (getNode) {
const node = getNode();
// console.log('getNode()', node, node.getData());
console.log('getNode()', node, node.getData());
const data = node.getData();
if (data?.label) {
appProperty.name = data.label;

View File

@@ -1,5 +1,5 @@
<template>
<div class="run-flow-page" >
<div class="run-flow-page">
<div class="flow-content" id="flow-view-content" v-loading="contentLoading"></div>
</div>
</template>
@@ -29,56 +29,67 @@ const graph = ref<any>();
const flowName = ref<any>();
const nodeDataList = ref<any>([]);
const querLlistSimulationFlowNode = async (id:any) => {
const res:any = await listSimulationFlowNodeApi({
const runProcessInfo = ref<any>({});
const querLlistSimulationFlowNode = async (id: any) => {
const res: any = await listSimulationFlowNodeApi({
runId: id,
});
if (res && res.code === 200) {
nodeDataList.value = res.data;
nodeDataList.value = res.data.flowNodeDtoList ;
runProcessInfo.value = res.data.processInfo;
} else {
nodeDataList.value = [];
runProcessInfo.value = {};
}
};
const getFlowDetail = async(uuid:string) => {
const getFlowDetail = async (uuid: string) => {
contentLoading.value = true;
const res:any = await queryFlowTemplateDetailApi({ uuid: uuid, status: 1 });
const res: any = await queryFlowTemplateDetailApi({ uuid: uuid, status: 1 });
if (res.code === 200) {
if (res.data.viewContent.length > 50) {
const dataJson = JSON.parse(res.data.viewContent);
// // 过滤起始节点和结束节点
const beginandend = dataJson.cells.filter((item:any) => {
return item.type === 'local' || item?.data?.label === '起始节点' || item?.data?.label === '结束节点';
const beginandend = dataJson.cells.filter((item: any) => {
return (
item.type === 'local' ||
item?.data?.label === '起始节点' ||
item?.data?.label === '结束节点'
);
});
const ids = beginandend.map((item:any) => {
const ids = beginandend.map((item: any) => {
return item.id;
});
dataJson.cells = dataJson.cells.filter((item:any) => {
return !ids.includes(item.id) && !ids.includes(item?.source?.cell) && !ids.includes(item?.target?.cell);
dataJson.cells = dataJson.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.cells.filter((item: any) => {
return item?.type;
});
// 改变各个节点之间的距离
let position = nodes.map((item:any) => {
let position = nodes.map((item: any) => {
return item?.position?.x;
});
position = objectTypeArrayRemovesDuplicates(position, 2);
for (let i = 0;i < position.length;i++) {
for (let j = 0;j < dataJson.cells.length;j++) {
for (let i = 0; i < position.length; i++) {
for (let j = 0; j < dataJson.cells.length; j++) {
if (dataJson.cells[j]?.position?.x === position[i]) {
dataJson.cells[j].rank = i + 1;
}
}
}
for (let i = 0;i < dataJson.cells.length;i++) {
if (dataJson.cells[i].type ) {
for (let i = 0; i < dataJson.cells.length; i++) {
if (dataJson.cells[i].type) {
dataJson.cells[i].size.width = 220;
dataJson.cells[i].position.x = dataJson.cells[i].position.x + dataJson.cells[i].rank * 70;
for (let j = 0;j < nodeDataList.value.length;j++) {
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];
}
@@ -87,7 +98,7 @@ const getFlowDetail = async(uuid:string) => {
}
console.log(dataJson, 'dataJson');
console.log( graph.value, ' graph.value');
console.log(graph.value, ' graph.value');
setTimeout(() => {
graph.value.fromJSON(dataJson);
@@ -104,7 +115,7 @@ const getFlowDetail = async(uuid:string) => {
};
const selectNode = ref<any>({});
const initGraph = async() => {
const initGraph = async () => {
graph.value = new Graph({
panning: {
enabled: true,
@@ -128,10 +139,10 @@ const initGraph = async() => {
const nodeList = await getNodeList();
createNode(nodeList, graph.value);
graph.value.on('node:click', ({ node }:any) => {
graph.value.on('node:click', ({ node }: any) => {
selectNode.value = node;
const allNodes = graph.value.getNodes();
for (let i = 0;i < allNodes.length;i++) {
for (let i = 0; i < allNodes.length; i++) {
if (selectNode.value.id === allNodes[i].id) {
allNodes[i].addTools({
name: 'boundary',
@@ -154,30 +165,30 @@ const initGraph = async() => {
}
}
const data = nodeDataList.value.find((item:any) => {
const data = nodeDataList.value.find((item: any) => {
return item.nodeId === node.id;
});
emits('change', {
node,
data,
process: runProcessInfo.value,
});
});
};
// 设置默认点击节点
const setCurrentNodeFun = () => {
const allNodes = graph.value.getNodes();
const currentId = localStorage.getItem('CURRENT_RUN_FLOW_NODE_INFO') || '';
let currentNodes:any = {};
let currentNodes: any = {};
if (currentId) {
currentNodes = allNodes.find((item:any) => {
return item.id === currentId;
}) || allNodes[0];
currentNodes =
allNodes.find((item: any) => {
return item.id === currentId;
}) || allNodes[0];
currentNodes.addTools({
name: 'boundary',
@@ -193,9 +204,7 @@ const setCurrentNodeFun = () => {
},
},
});
} else {
currentNodes = allNodes[0];
currentNodes.addTools({
@@ -214,59 +223,56 @@ const setCurrentNodeFun = () => {
});
}
const data = nodeDataList.value.find((item:any) => {
const data = nodeDataList.value.find((item: any) => {
return item.nodeId === currentNodes.id;
});
emits('change', {
node: currentNodes,
data: data,
process: runProcessInfo.value,
});
};
watch(() => props.runInfo, async (newVal) => {
if (newVal) {
// currentRunNodeInfo.value = newVal;
// await initGraph();
// await getFlowDetail(currentRunNodeInfo.value.flowTemplate);
// await querLlistSimulationFlowNode(currentRunNodeInfo.value.uuid);
watch(
() => props.runInfo,
async (newVal) => {
if (newVal) {
// currentRunNodeInfo.value = newVal;
// await initGraph();
// await getFlowDetail(currentRunNodeInfo.value.flowTemplate);
// await querLlistSimulationFlowNode(currentRunNodeInfo.value.uuid);
}
},
{
immediate: true,
deep: true,
}
}, {
immediate: true,
deep: true,
});
);
onMounted( async() => {
setTimeout( async() => {
onMounted(async () => {
setTimeout(async () => {
if (props.runInfo) {
await initGraph();
await querLlistSimulationFlowNode(props.runInfo.uuid);
await getFlowDetail(props.runInfo.flowTemplate);
}
});
setTimeout(() => {
setCurrentNodeFun();
}, 3000);
});
</script>
<style lang="scss" scoped>
.run-flow-page {
width: 100%;
height: 100%;
.run-flow-page{
.flow-content {
width: 100%;
height: 100%;
.flow-content{
width: 100%;
height: 100%;
}
}
}
</style>