初始化:静态菜单版 数据大屏管理系统,对接KLPL3数据库
This commit is contained in:
24
src/api/acidRolling.js
Normal file
24
src/api/acidRolling.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import request from './request'
|
||||
|
||||
export const getAcidRollingSummary = () => {
|
||||
return request({
|
||||
url: '/acid-rolling/summary',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export const getAcidRollingDetail = params => {
|
||||
return request({
|
||||
url: '/acid-rolling/detail',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export const getAcidRollingTrend = params => {
|
||||
return request({
|
||||
url: '/acid-rolling/trend',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
45
src/api/dataSource.js
Normal file
45
src/api/dataSource.js
Normal file
@@ -0,0 +1,45 @@
|
||||
import request from './request'
|
||||
|
||||
export const getDataSourceList = () => {
|
||||
return request({
|
||||
url: '/data-source/list',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export const getDataSourceById = id => {
|
||||
return request({
|
||||
url: `/data-source/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export const createDataSource = data => {
|
||||
return request({
|
||||
url: '/data-source',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const updateDataSource = (id, data) => {
|
||||
return request({
|
||||
url: `/data-source/${id}`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteDataSource = id => {
|
||||
return request({
|
||||
url: `/data-source/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export const testConnection = id => {
|
||||
return request({
|
||||
url: `/data-source/${id}/test`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
48
src/api/report.js
Normal file
48
src/api/report.js
Normal file
@@ -0,0 +1,48 @@
|
||||
import request from './request'
|
||||
|
||||
export const getReportList = params => {
|
||||
return request({
|
||||
url: '/report/list',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export const getReportById = id => {
|
||||
return request({
|
||||
url: `/report/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export const createReport = data => {
|
||||
return request({
|
||||
url: '/report',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const updateReport = (id, data) => {
|
||||
return request({
|
||||
url: `/report/${id}`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteReport = id => {
|
||||
return request({
|
||||
url: `/report/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export const exportReport = (id, params) => {
|
||||
return request({
|
||||
url: `/report/${id}/export`,
|
||||
method: 'get',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
41
src/api/request.js
Normal file
41
src/api/request.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import axios from 'axios'
|
||||
|
||||
const baseURL = process.env.VUE_APP_API_BASE_URL || '/api'
|
||||
|
||||
const service = axios.create({
|
||||
baseURL,
|
||||
timeout: 10000,
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8'
|
||||
}
|
||||
})
|
||||
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
const token = localStorage.getItem('token')
|
||||
if (token) {
|
||||
config.headers['Authorization'] = `Bearer ${token}`
|
||||
}
|
||||
return config
|
||||
},
|
||||
error => {
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
service.interceptors.response.use(
|
||||
response => {
|
||||
const res = response.data
|
||||
if (res.code !== 200) {
|
||||
console.error('请求失败:', res.message)
|
||||
return Promise.reject(new Error(res.message || 'Error'))
|
||||
}
|
||||
return res.data
|
||||
},
|
||||
error => {
|
||||
console.error('请求错误:', error)
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export default service
|
||||
109
src/api/screen.js
Normal file
109
src/api/screen.js
Normal file
@@ -0,0 +1,109 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getDashboardOverview() {
|
||||
return request({
|
||||
url: '/api/dashboard/overview',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getScreenList() {
|
||||
return request({
|
||||
url: '/api/screens',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getOeeData(params) {
|
||||
return request({
|
||||
url: '/api/wms/acid-rolling/dashboard/oee',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function getOeeSummary(params) {
|
||||
return request({
|
||||
url: '/da/oee/summary',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function getOeeLoss7(params) {
|
||||
return request({
|
||||
url: '/da/oee/loss7',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function getOeeEvents(params) {
|
||||
return request({
|
||||
url: '/da/oee/events',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function getAcidRollingReport(params) {
|
||||
return request({
|
||||
url: '/l2/report/acid',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function getAcidTypingPage(params) {
|
||||
return request({
|
||||
url: '/pocket/acidTyping/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function getAcidTyping(id) {
|
||||
return request({
|
||||
url: `/pocket/acidTyping/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function createAcidTyping(data) {
|
||||
return request({
|
||||
url: '/pocket/acidTyping',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateAcidTyping(id, data) {
|
||||
return request({
|
||||
url: `/pocket/acidTyping/${id}`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteAcidTyping(id) {
|
||||
return request({
|
||||
url: `/pocket/acidTyping/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function getProductionPlan(params) {
|
||||
return request({
|
||||
url: '/l2/plan/acid',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function getStopRecords(params) {
|
||||
return request({
|
||||
url: '/l2/stop/acid',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
100
src/api/system.js
Normal file
100
src/api/system.js
Normal file
@@ -0,0 +1,100 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getMenuList() {
|
||||
return request({
|
||||
url: '/api/system/menu/list',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getUserList(params) {
|
||||
return request({
|
||||
url: '/api/system/user/list',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function createUser(data) {
|
||||
return request({
|
||||
url: '/api/system/user',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateUser(id, data) {
|
||||
return request({
|
||||
url: `/api/system/user/${id}`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteUser(id) {
|
||||
return request({
|
||||
url: `/api/system/user/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function getRoleList(params) {
|
||||
return request({
|
||||
url: '/api/system/role/list',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function createRole(data) {
|
||||
return request({
|
||||
url: '/api/system/role',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateRole(id, data) {
|
||||
return request({
|
||||
url: `/api/system/role/${id}`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteRole(id) {
|
||||
return request({
|
||||
url: `/api/system/role/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function getMenuInfo(id) {
|
||||
return request({
|
||||
url: `/api/system/menu/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function createMenu(data) {
|
||||
return request({
|
||||
url: '/api/system/menu',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateMenu(id, data) {
|
||||
return request({
|
||||
url: `/api/system/menu/${id}`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteMenu(id) {
|
||||
return request({
|
||||
url: `/api/system/menu/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user