Ver Fonte

1.1 恢复/重置耗材和老的syncStatus 参数不一样,独立开

64060764@qq.com há 1 ano atrás
pai
commit
f84245464a

+ 21 - 1
src/views/equip-management/box-debug-rebuild/public-method/index.js

@@ -5,7 +5,7 @@ import {
 } from '@/api/box-debug-mqtt'
 // JSON转义并请求
 // 控制器命令
-export async function sendCtrlMessage(
+export async function sendConsumablesMessage(
     newtrend_order,
   box_id,
   order = 0,
@@ -29,6 +29,26 @@ export async function sendCtrlMessage(
   const res = await pulishRunStat(req)
   return res
 }
+export async function sendCtrlMessage(
+    box_id,
+    order = 0,
+    ctrl,
+    body
+) {
+  const req = {
+    box_id,
+    content: JSON.stringify({
+      order,
+      ctrl,
+      content: body
+    }),
+    client: 'vue-' + +new Date()
+  }
+  console.log({ box_id, order, ctrl, body })
+
+  const res = await pulishRunStat(req)
+  return res
+}
 
 // 运行状态参数
 export async function sendRunStatusMessage(

+ 2 - 2
src/views/oa-management/consumble-watch/index.vue

@@ -346,7 +346,7 @@ import DeleteIcon from "@/assets/consumable/Delete.png";
 import EditIcon from "@/assets/consumable/edit-button.png";
 import RefreshIcon from "@/assets/consumable/refresh.png";
 import {pulishRunStat} from "@/api/box-debug-mqtt";
-import {sendCtrlMessage} from "@/views/equip-management/box-debug-rebuild/public-method";
+	import {sendConsumablesMessage, sendCtrlMessage} from "@/views/equip-management/box-debug-rebuild/public-method";
 export default {
 	components: {
 		OperateConsumble
@@ -577,7 +577,7 @@ export default {
 				});
 				if (r.code === 200) {
 					console.log('////////////r is:',r)
-					const res = await sendCtrlMessage(
+					const res = await sendConsumablesMessage(
 							row.newtrend_order,
 							row.box_id,
 							r.result[0].order,