import request from '@/config/axios'
|
import * as DataPointApi from '@/api/data/da/point'
|
import * as PredictItemApi from '@/api/model/pre/item'
|
import * as PlanItemApi from '@/api/data/plan/item'
|
import {CommonEnabled} from "@/utils/constants";
|
import {getItemList, ItemVO} from "@/api/data/plan/item";
|
|
export interface ScheduleModelVO {
|
id: string
|
modelCode: string
|
modelName: string
|
modelType: string
|
className: string
|
methodName: string
|
portLength: number
|
paramStructure: string
|
modelPath: string
|
resultStrId: string
|
invocation: string
|
status: number,
|
paramList: null,
|
settingList: null
|
}
|
|
export interface ModelParamVO {
|
modelparamportorder: number
|
modelparamorder: number
|
modelparamtype: string
|
modelparamid: string
|
datalength: number
|
}
|
|
export interface WorkPrecessParamVO {
|
processType: string
|
}
|
|
export interface ScheduleModelPageReqVO extends PageParam {
|
modelCode?: string
|
modelName?: string
|
}
|
|
// 查询ScheduleModel列表
|
export const getScheduleModelPage = (params: ScheduleModelPageReqVO) => {
|
return request.get({ url: '/model/sche/model/page', params })
|
}
|
|
// 查询ScheduleModel详情
|
export const getScheduleModel = (id: number) => {
|
return request.get({ url: '/model/sche/model/get?id=' + id})
|
}
|
|
// 新增ScheduleModel
|
export const createScheduleModel = (data: ScheduleModelVO) => {
|
return request.post({ url: '/model/sche/model/create', data })
|
}
|
|
// 修改ScheduleModel
|
export const updateScheduleModel = (data: ScheduleModelVO) => {
|
return request.put({ url: '/model/sche/model/update', data })
|
}
|
|
// 删除ScheduleModel
|
export const deleteScheduleModel = (id: number) => {
|
return request.delete({ url: '/model/sche/model/delete?id=' + id })
|
}
|
|
// 查询ScheduleModel列表
|
export const getScheduleModelList = () => {
|
return request.get({ url: '/model/sche/model/list'})
|
}
|
|
// 查询模型参数列表
|
export const getModelParamList = async (id) => {
|
|
const dataPointList = ref([] as DataPointApi.DaPointVO)
|
dataPointList.value = await DataPointApi.getPointList({})
|
const pointList = []
|
if (dataPointList.value) {
|
dataPointList.value.forEach(item => {
|
pointList.push(
|
{
|
id: item.id,
|
name: item.pointName
|
}
|
)
|
})
|
}
|
|
const predictItemList = ref([] as PredictItemApi.MmPredictItemVO)
|
predictItemList.value = await PredictItemApi.getMmPredictItemList({
|
status: CommonEnabled.ENABLE,
|
itemtypename: 'NormalItem'
|
})
|
const normalItemList = []
|
if (predictItemList.value) {
|
// 过滤掉本身
|
predictItemList.value.filter(e => e.id !== id).forEach(item => {
|
normalItemList.push(
|
{
|
value: item.id,
|
label: item.itemname,
|
predictlength: item.predictlength,
|
moduleid: item.moduleid,
|
children: item.outPuts?.map(e => {
|
return {
|
value: e.id,
|
label: e.resultName
|
}
|
})
|
}
|
)
|
})
|
}
|
|
const planItemList = ref([] as PlanItemApi.ItemVO)
|
planItemList.value = await PlanItemApi.getItemList({
|
})
|
const planList = []
|
if (planItemList.value) {
|
planItemList.value.forEach(item => {
|
planList.push(
|
{
|
id: item.id,
|
name: item.itemName
|
}
|
)
|
})
|
}
|
|
|
predictItemList.value = await PredictItemApi.getMmPredictItemList({
|
status: CommonEnabled.ENABLE,
|
itemtypename: 'MergeItem'
|
})
|
const mergeItemList = []
|
if (predictItemList.value) {
|
// 过滤掉本身
|
predictItemList.value.filter(e => e.id !== id).forEach(item => {
|
mergeItemList.push(
|
{
|
id: item.id,
|
name: item.itemname
|
}
|
)
|
})
|
}
|
|
return {
|
'DATAPOINT':pointList,
|
'NormalItem': normalItemList,
|
'MergeItem': mergeItemList,
|
'PLAN': planList,
|
}
|
}
|