diff --git a/.env.dev b/.env.dev index 11d2b5c..3821850 100644 --- a/.env.dev +++ b/.env.dev @@ -2,6 +2,6 @@ FT_NODE_ENV=dev -FT_WS_URL=ws://192.168.1.199:9527 -FT_PROXY=http://192.168.1.199:8080 +FT_WS_URL=ws://192.168.1.200:8080/ws +FT_PROXY=http://192.168.1.200:8080 FT_API_BASE=/api \ No newline at end of file diff --git a/src/apis/container.ts b/src/apis/container.ts index d1f7375..f827a06 100644 --- a/src/apis/container.ts +++ b/src/apis/container.ts @@ -1,5 +1,5 @@ import http from 'libs/http' -export const getContainerList = (): Promise => http.get(`/container/list`) +export const getContainerList = (): Promise> => http.get(`/container/list`) -export const updateContainer = (params: Container.ContainerItem): Promise => http.put(`/container`, params) +export const updateContainer = (params: Container.ContainerItem): Promise => http.put(`/container`, params) diff --git a/src/apis/crafts.ts b/src/apis/crafts.ts index 50240f7..85080e6 100644 --- a/src/apis/crafts.ts +++ b/src/apis/crafts.ts @@ -7,18 +7,20 @@ interface Craft { oresId?: number } -export const getCraftList = (params: any): Promise => http.get(`/crafts/list/${params.oresId}`) +export const getCraftList = (params: { oresId: string }): Promise => http.get(`/crafts/list/${params.oresId}`) -export const createCraft = (params: Craft): Promise => http.post('/crafts', params) +export const createCraft = (params: Craft): Promise => http.post('/crafts', params) -export const updateCraft = (params: Craft): Promise => http.put(`/crafts`, params) +export const updateCraft = (params: Craft): Promise => http.put(`/crafts`, params) -export const delCraft = (ids: string): Promise => http.delete(`/crafts/${ids}`) +export const delCraft = (ids: string): Promise => http.delete(`/crafts/${ids}`) // 开始执行工艺 -export const startCraft = (params: { heatId: string }): Promise => http.post(`/crafts/start`, params) +export const startCraft = (params: { heatId: string }): Promise => http.post(`/crafts/start`, params) // 加热区配置工艺 -export const setCraft = (params: { heatId?: string | number, craftId?: string | number }): Promise => http.post(`/crafts/set`, params) +export const setCraft = (params: { heatId?: string | number, craftId?: string | number }): Promise => http.post(`/crafts/set`, params) -export const craftstatus = (): Promise => http.get(`/monitor/crafts/status`) +export const craftstatus = (): Promise => http.get(`/monitor/crafts/status`) + +export const craftstatusByHeatId = (heatId: string): Promise => http.get(`/monitor/crafts/status/${heatId}`) diff --git a/src/apis/ore.ts b/src/apis/ore.ts index 8b0b5ee..131e795 100644 --- a/src/apis/ore.ts +++ b/src/apis/ore.ts @@ -2,8 +2,8 @@ import http from 'libs/http' export const getOreList = (): Promise> => http.get(`/ores/list`) -export const saveOre = (params: { name: string }): Promise => http.post(`/ores`, params) +export const saveOre = (params: { name: string }): Promise => http.post(`/ores`, params) -export const editOre = (params: { id: number, name: string }): Promise => http.put(`/ores`, params) +export const editOre = (params: { id: number, name: string }): Promise => http.put(`/ores`, params) -export const delOre = (ids: string): Promise => http.delete(`/ores/${ids}`) +export const delOre = (ids: string): Promise => http.delete(`/ores/${ids}`) diff --git a/src/apis/solution.ts b/src/apis/solution.ts index 8f6b127..45f70d2 100644 --- a/src/apis/solution.ts +++ b/src/apis/solution.ts @@ -1,9 +1,9 @@ import http from 'libs/http' -export const getSolsList = (): Promise => http.get(`/sols/list`) +export const getSolsList = (): Promise> => http.get(`/sols/list`) -export const saveSols = (params: { name: string }): Promise => http.post(`/sols`, params) +export const saveSols = (params: { name: string }): Promise => http.post(`/sols`, params) -export const editSols = (params: { id: number, name: string }): Promise => http.put(`/sols`, params) +export const editSols = (params: { id: number, name: string }): Promise => http.put(`/sols`, params) -export const delSols = (ids: string): Promise => http.delete(`/sols/${ids}`) +export const delSols = (ids: string): Promise => http.delete(`/sols/${ids}`) diff --git a/src/apis/user.ts b/src/apis/user.ts index 665bf9d..8c5cb63 100644 --- a/src/apis/user.ts +++ b/src/apis/user.ts @@ -1,7 +1,7 @@ import http from 'libs/http' export const current = (): Promise => http.get('/auth/current') -export const addUser = (params: User.User): Promise => http.post('/user', params) +export const addUser = (params: User.AddUser): Promise => http.post('/user', params) export const updateUser = (params: User.User): Promise => http.put('/user', params) export const userList = (params: System.Page): Promise> => http.get('/user/list', { params }) export const delUser = (params: string): Promise => http.delete(`/user/${params}`) diff --git a/src/components/craft/AddCraftDialog.vue b/src/components/craft/AddCraftDialog.vue index 55419ef..2172ce0 100644 --- a/src/components/craft/AddCraftDialog.vue +++ b/src/components/craft/AddCraftDialog.vue @@ -47,7 +47,6 @@ const editDialog = (craftInfo: CraftTypes.Craft) => { craftObj.value = { ...craftInfo } if (craftInfo && craftInfo.steps) { const step = JSON.parse(craftInfo.steps) - /* eslint-disable no-debugger */ if (step && step.length) { step.forEach((item: CraftTypes.StepStruct) => { if (item.method === 'addLiquid') { @@ -74,9 +73,9 @@ function onConfirm() { const stepList = JSON.parse(JSON.stringify(stepStructs.value)) for (const step of stepList) { if (step.method === 'addLiquid') { - const list = step.params.tubeSolList + const list: CraftTypes.TubeSolStruct[] = step.params.tubeSolList if (list && list.length) { - list.forEach((item: any) => { + list.forEach((item) => { const tubeNum = item.tubeNum if (tubeNum === 0) { const tubeSolList: CraftTypes.TubeSolStruct[] = [] @@ -112,8 +111,7 @@ const confirmCraftEdit = (craft: CraftTypes.Craft) => { ElMessage.success('保存成功') emit('ok') closeDialog() - }).catch((e) => { - console.log('保存工艺失败---', e, tempStepStructs.value) + }).catch(() => { saveRef.value && saveRef.value.setLoading(false) }) } @@ -139,6 +137,7 @@ function addStep(step: CraftTypes.StepCmd) { method: step, params: { temperature: 100, + second: 10, }, } } diff --git a/src/components/craft/CraftStatus.vue b/src/components/craft/CraftStatus.vue index 2cb8ca7..4e63277 100644 --- a/src/components/craft/CraftStatus.vue +++ b/src/components/craft/CraftStatus.vue @@ -1,28 +1,66 @@ @@ -73,9 +87,11 @@ watch(stepInfo, (newVal) => {