This commit is contained in:
2026-03-04 09:41:34 +08:00
12 changed files with 137 additions and 66 deletions

View File

@@ -144,6 +144,8 @@ import CompForm from './components/form.vue';
import CompImg from './components/img.vue'; import CompImg from './components/img.vue';
import CompTable from './components/table.vue'; import CompTable from './components/table.vue';
const emit = defineEmits(['update:data']);
defineOptions({ defineOptions({
name: 'EditItem', name: 'EditItem',
}); });
@@ -174,6 +176,15 @@ const titleMap = ref<any>({
img: '图片', img: '图片',
table: '表格', table: '表格',
}); });
watch(
() => documentData.value,
(val: any) => {
emit('update:data', val);
},
{ deep: true }
);
watch( watch(
() => props.data, () => props.data,
(val: any, oldVal) => { (val: any, oldVal) => {

View File

@@ -107,12 +107,13 @@ const formatFun = (data: any) => {
params: item.params, params: item.params,
}; };
if (item.type === 'img') { if (item.type === 'img') {
itemData.value.forEach((val: any, valIndex: number) => { (itemData.value || []).forEach((val: any, valIndex: number) => {
const randNum = Math.floor(Math.random() * 900000) + 100000;
let picName = ''; let picName = '';
if (val.title) { if (val.title) {
picName = `${val.title.replace(/\s/g, '')}_${new Date().getTime()}_${index + 1}_${valIndex + 1}`; picName = `${val.title.replace(/\s/g, '')}_${randNum}_${index + 1}_${valIndex + 1}`;
} else { } else {
picName = `图片_${new Date().getTime()}_${index + 1}_${valIndex + 1}`; picName = `图片_${randNum}_${index + 1}_${valIndex + 1}`;
} }
val.picName = picName; val.picName = picName;
}); });

View File

@@ -208,6 +208,7 @@ const closeFun = () => {
.report-content { .report-content {
width: 100%; width: 100%;
flex: 1; flex: 1;
height: calc(100% - 32px);
.no-report { .no-report {
width: 100%; width: 100%;
height: 100%; height: 100%;

View File

@@ -104,16 +104,21 @@ onMounted(() => {
} }
}); });
const tableData = ref<any>([]);
const formatDataFun = (data: any) => { const formatDataFun = (data: any) => {
data?.extras?.forEach((item: any) => { if (tableData.value.length === 0) {
const { propertyName, propertyValue } = item; data?.extras?.forEach((item: any) => {
data[propertyName] = propertyValue; const { propertyName, propertyValue } = item;
}); data[propertyName] = propertyValue;
return data; });
return data;
} else {
return getFormDataFun(data);
}
}; };
const formData = ref<any>(formatDataFun(props.data)); const formData = ref<any>(formatDataFun(props.data));
const tableData = ref<any>([]);
const rules = ref<any>({}); const rules = ref<any>({});
const formRef = ref<any>(); const formRef = ref<any>();
@@ -127,6 +132,7 @@ const getHeadDataFun = () => {
formConfigData.value = data; formConfigData.value = data;
setValidateFun(data); setValidateFun(data);
tableData.value = data; tableData.value = data;
getFormDataFun(props.data);
formOptionsFormat(tableData.value); formOptionsFormat(tableData.value);
emit('load'); emit('load');
} }
@@ -236,20 +242,20 @@ const validateFun = () => {
}); });
}; };
const getFormDataFun = () => { const getFormDataFun = (data?: any) => {
const objData: any = formData.value || {}; const objData: any = data || formData.value || {};
const hasExtras = !!formData.value.extras; const hasExtras = !!objData.extras;
objData.extras = hasExtras ? formData.value.extras : []; objData.extras = hasExtras ? objData.extras : [];
tableData.value.forEach((item: any) => { tableData.value.forEach((item: any) => {
const { key, type } = item; const { key, type } = item;
if (type === 1) { if (type === 1) {
objData[key] = formData.value[key]; objData[key] = objData[key];
} else { } else {
if (hasExtras) { if (hasExtras) {
let hasExtraKey = false; let hasExtraKey = false;
objData.extras.some((val: any) => { objData.extras.some((val: any) => {
if (val.propertyName === key) { if (val.propertyName === key) {
val.propertyValue = formData.value[key]; val.propertyValue = objData[key];
hasExtraKey = true; hasExtraKey = true;
return true; return true;
} }
@@ -258,14 +264,14 @@ const getFormDataFun = () => {
objData.extras.push({ objData.extras.push({
propertyClass: 'default', propertyClass: 'default',
propertyName: key, propertyName: key,
propertyValue: formData.value[key], propertyValue: objData[key],
}); });
} }
} else { } else {
objData.extras.push({ objData.extras.push({
propertyClass: 'default', propertyClass: 'default',
propertyName: key, propertyName: key,
propertyValue: formData.value[key], propertyValue: objData[key],
}); });
} }
} }

View File

@@ -4,7 +4,7 @@
tableName="TASK_RUN_PERFORMANCE" tableName="TASK_RUN_PERFORMANCE"
ref="baseTableRef" ref="baseTableRef"
:export-file-name="'指标列表'" :export-file-name="'指标列表'"
:export-api="exportPerformanceApi" :export-api="exportPerformanceByScriptApi"
showCheckbox showCheckbox
hidePagination hidePagination
:data="performanceData" :data="performanceData"
@@ -65,7 +65,7 @@
ref="baseTableRef" ref="baseTableRef"
:data="performanceData" :data="performanceData"
:export-file-name="'指标列表'" :export-file-name="'指标列表'"
:export-api="exportPerformanceApi" :export-api="exportPerformanceByScriptApi"
showCheckbox showCheckbox
hidePagination hidePagination
:actionList="showLeftOptions ? actionList : []" :actionList="showLeftOptions ? actionList : []"
@@ -152,6 +152,7 @@ import StatusDot from '@/components/common/statusDot/index.vue';
import { syncKeyResultToTaskApi } from '@/api/project/run'; import { syncKeyResultToTaskApi } from '@/api/project/run';
import inputPerformanceExcel from './inputPerformanceExcel.vue'; import inputPerformanceExcel from './inputPerformanceExcel.vue';
import { importSimulationPerformanceApi } from '@/api/project/task'; import { importSimulationPerformanceApi } from '@/api/project/task';
import { exportPerformanceByScriptApi } from '@/api/project/analysis';
const props = defineProps({ const props = defineProps({
taskId: { taskId: {
@@ -358,7 +359,7 @@ const getFormConfigureFun = async () => {
}; };
} else { } else {
excelParams.value = { excelParams.value = {
taskId: props.taskInfo.uuid, taskNodeId: props.taskInfo.uuid,
}; };
} }
} }
@@ -523,7 +524,8 @@ const inputFileFun = async (data: any) => {
const res: any = await importSimulationPerformanceApi(param); const res: any = await importSimulationPerformanceApi(param);
if (res && res.code === 200) { if (res && res.code === 200) {
showInputDialog.value = false; showInputDialog.value = false;
baseTableRef.value.resetFun(); getTaskPerformanceDataFun();
// baseTableRef.value.resetFun();
} }
} catch {} } catch {}
}; };

View File

@@ -89,6 +89,7 @@
v-if="showComponents" v-if="showComponents"
:check-task-info="performanceData" :check-task-info="performanceData"
:cloumn-width="cloumnWidth" :cloumn-width="cloumnWidth"
:analysis-type="analysisType"
></performanceAnalysis> ></performanceAnalysis>
</template> </template>
<template v-if="item.value === 'result'"> <template v-if="item.value === 'result'">
@@ -474,7 +475,9 @@ const getRunPerformanceFn = async (data: any) => {
}); });
if (res && res.code === 200) { if (res && res.code === 200) {
const list = res.data; const list = res.data.map((item: any) => {
return { ...item, runName: data.runName };
});
return list; return list;
} }
@@ -491,6 +494,7 @@ const getSimulationTaskFileFun = async (data: any, level: any, fileBizType: any)
startTime: '', startTime: '',
endTime: '', endTime: '',
level: level, level: level,
fileTypeDictValue: fileBizType,
}; };
try { try {

View File

@@ -10,7 +10,6 @@
<template #performanceInfo="{ row }"> <template #performanceInfo="{ row }">
{{ row.performanceInfo }} {{ row.performanceInfo }}
</template> </template>
</BaseTable> </BaseTable>
</div> </div>
</template> </template>
@@ -41,6 +40,10 @@ const props = defineProps({
type: String, type: String,
default: '', default: '',
}, },
analysisType: {
type: String,
default: '',
},
}); });
const performanceTableRef = ref(); const performanceTableRef = ref();
@@ -52,15 +55,21 @@ const modelAttribute = ref<any>([]);
const getTableColumnsFun = (data: any) => { const getTableColumnsFun = (data: any) => {
const performanceDatas = data || []; const performanceDatas = data || [];
const type = props.analysisType === '仿真算例' ? 0 : 1;
console.log(performanceDatas, 'performanceDatasperformanceDatasperformanceDatas');
for (let i = 0; i < performanceDatas.length; i++) { for (let i = 0; i < performanceDatas.length; i++) {
performanceDatas[i].completeStatus = getPerformanceSTatus(performanceDatas[i]) || 0; performanceDatas[i].completeStatus = getPerformanceSTatus(performanceDatas[i]) || 0;
} }
const names = performanceDatas?.map((item: any) => { const names = performanceDatas?.map((item: any) => {
return item.taskName; return type ? item.taskName : item.runName;
}); });
const taskNames = Array.from(new Set(names)); const taskNames = Array.from(new Set(names));
console.log(taskNames, 'taskNamestaskNamestaskNames');
modelAttribute.value = performanceDatas.map((item: any) => { modelAttribute.value = performanceDatas.map((item: any) => {
const nodeName = item.nodeName || ''; const nodeName = item.nodeName || '';
const method = item.method || ''; const method = item.method || '';
@@ -68,10 +77,10 @@ const getTableColumnsFun = (data: any) => {
const unitLabel = PERFORMANCE_UNIT.value?.O?.[item.unit] || item.unit || ''; const unitLabel = PERFORMANCE_UNIT.value?.O?.[item.unit] || item.unit || '';
const obj: any = { const obj: any = {
name: `${nodeName} (${method} ${targetValue} ${unitLabel})`, name: `${nodeName} (${method} ${targetValue} ${unitLabel})`,
value: item.uuid, value: type ? item.taskId : item.runId,
}; };
obj[item.uuid] = item.highValue; obj[type ? item.taskId : item.runId] = item.resultValue;
return obj; return obj;
}); });
@@ -95,10 +104,10 @@ const getTableColumnsFun = (data: any) => {
let modelcolumns: any = []; let modelcolumns: any = [];
for (let j = 0; j < taskNames.length; j++) { for (let j = 0; j < taskNames.length; j++) {
for (let i = 0; i < list.length; i++) { for (let i = 0; i < list.length; i++) {
if (list[i].taskName === taskNames[j]) { if ((type ? list[i].taskName : list[i].runName) === taskNames[j]) {
const obj: any = { const obj: any = {
title: `${list[i].taskName}`, title: `${type ? list[i].taskName : list[i].runName}`,
key: `${list[i].uuid}`, key: `${type ? list[i].taskId : list[i].runId}`,
isShow: true, isShow: true,
}; };
modelcolumns.push(obj); modelcolumns.push(obj);
@@ -124,6 +133,7 @@ const getTableColumnsFun = (data: any) => {
tableData.value.push(obj); tableData.value.push(obj);
} }
console.log(modelcolumns, 'modelcolumns');
showTableContent.value = true; showTableContent.value = true;
nextTick(() => { nextTick(() => {
@@ -134,18 +144,18 @@ const getTableColumnsFun = (data: any) => {
const getPerformanceSTatus = (row: any) => { const getPerformanceSTatus = (row: any) => {
let status: any = 0; let status: any = 0;
// 当指标值,达标方式,目标值有一个不存在时,返回状态未分析 // 当指标值,达标方式,目标值有一个不存在时,返回状态未分析
if (!row?.method || !row?.highValue || !row?.targetValue) { if (!row?.method || !row?.resultValue || !row?.targetValue) {
return status; return status;
} }
if (row?.method && row?.highValue && row?.targetValue) { if (row?.method && row?.resultValue && row?.targetValue) {
const highValue = Number(row?.highValue); const resultValue = Number(row?.resultValue);
const targetValue = Number(row?.targetValue); const targetValue = Number(row?.targetValue);
const lowValue = Number(row?.lowValue); const lowValue = Number(row?.lowValue);
// 小于等于 // 小于等于
if (row.method === '≤') { if (row.method === '≤') {
if (targetValue <= highValue) { if (targetValue <= resultValue) {
status = 2; status = 2;
} else { } else {
status = 1; status = 1;
@@ -154,7 +164,7 @@ const getPerformanceSTatus = (row: any) => {
// 小于 // 小于
if (row.method === '<') { if (row.method === '<') {
if (targetValue < highValue) { if (targetValue < resultValue) {
status = 2; status = 2;
} else { } else {
status = 1; status = 1;
@@ -162,7 +172,7 @@ const getPerformanceSTatus = (row: any) => {
} }
// 大于 // 大于
if (row.method === '>') { if (row.method === '>') {
if (targetValue > highValue) { if (targetValue > resultValue) {
status = 2; status = 2;
} else { } else {
status = 1; status = 1;
@@ -170,7 +180,7 @@ const getPerformanceSTatus = (row: any) => {
} }
// 大于等于 // 大于等于
if (row.method === '≥') { if (row.method === '≥') {
if (targetValue >= highValue) { if (targetValue >= resultValue) {
status = 2; status = 2;
} else { } else {
status = 1; status = 1;
@@ -178,7 +188,7 @@ const getPerformanceSTatus = (row: any) => {
} }
// 包含 // 包含
if (row.method === '[]') { if (row.method === '[]') {
if (targetValue <= highValue && targetValue >= lowValue) { if (targetValue <= resultValue && targetValue >= lowValue) {
status = 2; status = 2;
} else { } else {
status = 1; status = 1;

View File

@@ -6,7 +6,7 @@
<div class="task-status"> <div class="task-status">
任务状态 任务状态
<div class="status"> <div class="status">
<el-icon class="upload" title="行中" v-if="runFlowPocesInfo?.status === 'running'"> <el-icon class="upload" title="行中" v-if="runFlowPocesInfo?.status === 'running'">
<HelpFilled /> <HelpFilled />
</el-icon> </el-icon>
<el-icon <el-icon
@@ -365,7 +365,7 @@ const props = defineProps({
const emits = defineEmits(['update']); const emits = defineEmits(['update']);
const statusList = ref<any>({ const statusList = ref<any>({
running: '行中', running: '行中',
completed: '已完成', completed: '已完成',
suspended: '挂起中', suspended: '挂起中',
error: '异常', error: '异常',

View File

@@ -12,8 +12,22 @@
<template #fileSize="{ row }"> <template #fileSize="{ row }">
<span>{{ formatFileSize(row.fileSize) }}</span> <span>{{ formatFileSize(row.fileSize) }}</span>
</template> </template>
<template #approvalStatus="{ row, column }">
<el-button
type="primary"
link
@click="openProcessFun(row)"
v-if="row[column.field] === 'pending'"
>
{{ KNOWLEDGE_APPROVE_STATUS.O[row[column.field]] }}
</el-button>
<el-button type="primary" link @click="openProcessFun(row)" v-else>
{{ $t('知识库.审批完成') }}
</el-button>
</template>
</BaseTable> </BaseTable>
<FilePreview v-model="previewVisible" :fileId="currentRow?.id" /> <FilePreview v-model="previewVisible" :fileId="currentRow?.id" />
<ApprovalProcess v-model="processVisible" :flowId="currentRow?.cidFlowId" />
</div> </div>
</template> </template>
@@ -24,6 +38,8 @@ import { getFileBaseInfoApi } from '@/api/data/data';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { downloadFileById, formatFileSize } from '@/utils/file'; import { downloadFileById, formatFileSize } from '@/utils/file';
import FilePreview from '@/components/common/filePreview/index.vue'; import FilePreview from '@/components/common/filePreview/index.vue';
import { useDict } from '@/utils/useDict';
import ApprovalProcess from '@/components/common/approvalProcess/index.vue';
const props = defineProps({ const props = defineProps({
runInfo: { runInfo: {
@@ -31,7 +47,7 @@ const props = defineProps({
default: () => {}, default: () => {},
}, },
}); });
const { KNOWLEDGE_APPROVE_STATUS } = useDict('KNOWLEDGE_APPROVE_STATUS');
const baseTableRef = ref(); const baseTableRef = ref();
const { t } = useI18n(); const { t } = useI18n();
@@ -79,6 +95,12 @@ const previewFileFun = (row: any) => {
previewVisible.value = true; previewVisible.value = true;
}; };
const processVisible = ref(false);
const openProcessFun = (row: any) => {
currentRow.value = row;
processVisible.value = true;
};
watch( watch(
() => props.runInfo, () => props.runInfo,
async (newVal) => { async (newVal) => {

View File

@@ -833,6 +833,7 @@ const addOrEditTaskFun = async () => {
const onAddApproveConfirmFun = async (formData: any) => { const onAddApproveConfirmFun = async (formData: any) => {
// dialogApproveUserVisible.value = false; // dialogApproveUserVisible.value = false;
dialogApproveUserVisible.value = false;
const deleteNodeList = getListIds( const deleteNodeList = getListIds(
approveParam.value.removeRecords.map((item: any) => { approveParam.value.removeRecords.map((item: any) => {
@@ -898,19 +899,16 @@ const onAddApproveConfirmFun = async (formData: any) => {
try { try {
const res: any = await modifyWithApproveAPi(param); const res: any = await modifyWithApproveAPi(param);
if (res && res.code === 200) { if (res && res.code === 200) {
dialogApproveUserVisible.value = false;
ElMessage.success('操作成功'); ElMessage.success('操作成功');
loadingInterface.value = false; loadingInterface.value = false;
emits('taskComplete', 'taskPlanPage'); emits('taskComplete', 'taskPlanPage');
closeFun(); closeFun();
} else { } else {
dialogApproveUserVisible.value = false;
loadingInterface.value = false; loadingInterface.value = false;
ElMessage.warning('操作失败'); ElMessage.warning('操作失败');
closeFun(); closeFun();
} }
} catch { } catch {
dialogApproveUserVisible.value = false;
loadingInterface.value = false; loadingInterface.value = false;
closeFun(); closeFun();
} }

View File

@@ -95,7 +95,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="选择工况" prop="chooseTaskList" v-if="insertTaskMode === 'lib'"> <el-form-item label="选择场景" prop="chooseTaskList" v-if="insertTaskMode === 'lib'">
<el-select-v2 <el-select-v2
v-model="sendForm.chooseTaskList" v-model="sendForm.chooseTaskList"
:options="libTaskList" :options="libTaskList"
@@ -134,6 +134,16 @@
<el-form-item label="仿真执行人:" prop="eMemberList"> <el-form-item label="仿真执行人:" prop="eMemberList">
<UserSelect v-model="sendForm.eMemberList" :multiple="true" /> <UserSelect v-model="sendForm.eMemberList" :multiple="true" />
</el-form-item> </el-form-item>
<el-form-item label="专项异常:" prop="expStatus">
<el-select :teleported="false" v-model="sendForm.expStatus">
<el-option
v-for="item in TASK_ABNORMAL.A"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<div> <div>
@@ -166,6 +176,7 @@ import { CommonStore } from '@/stores/common';
import { batchUpdateTaskStatusApi } from '@/api/project/task'; import { batchUpdateTaskStatusApi } from '@/api/project/task';
import { getUserSimulationType } from '@/tenants/lyric/views/task/lyricTask'; import { getUserSimulationType } from '@/tenants/lyric/views/task/lyricTask';
import { enableConfigByTenant, TENANT_ENUM } from '@/tenants/tenant'; import { enableConfigByTenant, TENANT_ENUM } from '@/tenants/tenant';
import { useDict } from '@/utils/useDict';
const props = defineProps({ const props = defineProps({
diaVisible: { diaVisible: {
@@ -190,6 +201,8 @@ const diaVisible = computed({
}, },
}); });
const { TASK_ABNORMAL } = useDict('TASK_ABNORMAL');
const sendForm = reactive<any>({ const sendForm = reactive<any>({
beginTime: '', beginTime: '',
endTime: '', endTime: '',
@@ -472,6 +485,10 @@ const sendTaskFun = async (row: any) => {
if (key !== 'eMemberList') { if (key !== 'eMemberList') {
sendForm[key] = row[key]; sendForm[key] = row[key];
} }
// EP 定制代码
if (key === 'expStatus') {
sendForm[key] = String(row[key]);
}
} }
sendForm.taskName = row.demandName; sendForm.taskName = row.demandName;
@@ -490,4 +507,10 @@ onMounted(() => {
} }
}); });
</script> </script>
<style lang="less" scoped></style> <style lang="scss" scoped>
.loadcase-img {
width: 18px;
vertical-align: text-bottom;
margin-right: 5px;
}
</style>

View File

@@ -343,29 +343,22 @@ const confirmFun = async () => {
const demandId = await createDemandApiFun(editFormInfo.value); const demandId = await createDemandApiFun(editFormInfo.value);
// 没有demandId就是创建需求失败 // 没有demandId就是创建需求失败
if (demandId && editFormInfo.value.attachments?.length > 0) { if (demandId && editFormInfo.value.attachments?.length > 0) {
// for (let index = 0; index < fromData.attachments.length; index++) { const files = editFormInfo.value.attachments.filter((item: any) => item.raw);
// const form = new FormData(); if (files.length > 0) {
// form.append('fileType', String(FILE_TYPE.DEMAND_ATTACHMENTS)); const params = {
// form.append('uuid ', demandId); fileList: files, // 文件列表
// form.append('fileName ', fromData.attachments[index].name); // dirId: demandId, // 文件目录id
// form.append('file ', fromData.attachments[index].raw); projectId: editFormInfo.value.projectId, // 项目id
// form.append('projectId ', String(fromData.projectId)); callbackFlag: '/task/sponsor', // 回调标识
// upload(`${PREFIX}demand/uploadDemandFiles`, form); uuid: demandId,
// } };
} await uploadBigFile(params, batchAddFileInfoApi);
const files = editFormInfo.value.attachments.filter((item: any) => item.raw); }
if (files.length > 0) { formVisible.value = false;
const params = { } else {
fileList: files, // 文件列表 loadingInterface.value = false;
// dirId: demandId, // 文件目录id
projectId: editFormInfo.value.projectId, // 项目id
callbackFlag: '/task/sponsor', // 回调标识
uuid: demandId,
};
await uploadBigFile(params, batchAddFileInfoApi);
} }
// batchUploadFile(fromData.attachments, fromData.projectId, demandId); // batchUploadFile(fromData.attachments, fromData.projectId, demandId);
formVisible.value = false;
} else { } else {
await editDemandApiFun(editFormInfo.value); await editDemandApiFun(editFormInfo.value);
} }