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