提交 | 用户 | 时间
|
2f0aa4
|
1 |
import request from '@/config/axios' |
d3ee81
|
2 |
import * as DataPointApi from '@/api/data/da/point' |
7b1ce6
|
3 |
import * as PredictItemApi from '@/api/model/pre/item' |
61c379
|
4 |
import * as PlanItemApi from '@/api/data/plan/item' |
d3ee81
|
5 |
import {CommonEnabled} from "@/utils/constants"; |
61c379
|
6 |
import {getItemList, ItemVO} from "@/api/data/plan/item"; |
2f0aa4
|
7 |
|
潘 |
8 |
export interface ScheduleModelVO { |
|
9 |
id: string |
|
10 |
modelCode: string |
|
11 |
modelName: string |
|
12 |
modelType: string |
|
13 |
className: string |
|
14 |
methodName: string |
|
15 |
portLength: number |
|
16 |
paramStructure: string |
|
17 |
modelPath: string |
|
18 |
resultStrId: string |
|
19 |
invocation: string |
|
20 |
status: number, |
|
21 |
paramList: null, |
|
22 |
settingList: null |
|
23 |
} |
|
24 |
|
|
25 |
export interface ModelParamVO { |
|
26 |
modelparamportorder: number |
|
27 |
modelparamorder: number |
|
28 |
modelparamtype: string |
|
29 |
modelparamid: string |
|
30 |
datalength: number |
|
31 |
} |
|
32 |
|
cd9f11
|
33 |
export interface WorkPrecessParamVO { |
L |
34 |
processType: string |
|
35 |
} |
|
36 |
|
2f0aa4
|
37 |
export interface ScheduleModelPageReqVO extends PageParam { |
潘 |
38 |
modelCode?: string |
|
39 |
modelName?: string |
|
40 |
} |
|
41 |
|
|
42 |
// 查询ScheduleModel列表 |
|
43 |
export const getScheduleModelPage = (params: ScheduleModelPageReqVO) => { |
|
44 |
return request.get({ url: '/model/sche/model/page', params }) |
|
45 |
} |
|
46 |
|
|
47 |
// 查询ScheduleModel详情 |
|
48 |
export const getScheduleModel = (id: number) => { |
6badb7
|
49 |
return request.get({ url: '/model/sche/model/get?id=' + id}) |
2f0aa4
|
50 |
} |
潘 |
51 |
|
|
52 |
// 新增ScheduleModel |
|
53 |
export const createScheduleModel = (data: ScheduleModelVO) => { |
6badb7
|
54 |
return request.post({ url: '/model/sche/model/create', data }) |
2f0aa4
|
55 |
} |
潘 |
56 |
|
|
57 |
// 修改ScheduleModel |
|
58 |
export const updateScheduleModel = (data: ScheduleModelVO) => { |
|
59 |
return request.put({ url: '/model/sche/model/update', data }) |
|
60 |
} |
|
61 |
|
|
62 |
// 删除ScheduleModel |
|
63 |
export const deleteScheduleModel = (id: number) => { |
|
64 |
return request.delete({ url: '/model/sche/model/delete?id=' + id }) |
|
65 |
} |
|
66 |
|
6badb7
|
67 |
// 查询ScheduleModel列表 |
潘 |
68 |
export const getScheduleModelList = () => { |
|
69 |
return request.get({ url: '/model/sche/model/list'}) |
|
70 |
} |
|
71 |
|
2f0aa4
|
72 |
// 查询模型参数列表 |
5c475d
|
73 |
export const getModelParamList = async (id) => { |
cd9f11
|
74 |
|
d3ee81
|
75 |
const dataPointList = ref([] as DataPointApi.DaPointVO) |
潘 |
76 |
dataPointList.value = await DataPointApi.getPointList({}) |
|
77 |
const pointList = [] |
|
78 |
if (dataPointList.value) { |
|
79 |
dataPointList.value.forEach(item => { |
|
80 |
pointList.push( |
|
81 |
{ |
be4298
|
82 |
id: item.id, |
d3ee81
|
83 |
name: item.pointName |
潘 |
84 |
} |
|
85 |
) |
|
86 |
}) |
|
87 |
} |
|
88 |
|
|
89 |
const predictItemList = ref([] as PredictItemApi.MmPredictItemVO) |
|
90 |
predictItemList.value = await PredictItemApi.getMmPredictItemList({ |
|
91 |
status: CommonEnabled.ENABLE, |
|
92 |
itemtypename: 'NormalItem' |
|
93 |
}) |
5c475d
|
94 |
const normalItemList = [] |
d3ee81
|
95 |
if (predictItemList.value) { |
5c475d
|
96 |
// 过滤掉本身 |
D |
97 |
predictItemList.value.filter(e => e.id !== id).forEach(item => { |
|
98 |
normalItemList.push( |
d3ee81
|
99 |
{ |
5c475d
|
100 |
value: item.id, |
D |
101 |
label: item.itemname, |
|
102 |
children: item.outPuts?.map(e => { |
|
103 |
return { |
|
104 |
value: e.id, |
|
105 |
label: e.resultName |
|
106 |
} |
|
107 |
}) |
d3ee81
|
108 |
} |
潘 |
109 |
) |
|
110 |
}) |
|
111 |
} |
61c379
|
112 |
|
潘 |
113 |
const planItemList = ref([] as PlanItemApi.ItemVO) |
|
114 |
planItemList.value = await PlanItemApi.getItemList({ |
|
115 |
}) |
|
116 |
const planList = [] |
|
117 |
if (planItemList.value) { |
|
118 |
planItemList.value.forEach(item => { |
|
119 |
planList.push( |
|
120 |
{ |
|
121 |
id: item.id, |
|
122 |
name: item.itemName |
|
123 |
} |
|
124 |
) |
|
125 |
}) |
|
126 |
} |
|
127 |
|
5c475d
|
128 |
|
D |
129 |
predictItemList.value = await PredictItemApi.getMmPredictItemList({ |
|
130 |
status: CommonEnabled.ENABLE, |
|
131 |
itemtypename: 'MergeItem' |
|
132 |
}) |
|
133 |
const mergeItemList = [] |
|
134 |
if (predictItemList.value) { |
|
135 |
// 过滤掉本身 |
|
136 |
predictItemList.value.filter(e => e.id !== id).forEach(item => { |
|
137 |
mergeItemList.push( |
|
138 |
{ |
|
139 |
id: item.id, |
|
140 |
name: item.itemname |
|
141 |
} |
|
142 |
) |
|
143 |
}) |
|
144 |
} |
|
145 |
|
d3ee81
|
146 |
return { |
潘 |
147 |
'DATAPOINT':pointList, |
5c475d
|
148 |
'NormalItem': normalItemList, |
D |
149 |
'MergeItem': mergeItemList, |
61c379
|
150 |
'PLAN': planList, |
d3ee81
|
151 |
} |
cd9f11
|
152 |
} |