提交 | 用户 | 时间
|
7462da
|
1 |
import request from '@/config/axios' |
7b1ce6
|
2 |
import {UploadRequestOptions} from "element-plus/es/components/upload/src/upload"; |
7462da
|
3 |
|
7b1ce6
|
4 |
export interface MmPredictItemVO { |
潘 |
5 |
id: string, |
7462da
|
6 |
itemtypename: string, |
7b1ce6
|
7 |
mmPredictItem: { |
潘 |
8 |
id: string, |
|
9 |
itemno: string, |
|
10 |
itemname: string, |
|
11 |
caltypeid: string, |
|
12 |
itemtypeid: string, |
|
13 |
predictlength: string, |
|
14 |
granularity: number, |
|
15 |
status: string, |
|
16 |
isfuse: number, |
|
17 |
predictphase: string, |
|
18 |
workchecked: number, |
|
19 |
unittransfactor: string, |
|
20 |
saveindex: string |
|
21 |
}, |
|
22 |
dmModuleItem: { |
|
23 |
id: string, |
|
24 |
moduleid: string, |
|
25 |
itemid: string, |
|
26 |
itemorder: number, |
|
27 |
status: number, |
|
28 |
categoryid: string |
|
29 |
}, |
|
30 |
mmItemOutput: { |
|
31 |
id: string, |
|
32 |
itemid: string, |
|
33 |
pointid: string, |
|
34 |
resulttableid: string, |
|
35 |
tagname: string, |
|
36 |
outputorder: number |
|
37 |
}, |
|
38 |
mmPredictModel: { |
|
39 |
id: string, |
|
40 |
modelno: string, |
|
41 |
modelname: string, |
|
42 |
itemid: string, |
|
43 |
arithid: string, |
|
44 |
trainsamplength: number, |
|
45 |
predictsamplength: string, |
|
46 |
isonlinetrain: string, |
|
47 |
modelpath: string, |
|
48 |
isnormal: string, |
|
49 |
normalmax: string, |
|
50 |
normalmin: string, |
|
51 |
status: number, |
|
52 |
classname: string, |
|
53 |
methodname: string, |
|
54 |
modelparamstructure: string, |
|
55 |
resultstrid: string, |
|
56 |
settingmap: string |
|
57 |
}, |
|
58 |
mmPredictMergeItem: { |
|
59 |
id: string, |
|
60 |
itemid: string, |
|
61 |
expression: string, |
|
62 |
num: string |
|
63 |
}, |
|
64 |
modelparamtypeList: [], |
|
65 |
mmModelArithSettingsList: [], |
|
66 |
mmModelParamList: [] |
7462da
|
67 |
} |
L |
68 |
|
7b1ce6
|
69 |
export interface MmPredictItemPageReqVO extends PageParam { |
潘 |
70 |
itemno?: string, |
|
71 |
itemname?: string, |
6dbd81
|
72 |
itemtypeid?: string, |
379650
|
73 |
modulename?: string, |
7462da
|
74 |
} |
L |
75 |
|
7b1ce6
|
76 |
// 查询MmPredictItem列表 |
潘 |
77 |
export const getMmPredictItemPage = (params: MmPredictItemPageReqVO) => { |
|
78 |
return request.get({ url: '/model/pre/item/page', params }) |
7462da
|
79 |
} |
L |
80 |
|
7b1ce6
|
81 |
// 查询MmPredictItem详情 |
潘 |
82 |
export const getMmPredictItem = (id: number) => { |
|
83 |
return request.get({ url: `/model/pre/item/get/${id}`}) |
7462da
|
84 |
} |
L |
85 |
|
7b1ce6
|
86 |
// 新增MmPredictItem |
潘 |
87 |
export const createMmPredictItem = (data: MmPredictItemVO) => { |
|
88 |
return request.post({ url: '/model/pre/item/create', data }) |
7462da
|
89 |
} |
L |
90 |
|
7b1ce6
|
91 |
// 修改MmPredictItem |
潘 |
92 |
export const updateMmPredictItem = (data: MmPredictItemVO) => { |
|
93 |
return request.put({ url: '/model/pre/item/update', data }) |
7462da
|
94 |
} |
L |
95 |
|
7b1ce6
|
96 |
// 删除MmPredictItem |
潘 |
97 |
export const deleteMmPredictItem = (id: number) => { |
|
98 |
return request.delete({ url: '/model/pre/item/delete?id=' + id }) |
cd9f11
|
99 |
} |
L |
100 |
|
7b1ce6
|
101 |
// 查询MmPredictItem列表 |
潘 |
102 |
export const getMmPredictItemList = (params) => { |
|
103 |
return request.get({ url: `/model/pre/item/list`, params}) |
|
104 |
} |
cd9f11
|
105 |
|
7b1ce6
|
106 |
export const updateModel = (data: any) => { |
潘 |
107 |
return request.upload({ url: '/model/pre/item/upload-model', data }) |
|
108 |
} |
|
109 |
|
|
110 |
export const useUpload = () => { |
|
111 |
const uploadUrl = import.meta.env.VITE_BASE_URL + '/admin-api/model/pre/item/upload-model' |
|
112 |
|
|
113 |
const httpRequest = async (options: UploadRequestOptions) => { |
|
114 |
return new Promise((resolve, reject) => { |
|
115 |
updateModel({ file: options.file }) |
|
116 |
.then((res) => { |
|
117 |
if (res.code === 0) { |
|
118 |
resolve(res) |
|
119 |
} else { |
|
120 |
reject(res) |
|
121 |
} |
|
122 |
}) |
|
123 |
.catch((res) => { |
|
124 |
reject(res) |
|
125 |
}) |
|
126 |
}) |
|
127 |
|
|
128 |
} |
|
129 |
|
|
130 |
return { |
|
131 |
uploadUrl, |
|
132 |
httpRequest |
|
133 |
} |
|
134 |
} |
|
135 |
|
|
136 |
export const getMmPredictItemTree = () => { |
|
137 |
return request.get({ url: `/model/pre/item/tree`}) |
|
138 |
} |
|
139 |
|
|
140 |
export const getViewCharts = (params) => { |
|
141 |
return request.get({ url: `/model/pre/item/view-charts`,params}) |
7462da
|
142 |
} |