This commit is contained in:
2026-01-29 16:38:49 +08:00
16 changed files with 305 additions and 86 deletions

View File

@@ -456,20 +456,10 @@ const lineChart = (
},
},
],
series: [
{
name: '',
type: 'line',
data: [],
lineStyle: {
width: 2,
},
},
],
series: [],
};
mergeObjArrItem(option, yAxis, 'yAxis');
mergeObjArrItem(option, xAxis, 'xAxis');
mergeObjArrItem(option, series, 'series');
mergeObjItem(option, grid, 'grid');
mergeObjItem(option, title, 'title');
mergeObjItem(option, legend, 'legend');
@@ -478,13 +468,13 @@ const lineChart = (
if (color) {
option.color = color;
}
// option.series =
// series.map((item: any) => {
// if (!Reflect.has(item, 'type')) {
// item.type = 'line';
// }
// return item;
// }) ?? [];
option.series =
series.map((item: any) => {
if (!Reflect.has(item, 'type')) {
item.type = 'line';
}
return item;
}) ?? [];
if (option) {
myChart[id].setOption(option);
}

View File

@@ -1,6 +1,11 @@
<template>
<div class="comp-content">
<el-select v-model="fileType" placeholder="请选择文件标签" @change="changeFileType">
<el-select
v-model="fileType"
placeholder="请选择文件标签"
v-bind="$attrs"
@change="changeFileType"
>
<el-option
v-for="item in ALL_FILE_TYPE.A"
:key="item.value + 'fileType'"

View File

@@ -16,7 +16,11 @@
ref="tableFormRef"
:tableName="localTableName"
v-model:data="formData"
:formAttrs="formAttrs"
:formAttrs="{
nodeCode: { disabled: formData.nodeType === NODE_TYPE.DISCIPLINE },
englishName: { disabled: formData.nodeType === NODE_TYPE.DISCIPLINE },
nodeType: { disabled: localOperationType === 'edit' },
}"
:rule-data="ruleData"
:itemNum="localItemNum"
@change="onFormChangeFun"
@@ -115,14 +119,6 @@ const standard = ref();
const tagSortOrderList = ref<string[]>([]);
const tagNameMap = ref<Map<string, string>>(new Map());
const formData = ref<any>({});
const formAttrs = computed(() => {
const isDiscipline = formData.value.nodeType === NODE_TYPE.DISCIPLINE;
return {
nodeCode: { disabled: isDiscipline },
englishName: { disabled: isDiscipline },
nodeType: { disabled: localOperationType.value === OPERATION_TYPE.EDIT },
};
});
watch(
() => props.modelValue,

View File

@@ -12,7 +12,14 @@
<TableForm
ref="tableFormRef"
tableName="NODE_LIST_LEVEL1"
:formAttrs="formAttrs"
:formAttrs="{
projectSource: { disabled: !!props.projectId },
epProjectSelect: { disabled: projectInfo.projectSource !== 'EP' || !!props.projectId },
nodeName: { disabled: projectInfo.projectSource === 'EP' },
nodeCode: { disabled: projectInfo.projectSource === 'EP' },
projectId: { disabled: projectInfo.projectSource === 'EP' },
nodeSubType: !!props.projectId ? {} : { defaultSelects: [0] },
}"
@load="loadFun"
@change="formChangeFun"
v-model:data="editRowInfo"
@@ -61,18 +68,6 @@ const tableFormRef = ref();
const loadingInterface = ref(false);
const epProjectId = ref<number | null>(null);
const formAttrs = computed(() => {
return {
projectSource: { disabled: !!props.projectId },
epProjectSelect: { disabled: projectInfo.projectSource !== 'EP' || !!props.projectId },
nodeName: { disabled: projectInfo.projectSource === 'EP' },
nodeCode: { disabled: projectInfo.projectSource === 'EP' },
projectId: { disabled: projectInfo.projectSource === 'EP' },
nodeSubType: {
defaultSelects: [0],
},
};
});
const dialogVisible = computed(() => {
return props.modelValue;
@@ -212,6 +207,9 @@ const epProjectSelectFun = (row: any) => {
if (item.propertyName === 'projectUndertaker') {
item.propertyValue = editRowInfo.value.projectUndertaker;
}
if (item.propertyName === 'referenceItem') {
item.propertyValue = editRowInfo.value.referenceItem;
}
return {
...item,
};

View File

@@ -0,0 +1,133 @@
<template>
<div class="task-demand-content">
<TableForm
v-model:data="demandInfo"
:show-disabled="true"
ref="tableFormRef"
tableName="SIMULATION_TASK_DEMAND_CREATE"
:colNum="2"
:hideKeys="['attachments']"
>
<template #form-downAttachments>
<div class="attachments">
<div class="file" v-for="item in attachmentFiles" :key="item.id">
<span>{{ item.name }}</span>
<el-icon size="18" @click="downloadFileById(item.id)"><Download /></el-icon>
</div>
</div>
</template>
<template #form-pMemberList>
<el-select disabled v-model="demandInfo.pMemberList" filterable placeholder="请选择">
<el-option
v-for="item in deptOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</TableForm>
</div>
</template>
<script lang="ts" setup>
import { ref, watch } from 'vue';
import TableForm from '@/components/common/table/tableForm.vue';
import { getDemandDetailApi } from '@/api/project/demand';
import { getMemberListIds } from '@/utils/task';
import { dataQueryDirApi } from '@/api/data/data';
import { downloadFileById } from '@/utils/file';
import { CommonStore } from '@/stores/common';
import { listDeptApi } from '@/api/system/departMent';
const props = defineProps<{
demandUid: string;
}>();
const commonStore = CommonStore();
const demandInfo = ref<any>({});
const tableFormRef = ref();
const getDemandInfoFun = async () => {
const res: any = await getDemandDetailApi({ demandId: props.demandUid });
if (res.code === 200) {
demandInfo.value = {
...res.data,
planTime: [res.data.beginTime, res.data.endTime],
pMemberList: getMemberListIds(res.data.pMemberList),
aMemberList: getMemberListIds(res.data.aMemberList),
tMemberList: getMemberListIds(res.data.tMemberList),
};
tableFormRef.value.setOptionsFun('phaseId', [
{ label: res.data.phaseName, value: res.data.phaseId },
]);
const simTypeList: any = commonStore.getDictData(res.data.demandType);
tableFormRef.value.setOptionsFun('simType', simTypeList.A);
}
};
const attachmentFiles = ref<any[]>([]);
const getAttachmentsFun = async () => {
const res: any = await dataQueryDirApi({ uuid: props.demandUid, current: 1, size: 99 });
attachmentFiles.value =
res.data?.data?.map((item: { originalName: any; fileSize: any; id: number }) => {
return {
name: item.originalName,
size: item.fileSize,
id: item.id,
};
}) || [];
};
const deptOptions = ref<any[]>([]);
const getListDeptFun = async () => {
const res: any = await listDeptApi({ current: 1, size: 999 });
if (res.code === 200) {
deptOptions.value = res.data.data.map((item: { deptName: any; userId: any }) => {
return {
label: item.deptName,
value: String(item.userId),
};
});
}
};
watch(
() => props.demandUid,
(val) => {
if (val) {
getDemandInfoFun();
getAttachmentsFun();
getListDeptFun();
}
},
{ immediate: true }
);
</script>
<style lang="scss" scoped>
.task-demand-content {
width: 100%;
height: 100%;
padding: 10px;
overflow-y: auto;
}
.attachments {
width: 100%;
height: 100px;
overflow-y: auto;
.file {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
.el-icon {
color: var(--el-color-primary);
cursor: pointer;
}
}
}
</style>

View File

@@ -5,7 +5,12 @@
ref="tableFormRef"
:tableName="tableName"
v-model:data="formData"
:formAttrs="formAttrs"
:formAttrs="{
originalName: {
multiple: !isEdit,
limit: isEdit ? 1 : undefined,
},
}"
:itemNum="5"
@change="onFormChangeFun"
>
@@ -134,13 +139,6 @@ const resetFun = () => {
initSnapshot();
tableFormRef.value?.resetFun();
};
const formAttrs = computed(() => ({
originalName: {
multiple: !isEdit.value,
limit: isEdit.value ? 1 : undefined,
},
}));
const onFormChangeFun = (data: any) => {
formData.value = tableFormRef.value.getFormDataFun();
if (data.key === 'templateId') {

View File

@@ -85,15 +85,6 @@
</el-button>
</div>
</template>
<template #originalName="{ row }">
<el-icon v-if="row.dataType === 1">
<Folder />
</el-icon>
<el-icon v-else>
<Document />
</el-icon>
{{ row.originalName }}
</template>
<template #fileSize="{ row }">
{{ formatFileSize(row.fileSize) }}
</template>

View File

@@ -5,7 +5,15 @@
ref="tableFormRef"
:tableName="tableName"
v-model:data="formData"
:formAttrs="formAttrs"
:formAttrs="{
originalName: {
multiple: !isEdit,
limit: isEdit ? 1 : undefined,
},
templateId: {
moduleCode: 'KNOWLEDGE_APPROVAL',
},
}"
:itemNum="6"
@change="onFormChangeFun"
>
@@ -134,16 +142,6 @@ const resetFun = () => {
initSnapshot();
tableFormRef.value?.resetFun();
};
const formAttrs = computed(() => ({
originalName: {
multiple: !isEdit.value,
limit: isEdit.value ? 1 : undefined,
},
templateId: {
moduleCode: 'KNOWLEDGE_APPROVAL',
},
}));
const onFormChangeFun = (data: any) => {
formData.value = tableFormRef.value.getFormDataFun();
if (data.key === 'templateId') {

View File

@@ -99,9 +99,6 @@
</el-button>
</div>
</template>
<template #originalName="{ row }">
{{ row.originalName }}
</template>
<template #fileSize="{ row }">
{{ formatFileSize(row.fileSize) }}
</template>

View File

@@ -331,7 +331,7 @@ const getConvertData = async (flag: any, type: any) => {
for (let i = 0; i < tasklist.length; i++) {
// const list = (await getAllRunResultByTaskIdFun(tasklist[i].uuid))?.runs;
// data = data.concat(list);
const datas = await getSimulationTaskFileFun(tasklist[i], 'task', FILE_TYPE.CANVAS_FILE);
const datas = await getSimulationTaskFileFun(tasklist[i], 'task', FILE_TYPE.REPORT_FILE);
reportData.value = reportData.value.concat(datas);
}
} else {

View File

@@ -65,8 +65,8 @@ const getTableColumnFun = (data: any) => {
for (let i = 0; i < list.length; i++) {
const obj: any = {
title: `${list[i].runName}-${list[i].originalName}`,
key: `${list[i].taskId}_${list[i].uuid}_${list[i].id}`,
title: `${list[i].owntaskName}-${list[i].originalName}`,
key: `${list[i].owntaskId}_${list[i].uuid}_${list[i].id}`,
isShow: true,
};
@@ -87,7 +87,7 @@ const getTableColumnFun = (data: any) => {
const str = tableColumns.value[i].key;
obj[str] = [];
for (let j = 0; j < list.length; j++) {
const str2 = list[j].taskId + '_' + list[j].uuid + '_' + list[j].id;
const str2 = list[j].owntaskId + '_' + list[j].uuid + '_' + list[j].id;
if (str2 === str) {
obj[str].push(list[j].id);
}

View File

@@ -9,7 +9,7 @@
>
<template v-for="item in tableColumns" :key="item.key" #[item.key]="{ row }">
<div
v-if="row[item.key].includes('.') && row.attributes === '文件名称'"
v-if="row[item.key]?.includes('.') && row.attributes === '文件名称'"
class="img-content"
>
<el-button link type="primary" icon="Document" @click="reviewFileFun(row, item.key)"

View File

@@ -835,9 +835,7 @@ const setChartFun = () => {
const data = res.data.xData[index].map((item_1: any, index_1: number) => {
return [item_1, res.data.yData[index][index_1]];
});
XData = res.data.xData[index].map((item: any) => {
return item;
});
XData = res.data.xData[index];
const title = compareData.value[key][index].originalName;
titleList.push(title);
seriesData.push({

View File

@@ -837,7 +837,13 @@ const checkBoxChangeFun = () => {
const compareData = ref<any>({});
const projectStorageSpaceStatisticsRef = ref<any>({});
// 初始化图表chart-1
const initProjectTaskAchievementStatistics = async ({ dom, seriesData, titleList, key }: any) => {
const initProjectTaskAchievementStatistics = async ({
dom,
seriesData,
XData,
titleList,
key,
}: any) => {
dom.commonChartRef.disposeEchartsByKey('chart-' + key);
dom.commonChartRef.option = {
title: {
@@ -858,10 +864,42 @@ const initProjectTaskAchievementStatistics = async ({ dom, seriesData, titleList
right: '5%',
},
xAxis: {
type: 'category',
type: 'value',
data: XData,
axisLabel: {
show: true,
// interval: 9,
interval: XData.length > 10 ? Math.floor(XData.length / 10) : 1,
},
splitLine: {
show: true,
},
axisLine: {
show: true,
},
axisTick: {
show: true,
},
},
yAxis: {
type: 'value',
axisLine: {
show: true,
},
axisTick: {
show: true,
},
minorTick: {
show: true,
splitNumber: 5, // 大刻度之间分割成5份
length: 3, // 小刻度长度
},
minorSplitLine: {
show: true,
lineStyle: {
type: 'dotted',
},
},
},
series: seriesData,
};
@@ -879,18 +917,32 @@ const setChartFun = () => {
}).then((res: any) => {
const seriesData: any = [];
const titleList: any = [];
let XData: any = [];
if (res.code === 200) {
res.data.xData.forEach((item: any, index: number) => {
const data = res.data.xData[index].map((item_1: any, index_1: number) => {
return [item_1, res.data.yData[index][index_1]];
});
XData = res.data.xData[index];
const title = compareData.value[key][index].name;
titleList.push(title);
seriesData.push({
name: title,
type: 'line',
stack: 'Total',
data,
showSymbol: false, // 默认不显示数据点
symbolSize: 6, // 悬停时数据点的大小
itemStyle: {
opacity: 0, // 默认数据点透明度
borderWidth: 2,
},
emphasis: {
scale: true, // 悬停时放大
focus: 'series', // 悬停时高亮整个系列
itemStyle: {
opacity: 1, // 悬停时显示数据点
},
},
});
});
}
@@ -899,6 +951,7 @@ const setChartFun = () => {
dom: projectStorageSpaceStatisticsRef.value[`chart-${key}`],
seriesData,
titleList,
XData,
key,
});
});

View File

@@ -897,7 +897,14 @@ const checkBoxChangeFun = () => {
const compareData = ref<any>({});
const projectStorageSpaceStatisticsRef = ref<any>({});
// 初始化图表chart-1
const initProjectTaskAchievementStatistics = async ({ dom, seriesData, titleList, key }: any) => {
const initProjectTaskAchievementStatistics = async ({
dom,
seriesData,
XData,
titleList,
key,
}: any) => {
console.log('XData', XData);
dom.commonChartRef.disposeEchartsByKey('chart-' + key);
dom.commonChartRef.option = {
title: {
@@ -918,10 +925,41 @@ const initProjectTaskAchievementStatistics = async ({ dom, seriesData, titleList
right: '5%',
},
xAxis: {
type: 'category',
type: 'value',
data: XData,
axisLabel: {
show: true,
interval: XData.length > 10 ? Math.floor(XData.length / 10) : 1,
},
splitLine: {
show: true,
},
axisLine: {
show: true,
},
axisTick: {
show: true,
},
},
yAxis: {
type: 'value',
axisLine: {
show: true,
},
axisTick: {
show: true,
},
minorTick: {
show: true,
splitNumber: 5, // 大刻度之间分割成5份
length: 3, // 小刻度长度
},
minorSplitLine: {
show: true,
lineStyle: {
type: 'dotted',
},
},
},
series: seriesData,
};
@@ -944,18 +982,32 @@ const setChartFun = () => {
}).then((res: any) => {
const seriesData: any = [];
const titleList: any = [];
let XData: any = [];
if (res.code === 200) {
res.data.xData.forEach((item: any, index: number) => {
const data = res.data.xData[index].map((item_1: any, index_1: number) => {
return [item_1, res.data.yData[index][index_1]];
});
XData = res.data.xData[index];
const title = compareData.value[key][index].name;
titleList.push(title);
seriesData.push({
name: title,
type: 'line',
stack: 'Total',
data,
showSymbol: false, // 默认不显示数据点
symbolSize: 6, // 悬停时数据点的大小
itemStyle: {
opacity: 0, // 默认数据点透明度
borderWidth: 2,
},
emphasis: {
scale: true, // 悬停时放大
focus: 'series', // 悬停时高亮整个系列
itemStyle: {
opacity: 1, // 悬停时显示数据点
},
},
});
});
}
@@ -963,6 +1015,7 @@ const setChartFun = () => {
initProjectTaskAchievementStatistics({
dom: projectStorageSpaceStatisticsRef.value[`chart-${key}`],
seriesData,
XData,
titleList,
key,
});

View File

@@ -98,6 +98,14 @@
:current-task-info="currentTaskInfo"
></runVersionTree>
</el-tab-pane>
<el-tab-pane label="关联需求" name="demand">
<div class="task-tab-content">
<taskDemand
v-if="activeTab === 'demand'"
:demand-uid="currentTaskInfo?.demandId"
></taskDemand>
</div>
</el-tab-pane>
<!-- <el-tab-pane label="交付物" name="deliverables">
<div class="task-tab-content">
<taskDeliverable
@@ -166,6 +174,7 @@ import { deliverableApproveApi } from '@/api/project/run';
import { systemApproveQueryApproveFlowTempalteApi } from '@/api/system/systemApprove';
import experimentResult from '@/views/task/execution/components/taskDetailPage/components/experimentResult.vue';
import runVersionTree from '@/views/task/execution/components/runDetailPage/runPagecomponent/runVersionTree.vue';
import taskDemand from '@/components/taskDetail/taskDemand.vue';
import { getSimulationTaskFilesApi } from '@/api/data/dataAnalysis';
const emits = defineEmits(['closeFn', 'updateFn']);