dongyukun
2025-04-16 b451bcdf065ddfdd5c46dce49e19707870cb4fa6
src/api/model/pre/item/index.ts
@@ -1,5 +1,6 @@
import request from '@/config/axios'
import {UploadRequestOptions} from "element-plus/es/components/upload/src/upload";
import {CommonEnabled} from "@/utils/constants";
export interface MmPredictItemVO {
  id: string,
@@ -17,7 +18,10 @@
    predictphase: string,
    workchecked: number,
    unittransfactor: string,
    saveindex: string
    saveindex: string,
    iscumulant: number,
    cumuldivisor: number,
    cumulpoint: string
  },
  dmModuleItem: {
    id: string,
@@ -69,6 +73,8 @@
export interface MmPredictItemPageReqVO extends PageParam {
  itemno?: string,
  itemname?: string,
  itemtypeid?: string,
  modulename?: string,
}
// 查询MmPredictItem列表
@@ -99,6 +105,11 @@
// 查询MmPredictItem列表
export const getMmPredictItemList = (params) => {
  return request.get({ url: `/model/pre/item/list`, params})
}
// 查询MmItemOutput列表
export const getMmItemOutputList = (params) => {
  return request.get({ url: `/model/pre/item-output/list/all`, params})
}
export const updateModel = (data: any) => {
@@ -138,3 +149,30 @@
export const getViewCharts = (params) => {
  return request.get({ url: `/model/pre/item/view-charts`,params})
}
export const getNormalItemList = async () => {
  const predictItemList = await getMmPredictItemList({
    status: CommonEnabled.ENABLE,
    itemtypename: 'NormalItem',
  })
  const normalItemList = []
  const predictNormalItemList = predictItemList.filter(e => e.outPuts && e.outPuts.length > 0);
  if (predictNormalItemList && predictNormalItemList.length > 0) {
    // 过滤掉本身
    predictNormalItemList.forEach(item => {
      normalItemList.push(
        {
          value: item.id,
          label: item.itemname,
          children: item.outPuts?.map(e => {
            return {
              value: e.id,
              label: e.resultName
            }
          })
        }
      )
    })
  }
  return normalItemList
}