merge
This commit is contained in:
@@ -196,7 +196,13 @@ const hasFilterField = ref(false);
|
||||
watch(
|
||||
() => formData.value,
|
||||
(newVal) => {
|
||||
hasFilterField.value = Object.values({ ...newVal, ...props.extraFilters }).some((item) => item);
|
||||
hasFilterField.value = Object.values({ ...newVal, ...props.extraFilters }).some((item) => {
|
||||
// 排除空数组、空字符串、null、undefined和0
|
||||
if (Array.isArray(item)) {
|
||||
return item.length > 0;
|
||||
}
|
||||
return Boolean(item);
|
||||
});
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
ref="inputModelTableRef"
|
||||
tableName="DATA_SEARCH"
|
||||
:api="getFileListApiFun"
|
||||
:params="getParamsByTypeFun(FILE_TYPE.MODEL_FILE)"
|
||||
:params="getParamsByTypeFun(FILE_TYPE.MODEL_3D_FILE)"
|
||||
showIndex
|
||||
:fullHeight="true"
|
||||
hideSearch
|
||||
|
||||
@@ -76,7 +76,7 @@ const flowRef = ref();
|
||||
const currentNodeId = ref('inputModel');
|
||||
|
||||
const nodeLabelsKey: Record<string, string> = {
|
||||
inputModel: '数据谱系.输入模型',
|
||||
inputModel: '数据谱系.3D模型',
|
||||
simParams: '数据谱系.仿真参数',
|
||||
calcModel: '数据谱系.计算模型',
|
||||
calcResult: '数据谱系.计算结果',
|
||||
|
||||
@@ -33,7 +33,7 @@ const nodeGap = computed(() => (locale.value === 'EN' ? 40 : 60));
|
||||
|
||||
const taskFlowNodesConfig = computed(() => {
|
||||
const baseNodes = [
|
||||
{ id: 'inputModel', labelKey: '数据谱系.输入模型' },
|
||||
{ id: 'inputModel', labelKey: '数据谱系.3D模型' },
|
||||
{ id: 'calcModel', labelKey: '数据谱系.计算模型' },
|
||||
{ id: 'keyResult', labelKey: '数据谱系.关键结果' },
|
||||
{ id: 'simReport', labelKey: '数据谱系.仿真报告' },
|
||||
@@ -46,7 +46,7 @@ const taskFlowNodesConfig = computed(() => {
|
||||
});
|
||||
|
||||
const runFlowNodesConfig = [
|
||||
{ id: 'inputModel', labelKey: '数据谱系.输入模型' },
|
||||
{ id: 'inputModel', labelKey: '数据谱系.3D模型' },
|
||||
{ id: 'simParams', labelKey: '数据谱系.仿真参数' },
|
||||
{ id: 'calcModel', labelKey: '数据谱系.计算模型' },
|
||||
{ id: 'calcResult', labelKey: '数据谱系.计算结果' },
|
||||
|
||||
@@ -440,11 +440,11 @@ const changeCurrentFlowNodeFun = (info: any) => {
|
||||
onlineFileParam.value = {
|
||||
processDefinitionId: process.processDefinitionId,
|
||||
runId: data.runId,
|
||||
nodeId: data.uuid,
|
||||
nodeId: data.nodeId,
|
||||
beforeNodeId: flowNodeParamData.value?.beforeNodeId,
|
||||
regexConfig: {
|
||||
masterFileRegularStr: '^aa\\.xml$',
|
||||
inputFilesRegularStr: '^.+\\.json$',
|
||||
masterFileRegularStr: base64ToStrFun(flowNodeParamData.value?.inputFormat) || '',
|
||||
inputFilesRegularStr: base64ToStrFun(flowNodeParamData.value?.outputFormat) || '',
|
||||
},
|
||||
};
|
||||
const params = data.userParams;
|
||||
|
||||
@@ -80,35 +80,70 @@ const getSimulationFlowNodeInfoFun = async (info: any) => {
|
||||
const list = res.data.flowNodeDtoList.filter((item: any) => {
|
||||
return item.nodeName != '起始节点' && item.nodeName != '结束节点';
|
||||
});
|
||||
treeData.value = [];
|
||||
// treeData.value = list.map((item: any) => {
|
||||
// const listChild = [
|
||||
// {
|
||||
// originalName: '输入数据',
|
||||
// id: item.inputDirId,
|
||||
// children: [],
|
||||
// dataType: 1,
|
||||
// // hasChild: 'hasChild',
|
||||
// },
|
||||
// {
|
||||
// originalName: '输出数据',
|
||||
// id: item.outputDirId,
|
||||
// children: [],
|
||||
// dataType: 1,
|
||||
// // hasChild: 'hasChild',
|
||||
// },
|
||||
// ];
|
||||
|
||||
treeData.value = list.map((item: any) => {
|
||||
const listChild = [
|
||||
// const obj: any = {
|
||||
// ...item,
|
||||
// originalName: item.nodeName,
|
||||
// children: listChild,
|
||||
// dataType: 1,
|
||||
// hasChild: 'hasChild',
|
||||
// };
|
||||
|
||||
// return obj;
|
||||
// });
|
||||
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const listChild: any = [
|
||||
{
|
||||
originalName: '输入数据',
|
||||
id: item.inputDirId,
|
||||
children: [],
|
||||
id: list[i].inputDirId,
|
||||
children: await queryRunDirFun({ id: list[i].inputDirId }),
|
||||
dataType: 1,
|
||||
hasChild: 'hasChild',
|
||||
// hasChild: 'hasChild',
|
||||
},
|
||||
{
|
||||
originalName: '输出数据',
|
||||
id: item.outputDirId,
|
||||
children: [],
|
||||
id: list[i].outputDirId,
|
||||
children: await queryRunDirFun({ id: list[i].outputDirId }),
|
||||
dataType: 1,
|
||||
hasChild: 'hasChild',
|
||||
// hasChild: 'hasChild',
|
||||
},
|
||||
];
|
||||
|
||||
for (let j = 0; j < listChild.length; j++) {
|
||||
if (listChild[j].children?.length) {
|
||||
listChild[j].hasChild = true;
|
||||
}
|
||||
}
|
||||
|
||||
const obj: any = {
|
||||
...item,
|
||||
originalName: item.nodeName,
|
||||
...list[i],
|
||||
originalName: list[i].nodeName,
|
||||
children: listChild,
|
||||
dataType: 1,
|
||||
hasChild: 'hasChild',
|
||||
};
|
||||
|
||||
return obj;
|
||||
});
|
||||
treeData.value.push(obj);
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
};
|
||||
@@ -116,51 +151,58 @@ const getSimulationFlowNodeInfoFun = async (info: any) => {
|
||||
const currentRunInfo = ref<any>({});
|
||||
|
||||
const getChildFun = async (row: any) => {
|
||||
const listChild = [
|
||||
{
|
||||
originalName: '输入数据',
|
||||
id: row.inputDirId,
|
||||
children: [],
|
||||
dataType: 1,
|
||||
hasChild: 'hasChild',
|
||||
},
|
||||
{
|
||||
originalName: '输出数据',
|
||||
id: row.outputDirId,
|
||||
children: [],
|
||||
dataType: 1,
|
||||
hasChild: 'hasChild',
|
||||
},
|
||||
];
|
||||
// const listChild = [
|
||||
// {
|
||||
// originalName: '输入数据',
|
||||
// id: row.inputDirId,
|
||||
// children: [],
|
||||
// dataType: 1,
|
||||
// hasChild: 'hasChild',
|
||||
// },
|
||||
// {
|
||||
// originalName: '输出数据',
|
||||
// id: row.outputDirId,
|
||||
// children: [],
|
||||
// dataType: 1,
|
||||
// hasChild: 'hasChild',
|
||||
// },
|
||||
// ];
|
||||
|
||||
if (row?.outputDirId && row?.inputDirId) {
|
||||
return listChild;
|
||||
} else {
|
||||
return queryRunDirFun(row.id);
|
||||
if (row.children?.length) {
|
||||
return row.children;
|
||||
}
|
||||
// else if (row?.outputDirId && row?.inputDirId) {
|
||||
// return listChild;
|
||||
// }
|
||||
else {
|
||||
return await queryRunDirFun(row);
|
||||
}
|
||||
};
|
||||
|
||||
const queryRunDirFun = async (id: any) => {
|
||||
const queryRunDirFun = async (data: any) => {
|
||||
const param = {
|
||||
current: 1,
|
||||
fileId: id,
|
||||
fileId: data.id,
|
||||
size: 9999,
|
||||
};
|
||||
let result: any = [];
|
||||
|
||||
try {
|
||||
const res: any = await queryRunDirApi(param);
|
||||
if (res && res.code === 200) {
|
||||
return res.data.data.map((item: any) => {
|
||||
result = res.data.data.map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
achieveType: null,
|
||||
hasChild: item.dataType === 1 ? true : false,
|
||||
};
|
||||
});
|
||||
return result;
|
||||
} else {
|
||||
return [];
|
||||
return result;
|
||||
}
|
||||
} catch {
|
||||
return [];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ const emits = defineEmits(['change', 'update', 'execute']);
|
||||
const contentLoading = ref(false);
|
||||
|
||||
const graph = ref<any>();
|
||||
const flowName = ref<any>();
|
||||
|
||||
const nodeDataList = ref<any>([]);
|
||||
const runProcessInfo = ref<any>({});
|
||||
@@ -48,98 +47,108 @@ const querLlistSimulationFlowNode = async (id: any) => {
|
||||
|
||||
const getFlowDetail = async (uuid: string) => {
|
||||
contentLoading.value = true;
|
||||
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 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)
|
||||
);
|
||||
});
|
||||
const nodes = dataJson.cells.filter((item: any) => {
|
||||
return item?.type;
|
||||
});
|
||||
|
||||
// // 改变各个节点之间的距离
|
||||
let position = nodes.map((item: any) => {
|
||||
return item?.position?.x;
|
||||
});
|
||||
position = objectTypeArrayRemovesDuplicates(position, 2);
|
||||
let viewContent: any = props.runInfo?.viewContent || '';
|
||||
|
||||
// const num = dataJson.cells.length;
|
||||
position.sort((a: any, b: any) => {
|
||||
return a - b;
|
||||
});
|
||||
|
||||
// // 避免两个节点重合了
|
||||
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);
|
||||
|
||||
dataJson.cells[i].position.x = dataJson.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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const paramNode = dataJson.cells.filter((item: any) => {
|
||||
return item.type;
|
||||
});
|
||||
|
||||
const nodeConfigList: any = {};
|
||||
for (let i = 0; i < paramNode.length; i++) {
|
||||
nodeConfigList[paramNode[i].data.label] = paramNode[i].data.pageConfigList;
|
||||
}
|
||||
|
||||
const userDetaileParams: any = {};
|
||||
|
||||
for (let i = 0; i < nodeDataList.value.length; i++) {
|
||||
userDetaileParams[nodeDataList.value[i].nodeName] = nodeDataList.value[i].userParams;
|
||||
}
|
||||
|
||||
emits('update', {
|
||||
list: nodeConfigList,
|
||||
param: userDetaileParams,
|
||||
nodeDatas: nodeDataList.value,
|
||||
flowNodeInfos: paramNode,
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
graph.value.fromJSON(dataJson);
|
||||
graph.value.centerContent();
|
||||
contentLoading.value = false;
|
||||
|
||||
if (graph.value) {
|
||||
setCurrentNodeFun();
|
||||
}
|
||||
}, 1000);
|
||||
} else {
|
||||
contentLoading.value = false;
|
||||
}
|
||||
flowName.value = res.data.templateName;
|
||||
if (viewContent?.length > 50) {
|
||||
setGraphNodeInfFun(viewContent);
|
||||
} else {
|
||||
ElMessage.error(res.message);
|
||||
const res: any = await queryFlowTemplateDetailApi({ uuid: uuid, status: 1 });
|
||||
if (res.code === 200) {
|
||||
if (res.data.viewContent.length > 50) {
|
||||
viewContent = res.data.viewContent;
|
||||
setGraphNodeInfFun(viewContent);
|
||||
} else {
|
||||
contentLoading.value = false;
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(res.message);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const setGraphNodeInfFun = (viewContent: any) => {
|
||||
const dataJson = JSON.parse(viewContent);
|
||||
// // 过滤起始节点和结束节点
|
||||
const beginandend = dataJson.cells.filter((item: any) => {
|
||||
return (
|
||||
item.type === 'local' || item?.data?.label === '起始节点' || item?.data?.label === '结束节点'
|
||||
);
|
||||
});
|
||||
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)
|
||||
);
|
||||
});
|
||||
const nodes = dataJson.cells.filter((item: any) => {
|
||||
return item?.type;
|
||||
});
|
||||
|
||||
// // 改变各个节点之间的距离
|
||||
let position = nodes.map((item: any) => {
|
||||
return item?.position?.x;
|
||||
});
|
||||
position = objectTypeArrayRemovesDuplicates(position, 2);
|
||||
|
||||
// const num = dataJson.cells.length;
|
||||
position.sort((a: any, b: any) => {
|
||||
return a - b;
|
||||
});
|
||||
|
||||
// // 避免两个节点重合了
|
||||
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);
|
||||
|
||||
dataJson.cells[i].position.x = dataJson.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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const paramNode = dataJson.cells.filter((item: any) => {
|
||||
return item.type;
|
||||
});
|
||||
|
||||
const nodeConfigList: any = {};
|
||||
for (let i = 0; i < paramNode.length; i++) {
|
||||
nodeConfigList[paramNode[i].data.label] = paramNode[i].data.pageConfigList;
|
||||
}
|
||||
|
||||
const userDetaileParams: any = {};
|
||||
|
||||
for (let i = 0; i < nodeDataList.value.length; i++) {
|
||||
userDetaileParams[nodeDataList.value[i].nodeName] = nodeDataList.value[i].userParams;
|
||||
}
|
||||
|
||||
emits('update', {
|
||||
list: nodeConfigList,
|
||||
param: userDetaileParams,
|
||||
nodeDatas: nodeDataList.value,
|
||||
flowNodeInfos: paramNode,
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
graph.value.fromJSON(dataJson);
|
||||
graph.value.centerContent();
|
||||
contentLoading.value = false;
|
||||
|
||||
if (graph.value) {
|
||||
setCurrentNodeFun();
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
const selectNode = ref<any>({});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="gl-page-content-grey-full">
|
||||
<div class="content">
|
||||
<div class="chart-box">
|
||||
<EchartCard
|
||||
<commonFilterChart
|
||||
:title="$t('统计分析.任务完成统计机台')"
|
||||
:charts-id="'chart-4'"
|
||||
:bar-type="'barChart'"
|
||||
@@ -10,10 +10,10 @@
|
||||
:option="taskCompletionAtWorkstations"
|
||||
:showChangeModel="true"
|
||||
>
|
||||
</EchartCard>
|
||||
</commonFilterChart>
|
||||
</div>
|
||||
<div class="chart-box">
|
||||
<EchartCard
|
||||
<commonFilterChart
|
||||
:title="$t('统计分析.任务完成统计学科')"
|
||||
:charts-id="'chart-5'"
|
||||
:bar-type="'barChart'"
|
||||
@@ -21,11 +21,11 @@
|
||||
:option="taskCompletionAtDisciplineOption"
|
||||
:showChangeModel="true"
|
||||
>
|
||||
</EchartCard>
|
||||
</commonFilterChart>
|
||||
</div>
|
||||
<!-- 新增 任务达成统计 工位/学科 -->
|
||||
<div class="chart-box">
|
||||
<EchartCard
|
||||
<commonFilterChart
|
||||
:title="$t('统计分析.任务达成统计机台')"
|
||||
:charts-id="'chart-Quality-1'"
|
||||
:bar-type="'barChart'"
|
||||
@@ -33,10 +33,10 @@
|
||||
:option="taskAchieveAtWorkstations"
|
||||
:showChangeModel="true"
|
||||
>
|
||||
</EchartCard>
|
||||
</commonFilterChart>
|
||||
</div>
|
||||
<div class="chart-box">
|
||||
<EchartCard
|
||||
<commonFilterChart
|
||||
:title="$t('统计分析.任务达成统计学科')"
|
||||
:charts-id="'chart-Quality-2'"
|
||||
:bar-type="'barChart'"
|
||||
@@ -44,10 +44,10 @@
|
||||
:option="taskAchieveAtDisciplineOption"
|
||||
:showChangeModel="true"
|
||||
>
|
||||
</EchartCard>
|
||||
</commonFilterChart>
|
||||
</div>
|
||||
<div class="chart-box">
|
||||
<EchartCard
|
||||
<commonFilterChart
|
||||
:title="$t('统计分析.指标完成统计机台')"
|
||||
:charts-id="'chart-6'"
|
||||
:bar-type="'barChart'"
|
||||
@@ -55,10 +55,10 @@
|
||||
:option="performanceCompletionAtWorkstationsOption"
|
||||
:showChangeModel="true"
|
||||
>
|
||||
</EchartCard>
|
||||
</commonFilterChart>
|
||||
</div>
|
||||
<div class="chart-box">
|
||||
<EchartCard
|
||||
<commonFilterChart
|
||||
:title="$t('统计分析.指标完成统计学科')"
|
||||
:charts-id="'chart-7'"
|
||||
:bar-type="'barChart'"
|
||||
@@ -66,10 +66,10 @@
|
||||
:option="performanceCompletionAtDisciplineOption"
|
||||
:showChangeModel="true"
|
||||
>
|
||||
</EchartCard>
|
||||
</commonFilterChart>
|
||||
</div>
|
||||
<div class="chart-box">
|
||||
<EchartCard
|
||||
<commonFilterChart
|
||||
:title="$t('统计分析.成员任务进度统计')"
|
||||
:charts-id="'chart-2'"
|
||||
:bar-type="'barChart'"
|
||||
@@ -77,10 +77,10 @@
|
||||
:option="userTaskCompleteOption"
|
||||
:showChangeModel="true"
|
||||
>
|
||||
</EchartCard>
|
||||
</commonFilterChart>
|
||||
</div>
|
||||
<div class="chart-box">
|
||||
<EchartCard
|
||||
<commonFilterChart
|
||||
:title="$t('统计分析.难度系数统计')"
|
||||
:charts-id="'chart-3'"
|
||||
:bar-type="'barChart'"
|
||||
@@ -88,7 +88,7 @@
|
||||
:option="userDifficultyCoefficientOption"
|
||||
:showChangeModel="true"
|
||||
>
|
||||
</EchartCard>
|
||||
</commonFilterChart>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -96,7 +96,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, watchEffect } from 'vue';
|
||||
import EchartCard from '@/components/common/echartCard/index.vue';
|
||||
import commonFilterChart from '@/components/common/echartCard/commonFilterChart.vue';
|
||||
import {
|
||||
getTaskCompleteStatisticsApi,
|
||||
getTaskAchieveStatisticsApi,
|
||||
|
||||
Reference in New Issue
Block a user