数据贯通完成,规程重构

This commit is contained in:
2026-04-27 20:37:59 +08:00
parent 5b38ef734a
commit b7161e9541
13 changed files with 1492 additions and 861 deletions

View File

@@ -1,36 +1,50 @@
import axios from 'axios'
import request from '@/utils/request'
export default function createTimingFetch(url) {
const request = axios.create({
baseURL: 'http://' + url,
headers: {
'Content-Type': 'application/json'
},
timeout: 10000
// 计划列表(分页)
export function getTimingPlanList(page = 1, pageSize = 20) {
return request({
url: '/sql-server-api/plans',
method: 'get',
params: { page, pageSize }
})
}
// 计划总数
export function getTimingPlanCount() {
return request({
url: '/sql-server-api/plans/count',
method: 'get'
})
}
// 计划详情
export function getTimingPlanDetail(coilId) {
return request({
url: '/sql-server-api/plans/' + coilId,
method: 'get'
})
}
// 钢卷实际 SEG按入口卷号查询
export function getTimingSegByEncoilId(encoilId) {
return request({
url: '/sql-server-api/seg/' + encoilId,
method: 'get'
})
}
// 钢卷实际 SEG按出口卷号查询
export function getTimingSegByExcoilId(excoilId) {
return request({
url: '/sql-server-api/seg-by-excoil/' + excoilId,
method: 'get'
})
}
// 实时数据Gauge + Shape
export function getTimingRealtimeData(matId) {
return request({
url: '/sql-server-api/realtime/' + matId,
method: 'get'
})
request.interceptors.response.use(response => response.data)
return {
getPlanList: () => request({
url: '/sql-server-api/plans',
method: 'get'
}),
getPlanDetail: (coilId) => request({
url: `/sql-server-api/plans/${coilId}`,
method: 'get'
}),
getSegByEncoilId: (encoilId) => request({
url: `/sql-server-api/seg/${encoilId}`,
method: 'get'
}),
getSegByExcoilId: (excoilId) => request({
url: `/sql-server-api/seg-by-excoil/${excoilId}`,
method: 'get'
}),
getRealtimeData: (matId) => request({
url: `/sql-server-api/realtime/${matId}`,
method: 'get'
})
}
}