From 7b1ce6433c5a0617ddb73e18bda610f925b709fd Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期二, 12 十一月 2024 14:12:04 +0800
Subject: [PATCH] 预测项详情

---
 src/api/model/pre/item/index.ts |  145 ++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 121 insertions(+), 24 deletions(-)

diff --git a/src/api/model/pre/item/index.ts b/src/api/model/pre/item/index.ts
index 795ca65..e27d8c4 100644
--- a/src/api/model/pre/item/index.ts
+++ b/src/api/model/pre/item/index.ts
@@ -1,43 +1,140 @@
 import request from '@/config/axios'
+import {UploadRequestOptions} from "element-plus/es/components/upload/src/upload";
 
-export interface MmItemTypeVO {
-  id: string
+export interface MmPredictItemVO {
+  id: string,
   itemtypename: string,
-  itemclasstype: string,
-  assemblyname: string
+  mmPredictItem: {
+    id: string,
+    itemno: string,
+    itemname: string,
+    caltypeid: string,
+    itemtypeid: string,
+    predictlength: string,
+    granularity: number,
+    status: string,
+    isfuse: number,
+    predictphase: string,
+    workchecked: number,
+    unittransfactor: string,
+    saveindex: string
+  },
+  dmModuleItem: {
+    id: string,
+    moduleid: string,
+    itemid: string,
+    itemorder: number,
+    status: number,
+    categoryid: string
+  },
+  mmItemOutput: {
+    id: string,
+    itemid: string,
+    pointid: string,
+    resulttableid: string,
+    tagname: string,
+    outputorder: number
+  },
+  mmPredictModel: {
+    id: string,
+    modelno: string,
+    modelname: string,
+    itemid: string,
+    arithid: string,
+    trainsamplength: number,
+    predictsamplength: string,
+    isonlinetrain: string,
+    modelpath: string,
+    isnormal: string,
+    normalmax: string,
+    normalmin: string,
+    status: number,
+    classname: string,
+    methodname: string,
+    modelparamstructure: string,
+    resultstrid: string,
+    settingmap: string
+  },
+  mmPredictMergeItem: {
+    id: string,
+    itemid: string,
+    expression: string,
+    num: string
+  },
+  modelparamtypeList: [],
+  mmModelArithSettingsList: [],
+  mmModelParamList: []
 }
 
-export interface MmItemTypePageReqVO extends PageParam {
-  itemtypename?: string
+export interface MmPredictItemPageReqVO extends PageParam {
+  itemno?: string,
+  itemname?: string,
 }
 
-// 查询MmItemType列表
-export const getMmItemTypePage = (params: MmItemTypePageReqVO) => {
-  return request.get({ url: '/model/pre/item-type/page', params })
+// 查询MmPredictItem列表
+export const getMmPredictItemPage = (params: MmPredictItemPageReqVO) => {
+  return request.get({ url: '/model/pre/item/page', params })
 }
 
-// 查询MmItemType详情
-export const getMmItemType = (id: number) => {
-  return request.get({ url: `/model/pre/item-type/get/${id}`})
+// 查询MmPredictItem详情
+export const getMmPredictItem = (id: number) => {
+  return request.get({ url: `/model/pre/item/get/${id}`})
 }
 
-// 新增MmItemType
-export const createMmItemType = (data: MmItemTypeVO) => {
-  return request.post({ url: '/model/pre/item-type/create', data })
+// 新增MmPredictItem
+export const createMmPredictItem = (data: MmPredictItemVO) => {
+  return request.post({ url: '/model/pre/item/create', data })
 }
 
-// 修改MmItemType
-export const updateMmItemType = (data: MmItemTypeVO) => {
-  return request.put({ url: '/model/pre/item-type/update', data })
+// 修改MmPredictItem
+export const updateMmPredictItem = (data: MmPredictItemVO) => {
+  return request.put({ url: '/model/pre/item/update', data })
 }
 
-// 删除MmItemType
-export const deleteMmItemType = (id: number) => {
-  return request.delete({ url: '/model/pre/item-type/delete?id=' + id })
+// 删除MmPredictItem
+export const deleteMmPredictItem = (id: number) => {
+  return request.delete({ url: '/model/pre/item/delete?id=' + id })
 }
 
+// 查询MmPredictItem列表
+export const getMmPredictItemList = (params) => {
+  return request.get({ url: `/model/pre/item/list`, params})
+}
 
-// 查询getItemTypeList详情
-export const getItemTypeList = () => {
-  return request.get({ url: `/model/pre/item-type/list`})
+export const updateModel = (data: any) => {
+  return request.upload({ url: '/model/pre/item/upload-model', data })
+}
+
+export const useUpload = () => {
+  const uploadUrl = import.meta.env.VITE_BASE_URL + '/admin-api/model/pre/item/upload-model'
+
+  const httpRequest = async (options: UploadRequestOptions) => {
+    return new Promise((resolve, reject) => {
+      updateModel({ file: options.file })
+        .then((res) => {
+          if (res.code === 0) {
+            resolve(res)
+          } else {
+            reject(res)
+          }
+        })
+        .catch((res) => {
+          reject(res)
+        })
+    })
+
+  }
+
+  return {
+    uploadUrl,
+    httpRequest
+  }
+}
+
+export const getMmPredictItemTree = () => {
+  return request.get({ url: `/model/pre/item/tree`})
+}
+
+export const getViewCharts = (params) => {
+  return request.get({ url: `/model/pre/item/view-charts`,params})
 }

--
Gitblit v1.9.3