diff --git a/src/api/device/microphone.js b/src/api/device/microphone.js new file mode 100644 index 0000000..e5fa841 --- /dev/null +++ b/src/api/device/microphone.js @@ -0,0 +1,46 @@ +import request from '@/utils/request' + +// 开始录音 +export function startMicrophoneApi(data) { + return request({ + url: '/api/Microphone/start', + method: 'post', + params: data + }) +} + +// 暂停录音 +export function pauseMicrophoneApi(data) { + return request({ + url: '/api/Microphone/pause', + method: 'post', + params: data + }) +} + +// 恢复录音 +export function resumeMicrophoneApi(data) { + return request({ + url: '/api/Microphone/resume', + method: 'post', + params: data + }) +} + +// 停止录音 +export function stopMicrophoneApi(data) { + return request({ + url: '/api/Microphone/stop', + method: 'post', + params: data + }) +} + +// 播放音频 +export function playSpeaker(data) { + return request({ + url: '/api/Speaker/play', + method: 'post', + params: data + }) +} \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index dbabe71..5c17dd3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,6 +1,7 @@ import { createWebHistory, createRouter } from "vue-router"; /* Layout */ import Layout from "@/layout"; +import path from "path"; /** * Note: 路由配置项 @@ -92,7 +93,14 @@ export const constantRoutes = [ name: "灵巧手示教", meta: { title: "灵巧手详情" }, hidden: true, - }, + },{ + path: "microphone/:id", + component: () => + import("@/views/device/register/components/Microphone/index.vue"), + name: "麦克风示教", + meta: { title: "麦克风详情" }, + hidden: true, + } ], }, { diff --git a/src/views/device/register/components/Microphone/index.vue b/src/views/device/register/components/Microphone/index.vue new file mode 100644 index 0000000..fa76496 --- /dev/null +++ b/src/views/device/register/components/Microphone/index.vue @@ -0,0 +1,225 @@ + + + 远程麦克风 + + + 选择扬声器 + + + + + + {{ item }} + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/device/register/index.vue b/src/views/device/register/index.vue index 986fb2d..7520614 100644 --- a/src/views/device/register/index.vue +++ b/src/views/device/register/index.vue @@ -378,6 +378,10 @@ function handleControl(row) { const fullPath = `${row.deviceModel}/${row.id}`; // 构造路由路径 router.push({ path: fullPath, + query: { + terminalId: row.idDeDeviceTerminalConfig, + deviceId: row.deviceCode + } }); // 使用路由跳转 // intoControlPage(`/${row.deviceModel}`, `${row.id}`) }