From 366612bd8e8b88d02a98edf508f96d7add23ff9f Mon Sep 17 00:00:00 2001 From: pengwei <2071057782@qq.com> Date: 星期日, 27 四月 2025 16:03:38 +0800 Subject: [PATCH] 功能新增 --- 项目代码/伸缩杆/client/src/views/tts/PickAndDrop/PickAndDrop.vue | 107 +++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 78 insertions(+), 29 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\344\274\270\347\274\251\346\235\206/client/src/views/tts/PickAndDrop/PickAndDrop.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\344\274\270\347\274\251\346\235\206/client/src/views/tts/PickAndDrop/PickAndDrop.vue" index 5337731..213802d 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\344\274\270\347\274\251\346\235\206/client/src/views/tts/PickAndDrop/PickAndDrop.vue" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\344\274\270\347\274\251\346\235\206/client/src/views/tts/PickAndDrop/PickAndDrop.vue" @@ -2,16 +2,22 @@ <div class="PickAndDrop"> <div class="button"> <div class="button_l"> - <el-button type="primary" size="small" style=" + <el-button + @click="handleAutoPickAndDrop('浼稿嚭')" + type="primary" + size="small" + style=" width: 14.69rem; height: 5.06rem; color: rgba(64, 253, 240, 1); background-color: rgba(6, 229, 231, 0.3); border: none; border-top: 0.25rem solid rgba(6, 229, 231, 1); - "> + " + > <div class="btnicon"> - <span style=" + <span + style=" width: 1rem; height: 1rem; display: flex; @@ -22,20 +28,28 @@ color: rgb(0, 0, 0); font-size: 0.75rem; margin-left: 0.1rem; - ">i</span> + " + >i</span + > </div> <span style="font-size: 2.25rem; text-align: center">浼稿嚭</span> </el-button> - <el-button type="primary" size="small" style=" + <el-button + @click="handleAutoPickAndDrop('缂╁洖')" + type="primary" + size="small" + style=" width: 14.69rem; height: 5.06rem; color: rgba(64, 253, 240, 1); background-color: rgba(6, 229, 231, 0.3); border: none; border-top: 0.25rem solid rgba(6, 229, 231, 1); - "> + " + > <div class="btnicon"> - <span style=" + <span + style=" width: 1rem; height: 1rem; display: flex; @@ -46,18 +60,28 @@ color: rgb(0, 0, 0); font-size: 0.75rem; margin-left: 0.1rem; - ">i</span> + " + >i</span + > </div> <span style="font-size: 2.25rem; text-align: center">缂╁洖</span> </el-button> </div> <div class="button_r"> - <el-button @click="jumpRouter('/Manualcontrol')" class="btn" type="primary" size="small" style=" + <el-button + @click="jumpRouter('/Manualcontrol')" + class="btn" + type="primary" + size="small" + style=" width: 27.52rem; height: 4.29rem; color: rgba(255, 255, 255, 1); - "> - <span class="Aspan" style="font-size: 2.25rem; text-align: center">鎵嬪姩鎺у埗</span> + " + > + <span class="Aspan" style="font-size: 2.25rem; text-align: center" + >鎵嬪姩鎺у埗</span + > </el-button> </div> </div> @@ -138,13 +162,30 @@ <script setup> import { ref, onMounted, nextTick } from "vue"; import { useRouter } from "vue-router"; +import { ElMessage } from "element-plus"; +import { AutoPickAndDrop } from "@/api/newapi/Parameters.js"; + const router = useRouter(); const isMobile = ref(false); const jumpRouter = (path) => { router.push(path); }; - +const handleAutoPickAndDrop = async (val) => { + try { + const response = await AutoPickAndDrop({ + ExtendedState: val, + }); + if (response.code === 0) { + ElMessage.success(`${val}鎴愬姛`); + } else { + ElMessage.error(`${val}澶辫触`); + } + } catch (error) { + console.error(error); + ElMessage.error("鎿嶄綔澶辫触"); + } +}; onMounted(() => { // 鐩戝惉绐楀彛澶у皬鍙樺寲 window.addEventListener("resize", () => { @@ -305,10 +346,12 @@ width: 8.75rem; height: 4.19rem; border-radius: 0.31rem; - background: linear-gradient(90deg, - rgba(0, 224, 255, 0.74) 0%, - rgba(0, 224, 255, 0.4) 60%, - rgba(235, 242, 243, 0.13) 100%); + background: linear-gradient( + 90deg, + rgba(0, 224, 255, 0.74) 0%, + rgba(0, 224, 255, 0.4) 60%, + rgba(235, 242, 243, 0.13) 100% + ); color: rgba(16, 16, 16, 1); color: rgb(255, 255, 255); font-size: 1.13rem; @@ -435,10 +478,12 @@ width: 8.75rem; height: 4.19rem; border-radius: 0.31rem; - background: linear-gradient(90deg, - rgba(0, 224, 255, 0.74) 0%, - rgba(0, 224, 255, 0.4) 60%, - rgba(235, 242, 243, 0.13) 100%); + background: linear-gradient( + 90deg, + rgba(0, 224, 255, 0.74) 0%, + rgba(0, 224, 255, 0.4) 60%, + rgba(235, 242, 243, 0.13) 100% + ); color: rgba(16, 16, 16, 1); color: rgb(255, 255, 255); font-size: 1.13rem; @@ -569,10 +614,12 @@ width: 8.75rem; height: 4.19rem; border-radius: 0.31rem; - background: linear-gradient(90deg, - rgba(0, 224, 255, 0.74) 0%, - rgba(0, 224, 255, 0.4) 60%, - rgba(235, 242, 243, 0.13) 100%); + background: linear-gradient( + 90deg, + rgba(0, 224, 255, 0.74) 0%, + rgba(0, 224, 255, 0.4) 60%, + rgba(235, 242, 243, 0.13) 100% + ); color: rgba(16, 16, 16, 1); color: rgb(255, 255, 255); font-size: 1.13rem; @@ -699,10 +746,12 @@ width: 8.75rem; height: 4.19rem; border-radius: 0.31rem; - background: linear-gradient(90deg, - rgba(0, 224, 255, 0.74) 0%, - rgba(0, 224, 255, 0.4) 60%, - rgba(235, 242, 243, 0.13) 100%); + background: linear-gradient( + 90deg, + rgba(0, 224, 255, 0.74) 0%, + rgba(0, 224, 255, 0.4) 60%, + rgba(235, 242, 243, 0.13) 100% + ); color: rgba(16, 16, 16, 1); color: rgb(255, 255, 255); font-size: 1.13rem; @@ -800,4 +849,4 @@ } } } -</style> \ No newline at end of file +</style> -- Gitblit v1.9.3