From 6940bdec72ef961c2103947986bf30eaf2341205 Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期一, 23 十二月 2024 17:28:52 +0800 Subject: [PATCH] MergeItem --- src/api/model/sche/model/index.ts | 44 ++++++++++++++++++++++++++++++++++---------- 1 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/api/model/sche/model/index.ts b/src/api/model/sche/model/index.ts index 8863d31..d850247 100644 --- a/src/api/model/sche/model/index.ts +++ b/src/api/model/sche/model/index.ts @@ -70,7 +70,7 @@ } // 查询模型参数列表 -export const getModelParamList = async () => { +export const getModelParamList = async (id) => { const dataPointList = ref([] as DataPointApi.DaPointVO) dataPointList.value = await DataPointApi.getPointList({}) @@ -88,16 +88,25 @@ const predictItemList = ref([] as PredictItemApi.MmPredictItemVO) predictItemList.value = await PredictItemApi.getMmPredictItemList({ - status: CommonEnabled.ENABLE, - itemtypename: 'NormalItem' + status: CommonEnabled.ENABLE }) - const itemList = [] - if (predictItemList.value) { - predictItemList.value.forEach(item => { - itemList.push( + const normalItemList = [] + const predictNormalItemList = predictItemList.value.filter(e => e.itemtypename === 'NormalItem' && e.outPuts && e.outPuts.length > 0); + if (predictNormalItemList && predictNormalItemList.length > 0) { + // 过滤掉本身 + predictNormalItemList.filter(e => e.id !== id).forEach(item => { + normalItemList.push( { - id: item.id, - name: item.itemname + value: item.id, + label: item.itemname, + predictlength: item.predictlength, + moduleid: item.moduleid, + children: item.outPuts?.map(e => { + return { + value: e.id, + label: e.resultName + } + }) } ) }) @@ -118,9 +127,24 @@ }) } + const predictMergeItemList = predictItemList.value.filter(e => e.itemtypename === 'MergeItem' && e.outPuts && e.outPuts.length > 0); + const mergeItemList = [] + if (predictMergeItemList && predictMergeItemList.length > 0) { + // 过滤掉本身 + predictMergeItemList.filter(e => e.id !== id).forEach(item => { + mergeItemList.push( + { + id: item.outPuts[0].id, + name: item.itemname + } + ) + }) + } + return { 'DATAPOINT':pointList, - 'PREDICTITEM': itemList, + 'NormalItem': normalItemList, + 'MergeItem': mergeItemList, 'PLAN': planList, } } -- Gitblit v1.9.3