index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <!--
  3. <headerBar
  4. title="遥控模拟器"
  5. />-->
  6. <div class="remote-control_main-container">
  7. <div class="te-c" style="color: #8C92A7">遥控器模拟器</div>
  8. <el-row align="middle" class="mar-top-50">
  9. <el-col :span="3"></el-col>
  10. <el-col :span="6"><div class="button up" @click="runLeft">左脚</div></el-col>
  11. <el-col :span="6"><div class="button up" @click="run_take_picture">拍照</div></el-col>
  12. <el-col :span="6"><div class="button up" @click="runRight">右脚</div></el-col>
  13. <el-col :span="3"></el-col>
  14. </el-row>
  15. <el-row align="middle">
  16. <el-col :span="9"></el-col>
  17. <el-col :span="6">
  18. <el-col :span="6">
  19. <div class="button up" @click.native="switchLED(1)" @contextmenu.native="switchLED(0)">LED</div>
  20. </el-col>
  21. <!-- <el-dropdown>
  22. <div class="button up">
  23. LED
  24. </div>
  25. <template #dropdown>
  26. <el-dropdown-menu>
  27. <el-dropdown-item @click.native="switchLED(1)">开</el-dropdown-item>
  28. <el-dropdown-item @click.native="switchLED(0)">关</el-dropdown-item>
  29. </el-dropdown-menu>
  30. </template>
  31. </el-dropdown>-->
  32. </el-col>
  33. <el-col :span="9"></el-col>
  34. </el-row>
  35. <div class="te-c fs-14" style="color: #8C92A7">左脚控制左脚鞋启动拍摄</div>
  36. <div class="te-c fs-14" style="color: #8C92A7">右脚控制右脚鞋启动拍摄</div>
  37. </div>
  38. </template>
  39. <script setup lang="ts">
  40. import { defineEmits } from 'vue'
  41. import headerBar from '@/components/header-bar/index.vue'
  42. import icpList from '@/utils/ipc'
  43. import client from "@/stores/modules/client";
  44. import socket from "@/stores/modules/socket";
  45. import {Switch} from "@element-plus/icons-vue";
  46. const clientStore = client();
  47. // 初始化 WebSocket 状态管理
  48. const socketStore = socket()
  49. const emit = defineEmits(['onRemoteControl'])
  50. const runLeft = async () => {
  51. emit('onRemoteControl','left')
  52. }
  53. const runRight = async () => {
  54. emit('onRemoteControl','right')
  55. }
  56. const run_take_picture = () => {
  57. emit('onRemoteControl','take_picture')
  58. }
  59. //LED
  60. const switchLED = async (value) => {
  61. socketStore.sendMessage({
  62. type: 'control_mcu',
  63. data: {
  64. device_name: "laser_position",
  65. value,
  66. }
  67. });
  68. }
  69. </script>
  70. <style scoped lang="scss">
  71. .remote-control_main-container {
  72. background: #EAECED;
  73. height: 358px;
  74. width: 300px;
  75. margin: 0 auto;
  76. margin-top: 10px;
  77. padding-top: 30px;
  78. background: url(@/assets/images/Photography/yk.png) 0px 0px no-repeat;
  79. background-size: 300px 358px;
  80. }
  81. .button {
  82. width: 60px;
  83. height: 60px;
  84. background: #fff;
  85. border-radius: 60px;
  86. line-height: 60px;
  87. color: #474747;
  88. margin: 0 auto;
  89. box-shadow: 0 2px 8px 0 rgba(0,0,0,0.2);
  90. background: url(@/assets/images/Photography/hui.png) 0px 0px no-repeat;
  91. background-size: 60px 60px;
  92. }
  93. .el-row {
  94. min-height: 100px;
  95. }
  96. .button:hover {
  97. background: url(@/assets/images/Photography/lan.png) 0px 0px no-repeat;
  98. background-size: 60px 60px;
  99. cursor: pointer;
  100. }
  101. </style>