From 15e2f2216d3d6c81eb495b979cdb1a46e20361c4 Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期三, 15 十一月 2023 15:30:42 +0800
Subject: [PATCH] feat: 添加设备切换弹窗组件, 添加设备切换功能,切换后刷新数据

---
 src/api/home/index.js |  141 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 138 insertions(+), 3 deletions(-)

diff --git a/src/api/home/index.js b/src/api/home/index.js
index d9d44aa..50760f3 100644
--- a/src/api/home/index.js
+++ b/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?number="+data.number+"&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
+  })
+}

--
Gitblit v1.8.0