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