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