From 73a728c441cf444d5c4d3813d7a8a5df2c01499a Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期四, 12 九月 2024 09:30:27 +0800
Subject: [PATCH] 工作台增加演示模式开关

---
 Web/src/views/device/deviceInfo/index.vue                 |    4 ++++
 Admin.NET/WCS.Application/Service/WcsPlc/WcsPlcService.cs |    2 +-
 Admin.NET/WCS.Application/Hub/PlcHub.cs                   |    6 ++++++
 3 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/Admin.NET/WCS.Application/Hub/PlcHub.cs b/Admin.NET/WCS.Application/Hub/PlcHub.cs
index c8108e7..ecf48ab 100644
--- a/Admin.NET/WCS.Application/Hub/PlcHub.cs
+++ b/Admin.NET/WCS.Application/Hub/PlcHub.cs
@@ -63,6 +63,12 @@
             PLCTaskAction.boRefresh = context.BoRefresh.Value;
             await _sysConfigService.UpdateConfigValue("sys_Refresh", context.BoRefresh.Value);
         }
+        //婕旂ず妯″紡
+        if (context.BoDemo.HasValue)
+        {
+            PLCTaskAction.boDemo = context.BoDemo.Value;
+            await _sysConfigService.UpdateConfigValue("sys_demo", context.BoDemo.Value);
+        }
         await _plcHubContext.Clients.All.UpdateService(new PLCServiceModel() { BoRunningState = PLCTaskAction.boRunningState, BoRefresh = PLCTaskAction.boRefresh, BoOffline = PLCTaskAction.boOffline, BoDemo = PLCTaskAction.boDemo});
     }
 }
diff --git a/Admin.NET/WCS.Application/Service/WcsPlc/WcsPlcService.cs b/Admin.NET/WCS.Application/Service/WcsPlc/WcsPlcService.cs
index e4fce43..0d77413 100644
--- a/Admin.NET/WCS.Application/Service/WcsPlc/WcsPlcService.cs
+++ b/Admin.NET/WCS.Application/Service/WcsPlc/WcsPlcService.cs
@@ -135,7 +135,7 @@
             }
         }
         //鏈嶅姟鐘舵��
-        var modService = new { PLCTaskAction.boRunningState, PLCTaskAction.boOffline, PLCTaskAction.boRefresh };
+        var modService = new { PLCTaskAction.boRunningState, PLCTaskAction.boOffline, PLCTaskAction.boRefresh, PLCTaskAction.boDemo };
         return new { listPlc, modService };
     }
     /// <summary>
diff --git a/Web/src/views/device/deviceInfo/index.vue b/Web/src/views/device/deviceInfo/index.vue
index 9d46727..dc5861a 100644
--- a/Web/src/views/device/deviceInfo/index.vue
+++ b/Web/src/views/device/deviceInfo/index.vue
@@ -16,6 +16,10 @@
 							<el-switch v-model="state.boRefresh" active-text="" inactive-text="鑷埛鏂�"
 								@change="handleSwitchChange('boRefresh', $event)"></el-switch>
 						</el-card>
+						<el-card class="box-card" shadow="hover" style="margin-top: 3px;">
+							<el-switch v-model="state.boDemo" active-text="" inactive-text="婕旂ず妯″紡"
+								@change="handleSwitchChange('boDemo', $event)"></el-switch>
+						</el-card>
 					</el-collapse-item>
 
 					<el-collapse-item title="鍫嗗灈鏈�" name="2">

--
Gitblit v1.8.0