App.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <div>
  3. <router-view />
  4. </div>
  5. </template>
  6. <script setup lang="ts">
  7. // import { useWebSocket } from '@/utils/handWs';
  8. // const { handWs, startDevice, startHand, stateHand } = useWebSocket();
  9. // const router = useRouter();
  10. // const data = reactive<any>({
  11. // device_info: {},//设备信息
  12. // });
  13. // const { device_info } = toRefs(data);
  14. // /**
  15. // * 手势
  16. // */
  17. // const getHandWs = async () => {
  18. // //加载手势WS
  19. // handWs((e: any) => {
  20. // // console.log("eeee", e)
  21. // if (e?.wksid) {
  22. // //获取设备项目
  23. // let deviceid = localStorage.getItem("deviceid") || '';
  24. // if (deviceid) {
  25. // startDevice({ deviceid: deviceid })
  26. // }
  27. // }
  28. // //接收设备信息
  29. // if (e?.device_info) {
  30. // device_info.value = e.device_info;
  31. // let handcontroller_id = device_info.value.handcontroller_id;
  32. // stateHand(handcontroller_id);
  33. // }
  34. // //获取手势状态
  35. // if (e?.cmd == 'get_handcontroller_state' && e?.state == 0) {
  36. // let handcontroller_id = device_info.value.handcontroller_id;
  37. // startHand(handcontroller_id);
  38. // }
  39. // //刷新
  40. // if (e?.data?.result == "refresh") {
  41. // router.push({ path: '/gesture' });
  42. // //刷新
  43. // window.location.reload()
  44. // }
  45. // });
  46. // };
  47. // getHandWs()
  48. </script>
  49. <style scoped></style>