songshankun
2023-11-22 f6739d7542be48f7f8139c3d5fc7b2326e5cfc8d
src/api/home/index.js
@@ -1,8 +1,77 @@
import request from "@/utils/request";
//获取任务
import axios from "axios"
// 获取网络配置
export const NetworkCard = () => {
  return request({
    url: "/v1/config/net",
    method: "get",
  });
};
export const setworkCard = (data) => {
  return request({
    url: "/v1/config/net",
    method: "post",
    data
  });
};
// 获取生产进度
export const getProgress = (data) => {
  return request({
    url: "/v1/plc/productProgress",
    loadingFlag:true,
    method: "post",
    data
  });
};
// 获取pLC品牌 列表
export const getMiniDictList = () => {
  return request({
    url: "/v1/plcBrand/list",
    method: "get",
  });
};
// 添加 pLC品牌
export const addMiniDict = () => {
  return request({
    url: "/v1/plcBrand/add",
    method: "post",
  });
};
// 删除 pLC品牌
export const deleteMiniDict = (data) => {
  return request({
    url: `v1/plcBrand/delete/${data.id}`,
    method: "delete",
  });
};
// 更新 pLC品牌
export const updateMiniDict = () => {
  return request({
    url: "/v1/plcBrand/update",
    method: "put",
  });
};
// 获取plc
export const getPlc = () => {
  return request({
    url: "/v1/config/plc",
    method: "get",
  });
};
export const setPlc = (data) => {
  return request({
    url: "/v1/config/plc",
    method: "post",
    data,
  });
};
// 设置plc
//获取任务?page= +data.page+'&pageSize='+data.pageSize
export const getTaskInfo = (data) => {
  return request({
    url: "/v1/task/get",
    url: "/v1/task/get?taskMode="+data.taskMode,
    method: "get",
    data,
  });
@@ -22,6 +91,7 @@
  return request({
    url: `v1/task/start/${data.id}`,
    method: "get",
    loadingFlag:true,
    data,
  });
};
@@ -29,11 +99,76 @@
export const sendProcessParams = (data) => {
  return request({
    url: `v1/task/sendProcessParams/${data.id}`,
    url: `v1/task/sendProcessParams`,
    method: "post",
    loadingFlag:true,
    data,
  });
};
// 倒计时
export const countdown = (data) => {
  return request({
    url: 'v1/task/countdown',
    method: "get",
    data,
  });
};
//获取未任务
export const getTaskUnStarted = (data) => {
  return request({
    url: "/v1/task/get/unStarted?page="+data.page+'&pageSize='+data.pageSize,
    method: "get",
    data,
  });
};
// 获取工艺模型列表
export const processModelList = (data) => {
  return request({
    url: "/v1/processModel/list?page="+data.page+'&pageSize='+data.pageSize+'&procedureId='+data.procedureId,
    method: "get",
    data,
  });
};
// 更新工艺模型
export const updateProcessParams = (data) => {
  return request({
    url: "/v1/task/updateProcessParams",
    method: "post",
    data,
  });
};
/**
 * 获取当前面板绑定的设备列表
 */
export function getDeviceList() {
  return request({
    url: `/v1/device/list`,
    method: 'get'
  })
}
/**
 * 设定当前设备配置
 */
export function apiSetCurrentDeviceConfig(data) {
  return request({
    url: `/v1/device/config`,
    method: 'post',
    data
  })
}
/**
 * 设定当前设备
 */
export function apiSetCurrentDevice(data) {
  return request({
    url: `/v1/device/setCurrentDeviceId`,
    method: 'post',
    data
  })
}