From 25184cadd4011856d95e76f1d79b37ce51a3e548 Mon Sep 17 00:00:00 2001
From: chengsc <Demo@DESKTOP-CPA90BF>
Date: 星期三, 30 十月 2024 11:34:12 +0800
Subject: [PATCH] 修改问题

---
 Web/src/views/device/deviceStartStop/index.vue |   65 ++++++++++++++++++++++----------
 1 files changed, 44 insertions(+), 21 deletions(-)

diff --git a/Web/src/views/device/deviceStartStop/index.vue b/Web/src/views/device/deviceStartStop/index.vue
index a1d5f65..a197f3c 100644
--- a/Web/src/views/device/deviceStartStop/index.vue
+++ b/Web/src/views/device/deviceStartStop/index.vue
@@ -2,23 +2,27 @@
     <el-row :gutter="10">
         <el-col :span="8">
             <el-collapse v-model="activeNames">
-                <el-collapse-item title="浠撳簱浜屽眰" name="1">
+                <el-collapse-item title="浠撳簱涓�灞�" name="1">
                     <el-card class="box-card" shadow="hover">
-                        <el-switch v-model="state.boRunningState" active-text="" inactive-text="鎵樼洏杈撻��"
-                            @change=""></el-switch>
+                        <el-text style="margin-right: 15px;">鎵樼洏杈撻��</el-text>
+                        <el-button @click="write('OnePalletStart','1')">鍚姩</el-button>
+                        <el-button @click="write('OnePalletStop','1')">鍋滄</el-button>
                     </el-card>
                     <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
-                        <el-switch active-text="" inactive-text="鎷嗚泛鏈哄櫒浜�1"
-                            @change=""></el-switch>
+                        <el-text style="margin-right: 15px;">鎷嗚泛鏈哄櫒浜�1</el-text>
+                        <el-button @click="write('OneChaiStart','1')">鍚姩</el-button>
+                        <el-button @click="write('OneChaiStop','1')">鍋滄</el-button>
                     </el-card> 
                     
                     <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
-                        <el-switch active-text="" inactive-text="鎷嗚泛鏈哄櫒浜�2"
-                            @change=""></el-switch>
+                        <el-text style="margin-right: 15px;">鎷嗚泛鏈哄櫒浜�2</el-text>
+                        <el-button @click="write('OneChaiTwoStart','1')">鍚姩</el-button>
+                        <el-button @click="write('OneChaiTwoStop','1')">鍋滄</el-button>
                     </el-card> 
                     <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
-                        <el-switch active-text="" inactive-text="浠剁杈撻��"
-                            @change=""></el-switch>
+                        <el-text style="margin-right: 15px;">浠剁杈撻��</el-text>
+                        <el-button @click="write('OneBoxStart','1')">鍚姩</el-button>
+                        <el-button @click="write('OneBoxStop','1')">鍋滄</el-button>
                     </el-card> 
                 </el-collapse-item>
             </el-collapse> 
@@ -28,21 +32,25 @@
             <el-collapse v-model="activeNames2">
                 <el-collapse-item title="浠撳簱浜屽眰" name="2">
                     <el-card class="box-card" shadow="hover">
-                        <el-switch active-text="" inactive-text="鎵樼洏杈撻��"
-                            @change=""></el-switch>
+                        <el-text style="margin-right: 15px;">鎵樼洏杈撻��</el-text>
+                        <el-button @click="write('TwoPalletStart','2')">鍚姩</el-button>
+                        <el-button @click="write('TwoPalletStop','2')">鍋滄</el-button>
                     </el-card>
                     <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
-                        <el-switch active-text="" inactive-text="鐮佸灈鏈哄櫒浜�1"
-                            @change=""></el-switch>
+                        <el-text style="margin-right: 15px;">鐮佽泛鏈哄櫒浜�1</el-text>
+                        <el-button @click="write('TwoMaStart','2')">鍚姩</el-button>
+                        <el-button @click="write('TwoMaStop','2')">鍋滄</el-button>
                     </el-card> 
                     
                     <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
-                        <el-switch active-text="" inactive-text="鐮佸灈鏈哄櫒浜�2"
-                            @change=""></el-switch>
+                        <el-text style="margin-right: 15px;">鐮佽泛鏈哄櫒浜�2</el-text>
+                        <el-button @click="write('TwoMaTwoStart','2')">鍚姩</el-button>
+                        <el-button @click="write('TwoMaTwoStop','2')">鍋滄</el-button>
                     </el-card> 
                     <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
-                        <el-switch active-text="" inactive-text="浠剁杈撻��"
-                            @change=""></el-switch>
+                        <el-text style="margin-right: 15px;">浠剁杈撻��</el-text>
+                        <el-button @click="write('TwoBoxStart','2')">鍚姩</el-button>
+                        <el-button @click="write('TwoBoxStop','2')">鍋滄</el-button>
                     </el-card> 
                 </el-collapse-item>
             </el-collapse>
@@ -52,8 +60,9 @@
             <el-collapse v-model="activeNames3">
                 <el-collapse-item title="浠撳簱涓夊眰" name="3">
                     <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
-                        <el-switch active-text="" inactive-text="鎵樼洏杈撻��"
-                            @change=""></el-switch>
+                        <el-text style="margin-right: 15px;">鎵樼洏杈撻��</el-text>
+                        <el-button @click="write('ThreePalletStart','3')">鍚姩</el-button>
+                        <el-button @click="write('ThreePalletStop','3')">鍋滄</el-button>
                     </el-card>
                 </el-collapse-item>
             </el-collapse>
@@ -65,7 +74,11 @@
 
 <script lang="ts" setup>
 
-import { ref } from 'vue';
+
+import { ref, reactive, onMounted } from 'vue';
+import { listStatus, listPosition } from '/@/api/wcs/wcsPlc';
+import { WriteStartStop } from '/@/api/wcs/wcsDevice';
+import { ElMessage } from "element-plus";
 
 const activeNames = ref(['1'])
 const activeNames2 = ref(['2'])
@@ -73,7 +86,17 @@
 
 const state = ref<any>({});
 
-
+const write = async (type: string,layer: string) => {
+	 
+	var data = {
+        Type:type,
+        Layer: layer
+    };
+	
+	var res = await WriteStartStop(data);
+	console.log(res.data.result);
+	// ElMessage.success(res.data.result);
+}
 
 
 </script>

--
Gitblit v1.8.0