提交 | 用户 | 时间
|
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, |
fcd59a
|
102 |
predictlength: item.predictlength, |
f5e3a1
|
103 |
moduleid: item.moduleid, |
5c475d
|
104 |
children: item.outPuts?.map(e => { |
D |
105 |
return { |
|
106 |
value: e.id, |
|
107 |
label: e.resultName |
|
108 |
} |
|
109 |
}) |
d3ee81
|
110 |
} |
潘 |
111 |
) |
|
112 |
}) |
|
113 |
} |
61c379
|
114 |
|
潘 |
115 |
const planItemList = ref([] as PlanItemApi.ItemVO) |
|
116 |
planItemList.value = await PlanItemApi.getItemList({ |
|
117 |
}) |
|
118 |
const planList = [] |
|
119 |
if (planItemList.value) { |
|
120 |
planItemList.value.forEach(item => { |
|
121 |
planList.push( |
|
122 |
{ |
|
123 |
id: item.id, |
|
124 |
name: item.itemName |
|
125 |
} |
|
126 |
) |
|
127 |
}) |
|
128 |
} |
|
129 |
|
5c475d
|
130 |
|
D |
131 |
predictItemList.value = await PredictItemApi.getMmPredictItemList({ |
|
132 |
status: CommonEnabled.ENABLE, |
|
133 |
itemtypename: 'MergeItem' |
|
134 |
}) |
|
135 |
const mergeItemList = [] |
|
136 |
if (predictItemList.value) { |
|
137 |
// 过滤掉本身 |
|
138 |
predictItemList.value.filter(e => e.id !== id).forEach(item => { |
|
139 |
mergeItemList.push( |
|
140 |
{ |
|
141 |
id: item.id, |
|
142 |
name: item.itemname |
|
143 |
} |
|
144 |
) |
|
145 |
}) |
|
146 |
} |
|
147 |
|
d3ee81
|
148 |
return { |
潘 |
149 |
'DATAPOINT':pointList, |
5c475d
|
150 |
'NormalItem': normalItemList, |
D |
151 |
'MergeItem': mergeItemList, |
61c379
|
152 |
'PLAN': planList, |
d3ee81
|
153 |
} |
cd9f11
|
154 |
} |