This commit is contained in:
2025-12-11 10:15:56 +08:00
parent 74d33b8f0d
commit 9776e2ba00
7 changed files with 146 additions and 108 deletions

View File

@@ -2,12 +2,13 @@
<div class="comp-content">
<el-dialog
:title="diaTitle"
@open="openFun"
draggable
:close-on-click-modal="false"
append-to-body
v-bind="$attrs"
@open="openFun"
>
<template v-for="(name) in Object.keys($slots)" :key="name" #[name]="scope">
<template v-for="name in Object.keys($slots)" :key="name" #[name]="scope">
<slot :name="name" v-bind="scope" />
</template>
</el-dialog>
@@ -34,7 +35,8 @@ withDefaults(defineProps<Props>(), {
});
const emit = defineEmits(['show']);
const openFun = () => { // 兼容vxe-modal
const openFun = () => {
// 兼容vxe-modal
emit('show');
};
</script>

View File

@@ -170,7 +170,7 @@ const props = defineProps({
},
runInfo: {
type: Object,
default: () => { },
default: () => {},
},
});
@@ -214,12 +214,9 @@ const saveNodeParamFun = async () => {
};
const setDataToParam = async (list: any, obj: any, isUpload?: any) => {
for (let i = 0; i < list.length; i++) {
if (list[i].englishLabel) {
if (list[i].tagType === WIDGET_TYPE.FILE && list[i]?.fileList?.length) {
const fileList = list[i]?.fileList;
const arrs: any = [];
for (let j = 0; j < fileList.length; j++) {
@@ -245,31 +242,33 @@ const uploadRunFilesFun = async (file: any) => {
fileType: 1,
};
await uploadRunFilesApi(param).then(async (res: any) => {
if (res.code === 200) {
await uploadRunFilesApi(param)
.then(async (res: any) => {
if (res.code === 200) {
return {
fileName: name,
};
}
})
.finally(() => {
return {
fileName: name,
};
}
}).finally(() => {
return {
fileName: name,
};
});
});
};
const getFileNameList = (list: any) => {
let names: any = '';
if (list?.length) {
names = list.map((item: any) => {
return item.fileName;
}).join(',');
names = list
.map((item: any) => {
return item.fileName;
})
.join(',');
}
return names;
};
// 参数入库
@@ -287,7 +286,6 @@ const paramToLibFun = async () => {
});
parameterArchiveVisible.value = true;
};
//
@@ -296,7 +294,6 @@ const referenceParamFun = () => {
};
const updateParamInfoFun = (data: any) => {
for (let i = 0; i < data.length; i++) {
for (let j = 0; j < tableData.value.length; j++) {
if (data[i].parameterName === tableData.value[j].englishLabel) {
@@ -309,7 +306,7 @@ const updateParamInfoFun = (data: any) => {
// 设置特殊的参数信息
const setSpecialParamData = (param: any) => {
console.log(props.runInfo);
console.log(props.runInfo);
param.taskId = props.runInfo.taskId;
param.taskName = props.runInfo.parentName;
@@ -319,44 +316,44 @@ console.log(props.runInfo);
param.software = '电池仿真';
};
watch(() => props.nodeParams, (newVal) => {
if (newVal) {
// const paramData = nodeParamData.value?.pageConfigList || [];
tableData.value = cloneDeep(newVal);
for (let i = 0; i < tableData.value.length; i++) {
if (tableData.value[i].englishLabel === 'jobName') {
tableData.value[i].defaultValue = '测试任务' + new Date().getTime();
}
}
formatDataFun(tableData.value, 0);
if (props.pageInfo) {
const saveParam: any = props.pageInfo?.userParams || '';
if (saveParam) {
for (let i = 0; i < tableData.value.length; i++) {
for (const key in saveParam) {
if (tableData.value[i].englishLabel === key) {
tableData.value[i].defaultValue = saveParam[key];
}
}
watch(
() => props.nodeParams,
(newVal) => {
if (newVal) {
// const paramData = nodeParamData.value?.pageConfigList || [];
tableData.value = cloneDeep(newVal);
for (let i = 0; i < tableData.value.length; i++) {
if (tableData.value[i].englishLabel === 'jobName') {
tableData.value[i].defaultValue = '测试任务' + new Date().getTime();
}
}
}
nextTick(() => {
baseTableRef.value.setDataFun(tableData.value);
});
formatDataFun(tableData.value, 0);
if (props.pageInfo) {
const saveParam: any = props.pageInfo?.userParams || '';
if (saveParam) {
for (let i = 0; i < tableData.value.length; i++) {
for (const key in saveParam) {
if (tableData.value[i].englishLabel === key) {
tableData.value[i].defaultValue = saveParam[key];
}
}
}
}
}
nextTick(() => {
baseTableRef.value.setDataFun(tableData.value);
});
}
},
{
immediate: true,
deep: true,
}
}, {
immediate: true,
deep: true,
}
);
</script>

View File

@@ -11,7 +11,7 @@
<flowTemplateSelect v-model="selectedFlowTemplate" />
</template>
<template #form-standard>
<knowledgeSelect v-model="standard"/>
<knowledgeSelect v-model="standard" />
</template>
</TableForm>
</div>
@@ -29,7 +29,7 @@ import { disposeTagKey } from '@/views/task/projectDetail/components/project';
const props = defineProps({
taskInfo: {
type: Object,
default: () => { },
default: () => {},
},
tableName: {
type: String,
@@ -63,32 +63,38 @@ const ruleData = ref<any>({
return true;
},
},
],
});
// 流程模板相关
const selectedFlowTemplate = ref<any>(null);
const standard = ref();
watch(() => props.taskInfo, (newVal) => {
if (newVal) {
localDetail.value = newVal;
watch(
() => props.taskInfo,
(newVal) => {
if (newVal) {
localDetail.value = newVal;
console.log(localDetail.value, 'localDetail.value');
console.log(localDetail.value, 'localDetail.value');
nextTick(() => {
tableFormRef.value?.setFormDataFun({ ...localDetail.value, eMemberList: getMemberListIds(localDetail.value.eMemberList), pMemberList: getMemberListIds(localDetail.value.pMemberList) });
standard.value = localDetail.value.standard;
if (localDetail.value.flowTemplate) {
selectedFlowTemplate.value = localDetail.value.flowTemplate;
}
});
nextTick(() => {
tableFormRef.value?.setFormDataFun({
...localDetail.value,
eMemberList: getMemberListIds(localDetail.value.eMemberList),
pMemberList: getMemberListIds(localDetail.value.pMemberList),
});
standard.value = localDetail.value.standard;
if (localDetail.value.flowTemplate) {
selectedFlowTemplate.value = localDetail.value.flowTemplate;
}
});
}
},
{
immediate: true,
deep: true,
}
}, {
immediate: true,
deep: true,
});
);
const getFormData = async () => {
const valid = await tableFormRef.value?.validateFun();
@@ -101,7 +107,11 @@ const getFormData = async () => {
formData.flowTemplate = selectedFlowTemplate.value;
}
if (localDetail.value?.tagKeyList) {
const tagKeyList = disposeTagKey(formData, localDetail.value?.tagKeyList || [], getTagKeyMap());
const tagKeyList = disposeTagKey(
formData,
localDetail.value?.tagKeyList || [],
getTagKeyMap()
);
console.log('tagKeyList', tagKeyList);
} else {
formData.tagKeyList = [];
@@ -121,20 +131,16 @@ const getFormData = async () => {
}
return formData;
} else {
return null;
}
};
defineExpose({
getFormData,
});
onMounted(() => {
});
onMounted(() => {});
</script>
<style lang="scss" scoped>
@@ -152,6 +158,5 @@ onMounted(() => {
margin-bottom: 18px !important;
}
}
}
</style>

View File

@@ -15,7 +15,7 @@ export enum TASK_PROCESS_STATUS {
/** 已延期 */
POSTPONED = '7',
}
export const TASK_PROCESS_STATUS_OBJ:any = {
export const TASK_PROCESS_STATUS_OBJ: any = {
[TASK_PROCESS_STATUS.REJECTED]: '已驳回',
[TASK_PROCESS_STATUS.NO_STARTED]: '未开始',
[TASK_PROCESS_STATUS.IN_PROGRESS]: '进行中',
@@ -24,7 +24,9 @@ export const TASK_PROCESS_STATUS_OBJ:any = {
[TASK_PROCESS_STATUS.CLOSED]: '已关闭',
};
export const TASK_PROCESS_STATUS_OPTIONS = (Object.keys(TASK_PROCESS_STATUS_OBJ) as Array<keyof typeof TASK_PROCESS_STATUS_OBJ>).map((key) => {
export const TASK_PROCESS_STATUS_OPTIONS = (
Object.keys(TASK_PROCESS_STATUS_OBJ) as Array<keyof typeof TASK_PROCESS_STATUS_OBJ>
).map((key) => {
return {
label: TASK_PROCESS_STATUS_OBJ[key],
value: key,
@@ -42,14 +44,16 @@ export enum TASK_CALCULATE_STATUS {
/** 临界 */
// CRITICAL = '3',
}
export const TASK_CALCULATE_STATUS_OBJ:any = {
export const TASK_CALCULATE_STATUS_OBJ: any = {
[TASK_CALCULATE_STATUS.NO_CALCULATE]: '未分析',
[TASK_CALCULATE_STATUS.QUALIFIED]: '合格',
[TASK_CALCULATE_STATUS.UNQUALIFIED]: '不合格',
// [TASK_CALCULATE_STATUS.CRITICAL]: '临界',
};
export const TASK_CALCULATE_STATUS_OPTIONS = (Object.keys(TASK_CALCULATE_STATUS_OBJ) as Array<keyof typeof TASK_CALCULATE_STATUS_OBJ>).map((key) => {
export const TASK_CALCULATE_STATUS_OPTIONS = (
Object.keys(TASK_CALCULATE_STATUS_OBJ) as Array<keyof typeof TASK_CALCULATE_STATUS_OBJ>
).map((key) => {
return {
label: TASK_CALCULATE_STATUS_OBJ[key],
value: key,

View File

@@ -2,9 +2,9 @@ import { cloneDeep } from 'lodash-es';
import { useDict } from './useDict';
import { getTagKeyMap } from './enum/node';
export const disposeSimType = (demandType: string, simType:string) => {
export const disposeSimType = (demandType: string, simType: string) => {
if (demandType && simType) {
const dict:any = useDict(demandType);
const dict: any = useDict(demandType);
if (dict[demandType].value.O[simType]) {
return dict[demandType].value.O[simType];
}
@@ -20,16 +20,18 @@ export const disposeSimType = (demandType: string, simType:string) => {
export const getMemberListIds = (memberList: any[]) => {
const list = cloneDeep(memberList);
if (Array.isArray(list)) {
return list.map((item:any) => {
return item.userId;
}).join(',');
return list
.map((item: any) => {
return item.userId;
})
.join(',');
}
return '';
};
export const getTagMapList = () => {
const tagMap = getTagKeyMap();
const tagMapList: { key: string; value: string; }[] = [];
const tagMapList: { key: string; value: string }[] = [];
tagMap.forEach((value: string, key: string) => {
tagMapList.push({
key: key,
@@ -38,4 +40,3 @@ export const getTagMapList = () => {
});
return tagMapList;
};

View File

@@ -32,10 +32,10 @@
flow.approveType === FLOW_APPROVE_STATUS_ENUM.NOT_APPROVED
? 'approve-box no-approve'
: flow.approveType === FLOW_APPROVE_STATUS_ENUM.APPROVING
? 'approve-box approving'
: flow.approveType === FLOW_APPROVE_STATUS_ENUM.APPROVED
? 'approve-box approve-success'
: 'approve-box approve-refuse'
? 'approve-box approving'
: flow.approveType === FLOW_APPROVE_STATUS_ENUM.APPROVED
? 'approve-box approve-success'
: 'approve-box approve-refuse'
"
>
{{ FLOW_APPROVE_STATUS.O[flow.approveType] }}

View File

@@ -1,10 +1,24 @@
<template>
<div class="comp-content">
<Dialog v-model="dialogVisible" diaTitle="任务详情" :width="'70%'" :height="700" @close="closeFun" show-footer :zIndex="100">
<Dialog
v-model="dialogVisible"
diaTitle="任务详情"
:width="'70%'"
:height="700"
@close="closeFun"
show-footer
:zIndex="100"
>
<el-tabs v-model="activeTab">
<el-tab-pane label="任务详情" name="info" v-if="showTaskInfo">
<div class="task-tab-content">
<taskInfo ref="taskInfoRef" v-if="activeTab === 'info'" :table-name="tableName" :task-id="currentTaskInfo?.uuid" :task-info="currentTaskInfo">
<taskInfo
ref="taskInfoRef"
v-if="activeTab === 'info'"
:table-name="tableName"
:task-id="currentTaskInfo?.uuid"
:task-info="currentTaskInfo"
>
</taskInfo>
</div>
</el-tab-pane>
@@ -15,18 +29,32 @@
</el-tab-pane>
<el-tab-pane label="性能指标" name="performance">
<div class="task-tab-content">
<taskPerformance ref="taskPerformanceRef" v-if="activeTab === 'performance'" :task-id="taskId" :param-type="'task'" :run-info="currentTaskInfo" :task-info="currentTaskInfo" :show-save-button="true">
<taskPerformance
ref="taskPerformanceRef"
v-if="activeTab === 'performance'"
:task-id="taskId"
:param-type="'task'"
:run-info="currentTaskInfo"
:task-info="currentTaskInfo"
:show-save-button="true"
>
</taskPerformance>
</div>
</el-tab-pane>
<el-tab-pane label="结果图片" name="resultImage">
<div class="task-tab-content">
<resultImage v-if="activeTab === 'resultImage'" :task-id="currentTaskInfo?.uuid"></resultImage>
<resultImage
v-if="activeTab === 'resultImage'"
:task-id="currentTaskInfo?.uuid"
></resultImage>
</div>
</el-tab-pane>
<el-tab-pane label="曲线查看" name="curveView">
<div class="task-tab-content">
<taskCurve v-if="activeTab === 'curveView'" :task-id="currentTaskInfo?.uuid"></taskCurve>
<taskCurve
v-if="activeTab === 'curveView'"
:task-id="currentTaskInfo?.uuid"
></taskCurve>
</div>
</el-tab-pane>
<el-tab-pane label="仿真报告" name="report">
@@ -36,10 +64,13 @@
</el-tab-pane>
<el-tab-pane label="交付物" name="deliverables">
<div class="task-tab-content">
<taskDeliverable v-if="activeTab === 'deliverables'" :task-id="currentTaskInfo?.uuid" :task-info="currentTaskInfo"></taskDeliverable>
<taskDeliverable
v-if="activeTab === 'deliverables'"
:task-id="currentTaskInfo?.uuid"
:task-info="currentTaskInfo"
></taskDeliverable>
</div>
</el-tab-pane>
</el-tabs>
<template #footer>
<div>
@@ -70,7 +101,7 @@ const props = defineProps({
},
currentTaskInfo: {
type: Object,
default: () => { },
default: () => {},
},
tableName: {
type: String,
@@ -83,7 +114,7 @@ const props = defineProps({
});
const dialogVisible = ref(true);
const activeTab = ref( props.showTaskInfo ? 'info' : 'model');
const activeTab = ref(props.showTaskInfo ? 'info' : 'model');
const taskPerformanceRef = ref();
const taskInfoRef = ref();
const closeFun = () => {
@@ -91,7 +122,6 @@ const closeFun = () => {
};
const updateFun = async () => {
let data: any;
if (activeTab.value === 'performance') {
await taskPerformanceRef.value.saveFun();
@@ -105,7 +135,6 @@ const updateFun = async () => {
flag: activeTab.value,
data,
});
};
</script>